diff --git a/arch/arm64/boot/dts/apple/t6041-j614c-j616c.dtsi b/arch/arm64/boot/dts/apple/t6041-j614c-j616c.dtsi index 5340cc024b9d1..fec641445c5d5 100644 --- a/arch/arm64/boot/dts/apple/t6041-j614c-j616c.dtsi +++ b/arch/arm64/boot/dts/apple/t6041-j614c-j616c.dtsi @@ -14,6 +14,7 @@ #include "t6041-j616c-ane.dtsi" #include +#include #include / { @@ -76,25 +77,26 @@ thermal-zones { /* - * The PMP's fast die loop is off on these boards (no - * apple,fast-die-effort), so these zones are the CPU's only - * throttle. The ADT (temp-sensor, fast-die-ctrl-loop) gives the - * J614c and J616c the M4 Pro's die limits: a 110 C target and a - * 125 C maximum, the sochot level. + * The PMP's fast die-temperature loop (apple,fast-die-effort) + * holds its hot-spot sensors at the ADT fast-die-ctrl-loop target + * of 110 C, as on macOS, and these zones are the backstop behind + * it. The ADT (temp-sensor) gives the J614c and J616c the M4 + * Pro's die limits: 110 C target, 125 C maximum (sochot). * - * - A zone per SMC core-die sensor runs the power allocator from - * 75 C, controls at the 110 C target and throttles only the - * cluster its sensor sits on: Tpx0-5 follow a load on P0, - * Tpx8-D one on P1, Tex0-3 the E cluster. The die zone on TCMz, - * their maximum, controls all three clusters from 115 C as a - * backstop; controlling at 110 C itself, it divided its budget - * by requested power and held P0 at 2.4-2.9 GHz while P1 ran at - * 4.1 GHz. The 1 s samples jump by about 10 C, so the zones are - * integral-led. + * - The SMC sensors read a few degrees above the PMP's: with the + * PMP alone, an all-core load holds TCMz at 112 C. The zones + * switch on at 112 C and control at 116 C, so the PMP keeps the + * fast control. Switched on from 75 C, the power allocator + * trimmed far below its control point and took over: it held + * the E cluster at 1.02 GHz, which the PMP leaves at 2.59 GHz. + * - A zone per SMC core-die sensor throttles only the cluster its + * sensor sits on: Tpx0-5 follow a load on P0, Tpx8-D one on P1, + * Tex0-3 the E cluster. The die zone on TCMz, their maximum, + * throttles all three. The 1 s samples jump by about 10 C, so + * the zones are integral-led. * - The SMC fans follow a power-weighted hot spot (dDT*), not - * TCMz: they only ramp once the CPU runs near 110 C at high - * power, as on macOS. A lower control point holds the power - * below where the fans engage, and the CPU then settles lower. + * TCMz, and ramp once the CPU runs near 110 C at high power, as + * on macOS. * - sustainable-power is what macOS sustained on a J614c under an * all-core FMA load: 48-51 W, TCMz 105-110 C. The P clusters * share one rail meter (PHPC), which reads 25 W with either @@ -113,13 +115,13 @@ trips { cpu_die_switch_on: cpu-die-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_die_passive: cpu-die-passive { - temperature = <115000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -181,13 +183,13 @@ trips { cpu_e0_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_e0_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -227,13 +229,13 @@ trips { cpu_e1_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_e1_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -273,13 +275,13 @@ trips { cpu_e2_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_e2_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -319,13 +321,13 @@ trips { cpu_e3_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_e3_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -365,13 +367,13 @@ trips { cpu_p00_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_p00_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -413,13 +415,13 @@ trips { cpu_p01_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_p01_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -461,13 +463,13 @@ trips { cpu_p02_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_p02_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -509,13 +511,13 @@ trips { cpu_p03_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_p03_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -557,13 +559,13 @@ trips { cpu_p04_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_p04_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -605,13 +607,13 @@ trips { cpu_p05_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_p05_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -653,13 +655,13 @@ trips { cpu_p10_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_p10_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -701,13 +703,13 @@ trips { cpu_p11_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_p11_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -749,13 +751,13 @@ trips { cpu_p12_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_p12_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -797,13 +799,13 @@ trips { cpu_p13_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_p13_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -845,13 +847,13 @@ trips { cpu_p14_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_p14_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -893,13 +895,13 @@ trips { cpu_p15_switch_on: trip-switch-on { - temperature = <75000>; + temperature = <112000>; hysteresis = <2000>; type = "passive"; }; cpu_p15_passive: trip-passive { - temperature = <110000>; + temperature = <116000>; hysteresis = <5000>; type = "passive"; }; @@ -1184,18 +1186,6 @@ status = "okay"; }; -&cpufreq_e { - /delete-property/ apple,fast-die-effort; -}; - -&cpufreq_p0 { - /delete-property/ apple,fast-die-effort; -}; - -&cpufreq_p1 { - /delete-property/ apple,fast-die-effort; -}; - &wdt { timeout-sec = <140>; }; @@ -1575,6 +1565,10 @@ wifi_clkreq_pins: wifi-clkreq-pins { pinmux = ; }; + + sd_clkreq_pins: sd-clkreq-pins { + pinmux = ; + }; }; &pinctrl_nub { @@ -1632,6 +1626,15 @@ }; / { + /* ADT dart-apcie1: the SD reader's DART (t6040.dtsi has T6040's). */ + apcie1_dart: iommu@411000000 { + compatible = "apple,t6041-dart", "apple,t8110-dart"; + reg = <0x4 0x11000000 0x0 0x20000>; + #iommu-cells = <1>; + interrupt-parent = <&aic>; + interrupts = ; + }; + pcie0: pcie@1cb0000000 { compatible = "apple,t6041-pcie", "apple,t6020-pcie"; reg = <0x1c 0xb0000000 0x0 0x1000000>, @@ -1650,16 +1653,17 @@ ranges = <0x43000000 0xb 0xc0000000 0xb 0xc0000000 0x0 0x20000000>, <0x02000000 0x0 0x80000000 0xb 0x80000000 0x0 0x40000000>; pinctrl-names = "default"; - pinctrl-0 = <&wifi_clkreq_pins>; + pinctrl-0 = <&wifi_clkreq_pins &sd_clkreq_pins>; #address-cells = <3>; #size-cells = <2>; - bus-range = <0 1>; + bus-range = <0 2>; iommu-map-mask = <0xffff>; - iommu-map = <0x100 &pcie_dart 1 2>; + iommu-map = <0x100 &pcie_dart 1 2>, <0x200 &apcie1_dart 1 1>; msi-ranges = <&aic AIC_IRQ 2071 IRQ_TYPE_EDGE_RISING 32>; msi-parent = <&pcie0>; msi-controller; - interrupts = ; + interrupts = , + ; interrupt-parent = <&aic>; device_type = "pci"; @@ -1692,6 +1696,36 @@ brcm,ccode-map-trivial; }; }; + + /* + * The GL9755 SD reader, as on the M4 Pro boards. The J614c and + * J616c ADTs give apcie0/pci-bridge1 PERST on GPIO 5, CLKREQ on + * GPIO 1 and the reader's power on the SMC's gP19 output. + */ + port01: pci@1,0 { + device_type = "pci"; + reg = <0x800 0 0 0 0>; + reset-gpios = <&pinctrl 5 GPIO_ACTIVE_LOW>; + bus-range = <2 2>; + pwren-gpios = <&smc_gpio 0x19 GPIO_ACTIVE_HIGH>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &port01 0 0 0 0>, + <0 0 0 2 &port01 0 0 0 1>, + <0 0 0 3 &port01 0 0 0 2>, + <0 0 0 4 &port01 0 0 0 3>; + + mmc@0,0 { + compatible = "pci17a0,9755"; + reg = <0x20000 0 0 0 0>; + cd-inverted; + wp-inverted; + }; + }; }; }; @@ -2330,6 +2364,136 @@ #include "t6041-j616c-hdmi.dtsi" #include "t6041-j616c-usbc.dtsi" +/* + * Keyboard backlight, as on the M4 Pro boards: the ADT /arm-io/pwm0 has one + * kbd-backlight channel (reg 0) at default-hz 25000, a 40 us period. + */ +/ { + led-controller { + compatible = "pwm-leds"; + + led-0 { + pwms = <&fpwm0 0 40000>; + label = "apple::kbd_backlight"; + function = LED_FUNCTION_KBD_BACKLIGHT; + color = ; + max-brightness = <255>; + }; + }; +}; + +&fpwm0 { + status = "okay"; +}; + +/* + * The front camera. The J614c and J616c ADTs (26.6.2) describe the same isp0: + * sensor-type 5 (an IMX958), cam-connections-scheme 0x10, and a firmware of + * 0xca8000 bytes of TEXT and 0x1344000 of DATA, which iBoot moves each boot. + */ +/ { + /* aura opens a co-processor's DAPF only if it finds its alias. */ + aliases { + isp = &isp; + }; + + reserved-memory { + /* + * iBoot moves the ISP firmware each boot: the loader fills + * these placeholders from the ADT. It runs at 0x100_0000_0000 + * onwards, in its 32 MiB main memory. + */ + isp_fw_text: isp-firmware-text@10000c44000 { + reg = <0x100 0x00c44000 0x0 0xca8000>; + iommu-addresses = <&isp 0x100 0x0 0x0 0xca8000>; + no-map; + }; + + isp_fw_data: isp-firmware-data@10001e7c000 { + reg = <0x100 0x01e7c000 0x0 0x1344000>; + iommu-addresses = <&isp 0x100 0xca8000 0x0 0x1344000>; + no-map; + }; + + /* the firmware's main memory, the driver allocates above it */ + isp_heap: isp-heap { + iommu-addresses = <&isp 0x100 0x0 0x0 0x2000000>; + }; + }; +}; + +&isp { + memory-region = <&isp_fw_text>, <&isp_fw_data>, <&isp_heap>; + memory-region-names = "text", "data", "heap"; + apple,platform-id = <5>; + /* ADT isp0 cam-connections-scheme */ + apple,cam-connections-scheme = <0x10>; + status = "okay"; + + /* The front camera, an IMX958: firmware configuration 5. */ + sensor-presets { + /* 1920x1080 */ + preset0 { + apple,config-index = <5>; + apple,input-size = <1920 2160>; + apple,output-size = <1920 1080>; + apple,crop = <0 0 1920 1080>; + }; + /* 1280x720 */ + preset1 { + apple,config-index = <5>; + apple,input-size = <1920 2160>; + apple,output-size = <1280 720>; + apple,crop = <0 0 1920 1080>; + }; + }; +}; + +&isp_dart0 { + status = "okay"; +}; + +&isp_dart1 { + status = "okay"; +}; + +&isp_dart2 { + status = "okay"; +}; + +/* + * The PMP, as the M4 Pro boards run it (t604x-j614-j616.dtsi). The pmp + * alias lets the loader copy this Mac's PMP values from the ADT and enable + * the PMP. The GPU sits on the PMP's GPU domain: a running PMP otherwise + * treats the GPU as off and holds it at its lowest state. + */ +/ { + aliases { + pmp = &pmp; + }; +}; + +&pmp_dart { + status = "okay"; +}; + +&pmp_report { + status = "okay"; +}; + +&pmp_mbox { + status = "okay"; +}; + +&pmc { + apple,pmp = <&pmp>; + status = "okay"; +}; + +&gpu { + power-domains = <&pmp_gfx>; +}; + / { aliases { nvram = &nvram; diff --git a/arch/arm64/boot/dts/apple/t6041-j616c.dts b/arch/arm64/boot/dts/apple/t6041-j616c.dts index f6a2ad6e49e21..9e122229805c5 100644 --- a/arch/arm64/boot/dts/apple/t6041-j616c.dts +++ b/arch/arm64/boot/dts/apple/t6041-j616c.dts @@ -16,35 +16,6 @@ / { compatible = "apple,j616c", "apple,t6041", "apple,arm-platform"; model = "Apple MacBook Pro (16-inch, M4 Max)"; - - /* aura opens a co-processor's DAPF only if it finds its alias. */ - aliases { - isp = &isp; - }; - - reserved-memory { - /* - * iBoot moves the ISP firmware each boot: the loader fills - * these placeholders from the ADT. It runs at 0x100_0000_0000 - * onwards, in its 32 MiB main memory. - */ - isp_fw_text: isp-firmware-text@10000c44000 { - reg = <0x100 0x00c44000 0x0 0xca8000>; - iommu-addresses = <&isp 0x100 0x0 0x0 0xca8000>; - no-map; - }; - - isp_fw_data: isp-firmware-data@10001e7c000 { - reg = <0x100 0x01e7c000 0x0 0x1344000>; - iommu-addresses = <&isp 0x100 0xca8000 0x0 0x1344000>; - no-map; - }; - - /* the firmware's main memory, the driver allocates above it */ - isp_heap: isp-heap { - iommu-addresses = <&isp 0x100 0x0 0x0 0x2000000>; - }; - }; }; &mtp_hid { @@ -85,42 +56,3 @@ &mesa { firmware-name = "apple/mesacal-j616c.bin", "apple/msrk-j616c.bin"; }; - -&isp { - memory-region = <&isp_fw_text>, <&isp_fw_data>, <&isp_heap>; - memory-region-names = "text", "data", "heap"; - apple,platform-id = <5>; - /* ADT isp0 cam-connections-scheme */ - apple,cam-connections-scheme = <0x10>; - status = "okay"; - - /* The front camera, an IMX958: firmware configuration 5. */ - sensor-presets { - /* 1920x1080 */ - preset0 { - apple,config-index = <5>; - apple,input-size = <1920 2160>; - apple,output-size = <1920 1080>; - apple,crop = <0 0 1920 1080>; - }; - /* 1280x720 */ - preset1 { - apple,config-index = <5>; - apple,input-size = <1920 2160>; - apple,output-size = <1280 720>; - apple,crop = <0 0 1920 1080>; - }; - }; -}; - -&isp_dart0 { - status = "okay"; -}; - -&isp_dart1 { - status = "okay"; -}; - -&isp_dart2 { - status = "okay"; -};