* Re: [PATCH 2/3] arm64: dts: qcom: sm6125: Add cpufreq-hw node [not found] <a3cbbfa897e960db0d671098be710032@mainlining.org> @ 2026-11-17 17:35 ` Majid Hajiheidari 0 siblings, 0 replies; 2+ messages in thread From: Majid Hajiheidari @ 2026-11-17 17:35 UTC (permalink / raw) To: barnabas.czeman Cc: andersson, konradybcio, rafael, viresh.kumar, robh, krzk+dt, conor+dt, abelvesa, mani, admin, linux-arm-msm, linux-pm, devicetree, linux-kernel Hi Barnabás, thanks for the review, and for your answer on the cover letter. Both mails reached me but neither shows up on lore, so I am answering both here and quoting the relevant parts. On 2026-11-16 14:41, Barnabás Czémán wrote: >> + reg = <0x0 0x0f521000 0x0 0x1000>, >> + <0x0 0x0f523000 0x0 0x1000>; > If you check the available sources SM6125 is different from SM6115 the > size is 0x1400 instead of 0x1000. You are right. The downstream trinket device tree has 0x1400 for both regions; I took 0x1000 over from sm6115.dtsi. I will fix that in v2. >> + clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>, <&gcc GPLL0_OUT_EARLY>; > There is no proof GPLL0_OUT_EARLY is related to cpufreq, the driver > using the clocks for getting the initial rate from them, it is working > because this clock have similar rate but i am not sure it is logically > correct to bind a clock without proof it is related. That is why i > have made changes in the driver to make the clocks optional. Agreed that downstream does not tell us where the 300 MHz row comes from; it has OSM_INIT_RATE and XO_RATE as constants. But that is the same file and the same constants for every SoC it serves, and the mainline binding still requires both clocks ("XO Clock", "GPLL0 Clock") for all of them, SM6115 included. I followed that: - SM6115 uses <&gcc GPLL0>, which in gcc-sm6115 is the alpha PLL itself. gcc-sm6125 has no index with that name; the PLL is GPLL0_OUT_EARLY, with OUT_MAIN and OUT_AUX2 as its /2 outputs. On my phone it runs at 600 MHz, so the driver's /2 gives the 300 MHz row. - The mainline driver uses "xo" for every PLL row (xo_rate * lval), not only for the initial rate, so I think at least that one should stay a real clock rather than a constant in the driver. So with the binding as it is today the DT in this series is what the schema asks for, and a node without clocks would need a binding change first. Whether the clocks should become optional for these SoCs is something I would leave to Viresh, Konrad and Krzysztof. From your mail on the cover letter (2026-11-15): > Also i have added a new SoC data because SM6125 and SM6115 have less > LUT entries (12) [2] and there are no throttling IRQs there. That part I agree with, the trinket fixup in downstream is clear. On laurel the generic data happens to stop at the repeated row before it gets that far, but nothing guarantees that. Would you send your soc data with lut_max_entries = 12 as a driver patch? It does not depend on the clock question. Your branch as a whole already ran fine on laurel (see my mail of 15 November), and once the patch is on the list I will boot it on top of this series and reply with a Tested-by. If the maintainers prefer that to go in first, or prefer your DT, I am fine with either and will rebase or drop my cpufreq patch accordingly. Thanks, Majid ^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 0/3] arm64: dts: qcom: sm6125: Add cpufreq-hw and CPU idle states @ 2026-11-15 0:31 Majid Hajiheidari 2026-11-15 0:31 ` [PATCH 2/3] arm64: dts: qcom: sm6125: Add cpufreq-hw node Majid Hajiheidari 0 siblings, 1 reply; 2+ messages in thread From: Majid Hajiheidari @ 2026-11-15 0:31 UTC (permalink / raw) To: andersson, konradybcio Cc: rafael, viresh.kumar, robh, krzk+dt, conor+dt, abelvesa, mani, admin, linux-arm-msm, linux-pm, devicetree, linux-kernel SM6125 has no CPU frequency scaling and no CPU idle states in mainline: the CPUs stay at the bootloader clock and only ever enter WFI. The blocks are the same as on SM6115. Register addresses and idle latencies come from the downstream "trinket" device tree of a Xiaomi Mi A3 (laurel-sprout), where the CPU low power levels match the SM6115 values exactly. Tested on the Mi A3 on next-20261113: cpufreq 300 MHz - 1.80/2.02 GHz with schedutil, WFI plus per-CPU power collapse in cpuidle with rising usage counters. This is meant to go together with Roman Linev's SM6125 TSENS series [1], which adds #cooling-cells to the CPUs and per-CPU cooling maps that stay inert until a cpufreq driver registers cooling devices. That is why #cooling-cells is not added here. On my phone the same TSENS description (derived independently) runs together with this series and the cpufreq cooling devices bind. Not done yet: cluster idle states (PSCI OSI parameters need checking) and an energy model. [1] https://lore.kernel.org/r/a3f071d3-6082-47a1-bb00-9d8e72fa3cdd@mswin.me/ Majid Hajiheidari (3): dt-bindings: cpufreq: cpufreq-qcom-hw: Add SM6125 compatible arm64: dts: qcom: sm6125: Add cpufreq-hw node arm64: dts: qcom: sm6125: Add CPU idle states .../bindings/cpufreq/cpufreq-qcom-hw.yaml | 2 + arch/arm64/boot/dts/qcom/sm6125.dtsi | 61 +++++++++++++++++++ 2 files changed, 63 insertions(+) base-commit: 84abb955b1015477aa11a96e2f3ac1b938b77f48 -- 2.56.1 ^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/3] arm64: dts: qcom: sm6125: Add cpufreq-hw node 2026-11-15 0:31 [PATCH 0/3] arm64: dts: qcom: sm6125: Add cpufreq-hw and CPU idle states Majid Hajiheidari @ 2026-11-15 0:31 ` Majid Hajiheidari 0 siblings, 0 replies; 2+ messages in thread From: Majid Hajiheidari @ 2026-11-15 0:31 UTC (permalink / raw) To: andersson, konradybcio Cc: rafael, viresh.kumar, robh, krzk+dt, conor+dt, abelvesa, mani, admin, linux-arm-msm, linux-pm, devicetree, linux-kernel SM6125 has the same cpufreq-hw (OSM) blocks as SM6115, at 0xf521000 (silver cluster) and 0xf523000 (gold cluster), per the downstream "trinket" device tree. Describe them and hook up the CPUs so the frequency can scale instead of staying at the bootloader setting. GCC on SM6125 has no plain GPLL0 output; GPLL0_OUT_EARLY is the PLL itself and is used as the alternate source. Tested on a Xiaomi Mi A3: policy0 300 MHz - 1.80 GHz, policy4 300 MHz - 2.02 GHz, scaling with schedutil; a single gold core holds 1998 MHz under 7-Zip. Signed-off-by: Majid Hajiheidari <majidhhdri@gmail.com> --- arch/arm64/boot/dts/qcom/sm6125.dtsi | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm6125.dtsi b/arch/arm64/boot/dts/qcom/sm6125.dtsi index 5f558b548..1b148e453 100644 --- a/arch/arm64/boot/dts/qcom/sm6125.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6125.dtsi @@ -43,6 +43,8 @@ cpu0: cpu@0 { compatible = "qcom,kryo260"; reg = <0x0 0x0>; enable-method = "psci"; + clocks = <&cpufreq_hw 0>; + qcom,freq-domain = <&cpufreq_hw 0>; capacity-dmips-mhz = <1024>; next-level-cache = <&l2_0>; l2_0: l2-cache { @@ -57,6 +59,8 @@ cpu1: cpu@1 { compatible = "qcom,kryo260"; reg = <0x0 0x1>; enable-method = "psci"; + clocks = <&cpufreq_hw 0>; + qcom,freq-domain = <&cpufreq_hw 0>; capacity-dmips-mhz = <1024>; next-level-cache = <&l2_0>; }; @@ -66,6 +70,8 @@ cpu2: cpu@2 { compatible = "qcom,kryo260"; reg = <0x0 0x2>; enable-method = "psci"; + clocks = <&cpufreq_hw 0>; + qcom,freq-domain = <&cpufreq_hw 0>; capacity-dmips-mhz = <1024>; next-level-cache = <&l2_0>; }; @@ -75,6 +81,8 @@ cpu3: cpu@3 { compatible = "qcom,kryo260"; reg = <0x0 0x3>; enable-method = "psci"; + clocks = <&cpufreq_hw 0>; + qcom,freq-domain = <&cpufreq_hw 0>; capacity-dmips-mhz = <1024>; next-level-cache = <&l2_0>; }; @@ -84,6 +92,8 @@ cpu4: cpu@100 { compatible = "qcom,kryo260"; reg = <0x0 0x100>; enable-method = "psci"; + clocks = <&cpufreq_hw 1>; + qcom,freq-domain = <&cpufreq_hw 1>; capacity-dmips-mhz = <1638>; next-level-cache = <&l2_1>; l2_1: l2-cache { @@ -98,6 +108,8 @@ cpu5: cpu@101 { compatible = "qcom,kryo260"; reg = <0x0 0x101>; enable-method = "psci"; + clocks = <&cpufreq_hw 1>; + qcom,freq-domain = <&cpufreq_hw 1>; capacity-dmips-mhz = <1638>; next-level-cache = <&l2_1>; }; @@ -107,6 +119,8 @@ cpu6: cpu@102 { compatible = "qcom,kryo260"; reg = <0x0 0x102>; enable-method = "psci"; + clocks = <&cpufreq_hw 1>; + qcom,freq-domain = <&cpufreq_hw 1>; capacity-dmips-mhz = <1638>; next-level-cache = <&l2_1>; }; @@ -116,6 +130,8 @@ cpu7: cpu@103 { compatible = "qcom,kryo260"; reg = <0x0 0x103>; enable-method = "psci"; + clocks = <&cpufreq_hw 1>; + qcom,freq-domain = <&cpufreq_hw 1>; capacity-dmips-mhz = <1638>; next-level-cache = <&l2_1>; }; @@ -1633,6 +1649,19 @@ intc: interrupt-controller@f200000 { interrupt-controller; interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>; }; + + cpufreq_hw: cpufreq@f521000 { + compatible = "qcom,sm6125-cpufreq-hw", "qcom,cpufreq-hw"; + reg = <0x0 0x0f521000 0x0 0x1000>, + <0x0 0x0f523000 0x0 0x1000>; + reg-names = "freq-domain0", "freq-domain1"; + + clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>, <&gcc GPLL0_OUT_EARLY>; + clock-names = "xo", "alternate"; + + #freq-domain-cells = <1>; + #clock-cells = <1>; + }; }; timer { -- 2.56.1 ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-17 17:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <a3cbbfa897e960db0d671098be710032@mainlining.org>
2026-11-17 17:35 ` [PATCH 2/3] arm64: dts: qcom: sm6125: Add cpufreq-hw node Majid Hajiheidari
2026-11-15 0:31 [PATCH 0/3] arm64: dts: qcom: sm6125: Add cpufreq-hw and CPU idle states Majid Hajiheidari
2026-11-15 0:31 ` [PATCH 2/3] arm64: dts: qcom: sm6125: Add cpufreq-hw node Majid Hajiheidari
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®