Add initial support for Qualcomm SM7250 SoC
Subsystems (8)
v15 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 thermal/qcom/lmh: Switch to match data for SoC CPU-to-node mappings
dt-bindings: thermal: lmh: Document SM7250 LMh thermal/qcom/lmh: Add support for Qualcomm SM7250
dt-bindings: firmware: qcom,scm: Document SM7250 SCM
dt-bindings: cpufreq: qcom-hw: Document SM7250 cpufreq hardware
arm64: dts: qcom: Add SM7250 devicetree file
Quoted 1 line
------------------------------------------------------------------------------<
Changelog [v15]:
[PATCH v15 3/8] thermal/qcom/lmh: Switch to match data for SoC CPU-to-node mappings
Quoted 1 line
Update the patch to fix apply conflicts with Linux 7.4-rc3
Link [v14]: https://lore.kernel.org/linux-arm-msm/[email protected]/t/#t
Changelog [v14]:
Fixed various issue found from Sashiko's review, Link: https://sashiko.dev/#/patchset/20261104-master-v13-0-355b65c6f764%40gmail.com
Link [v13]: https://lore.kernel.org/linux-arm-msm/[email protected]/t/#t
Changelog [v13]:
Fixed various issue found from Sashiko's review, Link: https://sashiko.dev/#/patchset/20261104-master-v12-0-57fbe9eef978%40gmail.com
[PATCH v13 3/8] thermal/qcom/lmh: Switch to match data for SoC CPU-to-node mappings
Quoted 1 line
Switch to match data mapping instead of hardcoded 4-4 cpu configuration.
[PATCH v13 5/8] thermal/qcom/lmh: Add support for Qualcomm SM7250
Quoted 1 line
Add 6-2 cpu configuration LMh support for SM7250 SoC.
[PATCH v13 8/8] arm64: dts: qcom: Add SM7250 devicetree file
Quoted 1 line
Place the nodes in acesending order.
Link [v12]: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#t
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 (8):
dt-bindings: clock: Add SM7250 global clock controller
clk: qcom: Add Global Clock Controller (GCC) driver for SM7250 thermal/qcom/lmh: Switch to match data for SoC CPU-to-node mappings
dt-bindings: thermal: lmh: Document SM7250 LMh thermal/qcom/lmh: Add support for Qualcomm SM7250
dt-bindings: firmware: qcom,scm: Document SM7250 SCM
dt-bindings: cpufreq: qcom-hw: Document SM7250 cpufreq hardware
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 | 1 + arch/arm64/boot/dts/qcom/sm7250.dtsi | 803 +++++++ drivers/clk/qcom/Kconfig | 10 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/gcc-sm7250.c | 2278 ++++++++++++++++++++ drivers/thermal/qcom/lmh.c | 74 +- include/dt-bindings/clock/qcom,gcc-sm7250.h | 163 ++ 10 files changed, 3327 insertions(+), 19 deletions(-)
---
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
change-id: 20261116-sm7250-024b350a7bf1
Best regards,
Signature · 1 line
Sreeshankar K <[email protected]>
PATCH v15 1/8 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 v15 2/8 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
PATCH v15 3/8 thermal/qcom/lmh: Switch to match data for SoC CPU-to-node mappings
In reply to Sreeshankar Klmh_probe() hardcodes the mapping of logical CPU IDs to LMh hardware cluster node IDs: CPU 0 maps to LMH_CLUSTER0_NODE_ID, and CPU 4 maps to LMH_CLUSTER1_NODE_ID.
This assumption only holds true for 4+4 big.LITTLE architectures like SDM845 and SM8150. On platforms with asymmetric cluster layouts, such as the 6+2 topology on SM7250 where the big cluster starts at logical CPU 6, lmh_probe() fails with -EINVAL. Consequently, the second LMh node does not register its interrupt domain, which in turn causes dependent drivers like qcom-cpufreq-hw to fail or indefinitely defer probing via fw_devlink.
Address this by introducing a SoC descriptor structure (struct qcom_lmh_soc_data) and an explicit mapping table (struct qcom_lmh_node_map) associated with of_device_id match data. This encapsulates both the algorithm enable flags and the CPU-to-node mappings per compatible string.
--- drivers/thermal/qcom/lmh.c | 63 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 15 deletions(-)
drivers/thermal/qcom/lmh.c +48 -15
@@ -94,19 +94,53 @@ static const struct irq_domain_ops lmh_irq_ops = { .xlate = irq_domain_xlate_onecell, }; +struct lmh_soc_map { +int cpu_id; +u32 node_id; +}; + +struct lmh_soc_data { +uintptr_t flags; +const struct lmh_soc_map *map; +size_t num_nodes; +}; + +static const struct lmh_soc_map sdm845_map[] = { + { .cpu_id =0 , .node_id =LMH_CLUSTER0_NODE_ID }, + { .cpu_id =4 , .node_id =LMH_CLUSTER1_NODE_ID }, +}; + +static const struct lmh_soc_data sdm845_data = { + .map = sdm845_map, + .num_nodes =ARRAY_SIZE (sdm845_map), + .flags =LMH_ENABLE_ALGOS , +}; + +static const struct lmh_soc_data sm8150_data = { + .map = sdm845_map, + .num_nodes =ARRAY_SIZE (sdm845_map), +}; +static int lmh_probe (struct platform_device *pdev) { +const struct lmh_soc_data *soc_data;struct device *dev = &pdev->dev;struct device_node *np = dev->of_node;struct device_node *cpu_node;struct lmh_hw_data *lmh_data;int temp_low, temp_high, temp_arm, cpu_id, ret;unsigned int enable_alg; +bool found = false;u32 node_id; +int i;if (!qcom_scm_is_available ())return -EPROBE_DEFER ; + soc_data =of_device_get_match_data (dev); +if (!soc_data) +return -EINVAL ; + lmh_data =devm_kzalloc_obj (dev, *lmh_data);if (!lmh_data)return -ENOMEM ;
@@ -139,24 +173,23 @@ static int lmh_probe(struct platform_device *pdev)return ret; } -/* -* Only sdm845 has lmh hardware currently enabled from hlos. If this is needed -* for other platforms, revisit this to check if the <cpu-id, node-id> should be part -* of a dt match table. -*/ -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" ); +for (i =0 ; i < soc_data->num_nodes; i++) { +if (cpu_id == soc_data->map[i].cpu_id) { + node_id = soc_data->map[i].node_id; + found = true; +break ; + } + } + +if (!found) { +dev_err (dev,"Wrong CPU id %d associated with LMh node\n" , cpu_id);return -EINVAL ; }if (!qcom_scm_lmh_dcvsh_available ())return -EINVAL ; - enable_alg = (uintptr_t )of_device_get_match_data (dev); + enable_alg = soc_data->flags;if (enable_alg) { ret = qcom_scm_lmh_dcvsh(LMH_SUB_FN_CRNT, LMH_ALGO_MODE_ENABLE, 1,
@@ -231,9 +264,9 @@ static int lmh_probe(struct platform_device *pdev) }static const struct of_device_id lmh_table[] = { - { .compatible ="qcom,sc8180x-lmh" , }, - { .compatible ="qcom,sdm845-lmh" , .data = (void *)LMH_ENABLE_ALGOS }, - { .compatible ="qcom,sm8150-lmh" , }, + { .compatible ="qcom,sc8180x-lmh" , .data = &sm8150_data }, + { .compatible ="qcom,sdm845-lmh" , .data = &sdm845_data }, + { .compatible ="qcom,sm8150-lmh" , .data = &sm8150_data }, {} };MODULE_DEVICE_TABLE (of, lmh_table);
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v15 3/8] thermal/qcom/lmh: Switch to match data for SoC CPU-to-node mappings
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] thermal/qcom/lmh: commit message struct names mismatch lmh_soc_data --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] thermal/qcom/lmh: commit message struct names mismatch lmh_soc_data
--
commit eec53390ca0e7b9b5a048e799d6259ee4ce6ec2a
Author: Sreeshankar K <[email protected]>
thermal/qcom/lmh: Switch to match data for SoC CPU-to-node mappings
This commit replaces the hardcoded CPU-to-node ID checks in lmh_probe() with per-SoC mapping tables stored in the OF match data.
Quoted 8 lines
drivers/thermal/qcom/lmh.c +0
-0@@ -94,19 +94,53 @@ static const struct irq_domain_ops lmh_irq_ops = { .xlate = irq_domain_xlate_onecell, };
drivers/thermal/qcom/lmh.c static const struct irq_domain_ops lmh_irq_ops = { · line 106
Quoted 10 lines
drivers/thermal/qcom/lmh.c +10
-0+struct lmh_soc_map { +int cpu_id; +u32 node_id; +}; + +struct lmh_soc_data { +uintptr_t flags; +const struct lmh_soc_map *map; +size_t num_nodes; +};
[Severity: Low]
This isn't a bug, but the commit message refers to these structures as struct qcom_lmh_node_map and struct qcom_lmh_soc_data instead of struct lmh_soc_map and struct lmh_soc_data. Also, should flags be unsigned int instead of uintptr_t, since it is no longer cast from the match data pointer and is assigned to unsigned int enable_alg in lmh_probe()?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
PATCH v15 4/8 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 | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/thermal/qcom-lmh.yaml +1 -0
@@ -21,6 +21,7 @@ properties: - enum: - qcom,sc8180x-lmh - qcom,sdm845-lmh + - qcom,sm7250-lmh - qcom,sm8150-lmh - items: - const: qcom,sdm670-lmh
Signature · 1 line
2.43.0
PATCH v15 5/8 thermal/qcom/lmh: Add support for Qualcomm SM7250
In reply to Sreeshankar KQualcomm SM7250 features an asymmetric 6+2 core topology where the Silver cluster consists of CPU 0 to CPU 5 and the Gold/Prime cluster starts at logical CPU 6.
Add the SoC match data defining the CPU-to-node mapping (CPU 0 to LMH_CLUSTER0_NODE_ID, and CPU 6 to LMH_CLUSTER1_NODE_ID), and register the "qcom,sm7250-lmh" compatible string so both LMh cluster instances can probe and register their respective DCVSh interrupt domains.
--- drivers/thermal/qcom/lmh.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/thermal/qcom/lmh.c +11 -0
@@ -110,12 +110,22 @@ static const struct lmh_soc_map sdm845_map[] = { { .cpu_id = 4, .node_id = LMH_CLUSTER1_NODE_ID }, }; +static const struct lmh_soc_map sm7250_map[] = { + { .cpu_id =0 , .node_id =LMH_CLUSTER0_NODE_ID }, + { .cpu_id =6 , .node_id =LMH_CLUSTER1_NODE_ID }, +}; +static const struct lmh_soc_data sdm845_data = { .map = sdm845_map, .num_nodes =ARRAY_SIZE (sdm845_map), .flags =LMH_ENABLE_ALGOS , }; +static const struct lmh_soc_data sm7250_data = { + .map = sm7250_map, + .num_nodes =ARRAY_SIZE (sm7250_map), +}; +static const struct lmh_soc_data sm8150_data = { .map = sdm845_map, .num_nodes = ARRAY_SIZE(sdm845_map),
@@ -266,6 +276,7 @@ static int lmh_probe(struct platform_device *pdev)static const struct of_device_id lmh_table[] = { { .compatible ="qcom,sc8180x-lmh" , .data = &sm8150_data }, { .compatible ="qcom,sdm845-lmh" , .data = &sdm845_data }, + { .compatible ="qcom,sm7250-lmh" , .data = &sm7250_data }, { .compatible ="qcom,sm8150-lmh" , .data = &sm8150_data }, {} };
Signature · 1 line
2.43.0
PATCH v15 6/8 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 v15 7/8 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 v15 8/8 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 | 803 +++++++++++++++++++++++++++++++++++ 1 file changed, 803 insertions(+)
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +803 -0
@@ -0,0 +1,803 @@ +// 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/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 = <0x41000044>; + 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 = <0x41002244>; + 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 = <0x4100c244>; + 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-region@80000000 { + reg = <0x0 0x80000000 0x0 0x600000>; + no-map; + }; + + xbl_aop_mem: xbl-aop-region@80700000 { + reg = <0x0 0x80700000 0x0 0x160000>; + no-map; + }; + + cmd_db_mem: cmd-db-region@80860000 { + compatible = "qcom,cmd-db"; + reg = <0x0 0x80860000 0x0 0x20000>; + no-map; + }; + + xbl_uefi_mem: xbl-uefi-region@80880000 { + reg = <0x0 0x80880000 0x0 0x14000>; + no-map; + }; + + sec_apps_mem: sec-apps-region@808ff000 { + reg = <0x0 0x808ff000 0x0 0x1000>; + no-map; + }; + + smem_mem: smem-region@80900000 { + compatible = "qcom,smem"; + reg = <0x0 0x80900000 0x0 0x200000>; + no-map; + hwlocks = <&tcsr_mutex 3>; + }; + + removed_mem: removed-region@80b00000 { + reg = <0x0 0x80b00000 0x0 0x1300000>; + no-map; + }; + + qtee_apps_mem: qtee-apps-region@81e00000 { + reg = <0x0 0x81e00000 0x0 0x2600000>; + no-map; + }; + + camera_mem: camera-region@86000000 { + reg = <0x0 0x86000000 0x0 0x500000>; + no-map; + }; + + npu_mem: npu-region@86500000 { + reg = <0x0 0x86500000 0x0 0x500000>; + no-map; + }; + + video_mem: video-region@86a00000 { + reg = <0x0 0x86a00000 0x0 0x500000>; + no-map; + }; + + cdsp_mem: cdsp-region@87400000 { + reg = <0x0 0x87400000 0x0 0x1e00000>; + no-map; + }; + + adsp_mem: adsp-region@89200000 { + reg = <0x0 0x89200000 0x0 0x2800000>; + no-map; + }; + + wlan_fw_mem: wlan-fw-region@8ba00000 { + reg = <0x0 0x8ba00000 0x0 0x200000>; + no-map; + }; + + ipa_fw_mem: ipa-fw-region@8bc00000 { + reg = <0x0 0x8bc00000 0x0 0x10000>; + no-map; + }; + + ipa_gsi_mem: ipa-gsi-region@8bc10000 { + reg = <0x0 0x8bc10000 0x0 0x6000>; + no-map; + }; + + gpu_mem: gpu-region@8bc16000 { + reg = <0x0 0x8bc16000 0x0 0x2000>; + no-map; + }; + + modem_wlan_mem: modem-wlan-region@8c000000 { + reg = <0x0 0x8c000000 0x0 0xf800000>; + no-map; + }; + + cdsp_sec_mem: cdsp-sec-region@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"; + }; + }; + + tcsr_mutex: hwlock@1f40000 { + compatible = "qcom,tcsr-mutex"; + reg = <0x0 0x01f40000 0x0 0x40000>; + #hwlock-cells = <1>; + }; + + 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>; + }; + + 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>; + }; + + 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"; + }; + }; + + 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_cluster1: lmh@18350800 { + compatible = "qcom,sm7250-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>; + }; + + lmh_cluster0: lmh@18358800 { + compatible = "qcom,sm7250-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>; + }; + }; + + 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 v15 8/8] arm64: dts: qcom: Add SM7250 devicetree file
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] cpufreq: qcom-hw: partial init and resource leak in qcom_cpufreq_hw_cpu_init() - [Low] arm64: dts…
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [Medium] cpufreq: qcom-hw: partial init and resource leak in qcom_cpufreq_hw_cpu_init()
- [Low] arm64: dts: qcom: sm7250: oversized PDC register region in pdc node
--
commit a2793b66bb2274241a395fec222892481d4a324f
Author: Sreeshankar K <[email protected]>
arm64: dts: qcom: Add SM7250 devicetree file
This commit adds the base devicetree file for the Qualcomm SM7250 SoC, including CPU, PSCI, clock, interrupt, and serial console nodes.
Quoted 5 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +0
-0
[ ... ]
arch/arm64/boot/dts/qcom/sm7250.dtsi line 573
Quoted 3 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +3
-0+ pdc: interrupt-controller@b220000 { + compatible = "qcom,sm7250-pdc", "qcom,pdc"; + reg = <0 0xb220000 0 0x30000>, <0 0x17c000f0 0 0x60>;
[Severity: Low]
Should the first reg region size be 0x10000 instead of 0x30000?
qcom_pdc_probe() maps max_t(resource_size_t, resource_size(&res), PDC_DRV_SIZE) where PDC_DRV_SIZE is 0x10000, so specifying 0x30000 maps three PDC DRV regions instead of just the OS PDC DRV region.
[ ... ]
arch/arm64/boot/dts/qcom/sm7250.dtsi line 764
Quoted 12 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +12
-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";
[Severity: Medium]
Can defining two LMh interrupts across three frequency domains cause partial cpufreq initialization, leaked frequency tables, and dangling data->policy pointers?
If qcom_cpufreq_hw_driver_probe() runs when lmh_cluster0 and lmh_cluster1 have not registered their IRQ domains (for example with CONFIG_ARM_QCOM_CPUFREQ_HW=y and CONFIG_QCOM_LMH=n, or before qcom-lmh.ko loads), platform_get_irq_optional(pdev, index) in qcom_cpufreq_hw_lmh_init() fails for domains 0 and 1 (CPUs 0..6) but returns -ENXIO for domain 2 (CPU 7), which qcom_cpufreq_hw_lmh_init() treats as success:
drivers/cpufreq/qcom-cpufreq-hw.c:qcom_cpufreq_hw_cpu_init() {
...
data->policy = policy;
ret = qcom_cpufreq_hw_read_lut(cpu_dev, policy);
if (ret) {
dev_err(dev, "Domain-%d failed to read LUT\n", index);
return ret;
}
ret = dev_pm_opp_get_opp_count(cpu_dev);
if (ret <= 0) {
dev_err(cpu_dev, "Failed to add OPPs\n");
return -ENODEV;
}
return qcom_cpufreq_hw_lmh_init(policy, index);
}When qcom_cpufreq_hw_lmh_init() fails on CPUs 0..6, cpufreq_online() skips cpufreq_driver->exit() and frees policy, leaking policy->freq_table and dynamic OPPs while leaving data->policy pointing to the freed policy (which qcom_cpufreq_hw_recalc_rate() later dereferences). Because CPU 7 succeeds, cpufreq_register_driver() sees a non-empty cpufreq_policy_list and returns 0 instead of deferring probe, leaving CPUs 0..6 without cpufreq support.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8