Add initial support for Qualcomm SM7250 SoC
Subsystems (6)
v11 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
arm64: dts: qcom: Add SM7250 devicetree file
Quoted 1 line
------------------------------------------------------------------------------<
Previous 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 (5):
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
arm64: dts: qcom: Add SM7250 devicetree file
.../devicetree/bindings/clock/qcom,sm6375-gcc.yaml | 4 +- .../bindings/cpufreq/cpufreq-qcom-hw.yaml | 1 + .../devicetree/bindings/firmware/qcom,scm.yaml | 1 + arch/arm64/boot/dts/qcom/sm7250.dtsi | 771 +++++++ drivers/clk/qcom/Kconfig | 10 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/gcc-sm7250.c | 2286 ++++++++++++++++++++ include/dt-bindings/clock/qcom,sm7250-gcc.h | 163 ++ 8 files changed, 3236 insertions(+), 1 deletion(-)
---
base-commit: f5491c67aeee4a68dd2b218e2f4c5baa7786c566
change-id: 20261029-master-a03876889046
Best regards,
Signature · 1 line
Sreeshankar K <[email protected]>
PATCH RESEND v11 1/5 dt-bindings: clock: Add SM7250 global clock controller
Add device tree bindings for global clock controller on SM7250 SoC.
--- .../devicetree/bindings/clock/qcom,sm6375-gcc.yaml | 4 +- include/dt-bindings/clock/qcom,sm7250-gcc.h | 163 +++++++++++++++++++++ 2 files changed, 166 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/clock/qcom,sm6375-gcc.yaml +3 -1
@@ -4,13 +4,14 @@ $id: http://devicetree.org/schemas/clock/qcom,sm6375-gcc.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Qualcomm Global Clock & Reset Controller on SM6375 and SM7150 +title: Qualcomm Global Clock & Reset Controller on SM6375, SM7150 and SM7250 maintainers: - Konrad Dybcio <[email protected]> - Bjorn Andersson <[email protected]> - Danila Tikhonov <[email protected]> - David Wronek <[email protected]> + - Sreeshankar K <[email protected]> description: | Qualcomm global clock control module provides the clocks, resets and power
@@ -26,6 +27,7 @@ properties: enum: - qcom,sm6375-gcc - qcom,sm7150-gcc + - qcom,sm7250-gcc clocks: items:
include/dt-bindings/clock/qcom,sm7250-gcc.h new file +163 -0
163 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH RESEND v11 2/5 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 | 2286 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2297 insertions(+)
drivers/clk/qcom/Kconfig +10 -0
@@ -1650,6 +1650,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
@@ -183,6 +183,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 +2286 -0
2,286 lines not on this page · raw message
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH RESEND v11 2/5] clk: qcom: Add Global Clock Controller (GCC) driver for SM7250
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [High] clk: qcom: gcc-sm7250: wrong parent source and map on gcc_cpuss_ahb_clk_src - [High] clk: qcom…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] clk: qcom: gcc-sm7250: wrong parent source and map on gcc_cpuss_ahb_clk_src
- [High] clk: qcom: gcc-sm7250: missing CLK_OPS_PARENT_ENABLE on gcc_sdcc2_apps_clk_src
- [High] clk: qcom: gcc-sm7250: mark gcc_cpuss_gnoc_clk critical to prevent gating --
commit df02ee88c50cbe124252b368c43513c346759f86
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 SoC devices, registering PLLs, RCGs, branch clocks, GDSCs, and resets.
Quoted 6 lines
drivers/clk/qcom/gcc-sm7250.c new file +0
-0@@ -0,0 +1,2286 @@
[ ... ]
Quoted 14 lines
drivers/clk/qcom/gcc-sm7250.c new file +14
-0+enum { +DT_BI_TCXO , +DT_BI_TCXO_AO , +DT_SLEEP_CLK , +}; + +enum { +P_BI_TCXO , +P_GPLL0_OUT_EVEN , +P_GPLL0_OUT_MAIN , +P_GPLL6_OUT_MAIN , +P_GPLL9_OUT_MAIN , +P_SLEEP_CLK , +};
[ ... ]
Quoted 15 lines
drivers/clk/qcom/gcc-sm7250.c new file +15
-0+static const struct parent_map gcc_parent_map_0[] = { + {P_BI_TCXO ,0 }, + {P_GPLL0_OUT_MAIN ,1 }, + {P_GPLL0_OUT_EVEN ,6 }, +}; + +static const struct clk_parent_data gcc_parent_data_0[] = { + { .index =DT_BI_TCXO }, + { .hw = &gpll0.clkr.hw }, + { .hw = &gpll0_out_even.clkr.hw }, +}; + +static const struct clk_parent_data gcc_parent_data_0_ao[] = { + { .index =DT_BI_TCXO_AO }, +};
[ ... ]
Quoted 9 lines
drivers/clk/qcom/gcc-sm7250.c new file +9
-0+static const struct freq_tbl ftbl_gcc_cpuss_ahb_clk_src[] = { +F (19200000 ,DT_BI_TCXO_AO ,1 ,0 ,0 ), + { } +}; + +static struct clk_rcg2 gcc_cpuss_ahb_clk_src = { + .cmd_rcgr =0x48010 , + .mnd_width =0 , + .hid_width =5 ,
drivers/clk/qcom/gcc-sm7250.c line 207
Quoted 10 lines
drivers/clk/qcom/gcc-sm7250.c new file +10
-0+ .parent_map = gcc_parent_map_0, + .freq_tbl = ftbl_gcc_cpuss_ahb_clk_src, + .clkr.hw.init = &(const struct clk_init_data ){ + .name ="gcc_cpuss_ahb_clk_src" , + .parent_data = gcc_parent_data_0_ao, + .num_parents =ARRAY_SIZE (gcc_parent_data_0_ao), + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_rcg2_ops, + }, +};
[Severity: High]
In drivers/clk/qcom/gcc-sm7250.c, ftbl_gcc_cpuss_ahb_clk_src passes DT_BI_TCXO_AO (which is 1 in the DT clock index enum) instead of P_BI_TCXO (which is 0 in the parent source enum) as the source argument to F().
In addition, gcc_cpuss_ahb_clk_src pairs the 3-entry gcc_parent_map_0 with gcc_parent_data_0_ao, which only defines 1 entry.
When clk_rcg2_determine_rate() or clk_rcg2_set_rate() runs on gcc_cpuss_ahb_clk_src, it calls qcom_find_src_index() in drivers/clk/qcom/common.c:
int qcom_find_src_index(struct clk_hw *hw, const struct parent_map *map, u8 src)
{
int i, num_parents = clk_hw_get_num_parents(hw);
for (i = 0; i < num_parents; i++)
if (src == map[i].src)
return i;
return -ENOENT;
}Because num_parents is 1 and map[0].src is P_BI_TCXO (0), passing src = DT_BI_TCXO_AO (1) causes qcom_find_src_index() to return -ENOENT. Furthermore, with only 1 entry in gcc_parent_data_0_ao, __clk_rcg2_get_parent() cannot resolve gpll0 or gpll0_out_even if selected in hardware, and if gcc_parent_data_0_ao is expanded to 3 entries, DT_BI_TCXO_AO (1) collides with P_GPLL0_OUT_EVEN (1).
Should ftbl_gcc_cpuss_ahb_clk_src use P_BI_TCXO, and should gcc_parent_data_0_ao either include the remaining parents from gcc_parent_data_0 or use a matching single-entry parent_map?
[ ... ]
Quoted 13 lines
drivers/clk/qcom/gcc-sm7250.c new file +13
-0+static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk_src[] = { +F (400000 ,P_BI_TCXO ,12 ,1 ,4 ), +F (19200000 ,P_BI_TCXO ,1 ,0 ,0 ), +F (25000000 ,P_GPLL0_OUT_EVEN ,6 ,1 ,2 ), +F (50000000 ,P_GPLL0_OUT_EVEN ,6 ,0 ,0 ), +F (100000000 ,P_GPLL0_OUT_EVEN ,3 ,0 ,0 ), +F (202000000 ,P_GPLL9_OUT_MAIN ,4 ,0 ,0 ), + { } +}; + +static struct clk_rcg2 gcc_sdcc2_apps_clk_src = { + .cmd_rcgr =0x1400c , + .mnd_width =8 ,
drivers/clk/qcom/gcc-sm7250.c line 565
Quoted 10 lines
drivers/clk/qcom/gcc-sm7250.c new file +10
-0+ .hid_width = 5, + .parent_map = gcc_parent_map_4, + .freq_tbl = ftbl_gcc_sdcc2_apps_clk_src, + .clkr.hw.init = &(const struct clk_init_data ){ + .name ="gcc_sdcc2_apps_clk_src" , + .parent_data = gcc_parent_data_4, + .num_parents =ARRAY_SIZE (gcc_parent_data_4), + .ops = &clk_rcg2_floor_ops, + }, +};
[Severity: High]
In drivers/clk/qcom/gcc-sm7250.c, ftbl_gcc_sdcc2_apps_clk_src uses P_GPLL9_OUT_MAIN (gpll9) for the 202 MHz entry. Unlike gpll0, gpll9 is only used by gcc_sdcc2_apps_clk_src and is not enabled by default.
Because gcc_sdcc2_apps_clk_src uses clk_rcg2_floor_ops without setting CLK_OPS_PARENT_ENABLE in its flags (unlike gcc_sdcc1_apps_clk_src with gpll6), calling clk_set_rate() on gcc_sdcc2_apps_clk to or from 202 MHz while the clock is unprepared or disabled will invoke update_config() in drivers/clk/qcom/clk-rcg2.c while gpll9 is off.
Wouldn't that cause the RCG update handshake to time out with a warning and return -EBUSY unless CLK_OPS_PARENT_ENABLE is set on gcc_sdcc2_apps_clk_src?
[ ... ]
Quoted 12 lines
drivers/clk/qcom/gcc-sm7250.c new file +12
-0+static struct clk_branch gcc_cpuss_gnoc_clk = { + .halt_reg =0x48064 , + .halt_check =BRANCH_HALT_VOTED , + .clkr = { + .enable_reg =0x52000 , + .enable_mask =BIT (29 ), + .hw.init = &(const struct clk_init_data ){ + .name ="gcc_cpuss_gnoc_clk" , + .ops = &clk_branch2_ops, + }, + }, +};
[ ... ]
Quoted 9 lines
drivers/clk/qcom/gcc-sm7250.c new file +9
-0+static struct clk_regmap *gcc_sm7250_clocks[] = { + [GCC_AGGRE_UFS_PHY_AXI_CLK ] = &gcc_aggre_ufs_phy_axi_clk.clkr, + [GCC_AGGRE_USB3_PRIM_AXI_CLK ] = &gcc_aggre_usb3_prim_axi_clk.clkr, + [GCC_BOOT_ROM_AHB_CLK ] = &gcc_boot_rom_ahb_clk.clkr, + [GCC_CAMERA_HF_AXI_CLK ] = &gcc_camera_hf_axi_clk.clkr, + [GCC_CAMERA_SF_AXI_CLK ] = &gcc_camera_sf_axi_clk.clkr, + [GCC_CFG_NOC_USB3_PRIM_AXI_CLK ] = &gcc_cfg_noc_usb3_prim_axi_clk.clkr, + [GCC_CPUSS_AHB_CLK_SRC ] = &gcc_cpuss_ahb_clk_src.clkr, + [GCC_CPUSS_GNOC_CLK ] = &gcc_cpuss_gnoc_clk.clkr,
[ ... ]
Quoted 5 lines
drivers/clk/qcom/gcc-sm7250.c new file +5
-0+static void gcc_sm7250_clk_regs_configure (struct device *dev,struct regmap *regmap) +{ +/* +* Disable the GPLL0 active input to NPU and GPU +* via MISC registers.
drivers/clk/qcom/gcc-sm7250.c line 2232
Quoted 10 lines
drivers/clk/qcom/gcc-sm7250.c new file +10
-0+*/ +regmap_update_bits (regmap,0x4d110 ,0x3 ,0x3 ); +regmap_update_bits (regmap,0x71028 ,0x3 ,0x3 ); + +/* +* Critical clocks sharing the same register with +* different masks +*/ +regmap_update_bits (regmap,0x52000 ,BIT (21 ),BIT (21 ));/* GCC_CPUSS_AHB_CLK */ +}
[Severity: High]
In drivers/clk/qcom/gcc-sm7250.c, gcc_cpuss_gnoc_clk is registered in gcc_sm7250_clocks[] with clk_branch2_ops and without CLK_IS_CRITICAL.
When clk_disable_unused() runs at late_initcall_sync and no consumer has claimed GCC_CPUSS_GNOC_CLK, clk_disable_unused_subtree() will call clk_branch2_disable() -> clk_disable_regmap() and clear BIT(29) in vote register 0x52000, gating the CPU subsystem to GNOC interconnect clock and hanging the system.
Should gcc_cpuss_gnoc_clk be marked with CLK_IS_CRITICAL (or handled via gcc_sm7250_clk_regs_configure() like GCC_CPUSS_AHB_CLK in register 0x52000) so that it is not disabled at boot?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
PATCH RESEND v11 3/5 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 RESEND v11 4/5 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 | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.yaml +1 -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
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH RESEND v11 4/5] dt-bindings: cpufreq: qcom-hw: Document SM7250 cpufreq hardware
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] dt-bindings: cpufreq: missing allOf constraints for qcom,sm7250-cpufreq-hw --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dt-bindings: cpufreq: missing allOf constraints for qcom,sm7250-cpufreq-hw --
commit 623b16fc0e86cc72b884cb60a98bee234109660b
Author: Sreeshankar K <[email protected]>
dt-bindings: cpufreq: qcom-hw: Document SM7250 cpufreq hardware
This commit adds the qcom,sm7250-cpufreq-hw compatible string to the Qualcomm cpufreq hardware Device Tree binding schema.
Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.yaml properties: · line 32
Quoted 9 lines
Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.yaml +1
-0@@ -29,6 +29,7 @@ properties: - qcom,sdm845-cpufreq-hw - qcom,sm6115-cpufreq-hw - qcom,sm6350-cpufreq-hw + - qcom,sm7250-cpufreq-hw
[Severity: Medium]
Should qcom,sm7250-cpufreq-hw also be added to one of the allOf conditional blocks in Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.yaml?
In this binding, the top-level definitions of reg, reg-names, interrupts, and interrupt-names allow anywhere from 1 to 4 items. Every other SoC-specific compatible string is listed in an allOf if-then block to constrain minItems and maxItems for those properties to match the exact number of frequency domains and interrupts on that SoC:
- if:
properties:
compatible:
contains:
enum:
- qcom,sm8150-cpufreq-hw
then:
properties:
reg:
minItems: 3
maxItems: 3
...
Without an allOf entry for qcom,sm7250-cpufreq-hw, device tree nodes matching qcom,sm7250-cpufreq-hw will leave reg, reg-names, interrupts, and interrupt-names unconstrained between 1 and 4 items during schema validation.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
PATCH RESEND v11 5/5 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 | 771 +++++++++++++++++++++++++++++++++++ 1 file changed, 771 insertions(+)
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +771 -0
@@ -0,0 +1,771 @@ +// 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,sm7250-gcc.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>; + }; + }; + + cluster1 { + core6 { + cpu = <&cpu6>; + }; + }; + + cluster2 { + 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 = <0x41001244>; + 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 = <0x4100b244>; + 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,sm7250-gcc"; + 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"; + clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GPLL0>; + clock-names = "xo", "alternate"; + #freq-domain-cells = <1>; + #clock-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; + 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 RESEND v11 5/5] arm64: dts: qcom: Add SM7250 devicetree file
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [High] arm64: dts: qcom: sm7250: invalid cpu-map core numbering in cluster1/cluster2 - [Low] arm64: dts…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] arm64: dts: qcom: sm7250: invalid cpu-map core numbering in cluster1/cluster2
- [Low] arm64: dts: qcom: sm7250: invalid empty ranges in timer@17c20000
- [Low] arm64: dts: qcom: sm7250: undocumented properties in gcc node
--
commit bf84a1845e05761eee023636ff9d6f3060fa7b0d
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, reserved memory, clock controller, interrupt controller, RPMh, cpufreq, and timer nodes.
Quoted 6 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +0
-0@@ -0,0 +1,771 @@
[ ... ]
Quoted 29 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +29
-0+ cpu-map { + cluster0 { + core0 { + cpu = <&cpu0>; + }; + + core1 { + cpu = <&cpu1>; + }; + + core2 { + cpu = <&cpu2>; + }; + + core3 { + cpu = <&cpu3>; + }; + + core4 { + cpu = <&cpu4>; + }; + + core5 { + cpu = <&cpu5>; + }; + }; + + cluster1 { + core6 {
arch/arm64/boot/dts/qcom/sm7250.dtsi line 265
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +10
-0+ cpu = <&cpu6>; + }; + }; + + cluster2 { + core7 { + cpu = <&cpu7>; + }; + }; + };
[Severity: High]
Will parse_cluster() in drivers/base/arch_topology.c fail to find cpu6 and cpu7 with this cpu-map node layout in arch/arm64/boot/dts/qcom/sm7250.dtsi?
During boot, init_cpu_topology() calls parse_dt_topology() -> parse_cluster(), which looks up core subnodes inside each cluster sequentially starting from core0:
drivers/base/arch_topology.c:parse_cluster() {
/* Now check for cores */
i = 0;
do {
snprintf(name, sizeof(name), "core%d", i);
struct device_node *c __free(device_node) =
of_get_child_by_name(cluster, name);
if (!c)
break;
}Because cluster1 and cluster2 only contain core6 and core7 (with no core0), of_get_child_by_name(cluster, "core0") returns NULL on the first iteration, logging empty cluster warnings and never calling parse_core() -> get_cpu_for_node() -> topology_parse_cpu_capacity() for cpu6 or cpu7.
Since parse_core() succeeds for cpu0..cpu5, raw_capacity is allocated with entries for cpu0..cpu5 set to 1024 while raw_capacity[6] and raw_capacity[7] remain 0. When parse_dt_topology() subsequently runs:
drivers/base/arch_topology.c:parse_dt_topology() {
topology_normalize_cpu_scale();
/*
* Check that all cores are in the topology; the SMP code will
* only mark cores described in the DT as possible.
*/
for_each_possible_cpu(cpu)
if (cpu_topology[cpu].package_id < 0) {
return -EINVAL;
}
}topology_normalize_cpu_scale() sets the scheduler capacity scale (cpu_scale) for cpu6 and cpu7 to 0, and parse_dt_topology() returns -EINVAL because cpu6 and cpu7 still have package_id < 0, causing init_cpu_topology() to call reset_cpu_topology() and discard the DT CPU topology.
Should core6 and core7 be placed under cluster0 (since all 8 cores share l3_0 and cluster_pd) or renamed to core0 within their respective clusters?
[ ... ]
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,sm7250-gcc"; + reg = <0x0 0x00100000 0x0 0x1f0000>; + clock-names = "bi_tcxo",
arch/arm64/boot/dts/qcom/sm7250.dtsi line 538
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: Low]
Should clock-names and power-domains be dropped from the gcc (clock-controller@100000) node in arch/arm64/boot/dts/qcom/sm7250.dtsi, or documented in the binding schema?
In Documentation/devicetree/bindings/clock/qcom,sm6375-gcc.yaml (which covers qcom,sm7250-gcc and references qcom,gcc.yaml), unevaluatedProperties is set to false and neither clock-names nor power-domains is defined, causing dtbs_check validation to fail on clock-controller@100000. In addition, drivers/clk/qcom/gcc-sm7250.c resolves its parent clocks by DT index rather than by name.
[ ... ]
arch/arm64/boot/dts/qcom/sm7250.dtsi line 709
Quoted 6 lines
arch/arm64/boot/dts/qcom/sm7250.dtsi new file +6
-0+ timer@17c20000 { + compatible = "arm,armv7-timer-mem"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + reg = <0x0 0x17c20000 0x0 0x1000>;
[Severity: Low]
Does the empty ranges property in timer@17c20000 in arch/arm64/boot/dts/qcom/sm7250.dtsi trigger dtc ranges_format warnings when building a board dtb?
The parent node soc@0 uses #address-cells = <2> and #size-cells = <2>, while timer@17c20000 uses #address-cells = <1> and #size-cells = <1> with an empty ranges property. In scripts/dtc/checks.c, check_ranges_format() checks for this mismatch:
scripts/dtc/checks.c:check_ranges_format() {
if (prop->val.len == 0) {
if (p_addr_cells != c_addr_cells)
FAIL_PROP(c, dti, node, prop, "empty \"%s\" property but its "
"#address-cells (%d) differs from %s (%d)",
ranges, c_addr_cells, node->parent->fullpath,
p_addr_cells);
if (p_size_cells != c_size_cells)
FAIL_PROP(c, dti, node, prop, "empty \"%s\" property but its "
"#size-cells (%d) differs from %s (%d)",
ranges, c_size_cells, node->parent->fullpath,
p_size_cells);
}
}Should this use an explicit mapping such as ranges = <0 0 0 0x20000000>; as on other Qualcomm SoCs?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5