diff mbox series

[1/4] ARM: dts: qcom: msm8974: add gpu support

Message ID 20210124135610.1779295-1-iskren.chernev@gmail.com
State Superseded
Headers show
Series [1/4] ARM: dts: qcom: msm8974: add gpu support | expand

Commit Message

Iskren Chernev Jan. 24, 2021, 1:56 p.m. UTC
From: Brian Masney <masneyb@onstation.org>

Add support for the a3xx GPU

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
Tested-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Reviewed-by: Brian Masney <masneyb@onstation.org>
---
Changes in v2:
- base set to next-20210122
- add tags from v1 replies
- add Signed-off-by: me on first three patches
- add commit message to 2nd patch

v1: https://lkml.org/lkml/2020/12/30/322

 arch/arm/boot/dts/qcom-msm8974.dtsi | 45 +++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)


base-commit: 226871e2eda4832d94c3239add7e52ad17b81ce5

Comments

Konrad Dybcio Jan. 24, 2021, 3:02 p.m. UTC | #1
> +	opp_table {
> +		status = "ok";
> +	};
> +
> +	adreno@fdb00000 {
> +		status = "ok";
> +	};
>  };


Could you use &label instead? Reminds me that I should perhaps finally submit my 8974 cleanups one day..


Konrad
Pavel Machek Jan. 24, 2021, 9:05 p.m. UTC | #2
On Sun 2021-01-24 15:56:07, Iskren Chernev wrote:
> From: Brian Masney <masneyb@onstation.org>
> 
> Add support for the a3xx GPU

This is phone, right? Can I ask phone-devel@vger.kernel.org to be
cc-ed?

Thank you,
							Pavel
Brian Masney Jan. 25, 2021, 12:09 a.m. UTC | #3
On Sun, Jan 24, 2021 at 03:56:06PM +0100, Konrad Dybcio wrote:
> Hi,
> 
> 
> > +		gpu_opp_table: opp_table {
> > +			status = "disabled";
> 
> 
> Is there a good reason to disable this?
> 
> 
> > +			opp-800000000 {
> > +				opp-hz = /bits/ 64 <800000000>;
> > +			};
> 
> No. A330 can't go lightspeed (unless there's some secret ultra-binned msm8974pro-v4-ad-5g). [1]

Hi Iskren,

I believe that the Nexus 5 GPU frequencies are documented in the
downstream kernel at:
https://github.com/AICP/kernel_lge_hammerhead/blob/n7.1/arch/arm/boot/dts/msm8974-gpu.dtsi#L67

I am fairly certain that the qcom,bus-freq property is an index into the
qcom,msm-bus,vectors-KBps property above. This will map to the
interconnect and operating points in the upstream kernel.

Note that the actual implementation in a3xx_gpu.c and a4xx_gpu.c
currently has this snippet to set the bus speed:

    /*
     * Set the ICC path to maximum speed for now by multiplying the fastest
     * frequency by the bus width (8). We'll want to scale this later on to
     * improve battery life.
     */
    icc_set_bw(icc_path, 0, Bps_to_icc(gpu->fast_rate) * 8);
    icc_set_bw(ocmem_icc_path, 0, Bps_to_icc(gpu->fast_rate) * 8);

This should be fine for the time being. You'll want to document it
correctly in device tree though.

If the v2 changes too much, then feel free to drop my name from the
patch. I thought that I had made these changes already but apparently
not. :/

Brian
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
index 51f5f904f9eb9..c399446d8154e 100644
--- a/arch/arm/boot/dts/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
@@ -1399,6 +1399,51 @@  cnoc: interconnect@fc480000 {
 			         <&rpmcc RPM_SMD_CNOC_A_CLK>;
 		};
 
+		gpu_opp_table: opp_table {
+			status = "disabled";
+
+			compatible = "operating-points-v2";
+
+			opp-800000000 {
+				opp-hz = /bits/ 64 <800000000>;
+			};
+
+			opp-500000000 {
+				opp-hz = /bits/ 64 <500000000>;
+			};
+
+			opp-275000000 {
+				opp-hz = /bits/ 64 <275000000>;
+			};
+		};
+
+		gpu: adreno@fdb00000 {
+			status = "disabled";
+
+			compatible = "qcom,adreno-330.2",
+			             "qcom,adreno";
+			reg = <0xfdb00000 0x10000>;
+			reg-names = "kgsl_3d0_reg_memory";
+			interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "kgsl_3d0_irq";
+			clock-names = "core",
+			              "iface",
+			              "mem_iface";
+			clocks = <&mmcc OXILI_GFX3D_CLK>,
+			         <&mmcc OXILICX_AHB_CLK>,
+			         <&mmcc OXILICX_AXI_CLK>;
+			sram = <&gmu_sram>;
+			power-domains = <&mmcc OXILICX_GDSC>;
+			operating-points-v2 = <&gpu_opp_table>;
+
+			interconnects = <&mmssnoc MNOC_MAS_GRAPHICS_3D &bimc BIMC_SLV_EBI_CH0>,
+			                <&ocmemnoc OCMEM_VNOC_MAS_GFX3D &ocmemnoc OCMEM_SLV_OCMEM>;
+			interconnect-names = "gfx-mem",
+			                     "ocmem";
+
+			// iommus = <&gpu_iommu 0>;
+		};
+
 		mdss: mdss@fd900000 {
 			status = "disabled";