Skip to contentSkip to conversation

arm64: tegra: Add the GPU on Tegra194

PATCH In review Thierry Reding 3 participants 4 messages Jul 16, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: tegra: Add the GPU on Tegra194

From: Thierry Reding <[email protected]>

The GPU found on NVIDIA Tegra194 SoCs is a Volta generation GPU called GV11B.

---
 arch/arm64/boot/dts/nvidia/tegra194.dtsi | 33 ++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
arch/arm64/boot/dts/nvidia/tegra194.dtsi +33 -0
index 259e40469908..f559fe983ebe 100644
@@ -1395,6 +1395,39 @@ sor3: sor@15bc0000 {
 				nvidia,interface = <3>;
 			};
 		};
+
+		gpu@17000000 {
+			compatible = "nvidia,gv11b";
+			reg = <0x17000000 0x10000000>,
+			      <0x18000000 0x10000000>;
+			interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "stall", "nonstall";
+			clocks = <&bpmp TEGRA194_CLK_GPCCLK>,
+				 <&bpmp TEGRA194_CLK_GPU_PWR>;
+			clock-names = "gpu", "pwr";
+			resets = <&bpmp TEGRA194_RESET_GPU>;
+			reset-names = "gpu";
+			status = "disabled";
+
+			power-domains = <&bpmp TEGRA194_POWER_DOMAIN_GPU>;
+			interconnects = <&mc TEGRA194_MEMORY_CLIENT_NVL1R &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL1RHP &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL1W &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL2R &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL2RHP &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL2W &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL3R &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL3RHP &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL3W &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL4R &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL4RHP &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL4W &emc>;
+			interconnect-names = "dma-mem", "read-0-hp", "write-0",
+					     "read-1", "read-1-hp", "write-1",
+					     "read-2", "read-2-hp", "write-2",
+					     "read-3", "read-3-hp", "write-3";
+		};
 	};
 
 	pcie@14100000 {
Signature · 1 line
2.27.0
maintainer
#1 lore raw
Quoted 15 lines · Thierry Reding

From: Thierry Reding <[email protected]>

The GPU found on NVIDIA Tegra194 SoCs is a Volta generation GPU called GV11B.

---
 arch/arm64/boot/dts/nvidia/tegra194.dtsi | 33 ++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
arch/arm64/boot/dts/nvidia/tegra194.dtsi +0 -0
index 259e40469908..f559fe983ebe 100644

arch/arm64/boot/dts/nvidia/tegra194.dtsi sor3: sor@15bc0000 { · line 1400

Quoted 6 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +3 -0
@@ -1395,6 +1395,39 @@ sor3: sor@15bc0000 {
 				nvidia,interface = <3>;
 			};
 		};
+
+		gpu@17000000 {
+			compatible = "nvidia,gv11b";

I think we also need to add the to binding doc.

Quoted 21 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +21 -0
+			reg = <0x17000000 0x10000000>,
+			      <0x18000000 0x10000000>;
+			interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "stall", "nonstall";
+			clocks = <&bpmp TEGRA194_CLK_GPCCLK>,
+				 <&bpmp TEGRA194_CLK_GPU_PWR>;
+			clock-names = "gpu", "pwr";
+			resets = <&bpmp TEGRA194_RESET_GPU>;
+			reset-names = "gpu";
+			status = "disabled";
+
+			power-domains = <&bpmp TEGRA194_POWER_DOMAIN_GPU>;
+			interconnects = <&mc TEGRA194_MEMORY_CLIENT_NVL1R &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL1RHP &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL1W &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL2R &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL2RHP &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL2W &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL3R &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL3RHP &emc>,

arch/arm64/boot/dts/nvidia/tegra194.dtsi sor3: sor@15bc0000 { · line 1431

Quoted 10 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +9 -0
+					<&mc TEGRA194_MEMORY_CLIENT_NVL3W &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL4R &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL4RHP &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL4W &emc>;
+			interconnect-names = "dma-mem", "read-0-hp", "write-0",
+					     "read-1", "read-1-hp", "write-1",
+					     "read-2", "read-2-hp", "write-2",
+					     "read-3", "read-3-hp", "write-3";
+		};
 	};

I also see that for gv11b we populate 'dma-coherent' and so we should probably add this as well.

Cheers
Jon

Signature · 1 line
nvpublic
#2 lore raw
Quoted 12 lines · Jon Hunter
Quoted 10 lines · Thierry Reding

From: Thierry Reding <[email protected]>

The GPU found on NVIDIA Tegra194 SoCs is a Volta generation GPU called GV11B.

---
 arch/arm64/boot/dts/nvidia/tegra194.dtsi | 33 ++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
Quoted 13 lines

arch/arm64/boot/dts/nvidia/tegra194.dtsi sor3: sor@15bc0000 { · line 1400

Quoted 11 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +3 -0
index 259e40469908..f559fe983ebe 100644
@@ -1395,6 +1395,39 @@ sor3: sor@15bc0000 {
 				nvidia,interface = <3>;
 			};
 		};
+
+		gpu@17000000 {
+			compatible = "nvidia,gv11b";

I think we also need to add the to binding doc.

I've got a patch that converts the nvidia,gk20a.txt to the json-schema format and then a patch on top that adds this compatible string. Since that patch is part of a larger series that's a bit stalled, I'll add this to the existing bindings for now.

Quoted 26 lines
Quoted 26 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +26 -0
+			reg = <0x17000000 0x10000000>,
+			      <0x18000000 0x10000000>;
+			interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "stall", "nonstall";
+			clocks = <&bpmp TEGRA194_CLK_GPCCLK>,
+				 <&bpmp TEGRA194_CLK_GPU_PWR>;
+			clock-names = "gpu", "pwr";
+			resets = <&bpmp TEGRA194_RESET_GPU>;
+			reset-names = "gpu";
+			status = "disabled";
+
+			power-domains = <&bpmp TEGRA194_POWER_DOMAIN_GPU>;
+			interconnects = <&mc TEGRA194_MEMORY_CLIENT_NVL1R &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL1RHP &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL1W &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL2R &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL2RHP &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL2W &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL3R &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL3RHP &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL3W &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL4R &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL4RHP &emc>,
+					<&mc TEGRA194_MEMORY_CLIENT_NVL4W &emc>;
+			interconnect-names = "dma-mem", "read-0-hp", "write-0",
Quoted 8 lines

arch/arm64/boot/dts/nvidia/tegra194.dtsi sor3: sor@15bc0000 { · line 1431

Quoted 5 lines
arch/arm64/boot/dts/nvidia/tegra194.dtsi +4 -0
+					     "read-1", "read-1-hp", "write-1",
+					     "read-2", "read-2-hp", "write-2",
+					     "read-3", "read-3-hp", "write-3";
+		};
 	};

I also see that for gv11b we populate 'dma-coherent' and so we should probably add this as well.

Do we know for certain that the GPU is DMA coherent? I've only tested this (with local patches to Nouveau) without dma-coherent, so I have not actually verified that it works without.

I vaguely recall reading that there are different apertures for sysmem, one for coherent sysmem and another for non-coherent sysmem. So I'm not sure if dma-coherent here will work without additional code in the driver to ensure that all memory is allocated from the coherent sysmem aperture.

I'd suggest we leave this as-is for now until we're further along with GPU support and we can properly test this. Leaving out dma-coherent should be harmless and in the worst case unnecessarily flushes caches.

Thierry

#3 lore raw
Quoted 7 lines · Thierry Reding
Quoted 2 lines · Jon Hunter

I also see that for gv11b we populate 'dma-coherent' and so we should probably add this as well.

Do we know for certain that the GPU is DMA coherent? I've only tested this (with local patches to Nouveau) without dma-coherent, so I have not actually verified that it works without.

Quoted 5 lines

I vaguely recall reading that there are different apertures for sysmem, one for coherent sysmem and another for non-coherent sysmem. So I'm not sure if dma-coherent here will work without additional code in the driver to ensure that all memory is allocated from the coherent sysmem aperture.

We do have the choices of coherent and non-coherent memory accesses in the iGPU via the two sysmem apertures. But in Tegra194 we're forcing coherency from the memory subsystem side, so all accesses are coherent.

Terje