diff --git a/arch/arm64/boot/dts/apple/t8142-j813-j815-sleep.dtsi b/arch/arm64/boot/dts/apple/t8142-j813-j815-sleep.dtsi index 08df0f8f46787..876056fb001a4 100644 --- a/arch/arm64/boot/dts/apple/t8142-j813-j815-sleep.dtsi +++ b/arch/arm64/boot/dts/apple/t8142-j813-j815-sleep.dtsi @@ -4,8 +4,9 @@ * the shared PCIe block the wake brings back, and the port controllers' sleep power state. * Included at the end of each board's device tree, after the nodes it refers to. * - * The boot core's power gate (cluster_pwrgate) and the DCP DART's PS write-disable bit come - * with the board's own nodes (aurora-silicon/linux#1942, #1941). + * The boot core's power gate (cluster_pwrgate), the internal display's power words (dcp_power) + * and the DCP DART's PS write-disable bit are in t8142-j813-j815.dtsi (aurora-silicon/linux#1942, + * #1941). */ #include @@ -105,6 +106,8 @@ * SMC.OutboxNotEmpty, MTP.DOCK.CHANNELS.AP0.IRQ and MTP.OutboxNotEmpty. */ apple,wake-enable = <152 72 168 190 89 108>; + /* PMU RTC: peripheral source 2, routed through NUB.SPMI0.SW3 (wake source 152). */ + apple,spmi-pmu-sources = <0x600 0x4>; /* * The DCP, then the external DCPs once the tree describes them (dcpext0, dcpext1): * the sleep lowers them with the display, and refuses while an undescribed one is up. diff --git a/arch/arm64/boot/dts/apple/t8142-j813-j815.dtsi b/arch/arm64/boot/dts/apple/t8142-j813-j815.dtsi index f07cf01fded72..e62457de8596f 100644 --- a/arch/arm64/boot/dts/apple/t8142-j813-j815.dtsi +++ b/arch/arm64/boot/dts/apple/t8142-j813-j815.dtsi @@ -389,3 +389,130 @@ &cpu7 { capacity-dmips-mhz = <1024>; }; &cpu8 { capacity-dmips-mhz = <1024>; }; &cpu9 { capacity-dmips-mhz = <1024>; }; + +&{/soc} { + /* + * The CPU clusters' power-gate enables, in /arm-io/pmgr reg[34]: E at + * +0x0 and P at +0x60, the offsets T8132 has and the two words + * AppleT8142PMGR's restoreHW sets. iBoot leaves P's clear, and the + * boot core (P core 0) then never powers down in WFI. The PMGR is the + * SoC's, so J815 has the same words. + */ + cluster_pwrgate: power-gate@380724000 { + compatible = "apple,t8142-cluster-pwrgate", "apple,cluster-pwrgate"; + reg = <0x3 0x80724000 0x0 0x4>, + <0x3 0x80724060 0x0 0x4>; + }; + + /* + * The internal display's power words for a DCP firmware stop (DPMS off): + * /arm-io/pmgr reg[34] (pwrgate: DISP_CPU's retention words 0x11cc and + * 0x11f0, the pmgr's retention_config_ff/_mem) and reg[32] (ps: DISP_CPU + * 0x10000, DISP_FE 0x318, DISP_SYS 0x290). T8142's PMC keeps no count of + * powered DCPs, so there is no pmc-dcp word. + */ + dcp_power: display-power@380724000 { + compatible = "apple,t8142-display-power"; + reg = <3 0x80724000 0 0x2000>, + <3 0x80700000 0 0x14000>; + reg-names = "pwrgate", "ps"; + }; +}; + +&dcp { + apple,display-power = <&dcp_power>; +}; + +&dcp_dart { + /* PMGR PS write-disable for DISP_CPU: offset 0x3fdc, bit 6. */ + reg = <2 0x86340000 0 0x20000>, + <3 0x80717fdc 0 0x4>; + reg-names = "dart", "ps-wr-dis"; + apple,ps-wr-dis-bit = <6>; +}; + +/* + * The video encoder, its two DARTs and the VENC power tree: ADT ave behind + * dart-ave (DART + CPUDART), the same addresses, interrupts and power states + * on both boards. The boot loader hands over iBoot's preloaded firmware + * (memory regions, CRCs in /chosen) or disables the encoder when the ADT has + * no preload. + */ +&ps_venc_sys { + status = "okay"; +}; + +&ps_venc_dma { + status = "okay"; +}; + +&ps_venc_pipe4 { + status = "okay"; +}; + +&ps_venc_pipe5 { + status = "okay"; +}; + +&ps_venc_me0 { + status = "okay"; +}; + +&ps_venc_me1 { + status = "okay"; +}; + +&ave_dart0 { + status = "okay"; +}; + +&ave_dart1 { + status = "okay"; +}; + +&ave { + status = "okay"; +}; + +/* + * The Neural Engine (ADT ane and dart-ane, the same on both boards). It stays + * off until the first request: the firmware is started then, from the preload, + * and system sleep cycles it cold. The boot loader hands the preload over by + * the engine's compatible, or disables the node when there is none. + */ +&ps_ane_sys { + status = "okay"; +}; + +&ane_dart0 { + status = "okay"; +}; + +&ane_dart1 { + status = "okay"; +}; + +&ane_dart2 { + status = "okay"; +}; + +&ane { + status = "okay"; +}; + +/* Both JPEG engines and their DART (ADT jpeg0, jpeg1, dart-jpeg). */ +&ps_jpg { + status = "okay"; +}; + +&jpeg_dart { + status = "okay"; +}; + +&jpeg0 { + status = "okay"; +}; + +&jpeg1 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t8142-j813.dts b/arch/arm64/boot/dts/apple/t8142-j813.dts index fe9e3b8ce77db..03059bfd9bf12 100644 --- a/arch/arm64/boot/dts/apple/t8142-j813.dts +++ b/arch/arm64/boot/dts/apple/t8142-j813.dts @@ -190,110 +190,12 @@ }; }; -/* - * N1 functions behind apcie port 0 (0000:00:00.0 -> 01:00.{0,1,2}), so the - * loader has somewhere to put the factory addresses: it copies ADT /chosen - * mac-address-wifi0 and mac-address-bluetooth0 into the wifi0/bluetooth0 - * alias targets. Same nodes as t8142-j815.dts (same N1, same PCI IDs). - */ -/ { - aliases { - wifi0 = &n1_alpha; - bluetooth0 = &n1_beta; - }; -}; - -&pcie0 { - n1_port: pci@0,0 { - device_type = "pci"; - reg = <0x0 0x0 0x0 0x0 0x0>; - bus-range = <1 1>; - #address-cells = <3>; - #size-cells = <2>; - ranges; - - n1_control: control@0,0 { - compatible = "apple,t8142-centauri-control", "pci106b,1900"; - reg = <0x10000 0x0 0x0 0x0 0x0>; - }; - - n1_alpha: wifi@0,1 { - compatible = "pci106b,1902"; - reg = <0x10100 0x0 0x0 0x0 0x0>; - /* Filled by the loader */ - local-mac-address = [00 00 00 00 00 00]; - }; - - n1_beta: bluetooth@0,2 { - compatible = "pci106b,1903"; - reg = <0x10200 0x0 0x0 0x0 0x0>; - /* Filled by the loader */ - local-bd-address = [00 00 00 00 00 00]; - }; - }; -}; - &mtp_hid { multi-touch { firmware-name = "apple/tpmtfw-j813.bin"; }; }; -&{/soc} { - /* - * The CPU clusters' power-gate enables, in /arm-io/pmgr reg[34]: E at - * +0x0 and P at +0x60, the offsets T8132 has and the two words - * AppleT8142PMGR's restoreHW sets. iBoot leaves P's clear, and the - * boot core (P core 0) then never powers down in WFI. - */ - cluster_pwrgate: power-gate@380724000 { - compatible = "apple,t8142-cluster-pwrgate", "apple,cluster-pwrgate"; - reg = <0x3 0x80724000 0x0 0x4>, - <0x3 0x80724060 0x0 0x4>; - }; -}; - -/* - * The video encoder, its two DARTs and the VENC power tree. The J813 ADT has - * the same ave and dart-ave as the J815. The boot loader hands over iBoot's - * preloaded firmware, or disables the encoder when there is none. - */ -&ps_venc_sys { - status = "okay"; -}; - -&ps_venc_dma { - status = "okay"; -}; - -&ps_venc_pipe4 { - status = "okay"; -}; - -&ps_venc_pipe5 { - status = "okay"; -}; - -&ps_venc_me0 { - status = "okay"; -}; - -&ps_venc_me1 { - status = "okay"; -}; - -&ave_dart0 { - status = "okay"; -}; - -&ave_dart1 { - status = "okay"; -}; - -&ave { - status = "okay"; -}; - /* Unexposed chassis port instances remain described and disabled. */ /* @@ -304,85 +206,11 @@ status = "okay"; }; -/* - * Video encoder: ADT ave ("ave2", pre-loaded) behind dart-ave, the same - * addresses, interrupts and power states as on the J815. aura hands over the - * preloaded firmware or disables the node. - */ -&ps_venc_sys { - status = "okay"; -}; - -&ps_venc_dma { - status = "okay"; -}; - -&ps_venc_pipe4 { - status = "okay"; -}; - -&ps_venc_pipe5 { - status = "okay"; -}; - -&ps_venc_me0 { - status = "okay"; -}; - -&ps_venc_me1 { - status = "okay"; -}; - -&ave_dart0 { - status = "okay"; -}; - -&ave_dart1 { - status = "okay"; -}; - -&ave { - status = "okay"; -}; - #include "t8142-j813-sep.dtsi" #include "t8142-j813-j815-sleep.dtsi" #include "t8142-j813-dcpext.dtsi" -&sleep { - /* PMU RTC: peripheral source 2, routed through NUB.SPMI0.SW3. */ - apple,spmi-pmu-sources = <0x600 0x4>; -}; - -&{/soc} { - /* - * The internal display's power words for a DCP firmware stop (DPMS off): - * /arm-io/pmgr reg[34] (pwrgate: DISP_CPU's retention words 0x11cc and - * 0x11f0, the pmgr's retention_config_ff/_mem) and reg[32] (ps: DISP_CPU - * 0x10000, DISP_FE 0x318, DISP_SYS 0x290). T8142's PMC keeps no count of - * powered DCPs, so there is no pmc-dcp word. - */ - dcp_power: display-power@380724000 { - compatible = "apple,t8142-display-power"; - reg = <3 0x80724000 0 0x2000>, - <3 0x80700000 0 0x14000>; - reg-names = "pwrgate", "ps"; - }; -}; - -&dcp { - apple,display-power = <&dcp_power>; -}; - -&dcp_dart { - /* PMGR PS write-disable for DISP_CPU: offset 0x3fdc, bit 6. */ - reg = <2 0x86340000 0 0x20000>, - <3 0x80717fdc 0 0x4>; - reg-names = "dart", "ps-wr-dis"; - apple,ps-wr-dis-bit = <6>; -}; - &{/reserved-memory} { /* * Both roles' __TEXT, contiguous (ADT gfx-asc and gfx1-asc segment-ranges), diff --git a/arch/arm64/boot/dts/apple/t8142-j815.dts b/arch/arm64/boot/dts/apple/t8142-j815.dts index c45d185c87c4c..6e42582c53dc1 100644 --- a/arch/arm64/boot/dts/apple/t8142-j815.dts +++ b/arch/arm64/boot/dts/apple/t8142-j815.dts @@ -390,84 +390,4 @@ status = "okay"; }; -/* - * Video encoder: ADT ave behind dart-ave (DART + CPUDART). aura hands over the - * preloaded 26A428 firmware (memory regions, CRCs in /chosen) or disables the - * node when the ADT has no preload. - */ -&ps_venc_sys { - status = "okay"; -}; - -&ps_venc_dma { - status = "okay"; -}; - -&ps_venc_pipe4 { - status = "okay"; -}; - -&ps_venc_pipe5 { - status = "okay"; -}; - -&ps_venc_me0 { - status = "okay"; -}; - -&ps_venc_me1 { - status = "okay"; -}; - -&ave_dart0 { - status = "okay"; -}; - -&ave_dart1 { - status = "okay"; -}; - -&ave { - status = "okay"; -}; - -/* - * The Neural Engine. It stays off until the first request: the firmware is - * started then, from the preload, and system sleep cycles it cold. - */ -&ps_ane_sys { - status = "okay"; -}; - -&ane_dart0 { - status = "okay"; -}; - -&ane_dart1 { - status = "okay"; -}; - -&ane_dart2 { - status = "okay"; -}; - -&ane { - status = "okay"; -}; - -/* Both JPEG engines and their DART. */ -&ps_jpg { - status = "okay"; -}; - -&jpeg_dart { - status = "okay"; -}; - -&jpeg0 { - status = "okay"; -}; - -&jpeg1 { - status = "okay"; -}; +#include "t8142-j813-j815-sleep.dtsi"