mbox series

[v7,00/22] soc: qcom: spm: add support for SPM regulator

Message ID 20240102-saw2-spm-regulator-v7-0-0472ec237f49@linaro.org
Headers show
Series soc: qcom: spm: add support for SPM regulator | expand

Message

Dmitry Baryshkov Jan. 2, 2024, 5:17 a.m. UTC
The apq8064 rework to use cacheinfo takes more than expected, so I've
spanwed this series. It is an excerpt of the APQ8064 cpufreq series
[1], so it it continues the version numbering for those patches.

The Subsystem Power Manager (SPM) / SPM AutoVoltageScaling Wrapper2
(SAW2) are hardware blocks used on some of Qualcomm platforms to handle
the voltage rails. It does this by bypassing RPM and directly
interfacing the PMIC. Extend current SPM driver to export this
regulator.

[1] https://lore.kernel.org/linux-arm-msm/20230827115033.935089-1-dmitry.baryshkov@linaro.org/

Changes since v6:
- Added SoC-specific compat strings on MSM8960, IPQ4019, IPQ8064
  platforms (Luca)
- Fixed saw2 node names on few remaining platforms.

Changes since v5:
- Added patch that moves SPM structs out of the header file
- Removed support for L2 SAW regulator (Stephan Gerhold).
  msm8960/apq8064 do not use this SAW2 to manage this regulator and
  other platforms will need changes anyway.

---
Dmitry Baryshkov (22):
      dt-bindings: soc: qcom: merge qcom,saw2.txt into qcom,spm.yaml
      dt-bindings: soc: qcom: qcom,saw2: add missing compatible strings
      dt-bindings: soc: qcom: qcom,saw2: define optional regulator node
      soc: qcom: spm: remove driver-internal structures from the driver API
      soc: qcom: spm: add support for voltage regulator
      ARM: dts: qcom: apq8084: use new compat string for L2 SAW2 unit
      ARM: dts: qcom: msm8974: use new compat string for L2 SAW2 unit
      ARM: dts: qcom: msm8960: use SoC-specific compatibles for SAW2 devices
      ARM: dts: qcom: ipq4019: use SoC-specific compatibles for SAW2 devices
      ARM: dts: qcom: ipq8064: use SoC-specific compatibles for SAW2 devices
      ARM: dts: qcom: apq8064: rename SAW nodes to power-manager
      ARM: dts: qcom: apq8084: rename SAW nodes to power-manager
      ARM: dts: qcom: msm8960: rename SAW nodes to power-manager
      ARM: dts: qcom: msm8974: rename SAW nodes to power-manager
      ARM: dts: qcom: ipq4019: rename SAW nodes to power-manager
      ARM: dts: qcom: ipq8064: rename SAW nodes to power-manager
      ARM: dts: qcom: apq8064: declare SAW2 regulators
      ARM: dts: qcom: msm8960: declare SAW2 regulators
      ARM: dts: qcom: apq8084: drop 'regulator' property from SAW2 device
      ARM: dts: qcom: msm8974: drop 'regulator' property from SAW2 device
      ARM: dts: qcom: ipq4019: drop 'regulator' property from SAW2 devices
      ARM: dts: qcom: ipq8064: drop 'regulator' property from SAW2 devices

 .../devicetree/bindings/arm/msm/qcom,saw2.txt      |  58 -----
 .../soc/qcom/{qcom,spm.yaml => qcom,saw2.yaml}     |  45 +++-
 arch/arm/boot/dts/qcom/qcom-apq8064.dtsi           |  32 ++-
 arch/arm/boot/dts/qcom/qcom-apq8084.dtsi           |  13 +-
 arch/arm/boot/dts/qcom/qcom-ipq4019.dtsi           |  25 +-
 arch/arm/boot/dts/qcom/qcom-ipq8064.dtsi           |  10 +-
 arch/arm/boot/dts/qcom/qcom-msm8960.dtsi           |  20 +-
 arch/arm/boot/dts/qcom/qcom-msm8974.dtsi           |  13 +-
 drivers/soc/qcom/spm.c                             | 254 ++++++++++++++++++++-
 include/soc/qcom/spm.h                             |  23 +-
 10 files changed, 353 insertions(+), 140 deletions(-)
---
base-commit: 39676dfe52331dba909c617f213fdb21015c8d10
change-id: 20240101-saw2-spm-regulator-af0f81c15cdc

Best regards,

Comments

Konrad Dybcio Jan. 2, 2024, 5:06 p.m. UTC | #1
On 2.01.2024 06:17, Dmitry Baryshkov wrote:
> Add SoC-specific compatibility strings to the L2 SAW2 unit. This is is
> to distinguish the SAW2 units related to L2 cache and the CPU cores.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Jan. 2, 2024, 5:06 p.m. UTC | #2
On 2.01.2024 06:17, Dmitry Baryshkov wrote:
> Add SoC-specific compatibility strings to the L2 SAW2 unit. This is is
> to distinguish the SAW2 units related to L2 cache and the CPU cores.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Jan. 2, 2024, 5:06 p.m. UTC | #3
On 2.01.2024 06:17, Dmitry Baryshkov wrote:
> There is no such thing as a generic 'SAW2' device. Use device-specific
> compatible strings to describe the SAW2 devices.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Jan. 2, 2024, 5:07 p.m. UTC | #4
On 2.01.2024 06:17, Dmitry Baryshkov wrote:
> There is no such thing as a generic 'SAW2' device. Use device-specific
> compatible strings to describe the SAW2 devices.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Jan. 2, 2024, 5:07 p.m. UTC | #5
On 2.01.2024 06:17, Dmitry Baryshkov wrote:
> There is no such thing as a generic 'SAW2' device. Use device-specific
> compatible strings to describe the SAW2 devices.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Jan. 2, 2024, 5:07 p.m. UTC | #6
On 2.01.2024 06:17, Dmitry Baryshkov wrote:
> Per the power-domain.yaml, the power-controller node name is reserved
> for power-domain providers. Rename SAW2 nodes to 'power-manager', the
> name which is suggested by qcom,saw2.yaml
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Jan. 2, 2024, 5:07 p.m. UTC | #7
On 2.01.2024 06:17, Dmitry Baryshkov wrote:
> The SAW2 device is not a regulator. It is a frontend to the PMIC, which
> handles voltage control, automatic voltage scaling and low-power states,
> Rename SAW2 nodes to 'power-manager', the name which is suggested by
> qcom,saw2.yaml
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Jan. 2, 2024, 5:07 p.m. UTC | #8
On 2.01.2024 06:17, Dmitry Baryshkov wrote:
> Per the power-domain.yaml, the power-controller node name is reserved
> for power-domain providers. Rename SAW2 nodes to 'power-manager', the
> name which is suggested by qcom,saw2.yaml
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Jan. 2, 2024, 5:08 p.m. UTC | #9
On 2.01.2024 06:17, Dmitry Baryshkov wrote:
> The SAW2 device is not a regulator. It is a frontend to the PMIC, which
> handles voltage control, automatic voltage scaling and low-power states,
> Rename SAW2 nodes to 'power-manager', the name which is suggested by
> qcom,saw2.yaml
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Jan. 2, 2024, 5:08 p.m. UTC | #10
On 2.01.2024 06:17, Dmitry Baryshkov wrote:
> The SAW2 device is not a regulator. It is a frontend to the PMIC, which
> handles voltage control, automatic voltage scaling and low-power states,
> Rename SAW2 nodes to 'power-manager', the name which is suggested by
> qcom,saw2.yaml
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Jan. 2, 2024, 5:15 p.m. UTC | #11
On 2.01.2024 06:17, Dmitry Baryshkov wrote:
> The SPM / SAW2 device also provides a voltage regulator functionality
> with optional AVS (Adaptive Voltage Scaling) support. The exact register
> sequence and voltage ranges differs from device to device.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
I don't think I have more complaints here..

Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Bjorn Andersson Feb. 16, 2024, 11:10 p.m. UTC | #12
On Tue, 02 Jan 2024 07:17:20 +0200, Dmitry Baryshkov wrote:
> The apq8064 rework to use cacheinfo takes more than expected, so I've
> spanwed this series. It is an excerpt of the APQ8064 cpufreq series
> [1], so it it continues the version numbering for those patches.
> 
> The Subsystem Power Manager (SPM) / SPM AutoVoltageScaling Wrapper2
> (SAW2) are hardware blocks used on some of Qualcomm platforms to handle
> the voltage rails. It does this by bypassing RPM and directly
> interfacing the PMIC. Extend current SPM driver to export this
> regulator.
> 
> [...]

Applied, thanks!

[01/22] dt-bindings: soc: qcom: merge qcom,saw2.txt into qcom,spm.yaml
        commit: c9491a16e571d7f33e1d00d1ec4ce9b035bb290c
[02/22] dt-bindings: soc: qcom: qcom,saw2: add missing compatible strings
        commit: 31ac56a59e7a8ed4ccd4831b73a1cc1ad9653b7f
[03/22] dt-bindings: soc: qcom: qcom,saw2: define optional regulator node
        commit: aa4e327fbbf665e96701fa1f53a97ae86b646603
[04/22] soc: qcom: spm: remove driver-internal structures from the driver API
        commit: 57e2b067f19b8de616d1e849ce3786df602bfe7f
[05/22] soc: qcom: spm: add support for voltage regulator
        commit: 6496dba142f4461360cae263126965e4ac761ab9
[06/22] ARM: dts: qcom: apq8084: use new compat string for L2 SAW2 unit
        commit: 551d90275631a7dd2d290aa60aedabc597029216
[07/22] ARM: dts: qcom: msm8974: use new compat string for L2 SAW2 unit
        commit: c0fe5442b1e5bcfbfe5272896e4dab23e1dfcc19
[08/22] ARM: dts: qcom: msm8960: use SoC-specific compatibles for SAW2 devices
        commit: 9f77f78bd420ffddafe8c019c9e94097ef32c4d6
[09/22] ARM: dts: qcom: ipq4019: use SoC-specific compatibles for SAW2 devices
        commit: 8cad85bfe08f419ea57a8a395e4ab0dcf346d617
[10/22] ARM: dts: qcom: ipq8064: use SoC-specific compatibles for SAW2 devices
        commit: e6e2986a3d57a4d6590c3654d64cd417585c1c66
[11/22] ARM: dts: qcom: apq8064: rename SAW nodes to power-manager
        commit: 3a3b949fd9555190f2a477271b79e6194f0a824b
[12/22] ARM: dts: qcom: apq8084: rename SAW nodes to power-manager
        commit: 07eb49b318000f8953c3de73f400b799215d6a32
[13/22] ARM: dts: qcom: msm8960: rename SAW nodes to power-manager
        commit: 34725e24f20d98a9bba2850934c2adef65b9ec0e
[14/22] ARM: dts: qcom: msm8974: rename SAW nodes to power-manager
        commit: e624dc495a425dc0598688c8c1aa5c028ca30750
[15/22] ARM: dts: qcom: ipq4019: rename SAW nodes to power-manager
        commit: 3ea06103ee40351dc4793e37c0e51e00753e3d26
[16/22] ARM: dts: qcom: ipq8064: rename SAW nodes to power-manager
        commit: 04e354e0b4dd409298c1909fdd8897055e9b3641
[17/22] ARM: dts: qcom: apq8064: declare SAW2 regulators
        commit: 893768803fa4ab7e5d75448980832b517d251a25
[18/22] ARM: dts: qcom: msm8960: declare SAW2 regulators
        commit: 378cc1b3e6cd3cab1f8c4a5e1891664545c2c7e9
[19/22] ARM: dts: qcom: apq8084: drop 'regulator' property from SAW2 device
        commit: 8c843db2bca12e911e0d0343c52a9e9a17704ae3
[20/22] ARM: dts: qcom: msm8974: drop 'regulator' property from SAW2 device
        commit: a560ff0acc0418e3c689ca2b050e00f964020b14
[21/22] ARM: dts: qcom: ipq4019: drop 'regulator' property from SAW2 devices
        commit: c169576dddff63be2108cb289a9ab1b7fc19ef53
[22/22] ARM: dts: qcom: ipq8064: drop 'regulator' property from SAW2 devices
        commit: 4ad2506d5a17387dcbedbd24e60d33f6421e249e

Best regards,