Add initial support for Qualcomm SM7250 SoC
Subsystems (7)
v12 cover Add initial support for Qualcomm SM7250 SoC
This patchset introduces foundational upstream support for the Qualcomm SM7250 SoC (internally codenamed Lito).
SM7250 is an ARMv8.2-A platform manufactured on a 7nm process, featuring an octa-core Kryo 475 CPU configuration (1x Prime Cortex-A76, 1x Gold Cortex-A76, and 6x Silver Cortex-A55) and Adreno 620 GPU.
This patchset is organized as follows:
Quoted 1 line
Document relevant device tree bindings (SoC ID, Kryo 475 CPUs, SCM, PDC,
RPMh clocks/power domains, GCC and cpufreq hardware).
Quoted 2 lines
Add driver support for SM7250 in socinfo, rpmh-clk, rpmhpd, and GCC. Add the base SoC DTSI (
sm7250.dtsi) defining the cpus, PSCI,
interrupt controllers, clock providers, power domains, and reserved memory.
Quoted 1 line
-----------------------------------------------------------------------------<
Merged patches:
dt-bindings: arm: qcom,ids: Add SoC ID for SM7250
soc: qcom: socinfo: Add SM7250 SoC ID
dt-bindings: clock: qcom,rpmhcc: Document RPMHCC compatible
clk: qcom: rpmh: Add SM7250 rpmh clocks
dt-bindings: power: qcom,rpmhpd: Document RPMh power domain for SM7250
pmdomain: qcom: rpmhpd: Add RPMh power domains
dt-bindings: arm: cpus: Document Kryo 475 CPUs
dt-bindings: interrupt-controller: qcom,pdc: Document SM7250 PDC
Pending patches:
dt-bindings: clock: Add SM7250 global clock controller
clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
dt-bindings: firmware: qcom,scm: Document SM7250 SCM
dt-bindings: cpufreq: qcom-hw: Document SM7250 cpufreq hardware
dt-bindings: thermal: lmh: Document SM7250 LMh
arm64: dts: qcom: Add SM7250 devicetree file
Quoted 1 line
------------------------------------------------------------------------------<
Changelog [v12]:
[PATCH v12 1/6] dt-bindings: clock: Add SM7250 global clock controller
Quoted 1 line
Move dt-binding definition to qcom,gcc-sm8250.yaml. The device tree
schema of SM7250 matches with SM8250 for clock-controller node. [PATCH v12 5/6] dt-bindings: thermal: lmh: Document SM7250 LMh
Quoted 1 line
Add LMh compatible.
[PATCH v12 6/6] arm64: dts: qcom: Add SM7250 devicetree file
Quoted 2 lines
Remove cluster wise sorting of cpus.
Add LMh node.
Link [RESEND v11]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
Link [v11]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
Changelog [v11]:
[PATCH v11 2/5] clk: qcom: Add Global Clock Controller (GCC) driver
Quoted 2 lines
Drop
hw_ctlclock branches
Populate default values for GDSCs
Link [v10]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
Changelog [v10]:
[PATCH v10 2/6] clk: qcom: Add Global Clock Controller (GCC) driver
Quoted 1 line
Update .halt_check and .ops are per the review.
Link [v9]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
Changelog [v9]:
[PATCH v9 04/13]: clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
Quoted 1 line
Make all
clk_init_datainstances const across the driver.
Link [v8]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
Changelog [v8]:
Same as v7. Resending the full patchset as v8 due to a transmission interruption during v7.
Link [v7]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
Changelog [v7]:
[PATCH v7 04/13]: clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
Quoted 1 line
Fixed missing (struct device *dev) in
gcc_sm7250_clk_regs_configure
Link [v6]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
Changelog [v6]:
[PATCH v6 04/13]: clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
Quoted 1 line
Make all
clk_init_datainstances const across the driver.
Link [v5]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
Changelog [v5]:
[PATCH v5 13/13]: arm64: dts: qcom: Add SM7250 devicetree file
Quoted 2 lines
Reformat multi-entry phandle lists (domain-idle-states) to '<&a>, <&b>'. Reformat multi-entry tuples and string lists (qcom,pdc-ranges, qcom,tcs-config, reg-names)
to one item per line.
Quoted 3 lines
Enable QUPv3 wrapper globally by dropping 'status = "disabled"'. Move compatible property to first.
Remove clock-frequency property for timer.
Link [v4]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
Changelog [v4]:
[PATCH v4 04/13] clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
Quoted 1 line
Update .fw_name with .index
[PATCH v4 13/13] arm64: dts: qcom: Add SM7250 devicetree file
Quoted 2 lines
Added missing capacity-dmips-mhz and dynamic-power-coefficient for cpu@300 Added power-domains for cpus and
apps_rsc
Link [v3]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
Changelog [v3]:
[PATCH v3 04/13] clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
Quoted 2 lines
Updated the way of registering critical clocks.
Made some more clock critical.
GCC_VIDEO_XO_CLK
GCC_CAMERA_XO_CLK
GCC_DISP_XO_CLK
GCC_NPU_CFG_AHB_CLK GCC_CPUSS_AHB_CLK GCC_NPU_BWMON_CFG_AHB_CLK
These clocks are flagged as critical in gcc-lito.c
Link [v2]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
Changelog [v2]:
[PATCH v2 12/13] dt-bindings: cpufreq: qcom-hw: Document SM7250 cpufreq hardware [PATCH v2 13/13] arm64: dts: qcom: Add SM7250 devicetree file
Quoted 1 line
Added SM7250 cpufreq hardware
Link [v1]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
---
Sreeshankar K (6):
dt-bindings: clock: Add SM7250 global clock controller
clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
dt-bindings: firmware: qcom,scm: Document SM7250 SCM
dt-bindings: cpufreq: qcom-hw: Document SM7250 cpufreq hardware
dt-bindings: thermal: lmh: Document SM7250 LMh
arm64: dts: qcom: Add SM7250 devicetree file
.../devicetree/bindings/clock/qcom,gcc-sm8250.yaml | 13 +- .../bindings/cpufreq/cpufreq-qcom-hw.yaml | 2 + .../devicetree/bindings/firmware/qcom,scm.yaml | 1 + .../devicetree/bindings/thermal/qcom-lmh.yaml | 4 +- arch/arm64/boot/dts/qcom/sm7250.dtsi | 795 +++++++ drivers/clk/qcom/Kconfig | 10 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/gcc-sm7250.c | 2278 ++++++++++++++++++++ include/dt-bindings/clock/qcom,gcc-sm7250.h | 163 ++ 9 files changed, 3262 insertions(+), 5 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261104-master-5cd2d9cb0ac8
Best regards,
Signature · 1 line
Sreeshankar K <[email protected]>
PATCH v12 1/6 dt-bindings: clock: Add SM7250 global clock controller
Add device tree bindings for global clock controller on SM7250 SoC.
--- .../devicetree/bindings/clock/qcom,gcc-sm8250.yaml | 13 +- include/dt-bindings/clock/qcom,gcc-sm7250.h | 163 +++++++++++++++++++++ 2 files changed, 172 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/clock/qcom,gcc-sm8250.yaml +9 -4
@@ -4,21 +4,26 @@ $id: http://devicetree.org/schemas/clock/qcom,gcc-sm8250.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Qualcomm Global Clock & Reset Controller on SM8250 +title: Qualcomm Global Clock & Reset Controller on SM7250 and SM8250 maintainers: - Stephen Boyd <[email protected]> - Taniya Das <[email protected]> + - Sreeshankar K <[email protected]> description: | Qualcomm global clock control module provides the clocks, resets and power - domains on SM8250. + domains on SM7250 and SM8250. - See also: include/dt-bindings/clock/qcom,gcc-sm8250.h + See also: + - include/dt-bindings/clock/qcom,gcc-sm7250.h + - include/dt-bindings/clock/qcom,gcc-sm8250.h properties: compatible: - const: qcom,gcc-sm8250 + enum: + - qcom,gcc-sm7250 + - qcom,gcc-sm8250 clocks: items:
include/dt-bindings/clock/qcom,gcc-sm7250.h new file +163 -0
163 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v12 2/6 clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
In reply to Sreeshankar KAdd support for the global clock controller found on SM7250 based devices.
--- drivers/clk/qcom/Kconfig | 10 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/gcc-sm7250.c | 2278 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2289 insertions(+)
drivers/clk/qcom/Kconfig +10 -0
@@ -1747,6 +1747,16 @@ config SM_GCC_7150 Say Y if you want to use peripheral devices such as UART, SPI, I2C, USB, SD/UFS, PCIe etc. +config SM_GCC_7250 + tristate "SM7250 Global Clock Controller" + depends on ARM64 || COMPILE_TEST + select QCOM_GDSC + default ARCH_QCOM + help + Support for the global clock controller on SM7250 devices. + Say Y if you want to use peripheral devices such as UART, + SPI, I2C, USB, SD/UFS etc. + config SM_GCC_MILOS tristate "Milos Global Clock Controller" depends on ARM64 || COMPILE_TEST
drivers/clk/qcom/Makefile +1 -0
@@ -192,6 +192,7 @@ obj-$(CONFIG_SM_GCC_6125) += gcc-sm6125.o obj-$(CONFIG_SM_GCC_6350) += gcc-sm6350.o obj-$(CONFIG_SM_GCC_6375) += gcc-sm6375.o obj-$(CONFIG_SM_GCC_7150) += gcc-sm7150.o +obj-$(CONFIG_SM_GCC_7250) += gcc-sm7250.o obj-$(CONFIG_SM_GCC_8150) += gcc-sm8150.o obj-$(CONFIG_SM_GCC_8250) += gcc-sm8250.o obj-$(CONFIG_SM_GCC_8350) += gcc-sm8350.o
drivers/clk/qcom/gcc-sm7250.c new file +2278 -0
2,278 lines not on this page · raw message
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v12 2/6] clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] clk: qcom: gcc-sm7250: wrong halt_check on gcc_ddrss_gpu_axi_clk --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] clk: qcom: gcc-sm7250: wrong halt_check on gcc_ddrss_gpu_axi_clk --
commit a24e620aee1e1a738b8a01486a74fa9dab88eef4
Author: Sreeshankar K <[email protected]>
clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
This commit adds the Global Clock Controller (GCC) driver for Qualcomm SM7250 SoCs, registering PLLs, RCGs, branch clocks, GDSCs, and resets.
Quoted 6 lines
drivers/clk/qcom/gcc-sm7250.c new file +0
-0@@ -0,0 +1,2278 @@
[ ... ]
drivers/clk/qcom/gcc-sm7250.c line 851
Quoted 12 lines
drivers/clk/qcom/gcc-sm7250.c new file +12
-0+static struct clk_branch gcc_ddrss_gpu_axi_clk = { + .halt_reg =0x71154 , + .halt_check =BRANCH_HALT , + .clkr = { + .enable_reg =0x71154 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ){ + .name ="gcc_ddrss_gpu_axi_clk" , + .ops = &clk_branch2_ops, + }, + }, +};
[Severity: Medium]
As reported by Taniya Das on v9 [1], should gcc_ddrss_gpu_axi_clk use BRANCH_VOTED instead of BRANCH_HALT for .halt_check?
When gcc_ddrss_gpu_axi_clk is disabled via clk_branch2_disable() -> clk_branch_toggle() -> clk_branch_wait() in drivers/clk/qcom/clk-branch.c:
bool voted = br->halt_check & BRANCH_VOTED;
...
if (br->halt_check == BRANCH_HALT_DELAY || (!enabling && voted)) {
udelay(10);
} else if (br->halt_check == BRANCH_HALT_ENABLE ||
br->halt_check == BRANCH_HALT ||
(enabling && voted)) {
int count = 200;
while (count-- > 0) {
if (check_halt(br, enabling))
return 0;
udelay(1);
}
WARN(1, "%s status stuck at 'o%s'", name,
enabling ? "ff" : "n");
return -EBUSY;
}Having .halt_check set to BRANCH_HALT instead of BRANCH_VOTED causes clk_branch_wait() to poll the CBCR_CLK_OFF bit on disable rather than delaying 10us, which can trigger a WARN() splat if the voted DDRSS GPU AXI clock remains active.
[1] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
PATCH v12 3/6 dt-bindings: firmware: qcom,scm: Document SM7250 SCM
In reply to Sreeshankar KDocument the SCM compatible for Qualcomm SM7250 SoC.
--- Documentation/devicetree/bindings/firmware/qcom,scm.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/firmware/qcom,scm.yaml +1 -0
@@ -76,6 +76,7 @@ properties: - qcom,scm-sm6350 - qcom,scm-sm6375 - qcom,scm-sm7150 + - qcom,scm-sm7250 - qcom,scm-sm8150 - qcom,scm-sm8250 - qcom,scm-sm8350
Signature · 1 line
2.43.0
PATCH v12 4/6 dt-bindings: cpufreq: qcom-hw: Document SM7250 cpufreq hardware
In reply to Sreeshankar KDocument the cpufreq hardware on the SM7250 SoC.
--- Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.yaml +2 -0
@@ -29,6 +29,7 @@ properties: - qcom,sdm845-cpufreq-hw - qcom,sm6115-cpufreq-hw - qcom,sm6350-cpufreq-hw + - qcom,sm7250-cpufreq-hw - qcom,sm8150-cpufreq-hw - const: qcom,cpufreq-hw
@@ -201,6 +202,7 @@ allOf: compatible: contains: enum: + - qcom,sm7250-cpufreq-hw - qcom,sm8150-cpufreq-hw then: properties:
Signature · 1 line
2.43.0
PATCH v12 5/6 dt-bindings: thermal: lmh: Document SM7250 LMh
In reply to Sreeshankar KDocument the LMh compatible for Qualcomm SM7250 SoC.
--- Documentation/devicetree/bindings/thermal/qcom-lmh.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/thermal/qcom-lmh.yaml +3 -1
@@ -26,7 +26,9 @@ properties: - const: qcom,sdm670-lmh - const: qcom,sdm845-lmh - items: - - const: qcom,qcm2290-lmh + - enum: + - qcom,qcm2290-lmh + - qcom,sm7250-lmh - const: qcom,sm8150-lmh reg:
Signature · 1 line
2.43.0
PATCH v12 6/6 arm64: dts: qcom: Add SM7250 devicetree file
In reply to Sreeshankar KAdd base devicetree file for SM7250 SoC.
This file adds the basic nodes like cpu, psci and other required configuration for booting up to the serial console.
--- arch/arm64/boot/dts/qcom/sm7250.dtsi | 795 +++++++++++++++++++++++++++++++++++ 1 file changed, 795 insertions(+)
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +795 -0
@@ -0,0 +1,795 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2026, Sreeshankar K <[email protected]> + */ + +#include <dt-bindings/clock/qcom,rpmh.h> +#include <dt-bindings/clock/qcom,gcc-sm7250.h> +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/power/qcom,rpmhpd.h> +#include <dt-bindings/power/qcom-rpmpd.h> +#include <dt-bindings/soc/qcom,rpmh-rsc.h> + +/ { + interrupt-parent = <&intc>; + #address-cells = <2>; + #size-cells = <2>; + + clocks { + xo_board: xo-board { + compatible = "fixed-clock"; + clock-frequency = <38400000>; + #clock-cells = <0>; + }; + + sleep_clk: sleep-clk { + compatible = "fixed-clock"; + clock-frequency = <32764>; + #clock-cells = <0>; + }; + }; + + cpus { + #address-cells = <2>; + #size-cells = <0>; + + cpu0: cpu@0 { + device_type = "cpu"; + compatible = "qcom,kryo475"; + reg = <0x0 0x0>; + clocks = <&cpufreq_hw 0>; + enable-method = "psci"; + capacity-dmips-mhz = <1024>; + dynamic-power-coefficient = <100>; + next-level-cache = <&l2_0>; + qcom,freq-domain = <&cpufreq_hw 0>; + power-domains = <&cpu_pd0>; + power-domain-names = "psci"; + #cooling-cells = <2>; + + l2_0: l2-cache { + compatible = "cache"; + cache-level = <2>; + cache-size = <0x20000>; + cache-unified; + next-level-cache = <&l3_0>; + + l3_0: l3-cache { + compatible = "cache"; + cache-level = <3>; + cache-size = <0x200000>; + cache-unified; + }; + }; + }; + + cpu1: cpu@100 { + device_type = "cpu"; + compatible = "qcom,kryo475"; + reg = <0x0 0x100>; + clocks = <&cpufreq_hw 0>; + enable-method = "psci"; + capacity-dmips-mhz = <1024>; + dynamic-power-coefficient = <100>; + next-level-cache = <&l2_100>; + qcom,freq-domain = <&cpufreq_hw 0>; + power-domains = <&cpu_pd1>; + power-domain-names = "psci"; + #cooling-cells = <2>; + + l2_100: l2-cache { + compatible = "cache"; + cache-level = <2>; + cache-size = <0x20000>; + cache-unified; + next-level-cache = <&l3_0>; + }; + }; + + cpu2: cpu@200 { + device_type = "cpu"; + compatible = "qcom,kryo475"; + reg = <0x0 0x200>; + clocks = <&cpufreq_hw 0>; + enable-method = "psci"; + capacity-dmips-mhz = <1024>; + dynamic-power-coefficient = <100>; + next-level-cache = <&l2_200>; + qcom,freq-domain = <&cpufreq_hw 0>; + power-domains = <&cpu_pd2>; + power-domain-names = "psci"; + #cooling-cells = <2>; + + l2_200: l2-cache { + compatible = "cache"; + cache-level = <2>; + cache-size = <0x20000>; + cache-unified; + next-level-cache = <&l3_0>; + }; + }; + + cpu3: cpu@300 { + device_type = "cpu"; + compatible = "qcom,kryo475"; + reg = <0x0 0x300>; + clocks = <&cpufreq_hw 0>; + enable-method = "psci"; + capacity-dmips-mhz = <1024>; + dynamic-power-coefficient = <100>; + next-level-cache = <&l2_300>; + qcom,freq-domain = <&cpufreq_hw 0>; + power-domains = <&cpu_pd3>; + power-domain-names = "psci"; + #cooling-cells = <2>; + + l2_300: l2-cache { + compatible = "cache"; + cache-level = <2>; + cache-size = <0x20000>; + cache-unified; + next-level-cache = <&l3_0>; + }; + }; + + cpu4: cpu@400 { + device_type = "cpu"; + compatible = "qcom,kryo475"; + reg = <0x0 0x400>; + clocks = <&cpufreq_hw 0>; + enable-method = "psci"; + capacity-dmips-mhz = <1024>; + dynamic-power-coefficient = <100>; + next-level-cache = <&l2_400>; + qcom,freq-domain = <&cpufreq_hw 0>; + power-domains = <&cpu_pd4>; + power-domain-names = "psci"; + #cooling-cells = <2>; + + l2_400: l2-cache { + compatible = "cache"; + cache-level = <2>; + cache-size = <0x20000>; + cache-unified; + next-level-cache = <&l3_0>; + }; + }; + + cpu5: cpu@500 { + device_type = "cpu"; + compatible = "qcom,kryo475"; + reg = <0x0 0x500>; + clocks = <&cpufreq_hw 0>; + enable-method = "psci"; + capacity-dmips-mhz = <1024>; + dynamic-power-coefficient = <100>; + next-level-cache = <&l2_500>; + qcom,freq-domain = <&cpufreq_hw 0>; + power-domains = <&cpu_pd5>; + power-domain-names = "psci"; + #cooling-cells = <2>; + + l2_500: l2-cache { + compatible = "cache"; + cache-level = <2>; + cache-size = <0x20000>; + cache-unified; + next-level-cache = <&l3_0>; + }; + }; + + cpu6: cpu@600 { + device_type = "cpu"; + compatible = "qcom,kryo475"; + reg = <0x0 0x600>; + clocks = <&cpufreq_hw 1>; + enable-method = "psci"; + capacity-dmips-mhz = <1740>; + dynamic-power-coefficient = <341>; + next-level-cache = <&l2_600>; + qcom,freq-domain = <&cpufreq_hw 1>; + power-domains = <&cpu_pd6>; + power-domain-names = "psci"; + #cooling-cells = <2>; + + l2_600: l2-cache { + compatible = "cache"; + cache-level = <2>; + cache-size = <0x40000>; + cache-unified; + next-level-cache = <&l3_0>; + }; + }; + + cpu7: cpu@700 { + device_type = "cpu"; + compatible = "qcom,kryo475"; + reg = <0x0 0x700>; + clocks = <&cpufreq_hw 2>; + enable-method = "psci"; + capacity-dmips-mhz = <1740>; + dynamic-power-coefficient = <375>; + next-level-cache = <&l2_700>; + qcom,freq-domain = <&cpufreq_hw 2>; + power-domains = <&cpu_pd7>; + power-domain-names = "psci"; + #cooling-cells = <2>; + + l2_700: l2-cache { + compatible = "cache"; + cache-level = <2>; + cache-size = <0x80000>; + cache-unified; + next-level-cache = <&l3_0>; + }; + }; + + cpu-map { + cluster0 { + core0 { + cpu = <&cpu0>; + }; + + core1 { + cpu = <&cpu1>; + }; + + core2 { + cpu = <&cpu2>; + }; + + core3 { + cpu = <&cpu3>; + }; + + core4 { + cpu = <&cpu4>; + }; + + core5 { + cpu = <&cpu5>; + }; + + core6 { + cpu = <&cpu6>; + }; + + core7 { + cpu = <&cpu7>; + }; + }; + }; + + domain-idle-states { + cluster_sleep_pc: cluster-sleep-0 { + compatible = "domain-idle-state"; + arm,psci-suspend-param = <0x40000004>; + entry-latency-us = <2752>; + exit-latency-us = <3048>; + min-residency-us = <6118>; + }; + + cluster_sleep_cx: cluster-sleep-1 { + compatible = "domain-idle-state"; + arm,psci-suspend-param = <0x41000224>; + entry-latency-us = <3638>; + exit-latency-us = <4562>; + min-residency-us = <8467>; + }; + + cluster_sleep_aoss: cluster-sleep-2 { + compatible = "domain-idle-state"; + arm,psci-suspend-param = <0x41000c24>; + entry-latency-us = <3263>; + exit-latency-us = <6562>; + min-residency-us = <9826>; + }; + }; + + idle-states { + entry-method = "psci"; + + little_cpu_sleep_0: cpu-sleep-0-0 { + compatible = "arm,idle-state"; + idle-state-name = "little-power-collapse"; + arm,psci-suspend-param = <0x40000003>; + entry-latency-us = <549>; + exit-latency-us = <901>; + min-residency-us = <1774>; + local-timer-stop; + }; + + little_cpu_sleep_1: cpu-sleep-0-1 { + compatible = "arm,idle-state"; + idle-state-name = "little-rail-power-collapse"; + arm,psci-suspend-param = <0x40000004>; + entry-latency-us = <702>; + exit-latency-us = <915>; + min-residency-us = <4001>; + local-timer-stop; + }; + + big_cpu_sleep_0: cpu-sleep-1-0 { + compatible = "arm,idle-state"; + idle-state-name = "big-power-collapse"; + arm,psci-suspend-param = <0x40000003>; + entry-latency-us = <523>; + exit-latency-us = <1244>; + min-residency-us = <2207>; + local-timer-stop; + }; + + big_cpu_sleep_1: cpu-sleep-1-1 { + compatible = "arm,idle-state"; + idle-state-name = "big-rail-power-collapse"; + arm,psci-suspend-param = <0x40000004>; + entry-latency-us = <526>; + exit-latency-us = <1854>; + min-residency-us = <5555>; + local-timer-stop; + }; + }; + }; + + firmware { + scm: scm { + compatible = "qcom,scm-sm7250", "qcom,scm"; + #reset-cells = <1>; + }; + }; + + memory@80000000 { + device_type = "memory"; + /* We expect the bootloader to fill in the size */ + reg = <0x0 0x80000000 0x0 0x0>; + }; + + pmu { + compatible = "arm,armv8-pmuv3"; + interrupts = <GIC_PPI 5 IRQ_TYPE_LEVEL_HIGH>; + }; + + psci { + compatible = "arm,psci-1.0"; + method = "smc"; + + cpu_pd0: power-domain-cpu0 { + #power-domain-cells = <0>; + power-domains = <&cluster_pd>; + domain-idle-states = <&little_cpu_sleep_0>, + <&little_cpu_sleep_1>; + }; + + cpu_pd1: power-domain-cpu1 { + #power-domain-cells = <0>; + power-domains = <&cluster_pd>; + domain-idle-states = <&little_cpu_sleep_0>, + <&little_cpu_sleep_1>; + }; + + cpu_pd2: power-domain-cpu2 { + #power-domain-cells = <0>; + power-domains = <&cluster_pd>; + domain-idle-states = <&little_cpu_sleep_0>, + <&little_cpu_sleep_1>; + }; + + cpu_pd3: power-domain-cpu3 { + #power-domain-cells = <0>; + power-domains = <&cluster_pd>; + domain-idle-states = <&little_cpu_sleep_0>, + <&little_cpu_sleep_1>; + }; + + cpu_pd4: power-domain-cpu4 { + #power-domain-cells = <0>; + power-domains = <&cluster_pd>; + domain-idle-states = <&little_cpu_sleep_0>, + <&little_cpu_sleep_1>; + }; + + cpu_pd5: power-domain-cpu5 { + #power-domain-cells = <0>; + power-domains = <&cluster_pd>; + domain-idle-states = <&little_cpu_sleep_0>, + <&little_cpu_sleep_1>; + }; + + cpu_pd6: power-domain-cpu6 { + #power-domain-cells = <0>; + power-domains = <&cluster_pd>; + domain-idle-states = <&big_cpu_sleep_0>, + <&big_cpu_sleep_1>; + }; + + cpu_pd7: power-domain-cpu7 { + #power-domain-cells = <0>; + power-domains = <&cluster_pd>; + domain-idle-states = <&big_cpu_sleep_0>, + <&big_cpu_sleep_1>; + }; + + cluster_pd: power-domain-cpu-cluster0 { + #power-domain-cells = <0>; + domain-idle-states = <&cluster_sleep_pc>, + <&cluster_sleep_cx>, + <&cluster_sleep_aoss>; + }; + }; + + reserved_memory: reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + hyp_mem: hyp@80000000 { + reg = <0x0 0x80000000 0x0 0x600000>; + no-map; + }; + + xbl_aop_mem: xbl-aop@80700000 { + reg = <0x0 0x80700000 0x0 0x160000>; + no-map; + }; + + cmd_db: cmd-db@80860000 { + compatible = "qcom,cmd-db"; + reg = <0x0 0x80860000 0x0 0x20000>; + no-map; + }; + + xbl_uefi_mem: xbl-uefi@80880000 { + reg = <0 0x80880000 0 0x14000>; + no-map; + }; + + smem_mem: smem@80900000 { + compatible = "qcom,smem"; + reg = <0x0 0x80900000 0x0 0x200000>; + no-map; + hwlocks = <&tcsr_mutex 3>; + }; + + removed_mem: removed@80b00000 { + reg = <0x0 0x80b00000 0x0 0x1300000>; + no-map; + }; + + camera_mem: camera@86000000 { + reg = <0x0 0x86000000 0x0 0x500000>; + no-map; + }; + + npu_mem: npu@86500000 { + reg = <0x0 0x86500000 0x0 0x500000>; + no-map; + }; + + video_mem: video@86a00000 { + reg = <0x0 0x86a00000 0x0 0x500000>; + no-map; + }; + + cdsp_mem: cdsp@87400000 { + reg = <0x0 0x87400000 0x0 0x1e00000>; + no-map; + }; + + adsp_mem: adsp@89200000 { + reg = <0x0 0x89200000 0x0 0x2800000>; + no-map; + }; + + wlan_fw_mem: wlan-fw@8ba00000 { + reg = <0x0 0x8ba00000 0x0 0x200000>; + no-map; + }; + + ipa_fw_mem: ipa-fw@8bc00000 { + reg = <0x0 0x8bc00000 0x0 0x10000>; + no-map; + }; + + ipa_gsi_mem: ipa-gsi@8bc10000 { + reg = <0x0 0x8bc10000 0x0 0x5400>; + no-map; + }; + + gpu_mem: gpu@8bc15400 { + reg = <0x0 0x8bc15400 0x0 0x2000>; + no-map; + }; + + modem_wlan_mem: modem-wlan@8c000000 { + reg = <0x0 0x8c000000 0x0 0xf800000>; + no-map; + }; + + cdsp_sec_mem: cdsp-sec@9f400000 { + reg = <0x0 0x9f400000 0x0 0xc00000>; + no-map; + }; + }; + + soc: soc@0 { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0 0 0 0 0x10 0>; + dma-ranges = <0 0 0 0 0x10 0>; + + gcc: clock-controller@100000 { + compatible = "qcom,gcc-sm7250"; + reg = <0x0 0x00100000 0x0 0x1f0000>; + clock-names = "bi_tcxo", + "bi_tcxo_ao", + "sleep_clk"; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&rpmhcc RPMH_CXO_CLK_A>, + <&sleep_clk>; + power-domains = <&rpmhpd RPMHPD_CX>; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + }; + + qupv3_id_1: geniqup@9c0000 { + compatible = "qcom,geni-se-qup"; + reg = <0x0 0x009c0000 0x0 0x6000>; + clock-names = "m-ahb", "s-ahb"; + clocks = <&gcc GCC_QUPV3_WRAP_1_M_AHB_CLK>, + <&gcc GCC_QUPV3_WRAP_1_S_AHB_CLK>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + uart2: serial@988000 { + compatible = "qcom,geni-debug-uart"; + reg = <0 0x00988000 0 0x4000>; + clock-names = "se"; + clocks = <&gcc GCC_QUPV3_WRAP1_S2_CLK>; + interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + }; + + intc: interrupt-controller@17a00000 { + compatible = "arm,gic-v3"; + reg = <0x0 0x17a00000 0x0 0x10000>, /* GICD */ + <0x0 0x17a60000 0x0 0x100000>; /* GICR * 8 */ + #interrupt-cells = <3>; + interrupt-controller; + interrupts = <GIC_PPI 8 IRQ_TYPE_LEVEL_HIGH>; + }; + + pdc: interrupt-controller@b220000 { + compatible = "qcom,sm7250-pdc", "qcom,pdc"; + reg = <0 0xb220000 0 0x30000>, <0 0x17c000f0 0 0x60>; + qcom,pdc-ranges = <0 480 42>, + <42 612 28>, + <70 63 1>, + <71 640 15>, + <86 522 52>; + #interrupt-cells = <2>; + interrupt-parent = <&intc>; + interrupt-controller; + }; + + spmi_bus: spmi@c440000 { + compatible = "qcom,spmi-pmic-arb"; + reg = <0x0 0x0c440000 0x0 0x0001100>, + <0x0 0x0c600000 0x0 0x2000000>, + <0x0 0x0e600000 0x0 0x0100000>, + <0x0 0x0e700000 0x0 0x00a0000>, + <0x0 0x0c40a000 0x0 0x0026000>; + reg-names = "core", + "chnls", + "obsrvr", + "intr", + "cnfg"; + interrupt-names = "periph_irq"; + interrupts-extended = <&pdc 1 IRQ_TYPE_LEVEL_HIGH>; + qcom,ee = <0>; + qcom,channel = <0>; + #address-cells = <2>; + #size-cells = <0>; + interrupt-controller; + #interrupt-cells = <4>; + }; + + apps_rsc: rsc@18200000 { + compatible = "qcom,rpmh-rsc"; + reg = <0x0 0x18200000 0x0 0x10000>, + <0x0 0x18210000 0x0 0x10000>, + <0x0 0x18220000 0x0 0x10000>; + reg-names = "drv-0", + "drv-1", + "drv-2"; + interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>; + label = "apps_rsc"; + qcom,tcs-offset = <0xd00>; + qcom,drv-id = <2>; + qcom,tcs-config = <ACTIVE_TCS 2>, <SLEEP_TCS 3>, + <WAKE_TCS 3>, <CONTROL_TCS 1>; + power-domains = <&cluster_pd>; + + rpmhcc: clock-controller { + compatible = "qcom,sm7250-rpmh-clk"; + #clock-cells = <1>; + clock-names = "xo"; + clocks = <&xo_board>; + }; + + rpmhpd: power-controller { + compatible = "qcom,sm7250-rpmhpd"; + #power-domain-cells = <1>; + operating-points-v2 = <&rpmhpd_opp_table>; + + rpmhpd_opp_table: opp-table { + compatible = "operating-points-v2"; + + rpmhpd_opp_ret: opp1 { + opp-level = <RPMH_REGULATOR_LEVEL_RETENTION>; + }; + + rpmhpd_opp_min_svs: opp2 { + opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>; + }; + + rpmhpd_opp_low_svs: opp3 { + opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>; + }; + + rpmhpd_opp_svs: opp4 { + opp-level = <RPMH_REGULATOR_LEVEL_SVS>; + }; + + rpmhpd_opp_svs_l1: opp5 { + opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>; + }; + + rpmhpd_opp_nom: opp6 { + opp-level = <RPMH_REGULATOR_LEVEL_NOM>; + }; + + rpmhpd_opp_nom_l1: opp7 { + opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>; + }; + + rpmhpd_opp_nom_l2: opp8 { + opp-level = <RPMH_REGULATOR_LEVEL_NOM_L2>; + }; + + rpmhpd_opp_turbo: opp9 { + opp-level = <RPMH_REGULATOR_LEVEL_TURBO>; + }; + + rpmhpd_opp_turbo_l1: opp10 { + opp-level = <RPMH_REGULATOR_LEVEL_TURBO_L1>; + }; + }; + }; + + apps_bcm_voter: bcm-voter { + compatible = "qcom,bcm-voter"; + }; + }; + + cpufreq_hw: cpufreq@18323000 { + compatible = "qcom,sm7250-cpufreq-hw", "qcom,cpufreq-hw"; + reg = <0 0x18323000 0 0x1000>, + <0 0x18325800 0 0x1000>, + <0 0x18327800 0 0x1000>; + reg-names = "freq-domain0", + "freq-domain1", + "freq-domain2"; + interrupts-extended = <&lmh_cluster0 0>, + <&lmh_cluster1 0>; + interrupt-names = "dcvsh-irq-0", + "dcvsh-irq-1"; + clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GPLL0>; + clock-names = "xo", "alternate"; + #freq-domain-cells = <1>; + #clock-cells = <1>; + }; + + lmh_cluster0: lmh@18358800 { + compatible = "qcom,sm7250-lmh", "qcom,sm8150-lmh"; + reg = <0x0 0x18358800 0x0 0x400>; + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; + cpus = <&cpu0>; + qcom,lmh-temp-arm-millicelsius = <60000>; + qcom,lmh-temp-low-millicelsius = <84500>; + qcom,lmh-temp-high-millicelsius = <85000>; + interrupt-controller; + #interrupt-cells = <1>; + }; + + lmh_cluster1: lmh@18350800 { + compatible = "qcom,sm7250-lmh", "qcom,sm8150-lmh"; + reg = <0x0 0x18350800 0x0 0x400>; + interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; + cpus = <&cpu6>; + qcom,lmh-temp-arm-millicelsius = <60000>; + qcom,lmh-temp-low-millicelsius = <84500>; + qcom,lmh-temp-high-millicelsius = <85000>; + interrupt-controller; + #interrupt-cells = <1>; + }; + + tcsr_mutex: hwlock@1f40000 { + compatible = "qcom,tcsr-mutex"; + reg = <0x0 0x01f40000 0x0 0x40000>; + #hwlock-cells = <1>; + }; + + timer@17c20000 { + compatible = "arm,armv7-timer-mem"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0x20000000>; + reg = <0x0 0x17c20000 0x0 0x1000>; + + frame@17c21000 { + frame-number = <0>; + interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x17c21000 0x1000>, + <0x17c22000 0x1000>; + }; + + frame@17c23000 { + frame-number = <1>; + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x17c23000 0x1000>; + status = "disabled"; + }; + + frame@17c25000 { + frame-number = <2>; + interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x17c25000 0x1000>; + status = "disabled"; + }; + + frame@17c27000 { + frame-number = <3>; + interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x17c27000 0x1000>; + status = "disabled"; + }; + + frame@17c29000 { + frame-number = <4>; + interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x17c29000 0x1000>; + status = "disabled"; + }; + + frame@17c2b000 { + frame-number = <5>; + interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x17c2b000 0x1000>; + status = "disabled"; + }; + + frame@17c2d000 { + frame-number = <6>; + interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x17c2d000 0x1000>; + status = "disabled"; + }; + }; + + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = <GIC_PPI 1 IRQ_TYPE_LEVEL_LOW>, + <GIC_PPI 2 IRQ_TYPE_LEVEL_LOW>, + <GIC_PPI 3 IRQ_TYPE_LEVEL_LOW>, + <GIC_PPI 0 IRQ_TYPE_LEVEL_LOW>; + }; +};
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v12 6/6] arm64: dts: qcom: Add SM7250 devicetree file
Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider: - [High] arm64: dts: qcom: sm7250: lmh_cluster1 cpu6 rejected by lmh_probe() - [Medium] arm64: dts: qcom…
Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider:
- [High] arm64: dts: qcom: sm7250: lmh_cluster1 cpu6 rejected by lmh_probe()
- [Medium] arm64: dts: qcom: sm7250: invalid PSCI parameters in domain-idle-states
- [Medium] clk: qcom: gcc-sm7250: out-of-bounds -EINVAL lookup for GCC_VIDEO_XO_CLK
- [Medium] arm64: dts: qcom: sm7250: non-page-aligned ipa_gsi_mem and gpu_mem regions
- [Low] arm64: dts: qcom: sm7250: child nodes under soc@0 not sorted by address
- [Low] arm64: dts: qcom: sm7250: unused dt-bindings/power/qcom-rpmpd.h include --
commit 133903425754af1429d60a918bf4c66666da655c
Author: Sreeshankar K <[email protected]>
arm64: dts: qcom: Add SM7250 devicetree file
This commit adds the base SoC devicetree file for Qualcomm SM7250, defining CPU topology, PSCI idle states, reserved memory regions, clocks, interrupt controllers, RPMh, cpufreq, LMh, and timers needed to boot to serial console.
Quoted 6 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +0
-0
arch/arm64/boot/dts/qcom/sm7250.dtsi line 10
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +10
-0@@ -0,0 +1,795 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2026, Sreeshankar K <[email protected]> + */ + +#include <dt-bindings/clock/qcom,rpmh.h> +#include <dt-bindings/clock/qcom,gcc-sm7250.h> +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/power/qcom,rpmhpd.h> +#include <dt-bindings/power/qcom-rpmpd.h>
[Severity: Low]
As reported by Sashiko on v11 [1], is the dt-bindings/power/qcom-rpmpd.h include needed here? SM7250 uses the RPMh power domain definitions from dt-bindings/power/qcom,rpmhpd.h, and none of the legacy RPM definitions from qcom-rpmpd.h are referenced in this file.
[ ... ]
Quoted 15 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +15
-0+ domain-idle-states { + cluster_sleep_pc: cluster-sleep-0 { + compatible = "domain-idle-state"; + arm,psci-suspend-param = <0x40000004>; + entry-latency-us = <2752>; + exit-latency-us = <3048>; + min-residency-us = <6118>; + }; + + cluster_sleep_cx: cluster-sleep-1 { + compatible = "domain-idle-state"; + arm,psci-suspend-param = <0x41000224>; + entry-latency-us = <3638>; + exit-latency-us = <4562>; + min-residency-us = <8467>;
arch/arm64/boot/dts/qcom/sm7250.dtsi line 287
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +10
-0+ }; + + cluster_sleep_aoss: cluster-sleep-2 { + compatible = "domain-idle-state"; + arm,psci-suspend-param = <0x41000c24>; + entry-latency-us = <3263>; + exit-latency-us = <6562>; + min-residency-us = <9826>; + }; + };
[Severity: Medium]
As reported by Filippo Falezza on v11 [2], are the arm,psci-suspend-param values in cluster_sleep_pc, cluster_sleep_cx, and cluster_sleep_aoss encoded as expected by psci_pd_power_off() and __psci_enter_domain_idle_state()?
When cluster_pd powers off in PSCI OSI mode, __psci_enter_domain_idle_state() replaces the per-CPU state parameter with ds->state:
drivers/cpuidle/cpuidle-psci.c:__psci_enter_domain_idle_state() {
...
if (ds->state)
state = ds->state;
ret = psci_cpu_suspend_enter(state);
...
}Because ds->state replaces the per-CPU parameter rather than being ORed with it, Qualcomm cluster domain-idle-state parameters encode the per-CPU rail power collapse state (0x4) in bits [3:0], the cluster mode shifted left by 4 bits in bits [15:4] (0x004 << 4 = 0x0040, 0x224 << 4 = 0x2240, and 0xc24 << 4 = 0xc240), and affinity level 1 in bit 24 (0x01000000).
Here, cluster_sleep_pc uses 0x40000004 (which is the affinity-level-0 per-CPU rail power collapse parameter used by little_cpu_sleep_1 and big_cpu_sleep_1), and cluster_sleep_cx and cluster_sleep_aoss use unshifted 0x41000224 and 0x41000c24. Should these three parameters be 0x41000044, 0x41002244, and 0x4100c244 instead?
[ ... ]
arch/arm64/boot/dts/qcom/sm7250.dtsi line 501
Quoted 9 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +9
-0+ ipa_gsi_mem: ipa-gsi@8bc10000 { + reg = <0x0 0x8bc10000 0x0 0x5400>; + no-map; + }; + + gpu_mem: gpu@8bc15400 { + reg = <0x0 0x8bc15400 0x0 0x2000>; + no-map; + };
[Severity: Medium]
Can the non-page-aligned boundary between ipa_gsi_mem and gpu_mem cause page mapping and PAS setup issues when loading the GPU zap shader?
Here ipa_gsi_mem has a size of 0x5400 (ending at 0x8bc153ff) and gpu_mem starts at 0x8bc15400 (ending at 0x8bc173ff), so both no-map regions share the 4KB physical page at 0x8bc15000, while map_mem() and __free_memory_core() round the start of the following System RAM region up via PAGE_ALIGN() / PFN_UP() to 0x8bc18000, leaving the remaining 3KB at 0x8bc17400..0x8bc17fff unmapped.
When adreno_zap_shader_load() -> zap_shader_load_mdt() in drivers/gpu/drm/msm/adreno/adreno_gpu.c loads the GPU zap shader, it remaps and initializes the region via:
mem_region = memremap(mem_phys, mem_size, MEMREMAP_WC); ... ret = qcom_mdt_load(dev, fw, fwname, pas_id, mem_region, mem_phys, mem_size, NULL);
generic_ioremap_prot() aligns mem_phys (0x8bc15400) down to page boundary 0x8bc15000 (overlapping the tail of ipa_gsi_mem), and qcom_mdt_load() -> __qcom_mdt_pas_init() -> qcom_pas_mem_setup() -> qcom_scm_pas_mem_setup() passes the unaligned base address 0x8bc15400 to TrustZone PIL setup (similar to the issue fixed on SM6350 in commit 44bcded2be4f ("arm64: dts: qcom:
sm6350: Fix ZAP region")). Should ipa_gsi_mem and gpu_mem be aligned to 4KB page boundaries?
[ ... ]
Quoted 11 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +11
-0+ soc: soc@0 { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0 0 0 0 0x10 0>; + dma-ranges = <0 0 0 0 0x10 0>; + + gcc: clock-controller@100000 { + compatible = "qcom,gcc-sm7250"; + reg = <0x0 0x00100000 0x0 0x1f0000>; + clock-names = "bi_tcxo",
arch/arm64/boot/dts/qcom/sm7250.dtsi line 534
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +10
-0+ "bi_tcxo_ao", + "sleep_clk"; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&rpmhcc RPMH_CXO_CLK_A>, + <&sleep_clk>; + power-domains = <&rpmhpd RPMHPD_CX>; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + };
[Severity: Medium]
Does instantiating qcom,gcc-sm7250 expose an out-of-bounds lookup for GCC_VIDEO_XO_CLK in qcom_cc_clk_hw_get()?
In include/dt-bindings/clock/qcom,gcc-sm7250.h, GCC_VIDEO_XO_CLK is defined as 122, the highest index in the header:
#define GCC_VIDEO_AHB_CLK 120 #define GCC_VIDEO_AXI_CLK 121 #define GCC_VIDEO_XO_CLK 122
In drivers/clk/qcom/gcc-sm7250.c, GCC_VIDEO_XO_CLK is enabled as a critical clock in gcc_sm7250_critical_cbcrs[] and omitted from gcc_sm7250_clocks[], where the highest designated index is [GCC_VIDEO_AXI_CLK] (121):
[GCC_VIDEO_AXI_CLK] = &gcc_video_axi_clk.clkr, [GPLL0] = &gpll0.clkr, [GPLL0_OUT_EVEN] = &gpll0_out_even.clkr, [GPLL6] = &gpll6.clkr, [GPLL9] = &gpll9.clkr, };
Because ARRAY_SIZE(gcc_sm7250_clocks) (stored in cc->num_rclks) is 122, any consumer requesting <&gcc GCC_VIDEO_XO_CLK> hits idx >= cc->num_rclks in drivers/clk/qcom/common.c:qcom_cc_clk_hw_get() and gets ERR_PTR(-EINVAL) instead of NULL as returned for lower-indexed critical clocks such as GCC_CAMERA_XO_CLK or GCC_DISP_XO_CLK.
[ ... ]
Quoted 31 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +31
-0+ cpufreq_hw: cpufreq@18323000 { + compatible = "qcom,sm7250-cpufreq-hw", "qcom,cpufreq-hw"; + reg = <0 0x18323000 0 0x1000>, + <0 0x18325800 0 0x1000>, + <0 0x18327800 0 0x1000>; + reg-names = "freq-domain0", + "freq-domain1", + "freq-domain2"; + interrupts-extended = <&lmh_cluster0 0>, + <&lmh_cluster1 0>; + interrupt-names = "dcvsh-irq-0", + "dcvsh-irq-1"; + clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GPLL0>; + clock-names = "xo", "alternate"; + #freq-domain-cells = <1>; + #clock-cells = <1>; + }; + + lmh_cluster0: lmh@18358800 { + compatible = "qcom,sm7250-lmh", "qcom,sm8150-lmh"; + reg = <0x0 0x18358800 0x0 0x400>; + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; + cpus = <&cpu0>; + qcom,lmh-temp-arm-millicelsius = <60000>; + qcom,lmh-temp-low-millicelsius = <84500>; + qcom,lmh-temp-high-millicelsius = <85000>; + interrupt-controller; + #interrupt-cells = <1>; + }; + + lmh_cluster1: lmh@18350800 {
arch/arm64/boot/dts/qcom/sm7250.dtsi line 720
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +10
-0+ compatible = "qcom,sm7250-lmh", "qcom,sm8150-lmh"; + reg = <0x0 0x18350800 0x0 0x400>; + interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; + cpus = <&cpu6>; + qcom,lmh-temp-arm-millicelsius = <60000>; + qcom,lmh-temp-low-millicelsius = <84500>; + qcom,lmh-temp-high-millicelsius = <85000>; + interrupt-controller; + #interrupt-cells = <1>; + };
[Severity: High]
Will lmh_cluster1 fail to probe and prevent cpufreq_hw from initializing when cpus = <&cpu6> is passed to lmh_probe()?
In drivers/thermal/qcom/lmh.c, lmh_probe() resolves the CPU node via of_cpu_node_to_id() and only accepts logical CPU IDs 0 and 4:
if (cpu_id == 0) {
node_id = LMH_CLUSTER0_NODE_ID;
} else if (cpu_id == 4) {
node_id = LMH_CLUSTER1_NODE_ID;
} else {
dev_err(dev, "Wrong CPU id associated with LMh node\n");
return -EINVAL;
}Because cpu6 is logical CPU 6 on SM7250 (where cpu0..cpu5 are in frequency domain 0 and cpu6 is the first big core in frequency domain 1), lmh_probe() returns -EINVAL for lmh_cluster1 before calling irq_domain_create_linear().
Because cpufreq_hw references <&lmh_cluster1 0> in interrupts-extended and lmh_cluster1 is enabled in DT without ever registering its IRQ domain, fw_devlink blocks cpufreq_hw on the unmet interrupt supplier link; even if cpufreq_hw probes, qcom_cpufreq_hw_cpu_init() -> qcom_cpufreq_hw_lmh_init() -> platform_get_irq_optional() returns -EPROBE_DEFER for domain 1 (and also leaks policy->freq_table and dynamic OPPs allocated earlier in qcom_cpufreq_hw_read_lut()). In addition, because qcom_cpufreq_hw_driver is registered at postcore_initcall while lmh_driver is registered at device_initcall (and cpu0 has no interconnects property to defer qcom_cpufreq_hw_driver_probe()), domain 0 also hits -EPROBE_DEFER during cpufreq_register_driver() while domain 2 (cpu7, which has no interrupt entry and gets -ENXIO) succeeds.
arch/arm64/boot/dts/qcom/sm7250.dtsi line 728
Quoted 8 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +8
-0+ + tcsr_mutex: hwlock@1f40000 { + compatible = "qcom,tcsr-mutex"; + reg = <0x0 0x01f40000 0x0 0x40000>; + #hwlock-cells = <1>; + }; + + timer@17c20000 {
[Severity: Low]
This isn't a bug, but several child nodes under soc@0 are out of ascending unit-address order: interrupt-controller@17a00000 is placed before interrupt-controller@b220000 and spmi@c440000, lmh@18358800 is placed before lmh@18350800, and hwlock@1f40000 and timer@17c20000 are placed at the end after lmh@18350800. Could the child nodes under soc@0 be sorted by unit address in ascending order to match the DTS coding style?
[1] https://lore.kernel.org/r/[email protected]
[2] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6