diff --git a/arch/arm64/boot/dts/apple/t8112-hwmon-rails.dtsi b/arch/arm64/boot/dts/apple/t8112-hwmon-rails.dtsi new file mode 100644 index 0000000000000..bd9901415f02b --- /dev/null +++ b/arch/arm64/boot/dts/apple/t8112-hwmon-rails.dtsi @@ -0,0 +1,234 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * T8112 PMU rail channels published by the SMC on every board measured so + * far (J413, J473). + * + * The SMC samples the main PMU outputs (VPxy voltage, IPxy current, PPxy + * power) and a second regulator family (VRxy, IRxy, PRxy). With the other + * cluster held at its lowest step, one cluster under load moves only its + * own output. On the J413: + * P cluster (cpu4-7): VP0b 555-775 mV, IP0b up to 7.8 A, PP0b up to 6.1 W + * E cluster (cpu0-3): VPbb 537-905 mV, IPbb up to 2.2 A, PPbb up to 2.0 W + * GPU: VP1b 0 mV while power-gated, 900-930 mV under load, PP1b ~1.1 W + * The J473 moves the same outputs: PP0b 0.4 W idle, 12.7 W with the P + * cluster loaded; PPbb 0.01 W idle, 2.1 W with the E cluster loaded. + * The consumers of the other outputs are not mapped; they are labelled + * "PMU " and "Rail ". Outputs whose current and power read 0 in + * every state are left out. Linux only reads the SMC keys. + * + * The driver skips a voltage, current or power channel whose key the SMC + * does not have, so a board without one of these outputs loses only that + * channel. + */ + +&smc_hwmon { + voltage-VP0b { + apple,key-id = "VP0b"; + label = "P-cluster VP0b"; + }; + + voltage-VPbb { + apple,key-id = "VPbb"; + label = "E-cluster VPbb"; + }; + + voltage-VP1b { + apple,key-id = "VP1b"; + label = "GPU VP1b"; + }; + + voltage-VP2b { + apple,key-id = "VP2b"; + label = "PMU VP2b"; + }; + + voltage-VP3b { + apple,key-id = "VP3b"; + label = "PMU VP3b"; + }; + + voltage-VP4b { + apple,key-id = "VP4b"; + label = "PMU VP4b"; + }; + + voltage-VP7b { + apple,key-id = "VP7b"; + label = "PMU VP7b"; + }; + + voltage-VP7l { + apple,key-id = "VP7l"; + label = "PMU VP7l"; + }; + + voltage-VP9b { + apple,key-id = "VP9b"; + label = "PMU VP9b"; + }; + + voltage-VP9l { + apple,key-id = "VP9l"; + label = "PMU VP9l"; + }; + + voltage-VPdb { + apple,key-id = "VPdb"; + label = "PMU VPdb"; + }; + + voltage-VR4l { + apple,key-id = "VR4l"; + label = "Rail VR4l"; + }; + + voltage-VR5b { + apple,key-id = "VR5b"; + label = "Rail VR5b"; + }; + + voltage-VR6b { + apple,key-id = "VR6b"; + label = "Rail VR6b"; + }; + + voltage-VR8b { + apple,key-id = "VR8b"; + label = "Rail VR8b"; + }; + + voltage-VRab { + apple,key-id = "VRab"; + label = "Rail VRab"; + }; + + voltage-VRcb { + apple,key-id = "VRcb"; + label = "Rail VRcb"; + }; + + voltage-VRcl { + apple,key-id = "VRcl"; + label = "Rail VRcl"; + }; + + voltage-VReb { + apple,key-id = "VReb"; + label = "Rail VReb"; + }; + + current-IP0b { + apple,key-id = "IP0b"; + label = "P-cluster IP0b"; + }; + + current-IPbb { + apple,key-id = "IPbb"; + label = "E-cluster IPbb"; + }; + + current-IP1b { + apple,key-id = "IP1b"; + label = "GPU IP1b"; + }; + + current-IP2b { + apple,key-id = "IP2b"; + label = "PMU IP2b"; + }; + + current-IP4b { + apple,key-id = "IP4b"; + label = "PMU IP4b"; + }; + + current-IP7b { + apple,key-id = "IP7b"; + label = "PMU IP7b"; + }; + + current-IP7l { + apple,key-id = "IP7l"; + label = "PMU IP7l"; + }; + + current-IP9b { + apple,key-id = "IP9b"; + label = "PMU IP9b"; + }; + + current-IR4l { + apple,key-id = "IR4l"; + label = "Rail IR4l"; + }; + + current-IR5b { + apple,key-id = "IR5b"; + label = "Rail IR5b"; + }; + + current-IR8b { + apple,key-id = "IR8b"; + label = "Rail IR8b"; + }; + + current-IRcl { + apple,key-id = "IRcl"; + label = "Rail IRcl"; + }; + + power-PP0b { + apple,key-id = "PP0b"; + label = "P-cluster PP0b"; + }; + + power-PPbb { + apple,key-id = "PPbb"; + label = "E-cluster PPbb"; + }; + + power-PP1b { + apple,key-id = "PP1b"; + label = "GPU PP1b"; + }; + + power-PP2b { + apple,key-id = "PP2b"; + label = "PMU PP2b"; + }; + + power-PP4b { + apple,key-id = "PP4b"; + label = "PMU PP4b"; + }; + + power-PP7b { + apple,key-id = "PP7b"; + label = "PMU PP7b"; + }; + + power-PP7l { + apple,key-id = "PP7l"; + label = "PMU PP7l"; + }; + + power-PP9b { + apple,key-id = "PP9b"; + label = "PMU PP9b"; + }; + + power-PR4l { + apple,key-id = "PR4l"; + label = "Rail PR4l"; + }; + + power-PR5b { + apple,key-id = "PR5b"; + label = "Rail PR5b"; + }; + + power-PRcl { + apple,key-id = "PRcl"; + label = "Rail PRcl"; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t8112-hwmon.dtsi b/arch/arm64/boot/dts/apple/t8112-hwmon.dtsi new file mode 100644 index 0000000000000..ec67a00731525 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t8112-hwmon.dtsi @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * T8112 SoC temperature channels published by the SMC, beyond the ones in + * t8112.dtsi. They are sensors of the SoC die, read-only; the J413 and + * J473 SMCs both publish every key here. + * + * t8112.dtsi makes the hwmon node a thermal sensor provider, so the driver + * keeps the channel number of a temperature key the SMC does not have and + * hides that channel with one warning. + * + * Include this file after the board's other hwmon files. The thermal zones + * index the first channels of t8112.dtsi; nothing indexes these. + */ + +/* + * GPU temperatures. The SMC publishes them only while the GPU is powered: + * with the GPU off, Tg0e, Tg0m and Tg0q read 0 C and Tg0f, Tg0n and Tg0r + * 4.6 C (they track the first three plus a fixed 4.6 C). Those + * placeholders are no data. Tg0f, Tg0n and Tg0r are in t8112.dtsi. + */ +&smc_hwmon { + temperature-Tg0e { + apple,key-id = "Tg0e"; + label = "GPU Tg0e"; + apple,no-data-below-millicelsius = <10000>; + }; + + temperature-Tg0m { + apple,key-id = "Tg0m"; + label = "GPU Tg0m"; + apple,no-data-below-millicelsius = <10000>; + }; + + temperature-Tg0q { + apple,key-id = "Tg0q"; + label = "GPU Tg0q"; + apple,no-data-below-millicelsius = <10000>; + }; +}; + +/* + * The other CPU temperatures, after the GPU channels. Each sensor site has + * a reading, the same plus a fixed offset and a hotspot estimate; the CPU + * thermal zones use the offset keys of four P sites and Te05. Te04-Te06 + * follow the E cluster, every Tp key the P cluster, TCMz is the hottest + * hotspot key and TCMb the hottest offset key. + */ +&smc_hwmon { + temperature-TCMb { + apple,key-id = "TCMb"; + label = "SoC Die TCMb"; + }; + + temperature-Te04 { + apple,key-id = "Te04"; + label = "E-cluster Te04"; + }; + + temperature-Te06 { + apple,key-id = "Te06"; + label = "E-cluster Te06"; + }; + + temperature-Tp00 { + apple,key-id = "Tp00"; + label = "P-cluster Tp00"; + }; + + temperature-Tp02 { + apple,key-id = "Tp02"; + label = "P-cluster Tp02"; + }; + + temperature-Tp04 { + apple,key-id = "Tp04"; + label = "P-cluster Tp04"; + }; + + temperature-Tp06 { + apple,key-id = "Tp06"; + label = "P-cluster Tp06"; + }; + + temperature-Tp08 { + apple,key-id = "Tp08"; + label = "P-cluster Tp08"; + }; + + temperature-Tp0A { + apple,key-id = "Tp0A"; + label = "P-cluster Tp0A"; + }; + + temperature-Tp0C { + apple,key-id = "Tp0C"; + label = "P-cluster Tp0C"; + }; + + temperature-Tp0E { + apple,key-id = "Tp0E"; + label = "P-cluster Tp0E"; + }; + + temperature-Tp0a { + apple,key-id = "Tp0a"; + label = "P-cluster Tp0a"; + }; + + temperature-Tp0b { + apple,key-id = "Tp0b"; + label = "P-cluster Tp0b"; + }; + + temperature-Tp0c { + apple,key-id = "Tp0c"; + label = "P-cluster Tp0c"; + }; + + temperature-Tp0e { + apple,key-id = "Tp0e"; + label = "P-cluster Tp0e"; + }; + + temperature-Tp0f { + apple,key-id = "Tp0f"; + label = "P-cluster Tp0f"; + }; + + temperature-Tp0g { + apple,key-id = "Tp0g"; + label = "P-cluster Tp0g"; + }; + + temperature-Tp0i { + apple,key-id = "Tp0i"; + label = "P-cluster Tp0i"; + }; + + temperature-Tp0j { + apple,key-id = "Tp0j"; + label = "P-cluster Tp0j"; + }; + + temperature-Tp0k { + apple,key-id = "Tp0k"; + label = "P-cluster Tp0k"; + }; + + temperature-Tp0m { + apple,key-id = "Tp0m"; + label = "P-cluster Tp0m"; + }; + + temperature-Tp0n { + apple,key-id = "Tp0n"; + label = "P-cluster Tp0n"; + }; + + temperature-Tp0o { + apple,key-id = "Tp0o"; + label = "P-cluster Tp0o"; + }; + + temperature-Tp0q { + apple,key-id = "Tp0q"; + label = "P-cluster Tp0q"; + }; + + temperature-Tp0r { + apple,key-id = "Tp0r"; + label = "P-cluster Tp0r"; + }; + + temperature-Tp0s { + apple,key-id = "Tp0s"; + label = "P-cluster Tp0s"; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t8112-j413-hwmon-rails.dtsi b/arch/arm64/boot/dts/apple/t8112-j413-hwmon-rails.dtsi index dfe95d1bdc2e9..0655d73a96d27 100644 --- a/arch/arm64/boot/dts/apple/t8112-j413-hwmon-rails.dtsi +++ b/arch/arm64/boot/dts/apple/t8112-j413-hwmon-rails.dtsi @@ -1,180 +1,36 @@ // SPDX-License-Identifier: GPL-2.0+ OR MIT /* - * T8112 J413 PMU rail channels published by the SMC. - * - * The SMC samples the main PMU outputs (VPxy voltage, IPxy current, PPxy - * power) and a second regulator family (VRxy, IRxy, PRxy). With the other - * cluster held at its lowest step, one cluster under load moves only its - * own output: - * P cluster (cpu4-7): VP0b 555-775 mV, IP0b up to 7.8 A, PP0b up to 6.1 W - * E cluster (cpu0-3): VPbb 537-905 mV, IPbb up to 2.2 A, PPbb up to 2.0 W - * GPU: VP1b 0 mV while power-gated, 900-930 mV under load, PP1b ~1.1 W - * The consumers of the other outputs are not mapped; they are labelled - * "PMU " and "Rail ". Outputs whose current and power read 0 in - * every state are left out. Linux only reads the SMC keys. + * T8112 J413 PMU rail channels the J473 SMC does not publish. The rails + * both boards have are in t8112-hwmon-rails.dtsi, where the key naming is + * explained. The consumers of these outputs are not mapped. */ &smc_hwmon { - voltage-VP0b { - apple,key-id = "VP0b"; - label = "P-cluster VP0b"; - }; - - voltage-VPbb { - apple,key-id = "VPbb"; - label = "E-cluster VPbb"; - }; - - voltage-VP1b { - apple,key-id = "VP1b"; - label = "GPU VP1b"; - }; - voltage-VP0R { apple,key-id = "VP0R"; label = "PMU VP0R"; }; - voltage-VP2b { - apple,key-id = "VP2b"; - label = "PMU VP2b"; - }; - voltage-VP2l { apple,key-id = "VP2l"; label = "PMU VP2l"; }; - voltage-VP3b { - apple,key-id = "VP3b"; - label = "PMU VP3b"; - }; - - voltage-VP4b { - apple,key-id = "VP4b"; - label = "PMU VP4b"; - }; - - voltage-VP7b { - apple,key-id = "VP7b"; - label = "PMU VP7b"; - }; - - voltage-VP7l { - apple,key-id = "VP7l"; - label = "PMU VP7l"; - }; - voltage-VP8l { apple,key-id = "VP8l"; label = "PMU VP8l"; }; - voltage-VP9b { - apple,key-id = "VP9b"; - label = "PMU VP9b"; - }; - - voltage-VP9l { - apple,key-id = "VP9l"; - label = "PMU VP9l"; - }; - - voltage-VPdb { - apple,key-id = "VPdb"; - label = "PMU VPdb"; - }; - voltage-VPkl { apple,key-id = "VPkl"; label = "PMU VPkl"; }; - voltage-VR4l { - apple,key-id = "VR4l"; - label = "Rail VR4l"; - }; - - voltage-VR5b { - apple,key-id = "VR5b"; - label = "Rail VR5b"; - }; - - voltage-VR6b { - apple,key-id = "VR6b"; - label = "Rail VR6b"; - }; - - voltage-VR8b { - apple,key-id = "VR8b"; - label = "Rail VR8b"; - }; - - voltage-VRab { - apple,key-id = "VRab"; - label = "Rail VRab"; - }; - - voltage-VRcb { - apple,key-id = "VRcb"; - label = "Rail VRcb"; - }; - - voltage-VRcl { - apple,key-id = "VRcl"; - label = "Rail VRcl"; - }; - - voltage-VReb { - apple,key-id = "VReb"; - label = "Rail VReb"; - }; - - current-IP0b { - apple,key-id = "IP0b"; - label = "P-cluster IP0b"; - }; - - current-IPbb { - apple,key-id = "IPbb"; - label = "E-cluster IPbb"; - }; - - current-IP1b { - apple,key-id = "IP1b"; - label = "GPU IP1b"; - }; - - current-IP2b { - apple,key-id = "IP2b"; - label = "PMU IP2b"; - }; - - current-IP4b { - apple,key-id = "IP4b"; - label = "PMU IP4b"; - }; - - current-IP7b { - apple,key-id = "IP7b"; - label = "PMU IP7b"; - }; - - current-IP7l { - apple,key-id = "IP7l"; - label = "PMU IP7l"; - }; - current-IP8l { apple,key-id = "IP8l"; label = "PMU IP8l"; }; - current-IP9b { - apple,key-id = "IP9b"; - label = "PMU IP9b"; - }; - current-IPBR { apple,key-id = "IPBR"; label = "PMU IPBR"; @@ -185,71 +41,11 @@ label = "PMU IPkl"; }; - current-IR4l { - apple,key-id = "IR4l"; - label = "Rail IR4l"; - }; - - current-IR5b { - apple,key-id = "IR5b"; - label = "Rail IR5b"; - }; - - current-IR8b { - apple,key-id = "IR8b"; - label = "Rail IR8b"; - }; - - current-IRcl { - apple,key-id = "IRcl"; - label = "Rail IRcl"; - }; - - power-PP0b { - apple,key-id = "PP0b"; - label = "P-cluster PP0b"; - }; - - power-PPbb { - apple,key-id = "PPbb"; - label = "E-cluster PPbb"; - }; - - power-PP1b { - apple,key-id = "PP1b"; - label = "GPU PP1b"; - }; - - power-PP2b { - apple,key-id = "PP2b"; - label = "PMU PP2b"; - }; - - power-PP4b { - apple,key-id = "PP4b"; - label = "PMU PP4b"; - }; - - power-PP7b { - apple,key-id = "PP7b"; - label = "PMU PP7b"; - }; - - power-PP7l { - apple,key-id = "PP7l"; - label = "PMU PP7l"; - }; - power-PP8l { apple,key-id = "PP8l"; label = "PMU PP8l"; }; - power-PP9b { - apple,key-id = "PP9b"; - label = "PMU PP9b"; - }; - power-PPBR { apple,key-id = "PPBR"; label = "PMU PPBR"; @@ -260,23 +56,8 @@ label = "PMU PPkl"; }; - power-PR4l { - apple,key-id = "PR4l"; - label = "Rail PR4l"; - }; - - power-PR5b { - apple,key-id = "PR5b"; - label = "Rail PR5b"; - }; - power-PR8b { apple,key-id = "PR8b"; label = "Rail PR8b"; }; - - power-PRcl { - apple,key-id = "PRcl"; - label = "Rail PRcl"; - }; }; diff --git a/arch/arm64/boot/dts/apple/t8112-j413.dts b/arch/arm64/boot/dts/apple/t8112-j413.dts index ff99c23afb7a9..4609399ea7e5c 100644 --- a/arch/arm64/boot/dts/apple/t8112-j413.dts +++ b/arch/arm64/boot/dts/apple/t8112-j413.dts @@ -278,173 +278,9 @@ }; #include "hwmon-laptop.dtsi" +#include "t8112-hwmon-rails.dtsi" #include "t8112-j413-hwmon-rails.dtsi" - -/* - * GPU temperatures, after the channels the thermal zones index. The SMC - * publishes them only while the GPU is powered: with the GPU off, Tg0e, - * Tg0m and Tg0q read 0 C and Tg0f, Tg0n and Tg0r 4.6 C (they track the - * first three plus a fixed 4.6 C). Those placeholders are no data. - * Tg0f, Tg0n and Tg0r are in t8112.dtsi. - */ -&smc_hwmon { - temperature-Tg0e { - apple,key-id = "Tg0e"; - label = "GPU Tg0e"; - apple,no-data-below-millicelsius = <10000>; - }; - - temperature-Tg0m { - apple,key-id = "Tg0m"; - label = "GPU Tg0m"; - apple,no-data-below-millicelsius = <10000>; - }; - - temperature-Tg0q { - apple,key-id = "Tg0q"; - label = "GPU Tg0q"; - apple,no-data-below-millicelsius = <10000>; - }; -}; - -/* - * The other CPU temperatures, read-only, after the GPU channels. Each - * sensor site has a reading, the same plus a fixed offset and a hotspot - * estimate; the zones above use the offset keys of four P sites and Te05. - * Te04-Te06 follow the E cluster, every Tp key the P cluster, TCMz is the - * hottest hotspot key and TCMb the hottest offset key. - */ -&smc_hwmon { - temperature-TCMb { - apple,key-id = "TCMb"; - label = "SoC Die TCMb"; - }; - - temperature-Te04 { - apple,key-id = "Te04"; - label = "E-cluster Te04"; - }; - - temperature-Te06 { - apple,key-id = "Te06"; - label = "E-cluster Te06"; - }; - - temperature-Tp00 { - apple,key-id = "Tp00"; - label = "P-cluster Tp00"; - }; - - temperature-Tp02 { - apple,key-id = "Tp02"; - label = "P-cluster Tp02"; - }; - - temperature-Tp04 { - apple,key-id = "Tp04"; - label = "P-cluster Tp04"; - }; - - temperature-Tp06 { - apple,key-id = "Tp06"; - label = "P-cluster Tp06"; - }; - - temperature-Tp08 { - apple,key-id = "Tp08"; - label = "P-cluster Tp08"; - }; - - temperature-Tp0A { - apple,key-id = "Tp0A"; - label = "P-cluster Tp0A"; - }; - - temperature-Tp0C { - apple,key-id = "Tp0C"; - label = "P-cluster Tp0C"; - }; - - temperature-Tp0E { - apple,key-id = "Tp0E"; - label = "P-cluster Tp0E"; - }; - - temperature-Tp0a { - apple,key-id = "Tp0a"; - label = "P-cluster Tp0a"; - }; - - temperature-Tp0b { - apple,key-id = "Tp0b"; - label = "P-cluster Tp0b"; - }; - - temperature-Tp0c { - apple,key-id = "Tp0c"; - label = "P-cluster Tp0c"; - }; - - temperature-Tp0e { - apple,key-id = "Tp0e"; - label = "P-cluster Tp0e"; - }; - - temperature-Tp0f { - apple,key-id = "Tp0f"; - label = "P-cluster Tp0f"; - }; - - temperature-Tp0g { - apple,key-id = "Tp0g"; - label = "P-cluster Tp0g"; - }; - - temperature-Tp0i { - apple,key-id = "Tp0i"; - label = "P-cluster Tp0i"; - }; - - temperature-Tp0j { - apple,key-id = "Tp0j"; - label = "P-cluster Tp0j"; - }; - - temperature-Tp0k { - apple,key-id = "Tp0k"; - label = "P-cluster Tp0k"; - }; - - temperature-Tp0m { - apple,key-id = "Tp0m"; - label = "P-cluster Tp0m"; - }; - - temperature-Tp0n { - apple,key-id = "Tp0n"; - label = "P-cluster Tp0n"; - }; - - temperature-Tp0o { - apple,key-id = "Tp0o"; - label = "P-cluster Tp0o"; - }; - - temperature-Tp0q { - apple,key-id = "Tp0q"; - label = "P-cluster Tp0q"; - }; - - temperature-Tp0r { - apple,key-id = "Tp0r"; - label = "P-cluster Tp0r"; - }; - - temperature-Tp0s { - apple,key-id = "Tp0s"; - label = "P-cluster Tp0s"; - }; -}; +#include "t8112-hwmon.dtsi" /* * Mesa fingerprint sensor on spi2. The J413 platform device tree diff --git a/arch/arm64/boot/dts/apple/t8112-j473.dts b/arch/arm64/boot/dts/apple/t8112-j473.dts index 84ecd65613567..3ac5bd50eedbf 100644 --- a/arch/arm64/boot/dts/apple/t8112-j473.dts +++ b/arch/arm64/boot/dts/apple/t8112-j473.dts @@ -277,6 +277,8 @@ }; #include "hwmon-mini.dtsi" +#include "t8112-hwmon-rails.dtsi" +#include "t8112-hwmon.dtsi" #include "t8112-j473-peripherals.dtsi"