linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/8] arm64: dts: qcom: sa8295p: Enable GPU
@ 2024-01-24  4:25 Bjorn Andersson
  2024-01-24  4:25 ` [PATCH v3 1/8] dt-bindings: clock: qcom: Allow VDD_GFX supply to GX Bjorn Andersson
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Bjorn Andersson @ 2024-01-24  4:25 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel, Bjorn Andersson, Dmitry Baryshkov, Ulf Hansson,
	Bjorn Andersson

Due to the different PMIC configuration found in the SA8295P platform,
compared to SC8280XP, the VDD_GFX pads are supplied by an dedicated
MAX20411 LDO.

Support for expressing the regulator supply is added to the binding, the
support for enabling the parent supply for GX is added, the missing
gfx.lvl power-domain is dropped, and the DeviceTree is wired up to
enable the GPU in this configuration.

Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
Changes in v3:
- Removed one unnecessary empty line in DT node
- Rebased series to v6.8-rc1
- Link to v2: https://lore.kernel.org/r/20231220-sa8295p-gpu-v2-0-4763246b72c0@quicinc.com

Changes in v2:
- Made gpucc binding accept either power-domain or vdd-gfx-supply
- Updated comment in gdsc_gx_do_nothing_enable()
- Added a comment for the /delete-property/ power-domains
- Fixed node and property sort order in dts
- Switched zap firmware to use mbn file
- Link to v1: https://lore.kernel.org/r/20231220-sa8295p-gpu-v1-0-d8cdf2257f97@quicinc.com

---
Bjorn Andersson (8):
      dt-bindings: clock: qcom: Allow VDD_GFX supply to GX
      clk: qcom: gdsc: Enable supply reglator in GPU GX handler
      clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc
      soc: qcom: rpmhpd: Drop SA8540P gfx.lvl
      arm64: dts: qcom: sa8540p: Drop gfx.lvl as power-domain for gpucc
      arm64: dts: qcom: sa8295p-adp: add max20411
      arm64: dts: qcom: sa8295p-adp: Enable GPU
      arm64: defconfig: Enable MAX20411 regulator driver

 .../devicetree/bindings/clock/qcom,gpucc.yaml      | 16 +++++
 arch/arm64/boot/dts/qcom/sa8295p-adp.dts           | 68 ++++++++++++++++++++++
 arch/arm64/boot/dts/qcom/sa8540p.dtsi              |  3 +
 arch/arm64/configs/defconfig                       |  1 +
 drivers/clk/qcom/gdsc.c                            | 12 +++-
 drivers/clk/qcom/gpucc-sc8280xp.c                  |  1 +
 drivers/pmdomain/qcom/rpmhpd.c                     |  1 -
 7 files changed, 99 insertions(+), 3 deletions(-)
---
base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d
change-id: 20231220-sa8295p-gpu-51c5f343e3ec

Best regards,
-- 
Bjorn Andersson <quic_bjorande@quicinc.com>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 1/8] dt-bindings: clock: qcom: Allow VDD_GFX supply to GX
  2024-01-24  4:25 [PATCH v3 0/8] arm64: dts: qcom: sa8295p: Enable GPU Bjorn Andersson
@ 2024-01-24  4:25 ` Bjorn Andersson
  2024-01-24  6:31   ` Krzysztof Kozlowski
  2024-01-24  4:25 ` [PATCH v3 2/8] clk: qcom: gdsc: Enable supply reglator in GPU GX handler Bjorn Andersson
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Bjorn Andersson @ 2024-01-24  4:25 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel, Bjorn Andersson

In some designs the SoC's VDD_GFX pads are supplied by an external
regulator, rather than a power-domain. Allow this to be described in the
GPU clock controller binding.

Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 Documentation/devicetree/bindings/clock/qcom,gpucc.yaml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml b/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
index f369fa34e00c..c0dd24c9dcb3 100644
--- a/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,gpucc.yaml
@@ -53,6 +53,9 @@ properties:
   power-domains:
     maxItems: 1
 
+  vdd-gfx-supply:
+    description: Regulator supply for the VDD_GFX pads
+
   '#clock-cells':
     const: 1
 
@@ -74,6 +77,19 @@ required:
   - '#reset-cells'
   - '#power-domain-cells'
 
+# Allow either power-domains or vdd-gfx-supply, not both
+oneOf:
+  - required:
+      - power-domains
+  - required:
+      - vdd-gfx-supply
+  - not:
+      anyOf:
+        - required:
+            - power-domains
+        - required:
+            - vdd-gfx-supply
+
 additionalProperties: false
 
 examples:

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 2/8] clk: qcom: gdsc: Enable supply reglator in GPU GX handler
  2024-01-24  4:25 [PATCH v3 0/8] arm64: dts: qcom: sa8295p: Enable GPU Bjorn Andersson
  2024-01-24  4:25 ` [PATCH v3 1/8] dt-bindings: clock: qcom: Allow VDD_GFX supply to GX Bjorn Andersson
@ 2024-01-24  4:25 ` Bjorn Andersson
  2024-01-24  4:25 ` [PATCH v3 3/8] clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc Bjorn Andersson
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Bjorn Andersson @ 2024-01-24  4:25 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel, Bjorn Andersson

The GX GDSC is modelled to aid the GMU in powering down the GPU in the
event that the GPU crashes, so that it can be restarted again. But in
the event that the power-domain is supplied through a dedicated
regulator (in contrast to being a subdomin of another power-domain),
something needs to turn that regulator on, both to make sure things are
powered and to match the operation in gdsc_disable().

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 drivers/clk/qcom/gdsc.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c
index 5358e28122ab..e7a4068b9f39 100644
--- a/drivers/clk/qcom/gdsc.c
+++ b/drivers/clk/qcom/gdsc.c
@@ -557,7 +557,15 @@ void gdsc_unregister(struct gdsc_desc *desc)
  */
 int gdsc_gx_do_nothing_enable(struct generic_pm_domain *domain)
 {
-	/* Do nothing but give genpd the impression that we were successful */
-	return 0;
+	struct gdsc *sc = domain_to_gdsc(domain);
+	int ret = 0;
+
+	/* Enable the parent supply, when controlled through the regulator framework. */
+	if (sc->rsupply)
+		ret = regulator_enable(sc->rsupply);
+
+	/* Do nothing with the GDSC itself */
+
+	return ret;
 }
 EXPORT_SYMBOL_GPL(gdsc_gx_do_nothing_enable);

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 3/8] clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc
  2024-01-24  4:25 [PATCH v3 0/8] arm64: dts: qcom: sa8295p: Enable GPU Bjorn Andersson
  2024-01-24  4:25 ` [PATCH v3 1/8] dt-bindings: clock: qcom: Allow VDD_GFX supply to GX Bjorn Andersson
  2024-01-24  4:25 ` [PATCH v3 2/8] clk: qcom: gdsc: Enable supply reglator in GPU GX handler Bjorn Andersson
@ 2024-01-24  4:25 ` Bjorn Andersson
  2024-01-24  4:25 ` [PATCH v3 4/8] soc: qcom: rpmhpd: Drop SA8540P gfx.lvl Bjorn Andersson
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Bjorn Andersson @ 2024-01-24  4:25 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel, Bjorn Andersson, Dmitry Baryshkov

On SA8295P and SA8540P the GFX rail is powered by a dedicated external
regulator, instead of the rpmh-controlled "gfx.lvl".

Define the "vdd-gfx" as the supply regulator for the GDSC, to cause the
gdsc logic to look for, and control, this external power supply.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 drivers/clk/qcom/gpucc-sc8280xp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/qcom/gpucc-sc8280xp.c b/drivers/clk/qcom/gpucc-sc8280xp.c
index 8e147ee294ee..e2b3bc000c71 100644
--- a/drivers/clk/qcom/gpucc-sc8280xp.c
+++ b/drivers/clk/qcom/gpucc-sc8280xp.c
@@ -399,6 +399,7 @@ static struct gdsc gx_gdsc = {
 	},
 	.pwrsts = PWRSTS_OFF_ON,
 	.flags = CLAMP_IO | RETAIN_FF_ENABLE,
+	.supply = "vdd-gfx",
 };
 
 static struct gdsc *gpu_cc_sc8280xp_gdscs[] = {

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 4/8] soc: qcom: rpmhpd: Drop SA8540P gfx.lvl
  2024-01-24  4:25 [PATCH v3 0/8] arm64: dts: qcom: sa8295p: Enable GPU Bjorn Andersson
                   ` (2 preceding siblings ...)
  2024-01-24  4:25 ` [PATCH v3 3/8] clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc Bjorn Andersson
@ 2024-01-24  4:25 ` Bjorn Andersson
  2024-01-24  9:36   ` Ulf Hansson
  2024-01-24  4:25 ` [PATCH v3 5/8] arm64: dts: qcom: sa8540p: Drop gfx.lvl as power-domain for gpucc Bjorn Andersson
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Bjorn Andersson @ 2024-01-24  4:25 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel, Bjorn Andersson, Dmitry Baryshkov, Ulf Hansson

On SA8295P and SA8540P gfx.lvl is not provdied by rpmh, but rather is
handled by an external regulator (max20411). Drop gfx.lvl from the list
of power-domains exposed on this platform.

Fixes: f68f1cb3437d ("soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 drivers/pmdomain/qcom/rpmhpd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pmdomain/qcom/rpmhpd.c b/drivers/pmdomain/qcom/rpmhpd.c
index 3078896b1300..27a73ff72614 100644
--- a/drivers/pmdomain/qcom/rpmhpd.c
+++ b/drivers/pmdomain/qcom/rpmhpd.c
@@ -217,7 +217,6 @@ static struct rpmhpd *sa8540p_rpmhpds[] = {
 	[SC8280XP_CX] = &cx,
 	[SC8280XP_CX_AO] = &cx_ao,
 	[SC8280XP_EBI] = &ebi,
-	[SC8280XP_GFX] = &gfx,
 	[SC8280XP_LCX] = &lcx,
 	[SC8280XP_LMX] = &lmx,
 	[SC8280XP_MMCX] = &mmcx,

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 5/8] arm64: dts: qcom: sa8540p: Drop gfx.lvl as power-domain for gpucc
  2024-01-24  4:25 [PATCH v3 0/8] arm64: dts: qcom: sa8295p: Enable GPU Bjorn Andersson
                   ` (3 preceding siblings ...)
  2024-01-24  4:25 ` [PATCH v3 4/8] soc: qcom: rpmhpd: Drop SA8540P gfx.lvl Bjorn Andersson
@ 2024-01-24  4:25 ` Bjorn Andersson
  2024-01-24  4:25 ` [PATCH v3 6/8] arm64: dts: qcom: sa8295p-adp: add max20411 Bjorn Andersson
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Bjorn Andersson @ 2024-01-24  4:25 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel, Bjorn Andersson, Dmitry Baryshkov

The SA8295P and SA8540P uses an external regulator (max20411), and
gfx.lvl is not provided by rpmh. Drop the power-domains property of the
gpucc node to reflect this.

Fixes: eec51ab2fd6f ("arm64: dts: qcom: sc8280xp: Add GPU related nodes")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 arch/arm64/boot/dts/qcom/sa8540p.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sa8540p.dtsi b/arch/arm64/boot/dts/qcom/sa8540p.dtsi
index 96b2c59ad02b..23888029cc11 100644
--- a/arch/arm64/boot/dts/qcom/sa8540p.dtsi
+++ b/arch/arm64/boot/dts/qcom/sa8540p.dtsi
@@ -168,6 +168,9 @@ opp-2592000000 {
 };
 
 &gpucc {
+	/* SA8295P and SA8540P doesn't provide gfx.lvl */
+	/delete-property/ power-domains;
+
 	status = "disabled";
 };
 

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 6/8] arm64: dts: qcom: sa8295p-adp: add max20411
  2024-01-24  4:25 [PATCH v3 0/8] arm64: dts: qcom: sa8295p: Enable GPU Bjorn Andersson
                   ` (4 preceding siblings ...)
  2024-01-24  4:25 ` [PATCH v3 5/8] arm64: dts: qcom: sa8540p: Drop gfx.lvl as power-domain for gpucc Bjorn Andersson
@ 2024-01-24  4:25 ` Bjorn Andersson
  2024-01-24 12:35   ` Konrad Dybcio
  2024-01-24  4:25 ` [PATCH v3 7/8] arm64: dts: qcom: sa8295p-adp: Enable GPU Bjorn Andersson
  2024-01-24  4:25 ` [PATCH v3 8/8] arm64: defconfig: Enable MAX20411 regulator driver Bjorn Andersson
  7 siblings, 1 reply; 17+ messages in thread
From: Bjorn Andersson @ 2024-01-24  4:25 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel, Bjorn Andersson, Bjorn Andersson

From: Bjorn Andersson <andersson@kernel.org>

The SA8295P ADP has a MAX20411 LDO regulator on I2C 12, supplying the
VDD_GFX pads. Enable the bus and add the maxim,max20411 device on the
bus.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 39 ++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
index fd253942e5e5..bd0962f39fc5 100644
--- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
+++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
@@ -266,6 +266,26 @@ &dispcc1 {
 	status = "okay";
 };
 
+&i2c12 {
+	pinctrl-0 = <&qup1_i2c4_state>;
+	pinctrl-names = "default";
+
+	status = "okay";
+
+	vdd_gfx: regulator@39 {
+		compatible = "maxim,max20411";
+		reg = <0x39>;
+
+		regulator-min-microvolt = <800000>;
+		regulator-max-microvolt = <800000>;
+
+		enable-gpios = <&pmm8540a_gpios 2 GPIO_ACTIVE_HIGH>;
+
+		pinctrl-0 = <&max20411_en>;
+		pinctrl-names = "default";
+	};
+};
+
 &mdss0 {
 	status = "okay";
 };
@@ -476,6 +496,10 @@ &pcie4_phy {
 	status = "okay";
 };
 
+&qup1 {
+	status = "okay";
+};
+
 &qup2 {
 	status = "okay";
 };
@@ -636,6 +660,14 @@ &xo_board_clk {
 
 /* PINCTRL */
 
+&pmm8540a_gpios {
+	max20411_en: max20411-en-state {
+		pins = "gpio2";
+		function = "normal";
+		output-enable;
+	};
+};
+
 &tlmm {
 	pcie2a_default: pcie2a-default-state {
 		clkreq-n-pins {
@@ -728,4 +760,11 @@ wake-n-pins {
 			bias-pull-up;
 		};
 	};
+
+	qup1_i2c4_state: qup1-i2c4-state {
+		pins = "gpio0", "gpio1";
+		function = "qup12";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
 };

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 7/8] arm64: dts: qcom: sa8295p-adp: Enable GPU
  2024-01-24  4:25 [PATCH v3 0/8] arm64: dts: qcom: sa8295p: Enable GPU Bjorn Andersson
                   ` (5 preceding siblings ...)
  2024-01-24  4:25 ` [PATCH v3 6/8] arm64: dts: qcom: sa8295p-adp: add max20411 Bjorn Andersson
@ 2024-01-24  4:25 ` Bjorn Andersson
  2024-01-24  4:25 ` [PATCH v3 8/8] arm64: defconfig: Enable MAX20411 regulator driver Bjorn Andersson
  7 siblings, 0 replies; 17+ messages in thread
From: Bjorn Andersson @ 2024-01-24  4:25 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel, Bjorn Andersson, Dmitry Baryshkov

With the necessary support in place for supplying VDD_GFX from the
MAX20411 regulator, enable the GPU clock controller, GMU, Adreno SMMU
and the GPU on the SA8295P ADP.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
index bd0962f39fc5..78e933c42c31 100644
--- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
+++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
@@ -108,6 +108,13 @@ edp3_connector_in: endpoint {
 			};
 		};
 	};
+
+	reserved-memory {
+		gpu_mem: gpu-mem@8bf00000 {
+			reg = <0 0x8bf00000 0 0x2000>;
+			no-map;
+		};
+	};
 };
 
 &apps_rsc {
@@ -286,6 +293,28 @@ vdd_gfx: regulator@39 {
 	};
 };
 
+&gpucc {
+	vdd-gfx-supply = <&vdd_gfx>;
+	status = "okay";
+};
+
+&gmu {
+	status = "okay";
+};
+
+&gpu {
+	status = "okay";
+
+	zap-shader {
+		memory-region = <&gpu_mem>;
+		firmware-name = "qcom/sa8295p/a690_zap.mbn";
+	};
+};
+
+&gpu_smmu {
+	status = "okay";
+};
+
 &mdss0 {
 	status = "okay";
 };

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 8/8] arm64: defconfig: Enable MAX20411 regulator driver
  2024-01-24  4:25 [PATCH v3 0/8] arm64: dts: qcom: sa8295p: Enable GPU Bjorn Andersson
                   ` (6 preceding siblings ...)
  2024-01-24  4:25 ` [PATCH v3 7/8] arm64: dts: qcom: sa8295p-adp: Enable GPU Bjorn Andersson
@ 2024-01-24  4:25 ` Bjorn Andersson
  2024-01-24 12:35   ` Konrad Dybcio
  7 siblings, 1 reply; 17+ messages in thread
From: Bjorn Andersson @ 2024-01-24  4:25 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel, Bjorn Andersson

The Qualcomm SA8295P ADP board uses a max20411 to power the GPU
subsystem.

Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index e6cf3e5d63c3..43cd31f30fd2 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -752,6 +752,7 @@ CONFIG_REGULATOR_HI6421V530=y
 CONFIG_REGULATOR_HI655X=y
 CONFIG_REGULATOR_MAX77620=y
 CONFIG_REGULATOR_MAX8973=y
+CONFIG_REGULATOR_MAX20411=m
 CONFIG_REGULATOR_MP8859=y
 CONFIG_REGULATOR_MT6315=m
 CONFIG_REGULATOR_MT6357=y

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/8] dt-bindings: clock: qcom: Allow VDD_GFX supply to GX
  2024-01-24  4:25 ` [PATCH v3 1/8] dt-bindings: clock: qcom: Allow VDD_GFX supply to GX Bjorn Andersson
@ 2024-01-24  6:31   ` Krzysztof Kozlowski
  2024-01-24 21:21     ` Bjorn Andersson
  0 siblings, 1 reply; 17+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-24  6:31 UTC (permalink / raw)
  To: Bjorn Andersson, Bjorn Andersson, Konrad Dybcio,
	Michael Turquette, Stephen Boyd, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Taniya Das, Johan Hovold
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel

On 24/01/2024 05:25, Bjorn Andersson wrote:
> +# Allow either power-domains or vdd-gfx-supply, not both
> +oneOf:
> +  - required:
> +      - power-domains
> +  - required:
> +      - vdd-gfx-supply
> +  - not:
> +      anyOf:
> +        - required:
> +            - power-domains
> +        - required:
> +            - vdd-gfx-supply

I don't fully understand what you want to achieve here. If only "allow
either", so not a "require either", then simpler:

https://lore.kernel.org/all/20230118163208.GA117919-robh@kernel.org/


Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 4/8] soc: qcom: rpmhpd: Drop SA8540P gfx.lvl
  2024-01-24  4:25 ` [PATCH v3 4/8] soc: qcom: rpmhpd: Drop SA8540P gfx.lvl Bjorn Andersson
@ 2024-01-24  9:36   ` Ulf Hansson
  2024-01-24 21:23     ` Bjorn Andersson
  0 siblings, 1 reply; 17+ messages in thread
From: Ulf Hansson @ 2024-01-24  9:36 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold, linux-arm-msm, linux-clk, devicetree, linux-kernel,
	linux-pm, linux-arm-kernel, Dmitry Baryshkov

On Wed, 24 Jan 2024 at 05:25, Bjorn Andersson <quic_bjorande@quicinc.com> wrote:
>
> On SA8295P and SA8540P gfx.lvl is not provdied by rpmh, but rather is
> handled by an external regulator (max20411). Drop gfx.lvl from the list
> of power-domains exposed on this platform.
>
> Fixes: f68f1cb3437d ("soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains")
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>

I assume you are picking this via your tree? If not, please tell me if I should.

Before applying, please amend the prefix of commit message header to
be "pmdomain: ..."

Kind regards
Uffe

> ---
>  drivers/pmdomain/qcom/rpmhpd.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/pmdomain/qcom/rpmhpd.c b/drivers/pmdomain/qcom/rpmhpd.c
> index 3078896b1300..27a73ff72614 100644
> --- a/drivers/pmdomain/qcom/rpmhpd.c
> +++ b/drivers/pmdomain/qcom/rpmhpd.c
> @@ -217,7 +217,6 @@ static struct rpmhpd *sa8540p_rpmhpds[] = {
>         [SC8280XP_CX] = &cx,
>         [SC8280XP_CX_AO] = &cx_ao,
>         [SC8280XP_EBI] = &ebi,
> -       [SC8280XP_GFX] = &gfx,
>         [SC8280XP_LCX] = &lcx,
>         [SC8280XP_LMX] = &lmx,
>         [SC8280XP_MMCX] = &mmcx,
>
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 6/8] arm64: dts: qcom: sa8295p-adp: add max20411
  2024-01-24  4:25 ` [PATCH v3 6/8] arm64: dts: qcom: sa8295p-adp: add max20411 Bjorn Andersson
@ 2024-01-24 12:35   ` Konrad Dybcio
  0 siblings, 0 replies; 17+ messages in thread
From: Konrad Dybcio @ 2024-01-24 12:35 UTC (permalink / raw)
  To: Bjorn Andersson, Bjorn Andersson, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Taniya Das, Johan Hovold
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel



On 1/24/24 05:25, Bjorn Andersson wrote:
> From: Bjorn Andersson <andersson@kernel.org>
> 
> The SA8295P ADP has a MAX20411 LDO regulator on I2C 12, supplying the
> VDD_GFX pads. Enable the bus and add the maxim,max20411 device on the
> bus.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Missing submitter signoff, but I'll trust you're the same Bjorn
Andersson!

> ---

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

Konrad

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 8/8] arm64: defconfig: Enable MAX20411 regulator driver
  2024-01-24  4:25 ` [PATCH v3 8/8] arm64: defconfig: Enable MAX20411 regulator driver Bjorn Andersson
@ 2024-01-24 12:35   ` Konrad Dybcio
  0 siblings, 0 replies; 17+ messages in thread
From: Konrad Dybcio @ 2024-01-24 12:35 UTC (permalink / raw)
  To: Bjorn Andersson, Bjorn Andersson, Michael Turquette,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Taniya Das, Johan Hovold
  Cc: linux-arm-msm, linux-clk, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel



On 1/24/24 05:25, Bjorn Andersson wrote:
> The Qualcomm SA8295P ADP board uses a max20411 to power the GPU
> subsystem.
> 
> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
> ---

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

Konrad

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/8] dt-bindings: clock: qcom: Allow VDD_GFX supply to GX
  2024-01-24  6:31   ` Krzysztof Kozlowski
@ 2024-01-24 21:21     ` Bjorn Andersson
  2024-01-25  7:39       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 17+ messages in thread
From: Bjorn Andersson @ 2024-01-24 21:21 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold, linux-arm-msm, linux-clk, devicetree, linux-kernel,
	linux-pm, linux-arm-kernel

On Wed, Jan 24, 2024 at 07:31:34AM +0100, Krzysztof Kozlowski wrote:
> On 24/01/2024 05:25, Bjorn Andersson wrote:
> > +# Allow either power-domains or vdd-gfx-supply, not both
> > +oneOf:
> > +  - required:
> > +      - power-domains
> > +  - required:
> > +      - vdd-gfx-supply
> > +  - not:
> > +      anyOf:
> > +        - required:
> > +            - power-domains
> > +        - required:
> > +            - vdd-gfx-supply
> 
> I don't fully understand what you want to achieve here. If only "allow
> either", so not a "require either", then simpler:
> 
> https://lore.kernel.org/all/20230118163208.GA117919-robh@kernel.org/
> 

As discussed in v2, power-domains is currently an optional property in
this binding and I'm adding vdd-gfx-supply as an alternative to that.

As it's optional, barely any of our platforms define the property, so
requiring this would not be compatible with existing DT source.

It's clear that this does not accurately represent the power situation
for the block, so we should fix this. But I'd prefer to see that as a
separate task.


Implementation-wise, we need to figure how to consume multiple
power-domains in the GPUCC drivers in Linux, because the correct
definition seems to be to add both CX and GX/GFX domains here - and if
we just add them to the DT node Linux will break.

Regards,
Bjorn

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 4/8] soc: qcom: rpmhpd: Drop SA8540P gfx.lvl
  2024-01-24  9:36   ` Ulf Hansson
@ 2024-01-24 21:23     ` Bjorn Andersson
  0 siblings, 0 replies; 17+ messages in thread
From: Bjorn Andersson @ 2024-01-24 21:23 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold, linux-arm-msm, linux-clk, devicetree, linux-kernel,
	linux-pm, linux-arm-kernel, Dmitry Baryshkov

On Wed, Jan 24, 2024 at 10:36:34AM +0100, Ulf Hansson wrote:
> On Wed, 24 Jan 2024 at 05:25, Bjorn Andersson <quic_bjorande@quicinc.com> wrote:
> >
> > On SA8295P and SA8540P gfx.lvl is not provdied by rpmh, but rather is
> > handled by an external regulator (max20411). Drop gfx.lvl from the list
> > of power-domains exposed on this platform.
> >
> > Fixes: f68f1cb3437d ("soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains")
> > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
> > Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
> 
> I assume you are picking this via your tree? If not, please tell me if I should.
> 

That sounds good, thanks.

> Before applying, please amend the prefix of commit message header to
> be "pmdomain: ..."
> 

Thanks for noticing, I will update accordingly.

Regards,
Bjorn

> Kind regards
> Uffe
> 
> > ---
> >  drivers/pmdomain/qcom/rpmhpd.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/pmdomain/qcom/rpmhpd.c b/drivers/pmdomain/qcom/rpmhpd.c
> > index 3078896b1300..27a73ff72614 100644
> > --- a/drivers/pmdomain/qcom/rpmhpd.c
> > +++ b/drivers/pmdomain/qcom/rpmhpd.c
> > @@ -217,7 +217,6 @@ static struct rpmhpd *sa8540p_rpmhpds[] = {
> >         [SC8280XP_CX] = &cx,
> >         [SC8280XP_CX_AO] = &cx_ao,
> >         [SC8280XP_EBI] = &ebi,
> > -       [SC8280XP_GFX] = &gfx,
> >         [SC8280XP_LCX] = &lcx,
> >         [SC8280XP_LMX] = &lmx,
> >         [SC8280XP_MMCX] = &mmcx,
> >
> > --
> > 2.25.1
> >

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/8] dt-bindings: clock: qcom: Allow VDD_GFX supply to GX
  2024-01-24 21:21     ` Bjorn Andersson
@ 2024-01-25  7:39       ` Krzysztof Kozlowski
  2024-01-25 21:00         ` Bjorn Andersson
  0 siblings, 1 reply; 17+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-25  7:39 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold, linux-arm-msm, linux-clk, devicetree, linux-kernel,
	linux-pm, linux-arm-kernel

On 24/01/2024 22:21, Bjorn Andersson wrote:
> On Wed, Jan 24, 2024 at 07:31:34AM +0100, Krzysztof Kozlowski wrote:
>> On 24/01/2024 05:25, Bjorn Andersson wrote:
>>> +# Allow either power-domains or vdd-gfx-supply, not both
>>> +oneOf:
>>> +  - required:
>>> +      - power-domains
>>> +  - required:
>>> +      - vdd-gfx-supply
>>> +  - not:
>>> +      anyOf:
>>> +        - required:
>>> +            - power-domains
>>> +        - required:
>>> +            - vdd-gfx-supply
>>
>> I don't fully understand what you want to achieve here. If only "allow
>> either", so not a "require either", then simpler:
>>
>> https://lore.kernel.org/all/20230118163208.GA117919-robh@kernel.org/
>>
> 
> As discussed in v2, power-domains is currently an optional property in
> this binding and I'm adding vdd-gfx-supply as an alternative to that.
> 

Then go with Rob's syntax - not:required: Much easier code.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/8] dt-bindings: clock: qcom: Allow VDD_GFX supply to GX
  2024-01-25  7:39       ` Krzysztof Kozlowski
@ 2024-01-25 21:00         ` Bjorn Andersson
  0 siblings, 0 replies; 17+ messages in thread
From: Bjorn Andersson @ 2024-01-25 21:00 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Bjorn Andersson, Konrad Dybcio, Michael Turquette, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Taniya Das,
	Johan Hovold, linux-arm-msm, linux-clk, devicetree, linux-kernel,
	linux-pm, linux-arm-kernel

On Thu, Jan 25, 2024 at 08:39:15AM +0100, Krzysztof Kozlowski wrote:
> On 24/01/2024 22:21, Bjorn Andersson wrote:
> > On Wed, Jan 24, 2024 at 07:31:34AM +0100, Krzysztof Kozlowski wrote:
> >> On 24/01/2024 05:25, Bjorn Andersson wrote:
> >>> +# Allow either power-domains or vdd-gfx-supply, not both
> >>> +oneOf:
> >>> +  - required:
> >>> +      - power-domains
> >>> +  - required:
> >>> +      - vdd-gfx-supply
> >>> +  - not:
> >>> +      anyOf:
> >>> +        - required:
> >>> +            - power-domains
> >>> +        - required:
> >>> +            - vdd-gfx-supply
> >>
> >> I don't fully understand what you want to achieve here. If only "allow
> >> either", so not a "require either", then simpler:
> >>
> >> https://lore.kernel.org/all/20230118163208.GA117919-robh@kernel.org/
> >>
> > 
> > As discussed in v2, power-domains is currently an optional property in
> > this binding and I'm adding vdd-gfx-supply as an alternative to that.
> > 
> 
> Then go with Rob's syntax - not:required: Much easier code.
> 

I looked at it, but was not able to understand that it expressed my
desired result. Now I do, and I agree with you, so will update it.

Thanks,
Bjorn

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-01-25 21:00 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-24  4:25 [PATCH v3 0/8] arm64: dts: qcom: sa8295p: Enable GPU Bjorn Andersson
2024-01-24  4:25 ` [PATCH v3 1/8] dt-bindings: clock: qcom: Allow VDD_GFX supply to GX Bjorn Andersson
2024-01-24  6:31   ` Krzysztof Kozlowski
2024-01-24 21:21     ` Bjorn Andersson
2024-01-25  7:39       ` Krzysztof Kozlowski
2024-01-25 21:00         ` Bjorn Andersson
2024-01-24  4:25 ` [PATCH v3 2/8] clk: qcom: gdsc: Enable supply reglator in GPU GX handler Bjorn Andersson
2024-01-24  4:25 ` [PATCH v3 3/8] clk: qcom: gpucc-sc8280xp: Add external supply for GX gdsc Bjorn Andersson
2024-01-24  4:25 ` [PATCH v3 4/8] soc: qcom: rpmhpd: Drop SA8540P gfx.lvl Bjorn Andersson
2024-01-24  9:36   ` Ulf Hansson
2024-01-24 21:23     ` Bjorn Andersson
2024-01-24  4:25 ` [PATCH v3 5/8] arm64: dts: qcom: sa8540p: Drop gfx.lvl as power-domain for gpucc Bjorn Andersson
2024-01-24  4:25 ` [PATCH v3 6/8] arm64: dts: qcom: sa8295p-adp: add max20411 Bjorn Andersson
2024-01-24 12:35   ` Konrad Dybcio
2024-01-24  4:25 ` [PATCH v3 7/8] arm64: dts: qcom: sa8295p-adp: Enable GPU Bjorn Andersson
2024-01-24  4:25 ` [PATCH v3 8/8] arm64: defconfig: Enable MAX20411 regulator driver Bjorn Andersson
2024-01-24 12:35   ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).