All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] SM8[12]50 GPU speedbin
@ 2022-12-13  0:24 Konrad Dybcio
  2022-12-13  0:24 ` [PATCH 1/7] dt-bindings: nvmem: Add compatible for SM8150 Konrad Dybcio
                   ` (6 more replies)
  0 siblings, 7 replies; 24+ messages in thread
From: Konrad Dybcio @ 2022-12-13  0:24 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Konrad Dybcio

This series brings SM8[12]50 (A6[45]0) speedbin support along with a
touch-up for 8150, allowing Adreno to cooperate with the display hw.

Tested on Xperia 5 II (SM8250 Edo PDX206) and Xperia 5 (SM8150 Kumano
Bahamut).

Konrad Dybcio (7):
  dt-bindings: nvmem: Add compatible for SM8150
  dt-bindings: nvmem: Add compatible for SM8250
  drm/msm/a6xx: Add support for A640 speed binning
  drm/msm/a6xx: Add support for A650 speed binning
  arm64: dts: qcom: sm8150: Don't start Adreno in headless mode
  arm64: dts: qcom: sm8150: Add GPU speedbin support
  arm64: dts: qcom: sm8250: Add GPU speedbin support

 .../bindings/nvmem/qcom,qfprom.yaml           |  2 ++
 arch/arm64/boot/dts/qcom/sm8150-hdk.dts       |  5 ++++
 arch/arm64/boot/dts/qcom/sm8150-mtp.dts       |  5 ++++
 arch/arm64/boot/dts/qcom/sm8150.dtsi          | 30 +++++++++++++------
 arch/arm64/boot/dts/qcom/sm8250.dtsi          | 23 +++++++++++++-
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c         | 30 +++++++++++++++++++
 6 files changed, 85 insertions(+), 10 deletions(-)

-- 
2.39.0


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

* [PATCH 1/7] dt-bindings: nvmem: Add compatible for SM8150
  2022-12-13  0:24 [PATCH 0/7] SM8[12]50 GPU speedbin Konrad Dybcio
@ 2022-12-13  0:24 ` Konrad Dybcio
  2022-12-13 13:16   ` Krzysztof Kozlowski
  2023-01-03 11:58   ` Srinivas Kandagatla
  2022-12-13  0:24 ` [PATCH 2/7] dt-bindings: nvmem: Add compatible for SM8250 Konrad Dybcio
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 24+ messages in thread
From: Konrad Dybcio @ 2022-12-13  0:24 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Konrad Dybcio, Srinivas Kandagatla, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

Docuemnt the QFPROM on SM8150.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml b/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
index ca744f5890ff..a1305fd68f67 100644
--- a/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
+++ b/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
@@ -30,6 +30,7 @@ properties:
           - qcom,sdm845-qfprom
           - qcom,sm6115-qfprom
           - qcom,sm6350-qfprom
+          - qcom,sm8150-qfprom
       - const: qcom,qfprom
 
   reg:
-- 
2.39.0


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

* [PATCH 2/7] dt-bindings: nvmem: Add compatible for SM8250
  2022-12-13  0:24 [PATCH 0/7] SM8[12]50 GPU speedbin Konrad Dybcio
  2022-12-13  0:24 ` [PATCH 1/7] dt-bindings: nvmem: Add compatible for SM8150 Konrad Dybcio
@ 2022-12-13  0:24 ` Konrad Dybcio
  2022-12-13 13:16   ` Krzysztof Kozlowski
  2023-01-03 11:58   ` Srinivas Kandagatla
  2022-12-13  0:24   ` Konrad Dybcio
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 24+ messages in thread
From: Konrad Dybcio @ 2022-12-13  0:24 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Konrad Dybcio, Srinivas Kandagatla, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

Docuemnt the QFPROM on SM8250.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml b/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
index a1305fd68f67..c3d909387e07 100644
--- a/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
+++ b/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
@@ -31,6 +31,7 @@ properties:
           - qcom,sm6115-qfprom
           - qcom,sm6350-qfprom
           - qcom,sm8150-qfprom
+          - qcom,sm8250-qfprom
       - const: qcom,qfprom
 
   reg:
-- 
2.39.0


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

* [PATCH 3/7] drm/msm/a6xx: Add support for A640 speed binning
  2022-12-13  0:24 [PATCH 0/7] SM8[12]50 GPU speedbin Konrad Dybcio
@ 2022-12-13  0:24   ` Konrad Dybcio
  2022-12-13  0:24 ` [PATCH 2/7] dt-bindings: nvmem: Add compatible for SM8250 Konrad Dybcio
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 24+ messages in thread
From: Konrad Dybcio @ 2022-12-13  0:24 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Konrad Dybcio, Rob Clark, Abhinav Kumar,
	Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
	Akhil P Oommen, Chia-I Wu, Douglas Anderson, dri-devel,
	freedreno, linux-kernel

Add support for matching QFPROM fuse values to get the correct speed bin
on A640 (SM8150) GPUs.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 36c8fb699b56..2c1630f0c04c 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -1877,6 +1877,16 @@ static u32 a619_get_speed_bin(u32 fuse)
 	return UINT_MAX;
 }
 
+static u32 a640_get_speed_bin(u32 fuse)
+{
+	if (fuse == 0)
+		return 0;
+	else if (fuse == 1)
+		return 1;
+
+	return UINT_MAX;
+}
+
 static u32 adreno_7c3_get_speed_bin(u32 fuse)
 {
 	if (fuse == 0)
@@ -1902,6 +1912,9 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
 	if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev))
 		val = adreno_7c3_get_speed_bin(fuse);
 
+	if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev))
+		val = a640_get_speed_bin(fuse);
+
 	if (val == UINT_MAX) {
 		DRM_DEV_ERROR(dev,
 			"missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n",
-- 
2.39.0


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

* [PATCH 3/7] drm/msm/a6xx: Add support for A640 speed binning
@ 2022-12-13  0:24   ` Konrad Dybcio
  0 siblings, 0 replies; 24+ messages in thread
From: Konrad Dybcio @ 2022-12-13  0:24 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: freedreno, Akhil P Oommen, Abhinav Kumar, dri-devel,
	Douglas Anderson, Konrad Dybcio, Dmitry Baryshkov,
	marijn.suijten, Sean Paul, linux-kernel

Add support for matching QFPROM fuse values to get the correct speed bin
on A640 (SM8150) GPUs.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 36c8fb699b56..2c1630f0c04c 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -1877,6 +1877,16 @@ static u32 a619_get_speed_bin(u32 fuse)
 	return UINT_MAX;
 }
 
+static u32 a640_get_speed_bin(u32 fuse)
+{
+	if (fuse == 0)
+		return 0;
+	else if (fuse == 1)
+		return 1;
+
+	return UINT_MAX;
+}
+
 static u32 adreno_7c3_get_speed_bin(u32 fuse)
 {
 	if (fuse == 0)
@@ -1902,6 +1912,9 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
 	if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev))
 		val = adreno_7c3_get_speed_bin(fuse);
 
+	if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev))
+		val = a640_get_speed_bin(fuse);
+
 	if (val == UINT_MAX) {
 		DRM_DEV_ERROR(dev,
 			"missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n",
-- 
2.39.0


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

* [PATCH 4/7] drm/msm/a6xx: Add support for A650 speed binning
  2022-12-13  0:24 [PATCH 0/7] SM8[12]50 GPU speedbin Konrad Dybcio
@ 2022-12-13  0:24   ` Konrad Dybcio
  2022-12-13  0:24 ` [PATCH 2/7] dt-bindings: nvmem: Add compatible for SM8250 Konrad Dybcio
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 24+ messages in thread
From: Konrad Dybcio @ 2022-12-13  0:24 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Konrad Dybcio, Rob Clark, Abhinav Kumar,
	Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
	Akhil P Oommen, Chia-I Wu, Douglas Anderson, dri-devel,
	freedreno, linux-kernel

Add support for matching QFPROM fuse values to get the correct speed bin
on A650 (SM8250) GPUs.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 2c1630f0c04c..f139ec57c32d 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -1887,6 +1887,20 @@ static u32 a640_get_speed_bin(u32 fuse)
 	return UINT_MAX;
 }
 
+static u32 a650_get_speed_bin(u32 fuse)
+{
+	if (fuse == 0)
+		return 0;
+	else if (fuse == 1)
+		return 1;
+	else if (fuse == 2)
+		return 2;
+	else if (fuse == 3)
+		return 3;
+
+	return UINT_MAX;
+}
+
 static u32 adreno_7c3_get_speed_bin(u32 fuse)
 {
 	if (fuse == 0)
@@ -1915,6 +1929,9 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
 	if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev))
 		val = a640_get_speed_bin(fuse);
 
+	if (adreno_cmp_rev(ADRENO_REV(6, 5, 0, ANY_ID), rev))
+		val = a650_get_speed_bin(fuse);
+
 	if (val == UINT_MAX) {
 		DRM_DEV_ERROR(dev,
 			"missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n",
-- 
2.39.0


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

* [PATCH 4/7] drm/msm/a6xx: Add support for A650 speed binning
@ 2022-12-13  0:24   ` Konrad Dybcio
  0 siblings, 0 replies; 24+ messages in thread
From: Konrad Dybcio @ 2022-12-13  0:24 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: freedreno, Akhil P Oommen, Abhinav Kumar, dri-devel,
	Douglas Anderson, Konrad Dybcio, Dmitry Baryshkov,
	marijn.suijten, Sean Paul, linux-kernel

Add support for matching QFPROM fuse values to get the correct speed bin
on A650 (SM8250) GPUs.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 2c1630f0c04c..f139ec57c32d 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -1887,6 +1887,20 @@ static u32 a640_get_speed_bin(u32 fuse)
 	return UINT_MAX;
 }
 
+static u32 a650_get_speed_bin(u32 fuse)
+{
+	if (fuse == 0)
+		return 0;
+	else if (fuse == 1)
+		return 1;
+	else if (fuse == 2)
+		return 2;
+	else if (fuse == 3)
+		return 3;
+
+	return UINT_MAX;
+}
+
 static u32 adreno_7c3_get_speed_bin(u32 fuse)
 {
 	if (fuse == 0)
@@ -1915,6 +1929,9 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
 	if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev))
 		val = a640_get_speed_bin(fuse);
 
+	if (adreno_cmp_rev(ADRENO_REV(6, 5, 0, ANY_ID), rev))
+		val = a650_get_speed_bin(fuse);
+
 	if (val == UINT_MAX) {
 		DRM_DEV_ERROR(dev,
 			"missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n",
-- 
2.39.0


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

* [PATCH 5/7] arm64: dts: qcom: sm8150: Don't start Adreno in headless mode
  2022-12-13  0:24 [PATCH 0/7] SM8[12]50 GPU speedbin Konrad Dybcio
                   ` (3 preceding siblings ...)
  2022-12-13  0:24   ` Konrad Dybcio
@ 2022-12-13  0:24 ` Konrad Dybcio
  2022-12-15 21:24   ` Marijn Suijten
  2022-12-13  0:24 ` [PATCH 6/7] arm64: dts: qcom: sm8150: Add GPU speedbin support Konrad Dybcio
  2022-12-13  0:24 ` [PATCH 7/7] arm64: dts: qcom: sm8250: " Konrad Dybcio
  6 siblings, 1 reply; 24+ messages in thread
From: Konrad Dybcio @ 2022-12-13  0:24 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-kernel

Now that there's display support, there is no reason to assume the default
mode for Adreno should be headless. Keep it like that for boards that
previously enabled it, so as not to create regressions though.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8150-hdk.dts |  5 +++++
 arch/arm64/boot/dts/qcom/sm8150-mtp.dts |  5 +++++
 arch/arm64/boot/dts/qcom/sm8150.dtsi    | 10 +---------
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8150-hdk.dts b/arch/arm64/boot/dts/qcom/sm8150-hdk.dts
index 3331ee957d64..0ee5309408b9 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-hdk.dts
+++ b/arch/arm64/boot/dts/qcom/sm8150-hdk.dts
@@ -359,6 +359,11 @@ &gmu {
 };
 
 &gpu {
+	/*
+	 * NOTE: "amd,imageon" makes Adreno start in headless mode, remove it
+	 * after display support is added on this board.
+	 */
+	compatible = "qcom,adreno-640.1", "qcom,adreno", "amd,imageon";
 	status = "okay";
 };
 
diff --git a/arch/arm64/boot/dts/qcom/sm8150-mtp.dts b/arch/arm64/boot/dts/qcom/sm8150-mtp.dts
index 46b5cf9a1192..9dfecbf89b21 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-mtp.dts
+++ b/arch/arm64/boot/dts/qcom/sm8150-mtp.dts
@@ -354,6 +354,11 @@ &gmu {
 };
 
 &gpu {
+	/*
+	 * NOTE: "amd,imageon" makes Adreno start in headless mode, remove it
+	 * after display support is added on this board.
+	 */
+	compatible = "qcom,adreno-640.1", "qcom,adreno", "amd,imageon";
 	status = "okay";
 };
 
diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index fad70032a98a..e160acb47cd9 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -2125,15 +2125,7 @@ compute-cb@3 {
 		};
 
 		gpu: gpu@2c00000 {
-			/*
-			 * note: the amd,imageon compatible makes it possible
-			 * to use the drm/msm driver without the display node,
-			 * make sure to remove it when display node is added
-			 */
-			compatible = "qcom,adreno-640.1",
-				     "qcom,adreno",
-				     "amd,imageon";
-
+			compatible = "qcom,adreno-640.1", "qcom,adreno";
 			reg = <0 0x02c00000 0 0x40000>;
 			reg-names = "kgsl_3d0_reg_memory";
 
-- 
2.39.0


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

* [PATCH 6/7] arm64: dts: qcom: sm8150: Add GPU speedbin support
  2022-12-13  0:24 [PATCH 0/7] SM8[12]50 GPU speedbin Konrad Dybcio
                   ` (4 preceding siblings ...)
  2022-12-13  0:24 ` [PATCH 5/7] arm64: dts: qcom: sm8150: Don't start Adreno in headless mode Konrad Dybcio
@ 2022-12-13  0:24 ` Konrad Dybcio
  2022-12-15 21:25   ` Marijn Suijten
  2022-12-15 22:37   ` Marijn Suijten
  2022-12-13  0:24 ` [PATCH 7/7] arm64: dts: qcom: sm8250: " Konrad Dybcio
  6 siblings, 2 replies; 24+ messages in thread
From: Konrad Dybcio @ 2022-12-13  0:24 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-kernel

SM8150 has (at least) two GPU speed bins. With the support added on the
driver side, wire up bin detection in the DTS to restrict lower-quality
SKUs from running at frequencies they were not validated at.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8150.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index e160acb47cd9..3f940cc3f32b 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -936,6 +936,17 @@ ethernet: ethernet@20000 {
 			status = "disabled";
 		};
 
+		qfprom: efuse@784000 {
+			compatible = "qcom,sm8150-qfprom", "qcom,qfprom";
+			reg = <0 0x00784000 0 0x8ff>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			gpu_speed_bin: gpu_speed_bin@133 {
+				reg = <0x133 0x1>;
+				bits = <5 3>;
+			};
+		};
 
 		qupv3_id_0: geniqup@8c0000 {
 			compatible = "qcom,geni-se-qup";
@@ -2137,6 +2148,9 @@ gpu: gpu@2c00000 {
 
 			qcom,gmu = <&gmu>;
 
+			nvmem-cells = <&gpu_speed_bin>;
+			nvmem-cell-names = "speed_bin";
+
 			status = "disabled";
 
 			zap-shader {
@@ -2150,31 +2164,37 @@ gpu_opp_table: opp-table {
 				opp-675000000 {
 					opp-hz = /bits/ 64 <675000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
+					opp-supported-hw = <0x2>;
 				};
 
 				opp-585000000 {
 					opp-hz = /bits/ 64 <585000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
+					opp-supported-hw = <0x3>;
 				};
 
 				opp-499200000 {
 					opp-hz = /bits/ 64 <499200000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_SVS_L2>;
+					opp-supported-hw = <0x3>;
 				};
 
 				opp-427000000 {
 					opp-hz = /bits/ 64 <427000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
+					opp-supported-hw = <0x3>;
 				};
 
 				opp-345000000 {
 					opp-hz = /bits/ 64 <345000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
+					opp-supported-hw = <0x3>;
 				};
 
 				opp-257000000 {
 					opp-hz = /bits/ 64 <257000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
+					opp-supported-hw = <0x3>;
 				};
 			};
 		};
-- 
2.39.0


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

* [PATCH 7/7] arm64: dts: qcom: sm8250: Add GPU speedbin support
  2022-12-13  0:24 [PATCH 0/7] SM8[12]50 GPU speedbin Konrad Dybcio
                   ` (5 preceding siblings ...)
  2022-12-13  0:24 ` [PATCH 6/7] arm64: dts: qcom: sm8150: Add GPU speedbin support Konrad Dybcio
@ 2022-12-13  0:24 ` Konrad Dybcio
  2022-12-15 22:36   ` Marijn Suijten
  6 siblings, 1 reply; 24+ messages in thread
From: Konrad Dybcio @ 2022-12-13  0:24 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-kernel

SM8250 has (at least) four GPU speed bins. With the support added on the
driver side, wire up bin detection in the DTS to restrict lower-quality
SKUs from running at frequencies they were not validated at.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 arch/arm64/boot/dts/qcom/sm8250.dtsi | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
index c008f49b5852..0c4ecdab1244 100644
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
@@ -955,6 +955,18 @@ ipcc: mailbox@408000 {
 			#mbox-cells = <2>;
 		};
 
+		qfprom: efuse@784000 {
+			compatible = "qcom,sm8250-qfprom", "qcom,qfprom";
+			reg = <0 0x00784000 0 0x8ff>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			gpu_speed_bin: gpu_speed_bin@19b {
+				reg = <0x19b 0x1>;
+				bits = <5 3>;
+			};
+		};
+
 		rng: rng@793000 {
 			compatible = "qcom,prng-ee";
 			reg = <0 0x00793000 0 0x1000>;
@@ -2563,49 +2575,58 @@ gpu: gpu@3d00000 {
 
 			qcom,gmu = <&gmu>;
 
+			nvmem-cells = <&gpu_speed_bin>;
+			nvmem-cell-names = "speed_bin";
+
 			status = "disabled";
 
 			zap-shader {
 				memory-region = <&gpu_mem>;
 			};
 
-			/* note: downstream checks gpu binning for 670 Mhz */
 			gpu_opp_table: opp-table {
 				compatible = "operating-points-v2";
 
 				opp-670000000 {
 					opp-hz = /bits/ 64 <670000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
+					opp-supported-hw = <0x6>;
 				};
 
 				opp-587000000 {
 					opp-hz = /bits/ 64 <587000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
+					opp-supported-hw = <0x7>;
 				};
 
 				opp-525000000 {
 					opp-hz = /bits/ 64 <525000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_SVS_L2>;
+					opp-supported-hw = <0xf>;
 				};
 
 				opp-490000000 {
 					opp-hz = /bits/ 64 <490000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
+					opp-supported-hw = <0xf>;
 				};
 
 				opp-441600000 {
 					opp-hz = /bits/ 64 <441600000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_SVS_L0>;
+					opp-supported-hw = <0xf>;
 				};
 
 				opp-400000000 {
 					opp-hz = /bits/ 64 <400000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
+					opp-supported-hw = <0xf>;
 				};
 
 				opp-305000000 {
 					opp-hz = /bits/ 64 <305000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
+					opp-supported-hw = <0xf>;
 				};
 			};
 		};
-- 
2.39.0


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

* Re: [PATCH 3/7] drm/msm/a6xx: Add support for A640 speed binning
  2022-12-13  0:24   ` Konrad Dybcio
@ 2022-12-13  7:06     ` Akhil P Oommen
  -1 siblings, 0 replies; 24+ messages in thread
From: Akhil P Oommen @ 2022-12-13  7:06 UTC (permalink / raw)
  To: Konrad Dybcio, linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Rob Clark, Abhinav Kumar, Dmitry Baryshkov,
	Sean Paul, David Airlie, Daniel Vetter, Chia-I Wu,
	Douglas Anderson, dri-devel, freedreno, linux-kernel

On 12/13/2022 5:54 AM, Konrad Dybcio wrote:
> Add support for matching QFPROM fuse values to get the correct speed bin
> on A640 (SM8150) GPUs.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> index 36c8fb699b56..2c1630f0c04c 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> @@ -1877,6 +1877,16 @@ static u32 a619_get_speed_bin(u32 fuse)
>  	return UINT_MAX;
>  }
>  
> +static u32 a640_get_speed_bin(u32 fuse)
> +{
> +	if (fuse == 0)
> +		return 0;
> +	else if (fuse == 1)
> +		return 1;
> +
> +	return UINT_MAX;
> +}
> +
>  static u32 adreno_7c3_get_speed_bin(u32 fuse)
>  {
>  	if (fuse == 0)
> @@ -1902,6 +1912,9 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
>  	if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev))
>  		val = adreno_7c3_get_speed_bin(fuse);
>  
> +	if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev))
> +		val = a640_get_speed_bin(fuse);
> +
>  	if (val == UINT_MAX) {
>  		DRM_DEV_ERROR(dev,
>  			"missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n",

Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>


-Akhil.

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

* Re: [PATCH 3/7] drm/msm/a6xx: Add support for A640 speed binning
@ 2022-12-13  7:06     ` Akhil P Oommen
  0 siblings, 0 replies; 24+ messages in thread
From: Akhil P Oommen @ 2022-12-13  7:06 UTC (permalink / raw)
  To: Konrad Dybcio, linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: freedreno, Abhinav Kumar, dri-devel, Douglas Anderson,
	Dmitry Baryshkov, marijn.suijten, Sean Paul, linux-kernel

On 12/13/2022 5:54 AM, Konrad Dybcio wrote:
> Add support for matching QFPROM fuse values to get the correct speed bin
> on A640 (SM8150) GPUs.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> index 36c8fb699b56..2c1630f0c04c 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> @@ -1877,6 +1877,16 @@ static u32 a619_get_speed_bin(u32 fuse)
>  	return UINT_MAX;
>  }
>  
> +static u32 a640_get_speed_bin(u32 fuse)
> +{
> +	if (fuse == 0)
> +		return 0;
> +	else if (fuse == 1)
> +		return 1;
> +
> +	return UINT_MAX;
> +}
> +
>  static u32 adreno_7c3_get_speed_bin(u32 fuse)
>  {
>  	if (fuse == 0)
> @@ -1902,6 +1912,9 @@ static u32 fuse_to_supp_hw(struct device *dev, struct adreno_rev rev, u32 fuse)
>  	if (adreno_cmp_rev(ADRENO_REV(6, 3, 5, ANY_ID), rev))
>  		val = adreno_7c3_get_speed_bin(fuse);
>  
> +	if (adreno_cmp_rev(ADRENO_REV(6, 4, 0, ANY_ID), rev))
> +		val = a640_get_speed_bin(fuse);
> +
>  	if (val == UINT_MAX) {
>  		DRM_DEV_ERROR(dev,
>  			"missing support for speed-bin: %u. Some OPPs may not be supported by hardware\n",

Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>


-Akhil.

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

* Re: [PATCH 1/7] dt-bindings: nvmem: Add compatible for SM8150
  2022-12-13  0:24 ` [PATCH 1/7] dt-bindings: nvmem: Add compatible for SM8150 Konrad Dybcio
@ 2022-12-13 13:16   ` Krzysztof Kozlowski
  2023-01-03 11:58   ` Srinivas Kandagatla
  1 sibling, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-13 13:16 UTC (permalink / raw)
  To: Konrad Dybcio, linux-arm-msm, andersson, agross
  Cc: marijn.suijten, Srinivas Kandagatla, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

On 13/12/2022 01:24, Konrad Dybcio wrote:
> Docuemnt the QFPROM on SM8150.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml | 1 +


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH 2/7] dt-bindings: nvmem: Add compatible for SM8250
  2022-12-13  0:24 ` [PATCH 2/7] dt-bindings: nvmem: Add compatible for SM8250 Konrad Dybcio
@ 2022-12-13 13:16   ` Krzysztof Kozlowski
  2023-01-03 11:58   ` Srinivas Kandagatla
  1 sibling, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-13 13:16 UTC (permalink / raw)
  To: Konrad Dybcio, linux-arm-msm, andersson, agross
  Cc: marijn.suijten, Srinivas Kandagatla, Rob Herring,
	Krzysztof Kozlowski, devicetree, linux-kernel

On 13/12/2022 01:24, Konrad Dybcio wrote:
> Docuemnt the QFPROM on SM8250.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml | 1 +
>  1 file changed, 1 insertion(+)


Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH 4/7] drm/msm/a6xx: Add support for A650 speed binning
  2022-12-13  0:24   ` Konrad Dybcio
@ 2022-12-13 15:23     ` Doug Anderson
  -1 siblings, 0 replies; 24+ messages in thread
From: Doug Anderson @ 2022-12-13 15:23 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: linux-arm-msm, andersson, agross, krzysztof.kozlowski,
	marijn.suijten, Rob Clark, Abhinav Kumar, Dmitry Baryshkov,
	Sean Paul, David Airlie, Daniel Vetter, Akhil P Oommen,
	Chia-I Wu, dri-devel, freedreno, linux-kernel

Hi,

On Mon, Dec 12, 2022 at 4:24 PM Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>
> Add support for matching QFPROM fuse values to get the correct speed bin
> on A650 (SM8250) GPUs.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> index 2c1630f0c04c..f139ec57c32d 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> @@ -1887,6 +1887,20 @@ static u32 a640_get_speed_bin(u32 fuse)
>         return UINT_MAX;
>  }
>
> +static u32 a650_get_speed_bin(u32 fuse)
> +{
> +       if (fuse == 0)
> +               return 0;
> +       else if (fuse == 1)
> +               return 1;
> +       else if (fuse == 2)
> +               return 2;
> +       else if (fuse == 3)
> +               return 3;
> +
> +       return UINT_MAX;

Unlike some of the other functions, you don't need any complexity. Just do:

if (fuse <= 3)
  return fuse;

return UINT_MAX;


I'd also suggest that perhaps "UINT_MAX" isn't exactly the right
return value for when we have an unrecognized fuse. The return type
for the function is "u32" which is a fixed size type. UINT_MAX,
however, is a type that is automatically sized by the compiler. Though
it's unlikely, theoretically a compiler could be configured such that
"unsigned int" was something other than 32 bits. Ideally either the
return type would be changed to "unsigned int" or you'd return
0xffffffff as the sentinel value.

-Doug

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

* Re: [PATCH 4/7] drm/msm/a6xx: Add support for A650 speed binning
@ 2022-12-13 15:23     ` Doug Anderson
  0 siblings, 0 replies; 24+ messages in thread
From: Doug Anderson @ 2022-12-13 15:23 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: freedreno, Akhil P Oommen, linux-arm-msm, andersson,
	krzysztof.kozlowski, dri-devel, Abhinav Kumar, agross,
	Dmitry Baryshkov, marijn.suijten, Sean Paul, linux-kernel

Hi,

On Mon, Dec 12, 2022 at 4:24 PM Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>
> Add support for matching QFPROM fuse values to get the correct speed bin
> on A650 (SM8250) GPUs.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> index 2c1630f0c04c..f139ec57c32d 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> @@ -1887,6 +1887,20 @@ static u32 a640_get_speed_bin(u32 fuse)
>         return UINT_MAX;
>  }
>
> +static u32 a650_get_speed_bin(u32 fuse)
> +{
> +       if (fuse == 0)
> +               return 0;
> +       else if (fuse == 1)
> +               return 1;
> +       else if (fuse == 2)
> +               return 2;
> +       else if (fuse == 3)
> +               return 3;
> +
> +       return UINT_MAX;

Unlike some of the other functions, you don't need any complexity. Just do:

if (fuse <= 3)
  return fuse;

return UINT_MAX;


I'd also suggest that perhaps "UINT_MAX" isn't exactly the right
return value for when we have an unrecognized fuse. The return type
for the function is "u32" which is a fixed size type. UINT_MAX,
however, is a type that is automatically sized by the compiler. Though
it's unlikely, theoretically a compiler could be configured such that
"unsigned int" was something other than 32 bits. Ideally either the
return type would be changed to "unsigned int" or you'd return
0xffffffff as the sentinel value.

-Doug

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

* Re: [PATCH 4/7] drm/msm/a6xx: Add support for A650 speed binning
  2022-12-13 15:23     ` Doug Anderson
@ 2022-12-13 15:34       ` Konrad Dybcio
  -1 siblings, 0 replies; 24+ messages in thread
From: Konrad Dybcio @ 2022-12-13 15:34 UTC (permalink / raw)
  To: Doug Anderson
  Cc: linux-arm-msm, andersson, agross, krzysztof.kozlowski,
	marijn.suijten, Rob Clark, Abhinav Kumar, Dmitry Baryshkov,
	Sean Paul, David Airlie, Daniel Vetter, Akhil P Oommen,
	Chia-I Wu, dri-devel, freedreno, linux-kernel



On 13.12.2022 16:23, Doug Anderson wrote:
> Hi,
> 
> On Mon, Dec 12, 2022 at 4:24 PM Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>>
>> Add support for matching QFPROM fuse values to get the correct speed bin
>> on A650 (SM8250) GPUs.
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>>  drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 17 +++++++++++++++++
>>  1 file changed, 17 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>> index 2c1630f0c04c..f139ec57c32d 100644
>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>> @@ -1887,6 +1887,20 @@ static u32 a640_get_speed_bin(u32 fuse)
>>         return UINT_MAX;
>>  }
>>
>> +static u32 a650_get_speed_bin(u32 fuse)
>> +{
>> +       if (fuse == 0)
>> +               return 0;
>> +       else if (fuse == 1)
>> +               return 1;
>> +       else if (fuse == 2)
>> +               return 2;
>> +       else if (fuse == 3)
>> +               return 3;
>> +
>> +       return UINT_MAX;
> 
> Unlike some of the other functions, you don't need any complexity. Just do:
> 
> if (fuse <= 3)
>   return fuse;
> 
> return UINT_MAX;
I'd prefer to keep it open-coded, it's just 8150 and 8250 that have
these simple fuse values, other SoCs have random numbers (check A618/
619 above, for example).. Plus the returned values might as well be
made-up, as it's just for opp matching.


> 
> 
> I'd also suggest that perhaps "UINT_MAX" isn't exactly the right
> return value for when we have an unrecognized fuse. The return type
> for the function is "u32" which is a fixed size type. UINT_MAX,
> however, is a type that is automatically sized by the compiler. Though
> it's unlikely, theoretically a compiler could be configured such that
> "unsigned int" was something other than 32 bits. Ideally either the
> return type would be changed to "unsigned int" or you'd return
> 0xffffffff as the sentinel value.
That's out of the scope of this patch, as it concerns all the
speedbin-supported GPUs. The returned value feeds 1<<ret, which
should be capped a bit lower than UINT_MAX, anyway. But I can
look into that in a separate patchset.

Konrad
> 
> -Doug

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

* Re: [PATCH 4/7] drm/msm/a6xx: Add support for A650 speed binning
@ 2022-12-13 15:34       ` Konrad Dybcio
  0 siblings, 0 replies; 24+ messages in thread
From: Konrad Dybcio @ 2022-12-13 15:34 UTC (permalink / raw)
  To: Doug Anderson
  Cc: freedreno, Akhil P Oommen, linux-arm-msm, andersson,
	krzysztof.kozlowski, dri-devel, Abhinav Kumar, agross,
	Dmitry Baryshkov, marijn.suijten, Sean Paul, linux-kernel



On 13.12.2022 16:23, Doug Anderson wrote:
> Hi,
> 
> On Mon, Dec 12, 2022 at 4:24 PM Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>>
>> Add support for matching QFPROM fuse values to get the correct speed bin
>> on A650 (SM8250) GPUs.
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>>  drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 17 +++++++++++++++++
>>  1 file changed, 17 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>> index 2c1630f0c04c..f139ec57c32d 100644
>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>> @@ -1887,6 +1887,20 @@ static u32 a640_get_speed_bin(u32 fuse)
>>         return UINT_MAX;
>>  }
>>
>> +static u32 a650_get_speed_bin(u32 fuse)
>> +{
>> +       if (fuse == 0)
>> +               return 0;
>> +       else if (fuse == 1)
>> +               return 1;
>> +       else if (fuse == 2)
>> +               return 2;
>> +       else if (fuse == 3)
>> +               return 3;
>> +
>> +       return UINT_MAX;
> 
> Unlike some of the other functions, you don't need any complexity. Just do:
> 
> if (fuse <= 3)
>   return fuse;
> 
> return UINT_MAX;
I'd prefer to keep it open-coded, it's just 8150 and 8250 that have
these simple fuse values, other SoCs have random numbers (check A618/
619 above, for example).. Plus the returned values might as well be
made-up, as it's just for opp matching.


> 
> 
> I'd also suggest that perhaps "UINT_MAX" isn't exactly the right
> return value for when we have an unrecognized fuse. The return type
> for the function is "u32" which is a fixed size type. UINT_MAX,
> however, is a type that is automatically sized by the compiler. Though
> it's unlikely, theoretically a compiler could be configured such that
> "unsigned int" was something other than 32 bits. Ideally either the
> return type would be changed to "unsigned int" or you'd return
> 0xffffffff as the sentinel value.
That's out of the scope of this patch, as it concerns all the
speedbin-supported GPUs. The returned value feeds 1<<ret, which
should be capped a bit lower than UINT_MAX, anyway. But I can
look into that in a separate patchset.

Konrad
> 
> -Doug

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

* Re: [PATCH 5/7] arm64: dts: qcom: sm8150: Don't start Adreno in headless mode
  2022-12-13  0:24 ` [PATCH 5/7] arm64: dts: qcom: sm8150: Don't start Adreno in headless mode Konrad Dybcio
@ 2022-12-15 21:24   ` Marijn Suijten
  0 siblings, 0 replies; 24+ messages in thread
From: Marijn Suijten @ 2022-12-15 21:24 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: linux-arm-msm, andersson, agross, krzysztof.kozlowski,
	Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel

On 2022-12-13 01:24:21, Konrad Dybcio wrote:
> Now that there's display support, there is no reason to assume the default
> mode for Adreno should be headless. Keep it like that for boards that
> previously enabled it, so as not to create regressions though.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Tested-by: Marijn Suijten <marijn.suijten@somainline.org> # On Sony Xperia 5
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>

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

* Re: [PATCH 6/7] arm64: dts: qcom: sm8150: Add GPU speedbin support
  2022-12-13  0:24 ` [PATCH 6/7] arm64: dts: qcom: sm8150: Add GPU speedbin support Konrad Dybcio
@ 2022-12-15 21:25   ` Marijn Suijten
  2022-12-15 22:37   ` Marijn Suijten
  1 sibling, 0 replies; 24+ messages in thread
From: Marijn Suijten @ 2022-12-15 21:25 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: linux-arm-msm, andersson, agross, krzysztof.kozlowski,
	Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel

On 2022-12-13 01:24:22, Konrad Dybcio wrote:
> SM8150 has (at least) two GPU speed bins. With the support added on the
> driver side, wire up bin detection in the DTS to restrict lower-quality
> SKUs from running at frequencies they were not validated at.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Tested-by: Marijn Suijten <marijn.suijten@somainline.org> # On Sony Xperia 5 (speed bin 0x3)
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>

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

* Re: [PATCH 7/7] arm64: dts: qcom: sm8250: Add GPU speedbin support
  2022-12-13  0:24 ` [PATCH 7/7] arm64: dts: qcom: sm8250: " Konrad Dybcio
@ 2022-12-15 22:36   ` Marijn Suijten
  0 siblings, 0 replies; 24+ messages in thread
From: Marijn Suijten @ 2022-12-15 22:36 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: linux-arm-msm, andersson, agross, krzysztof.kozlowski,
	Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel

On 2022-12-13 01:24:23, Konrad Dybcio wrote:
> SM8250 has (at least) four GPU speed bins. With the support added on the
> driver side, wire up bin detection in the DTS to restrict lower-quality
> SKUs from running at frequencies they were not validated at.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Tested-by: Marijn Suijten <marijn.suijten@somainline.org> # On Sony Xperia 5 II (speed bin 0x7)
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>

> ---
>  arch/arm64/boot/dts/qcom/sm8250.dtsi | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> index c008f49b5852..0c4ecdab1244 100644
> --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> @@ -955,6 +955,18 @@ ipcc: mailbox@408000 {
>  			#mbox-cells = <2>;
>  		};
>  
> +		qfprom: efuse@784000 {
> +			compatible = "qcom,sm8250-qfprom", "qcom,qfprom";
> +			reg = <0 0x00784000 0 0x8ff>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +
> +			gpu_speed_bin: gpu_speed_bin@19b {
> +				reg = <0x19b 0x1>;
> +				bits = <5 3>;
> +			};
> +		};
> +
>  		rng: rng@793000 {
>  			compatible = "qcom,prng-ee";
>  			reg = <0 0x00793000 0 0x1000>;
> @@ -2563,49 +2575,58 @@ gpu: gpu@3d00000 {
>  
>  			qcom,gmu = <&gmu>;
>  
> +			nvmem-cells = <&gpu_speed_bin>;
> +			nvmem-cell-names = "speed_bin";
> +
>  			status = "disabled";
>  
>  			zap-shader {
>  				memory-region = <&gpu_mem>;
>  			};
>  
> -			/* note: downstream checks gpu binning for 670 Mhz */
>  			gpu_opp_table: opp-table {
>  				compatible = "operating-points-v2";
>  
>  				opp-670000000 {
>  					opp-hz = /bits/ 64 <670000000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
> +					opp-supported-hw = <0x6>;
>  				};
>  
>  				opp-587000000 {
>  					opp-hz = /bits/ 64 <587000000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
> +					opp-supported-hw = <0x7>;
>  				};
>  
>  				opp-525000000 {
>  					opp-hz = /bits/ 64 <525000000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_SVS_L2>;
> +					opp-supported-hw = <0xf>;
>  				};
>  
>  				opp-490000000 {
>  					opp-hz = /bits/ 64 <490000000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
> +					opp-supported-hw = <0xf>;
>  				};
>  
>  				opp-441600000 {
>  					opp-hz = /bits/ 64 <441600000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_SVS_L0>;
> +					opp-supported-hw = <0xf>;
>  				};
>  
>  				opp-400000000 {
>  					opp-hz = /bits/ 64 <400000000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
> +					opp-supported-hw = <0xf>;
>  				};
>  
>  				opp-305000000 {
>  					opp-hz = /bits/ 64 <305000000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
> +					opp-supported-hw = <0xf>;
>  				};
>  			};
>  		};
> -- 
> 2.39.0
> 

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

* Re: [PATCH 6/7] arm64: dts: qcom: sm8150: Add GPU speedbin support
  2022-12-13  0:24 ` [PATCH 6/7] arm64: dts: qcom: sm8150: Add GPU speedbin support Konrad Dybcio
  2022-12-15 21:25   ` Marijn Suijten
@ 2022-12-15 22:37   ` Marijn Suijten
  1 sibling, 0 replies; 24+ messages in thread
From: Marijn Suijten @ 2022-12-15 22:37 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: linux-arm-msm, andersson, agross, krzysztof.kozlowski,
	Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel

On 2022-12-13 01:24:22, Konrad Dybcio wrote:
> SM8150 has (at least) two GPU speed bins. With the support added on the
> driver side, wire up bin detection in the DTS to restrict lower-quality
> SKUs from running at frequencies they were not validated at.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/sm8150.dtsi | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
> index e160acb47cd9..3f940cc3f32b 100644
> --- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
> @@ -936,6 +936,17 @@ ethernet: ethernet@20000 {
>  			status = "disabled";
>  		};
>  
> +		qfprom: efuse@784000 {
> +			compatible = "qcom,sm8150-qfprom", "qcom,qfprom";
> +			reg = <0 0x00784000 0 0x8ff>;
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +
> +			gpu_speed_bin: gpu_speed_bin@133 {
> +				reg = <0x133 0x1>;
> +				bits = <5 3>;
> +			};
> +		};
>  
>  		qupv3_id_0: geniqup@8c0000 {
>  			compatible = "qcom,geni-se-qup";
> @@ -2137,6 +2148,9 @@ gpu: gpu@2c00000 {
>  
>  			qcom,gmu = <&gmu>;
>  
> +			nvmem-cells = <&gpu_speed_bin>;
> +			nvmem-cell-names = "speed_bin";
> +
>  			status = "disabled";
>  
>  			zap-shader {
> @@ -2150,31 +2164,37 @@ gpu_opp_table: opp-table {

Just like sm8250, you can probably delete the:

    /* note: downstream checks gpu binning for 675 Mhz */

comment right above this node.

- Marijn

>  				opp-675000000 {
>  					opp-hz = /bits/ 64 <675000000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
> +					opp-supported-hw = <0x2>;
>  				};
>  
>  				opp-585000000 {
>  					opp-hz = /bits/ 64 <585000000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
> +					opp-supported-hw = <0x3>;
>  				};
>  
>  				opp-499200000 {
>  					opp-hz = /bits/ 64 <499200000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_SVS_L2>;
> +					opp-supported-hw = <0x3>;
>  				};
>  
>  				opp-427000000 {
>  					opp-hz = /bits/ 64 <427000000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
> +					opp-supported-hw = <0x3>;
>  				};
>  
>  				opp-345000000 {
>  					opp-hz = /bits/ 64 <345000000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
> +					opp-supported-hw = <0x3>;
>  				};
>  
>  				opp-257000000 {
>  					opp-hz = /bits/ 64 <257000000>;
>  					opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
> +					opp-supported-hw = <0x3>;
>  				};
>  			};
>  		};
> -- 
> 2.39.0
> 

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

* Re: [PATCH 2/7] dt-bindings: nvmem: Add compatible for SM8250
  2022-12-13  0:24 ` [PATCH 2/7] dt-bindings: nvmem: Add compatible for SM8250 Konrad Dybcio
  2022-12-13 13:16   ` Krzysztof Kozlowski
@ 2023-01-03 11:58   ` Srinivas Kandagatla
  1 sibling, 0 replies; 24+ messages in thread
From: Srinivas Kandagatla @ 2023-01-03 11:58 UTC (permalink / raw)
  To: Konrad Dybcio, linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Rob Herring, Krzysztof Kozlowski, devicetree,
	linux-kernel



On 13/12/2022 00:24, Konrad Dybcio wrote:
> Docuemnt the QFPROM on SM8250.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>   Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml | 1 +
>   1 file changed, 1 insertion(+)
> 

Applied thanks,

--srini

> diff --git a/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml b/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
> index a1305fd68f67..c3d909387e07 100644
> --- a/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
> @@ -31,6 +31,7 @@ properties:
>             - qcom,sm6115-qfprom
>             - qcom,sm6350-qfprom
>             - qcom,sm8150-qfprom
> +          - qcom,sm8250-qfprom
>         - const: qcom,qfprom
>   
>     reg:

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

* Re: [PATCH 1/7] dt-bindings: nvmem: Add compatible for SM8150
  2022-12-13  0:24 ` [PATCH 1/7] dt-bindings: nvmem: Add compatible for SM8150 Konrad Dybcio
  2022-12-13 13:16   ` Krzysztof Kozlowski
@ 2023-01-03 11:58   ` Srinivas Kandagatla
  1 sibling, 0 replies; 24+ messages in thread
From: Srinivas Kandagatla @ 2023-01-03 11:58 UTC (permalink / raw)
  To: Konrad Dybcio, linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Rob Herring, Krzysztof Kozlowski, devicetree,
	linux-kernel



On 13/12/2022 00:24, Konrad Dybcio wrote:
> Docuemnt the QFPROM on SM8150.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>   Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml | 1 +
>   1 file changed, 1 insertion(+)

Applied thanks,

--srini
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml b/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
> index ca744f5890ff..a1305fd68f67 100644
> --- a/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml
> @@ -30,6 +30,7 @@ properties:
>             - qcom,sdm845-qfprom
>             - qcom,sm6115-qfprom
>             - qcom,sm6350-qfprom
> +          - qcom,sm8150-qfprom
>         - const: qcom,qfprom
>   
>     reg:

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

end of thread, other threads:[~2023-01-03 11:58 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13  0:24 [PATCH 0/7] SM8[12]50 GPU speedbin Konrad Dybcio
2022-12-13  0:24 ` [PATCH 1/7] dt-bindings: nvmem: Add compatible for SM8150 Konrad Dybcio
2022-12-13 13:16   ` Krzysztof Kozlowski
2023-01-03 11:58   ` Srinivas Kandagatla
2022-12-13  0:24 ` [PATCH 2/7] dt-bindings: nvmem: Add compatible for SM8250 Konrad Dybcio
2022-12-13 13:16   ` Krzysztof Kozlowski
2023-01-03 11:58   ` Srinivas Kandagatla
2022-12-13  0:24 ` [PATCH 3/7] drm/msm/a6xx: Add support for A640 speed binning Konrad Dybcio
2022-12-13  0:24   ` Konrad Dybcio
2022-12-13  7:06   ` Akhil P Oommen
2022-12-13  7:06     ` Akhil P Oommen
2022-12-13  0:24 ` [PATCH 4/7] drm/msm/a6xx: Add support for A650 " Konrad Dybcio
2022-12-13  0:24   ` Konrad Dybcio
2022-12-13 15:23   ` Doug Anderson
2022-12-13 15:23     ` Doug Anderson
2022-12-13 15:34     ` Konrad Dybcio
2022-12-13 15:34       ` Konrad Dybcio
2022-12-13  0:24 ` [PATCH 5/7] arm64: dts: qcom: sm8150: Don't start Adreno in headless mode Konrad Dybcio
2022-12-15 21:24   ` Marijn Suijten
2022-12-13  0:24 ` [PATCH 6/7] arm64: dts: qcom: sm8150: Add GPU speedbin support Konrad Dybcio
2022-12-15 21:25   ` Marijn Suijten
2022-12-15 22:37   ` Marijn Suijten
2022-12-13  0:24 ` [PATCH 7/7] arm64: dts: qcom: sm8250: " Konrad Dybcio
2022-12-15 22:36   ` Marijn Suijten

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.