All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ARM64: DT: add gpu for msm8916
@ 2017-06-12 12:43 Rob Clark
  2017-06-12 12:43 ` [PATCH 2/3] ARM64: DT: add video codec devicetree node Rob Clark
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Rob Clark @ 2017-06-12 12:43 UTC (permalink / raw)
  To: linux-arm-msm; +Cc: Stephen Boyd, Andy Gross, Stanimir Varbanov, Rob Clark

Signed-off-by: Rob Clark <robdclark@gmail.com>
---
 arch/arm64/boot/dts/qcom/msm8916.dtsi | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index ab30939..24c24ab 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -204,6 +204,17 @@
 
 	};
 
+	gpu_opp_table: opp_table {
+		compatible = "operating-points-v2";
+
+		opp-400000000 {
+			opp-hz = /bits/ 64 <400000000>;
+		};
+		opp-19200000 {
+			opp-hz = /bits/ 64 <19200000>;
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
@@ -698,6 +709,30 @@
 			#thermal-sensor-cells = <1>;
 		};
 
+		gpu@1c00000 {
+			compatible = "qcom,adreno-306.0", "qcom,adreno";
+			reg = <0x01c00000 0x20000>;
+			reg-names = "kgsl_3d0_reg_memory";
+			interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "kgsl_3d0_irq";
+			clock-names =
+			    "core",
+			    "iface",
+			    "mem",
+			    "mem_iface",
+			    "alt_mem_iface",
+			    "gfx3d";
+			clocks =
+			    <&gcc GCC_OXILI_GFX3D_CLK>,
+			    <&gcc GCC_OXILI_AHB_CLK>,
+			    <&gcc GCC_OXILI_GMEM_CLK>,
+			    <&gcc GCC_BIMC_GFX_CLK>,
+			    <&gcc GCC_BIMC_GPU_CLK>,
+			    <&gcc GFX3D_CLK_SRC>;
+			power-domains = <&gcc OXILI_GDSC>;
+			operating-points-v2 = <&gpu_opp_table>;
+		};
+
 		mdss: mdss@1a00000 {
 			compatible = "qcom,mdss";
 			reg = <0x1a00000 0x1000>,
-- 
2.9.4

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

* [PATCH 2/3] ARM64: DT: add video codec devicetree node
  2017-06-12 12:43 [PATCH 1/3] ARM64: DT: add gpu for msm8916 Rob Clark
@ 2017-06-12 12:43 ` Rob Clark
  2017-06-13  2:12   ` Stephen Boyd
  2017-08-16 14:31   ` Stanimir Varbanov
  2017-06-12 12:43 ` [PATCH 3/3] ARM64: DT: add iommu for msm8916 Rob Clark
  2017-06-13  2:11 ` [PATCH 1/3] ARM64: DT: add gpu " Stephen Boyd
  2 siblings, 2 replies; 12+ messages in thread
From: Rob Clark @ 2017-06-12 12:43 UTC (permalink / raw)
  To: linux-arm-msm; +Cc: Stephen Boyd, Andy Gross, Stanimir Varbanov, Rob Clark

From: Stanimir Varbanov <stanimir.varbanov@linaro.org>

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
 arch/arm64/boot/dts/qcom/msm8916.dtsi | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 24c24ab..1dcd632 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -88,6 +88,13 @@
 			no-map;
 		};
 
+		venus_mem: venus@89900000 {
+			compatible = "shared-dma-pool";
+			reg = <0x0 0x89900000 0x0 0x800000>;
+			alignment = <0x1000>;
+			no-map;
+		};
+
 		mba_mem: mba@8ea00000 {
 			no-map;
 			reg = <0 0x8ea00000 0 0x100000>;
@@ -1214,6 +1221,27 @@
 				};
 			};
 		};
+
+		venus: video-codec@1d00000 {
+			compatible = "qcom,msm8916-venus";
+			reg = <0x01d00000 0xff000>;
+			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
+			power-domains = <&gcc VENUS_GDSC>;
+			clocks = <&gcc GCC_VENUS0_VCODEC0_CLK>,
+				 <&gcc GCC_VENUS0_AHB_CLK>,
+				 <&gcc GCC_VENUS0_AXI_CLK>;
+			clock-names = "core", "iface", "bus";
+			memory-region = <&venus_mem>;
+			status = "okay";
+
+			video-decoder {
+				compatible = "venus-decoder";
+			};
+
+			video-encoder {
+				compatible = "venus-encoder";
+			};
+		};
 	};
 
 	smd {
-- 
2.9.4

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

* [PATCH 3/3] ARM64: DT: add iommu for msm8916
  2017-06-12 12:43 [PATCH 1/3] ARM64: DT: add gpu for msm8916 Rob Clark
  2017-06-12 12:43 ` [PATCH 2/3] ARM64: DT: add video codec devicetree node Rob Clark
@ 2017-06-12 12:43 ` Rob Clark
  2017-06-13  2:12   ` Stephen Boyd
  2017-06-13  2:11 ` [PATCH 1/3] ARM64: DT: add gpu " Stephen Boyd
  2 siblings, 1 reply; 12+ messages in thread
From: Rob Clark @ 2017-06-12 12:43 UTC (permalink / raw)
  To: linux-arm-msm; +Cc: Stephen Boyd, Andy Gross, Stanimir Varbanov, Rob Clark

Signed-off-by: Rob Clark <robdclark@gmail.com>
---
 arch/arm64/boot/dts/qcom/msm8916.dtsi | 57 +++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 1dcd632..9a1d7ef 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -716,6 +716,59 @@
 			#thermal-sensor-cells = <1>;
 		};
 
+		apps_iommu: iommu@1ef0000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			#iommu-cells = <1>;
+			compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1";
+			ranges = <0 0x1e20000 0x40000>;
+			reg = <0x1ef0000 0x3000>;
+			clocks = <&gcc GCC_SMMU_CFG_CLK>,
+				 <&gcc GCC_APSS_TCU_CLK>;
+			clock-names = "iface", "bus";
+			qcom,iommu-secure-id = <17>;
+
+			// mdp_0:
+			iommu-ctx@4000 {
+				compatible = "qcom,msm-iommu-v1-ns";
+				reg = <0x4000 0x1000>;
+				interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
+			};
+
+			// venus_ns:
+			iommu-ctx@5000 {
+				compatible = "qcom,msm-iommu-v1-sec";
+				reg = <0x5000 0x1000>;
+				interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
+			};
+		};
+
+		gpu_iommu: iommu@1f08000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			#iommu-cells = <1>;
+			compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1";
+			ranges = <0 0x1f08000 0x10000>;
+			clocks = <&gcc GCC_SMMU_CFG_CLK>,
+				 <&gcc GCC_GFX_TCU_CLK>;
+			clock-names = "iface", "bus";
+			qcom,iommu-secure-id = <18>;
+
+			// gfx3d_user:
+			iommu-ctx@1000 {
+				compatible = "qcom,msm-iommu-v1-ns";
+				reg = <0x1000 0x1000>;
+				interrupts = <GIC_SPI 241 IRQ_TYPE_LEVEL_HIGH>;
+			};
+
+			// gfx3d_priv:
+			iommu-ctx@2000 {
+				compatible = "qcom,msm-iommu-v1-ns";
+				reg = <0x2000 0x1000>;
+				interrupts = <GIC_SPI 242 0>;
+			};
+		};
+
 		gpu@1c00000 {
 			compatible = "qcom,adreno-306.0", "qcom,adreno";
 			reg = <0x01c00000 0x20000>;
@@ -738,6 +791,7 @@
 			    <&gcc GFX3D_CLK_SRC>;
 			power-domains = <&gcc OXILI_GDSC>;
 			operating-points-v2 = <&gpu_opp_table>;
+			iommus = <&gpu_iommu 1>, <&gpu_iommu 2>;
 		};
 
 		mdss: mdss@1a00000 {
@@ -781,6 +835,8 @@
 					      "core_clk",
 					      "vsync_clk";
 
+				iommus = <&apps_iommu 4>;
+
 				ports {
 					#address-cells = <1>;
 					#size-cells = <0>;
@@ -1231,6 +1287,7 @@
 				 <&gcc GCC_VENUS0_AHB_CLK>,
 				 <&gcc GCC_VENUS0_AXI_CLK>;
 			clock-names = "core", "iface", "bus";
+			iommus = <&apps_iommu 5>;
 			memory-region = <&venus_mem>;
 			status = "okay";
 
-- 
2.9.4

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

* Re: [PATCH 1/3] ARM64: DT: add gpu for msm8916
  2017-06-12 12:43 [PATCH 1/3] ARM64: DT: add gpu for msm8916 Rob Clark
  2017-06-12 12:43 ` [PATCH 2/3] ARM64: DT: add video codec devicetree node Rob Clark
  2017-06-12 12:43 ` [PATCH 3/3] ARM64: DT: add iommu for msm8916 Rob Clark
@ 2017-06-13  2:11 ` Stephen Boyd
  2 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2017-06-13  2:11 UTC (permalink / raw)
  To: Rob Clark; +Cc: linux-arm-msm, Andy Gross, Stanimir Varbanov

On 06/12, Rob Clark wrote:
> Signed-off-by: Rob Clark <robdclark@gmail.com>
> ---

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH 2/3] ARM64: DT: add video codec devicetree node
  2017-06-12 12:43 ` [PATCH 2/3] ARM64: DT: add video codec devicetree node Rob Clark
@ 2017-06-13  2:12   ` Stephen Boyd
  2017-08-16 14:31   ` Stanimir Varbanov
  1 sibling, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2017-06-13  2:12 UTC (permalink / raw)
  To: Rob Clark; +Cc: linux-arm-msm, Andy Gross, Stanimir Varbanov

On 06/12, Rob Clark wrote:
> From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> 
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> Signed-off-by: Rob Clark <robdclark@gmail.com>
> ---

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH 3/3] ARM64: DT: add iommu for msm8916
  2017-06-12 12:43 ` [PATCH 3/3] ARM64: DT: add iommu for msm8916 Rob Clark
@ 2017-06-13  2:12   ` Stephen Boyd
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2017-06-13  2:12 UTC (permalink / raw)
  To: Rob Clark; +Cc: linux-arm-msm, Andy Gross, Stanimir Varbanov

On 06/12, Rob Clark wrote:
> Signed-off-by: Rob Clark <robdclark@gmail.com>
> ---

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH 2/3] ARM64: DT: add video codec devicetree node
  2017-06-12 12:43 ` [PATCH 2/3] ARM64: DT: add video codec devicetree node Rob Clark
  2017-06-13  2:12   ` Stephen Boyd
@ 2017-08-16 14:31   ` Stanimir Varbanov
  2017-08-16 14:53     ` Andy Gross
  1 sibling, 1 reply; 12+ messages in thread
From: Stanimir Varbanov @ 2017-08-16 14:31 UTC (permalink / raw)
  To: Rob Clark, linux-arm-msm, Andy Gross; +Cc: Stephen Boyd, Stanimir Varbanov

Hi Rob, Andy,

On 06/12/2017 03:43 PM, Rob Clark wrote:
> From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> 
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> Signed-off-by: Rob Clark <robdclark@gmail.com>
> ---
>  arch/arm64/boot/dts/qcom/msm8916.dtsi | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> index 24c24ab..1dcd632 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> @@ -88,6 +88,13 @@
>  			no-map;
>  		};
>  
> +		venus_mem: venus@89900000 {
> +			compatible = "shared-dma-pool";
> +			reg = <0x0 0x89900000 0x0 0x800000>;
> +			alignment = <0x1000>;
> +			no-map;
> +		};

In the spirit of 377a22d3caec3d2cda0cc996101121145ac43ff2 "media: venus:
don't abuse dma_alloc for non-DMA allocations" commit the above
venus_mem should be changed to:

		venus_mem: venus@89900000 {
			reg = <0x0 0x89900000 0x0 0x600000>;
			no-map;
		};

> +
>  		mba_mem: mba@8ea00000 {
>  			no-map;
>  			reg = <0 0x8ea00000 0 0x100000>;
> @@ -1214,6 +1221,27 @@
>  				};
>  			};
>  		};
> +
> +		venus: video-codec@1d00000 {
> +			compatible = "qcom,msm8916-venus";
> +			reg = <0x01d00000 0xff000>;
> +			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
> +			power-domains = <&gcc VENUS_GDSC>;
> +			clocks = <&gcc GCC_VENUS0_VCODEC0_CLK>,
> +				 <&gcc GCC_VENUS0_AHB_CLK>,
> +				 <&gcc GCC_VENUS0_AXI_CLK>;
> +			clock-names = "core", "iface", "bus";
> +			memory-region = <&venus_mem>;
> +			status = "okay";

Is that correct, shouldn't the status be disabled and enabled in the
board dts(i) files?

> +
> +			video-decoder {
> +				compatible = "venus-decoder";
> +			};
> +
> +			video-encoder {
> +				compatible = "venus-encoder";
> +			};
> +		};
>  	};
>  
>  	smd {
> 

-- 
regards,
Stan

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

* Re: [PATCH 2/3] ARM64: DT: add video codec devicetree node
  2017-08-16 14:31   ` Stanimir Varbanov
@ 2017-08-16 14:53     ` Andy Gross
  0 siblings, 0 replies; 12+ messages in thread
From: Andy Gross @ 2017-08-16 14:53 UTC (permalink / raw)
  To: Stanimir Varbanov; +Cc: Rob Clark, linux-arm-msm, Andy Gross, Stephen Boyd

On Wed, Aug 16, 2017 at 05:31:47PM +0300, Stanimir Varbanov wrote:
> Hi Rob, Andy,
> 
> On 06/12/2017 03:43 PM, Rob Clark wrote:
> > From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> > 
> > Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> > Signed-off-by: Rob Clark <robdclark@gmail.com>
> > ---
> >  arch/arm64/boot/dts/qcom/msm8916.dtsi | 28 ++++++++++++++++++++++++++++
> >  1 file changed, 28 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> > index 24c24ab..1dcd632 100644
> > --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
> > @@ -88,6 +88,13 @@
> >  			no-map;
> >  		};
> >  
> > +		venus_mem: venus@89900000 {
> > +			compatible = "shared-dma-pool";
> > +			reg = <0x0 0x89900000 0x0 0x800000>;
> > +			alignment = <0x1000>;
> > +			no-map;
> > +		};
> 
> In the spirit of 377a22d3caec3d2cda0cc996101121145ac43ff2 "media: venus:
> don't abuse dma_alloc for non-DMA allocations" commit the above
> venus_mem should be changed to:
> 
> 		venus_mem: venus@89900000 {
> 			reg = <0x0 0x89900000 0x0 0x600000>;
> 			no-map;
> 		};
> 

Ok, I'll fix this up.  No need to send any update.

> > +
> >  		mba_mem: mba@8ea00000 {
> >  			no-map;
> >  			reg = <0 0x8ea00000 0 0x100000>;
> > @@ -1214,6 +1221,27 @@
> >  				};
> >  			};
> >  		};
> > +
> > +		venus: video-codec@1d00000 {
> > +			compatible = "qcom,msm8916-venus";
> > +			reg = <0x01d00000 0xff000>;
> > +			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
> > +			power-domains = <&gcc VENUS_GDSC>;
> > +			clocks = <&gcc GCC_VENUS0_VCODEC0_CLK>,
> > +				 <&gcc GCC_VENUS0_AHB_CLK>,
> > +				 <&gcc GCC_VENUS0_AXI_CLK>;
> > +			clock-names = "core", "iface", "bus";
> > +			memory-region = <&venus_mem>;
> > +			status = "okay";
> 
> Is that correct, shouldn't the status be disabled and enabled in the
> board dts(i) files?

There isn't anything board specific for this, so it should be enabled by
default.

> > +
> > +			video-decoder {
> > +				compatible = "venus-decoder";
> > +			};
> > +
> > +			video-encoder {
> > +				compatible = "venus-encoder";
> > +			};
> > +		};
> >  	};
> >  
> >  	smd {
> > 

Regards,

Andy

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

* Re: [PATCH 3/3] ARM64: DT: add iommu for msm8916
  2017-05-31 11:58     ` Rob Clark
@ 2017-05-31 16:14       ` Stephen Boyd
  0 siblings, 0 replies; 12+ messages in thread
From: Stephen Boyd @ 2017-05-31 16:14 UTC (permalink / raw)
  To: Rob Clark; +Cc: linux-arm-msm, Andy Gross, Stanimir Varbanov

On 05/31, Rob Clark wrote:
> On Tue, May 30, 2017 at 8:14 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> > On 05/25, Rob Clark wrote:
> >> +             apps_iommu: iommu@1ef0000 {
> >> +                     #address-cells = <1>;
> >> +                     #size-cells = <1>;
> >> +                     #iommu-cells = <1>;
> >> +                     compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1";
> >> +                     ranges = <0 0x1e20000 0x40000>;
> >> +                     reg = <0x1ef0000 0x3000>;
> >> +                     clocks = <&gcc GCC_SMMU_CFG_CLK>,
> >> +                              <&gcc GCC_APSS_TCU_CLK>;
> >> +                     clock-names = "iface", "bus";
> >> +                     qcom,iommu-secure-id = <17>;
> >> +
> >> +                     // mdp_0:
> >> +                     iommu-ctx@4000 {
> >> +                             compatible = "qcom,msm-iommu-v1-ns";
> >> +                             reg = <0x4000 0x1000>;
> >> +                             interrupts = <GIC_SPI 70 0>;
> >
> > s/0/IRQ_TYPE_LEVEL_HIGH/
> 
> 0 actually seems to be _NONE.. so using _HIGH would change how irq is
> configured (according to gic_configure_irq()).  Do you expect that to
> work?  I'm probably going based on what was in downstream dt, and some
> of that is more a pain to retest so I'd rather not change the type
> unless at least one of us knows what they are doing.

I believe the default setting for all these interrupts are
IRQ_TYPE_LEVEL_HIGH already, so there shouldn't be any change to
behavior and things should still work. Would be worth double
checking what the GIC has it configured as with IRQ_TYPE_NONE
here by looking at /proc/interrupts. I suspect it's level high.

> 
> >> +                     };
> >> +
> >> +                     // venus_ns:
> >> +                     iommu-ctx@5000 {
> >> +                             compatible = "qcom,msm-iommu-v1-sec";
> >> +                             reg = <0x5000 0x1000>;
> >> +                             interrupts = <GIC_SPI 70 0>;
> >
> > s/0/IRQ_TYPE_LEVEL_HIGH/
> >
> > Is it the same interrupt number (70) twice? Not 71 or something?
> 
> According to downstream.  Not *entirely* sure how that is supposed to
> work as far as dispatching fault callback to the right driver, but at
> least unlike with the gpu, if we get a fault for mdp, that is entirely
> the kernels fault.  So meh?
> 
> If you know better, let me know.
> 

Ok, I see what's going on. This design still seems odd to me. We
have an interrupt per-context bank in DT so that we can map the
top-level aggregated context bank interrupt (70) to each context
bank that has their interrupt routed there. Depending on the
bootloader configuration we could have many context banks route
their fault interrupt to the same interrupt at the GIC or they
could go to different top-level interrupts. In the GFX IOMMU
case, hw folks decided to _not_ aggregate context bank interrupts
at all so each context bank has a dedicated interrupt at the GIC.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH 3/3] ARM64: DT: add iommu for msm8916
  2017-05-31  0:14   ` Stephen Boyd
@ 2017-05-31 11:58     ` Rob Clark
  2017-05-31 16:14       ` Stephen Boyd
  0 siblings, 1 reply; 12+ messages in thread
From: Rob Clark @ 2017-05-31 11:58 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: linux-arm-msm, Andy Gross, Stanimir Varbanov

On Tue, May 30, 2017 at 8:14 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> On 05/25, Rob Clark wrote:
>> +             apps_iommu: iommu@1ef0000 {
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     #iommu-cells = <1>;
>> +                     compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1";
>> +                     ranges = <0 0x1e20000 0x40000>;
>> +                     reg = <0x1ef0000 0x3000>;
>> +                     clocks = <&gcc GCC_SMMU_CFG_CLK>,
>> +                              <&gcc GCC_APSS_TCU_CLK>;
>> +                     clock-names = "iface", "bus";
>> +                     qcom,iommu-secure-id = <17>;
>> +
>> +                     // mdp_0:
>> +                     iommu-ctx@4000 {
>> +                             compatible = "qcom,msm-iommu-v1-ns";
>> +                             reg = <0x4000 0x1000>;
>> +                             interrupts = <GIC_SPI 70 0>;
>
> s/0/IRQ_TYPE_LEVEL_HIGH/

0 actually seems to be _NONE.. so using _HIGH would change how irq is
configured (according to gic_configure_irq()).  Do you expect that to
work?  I'm probably going based on what was in downstream dt, and some
of that is more a pain to retest so I'd rather not change the type
unless at least one of us knows what they are doing.

>> +                     };
>> +
>> +                     // venus_ns:
>> +                     iommu-ctx@5000 {
>> +                             compatible = "qcom,msm-iommu-v1-sec";
>> +                             reg = <0x5000 0x1000>;
>> +                             interrupts = <GIC_SPI 70 0>;
>
> s/0/IRQ_TYPE_LEVEL_HIGH/
>
> Is it the same interrupt number (70) twice? Not 71 or something?

According to downstream.  Not *entirely* sure how that is supposed to
work as far as dispatching fault callback to the right driver, but at
least unlike with the gpu, if we get a fault for mdp, that is entirely
the kernels fault.  So meh?

If you know better, let me know.

BR,
-R

>
>> +                     };
>> +             };
>> +
>> +             gpu_iommu: iommu@1f08000 {
>> +                     #address-cells = <1>;
>> +                     #size-cells = <1>;
>> +                     #iommu-cells = <1>;
>> +                     compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1";
>> +                     ranges = <0 0x1f08000 0x10000>;
>> +                     clocks = <&gcc GCC_SMMU_CFG_CLK>,
>> +                              <&gcc GCC_GFX_TCU_CLK>;
>> +                     clock-names = "iface", "bus";
>> +                     qcom,iommu-secure-id = <18>;
>> +
>> +                     // gfx3d_user:
>> +                     iommu-ctx@1000 {
>> +                             compatible = "qcom,msm-iommu-v1-ns";
>> +                             reg = <0x1000 0x1000>;
>> +                             interrupts = <GIC_SPI 241 0>;
>
> s/0/IRQ_TYPE_LEVEL_HIGH/
>
>> +                     };
>> +
>> +                     // gfx3d_priv:
>> +                     iommu-ctx@2000 {
>> +                             compatible = "qcom,msm-iommu-v1-ns";
>> +                             reg = <0x2000 0x1000>;
>> +                             interrupts = <GIC_SPI 242 0>;
>
> s/0/IRQ_TYPE_LEVEL_HIGH/
>
>> +                     };
>> +             };
>> +
>>               gpu_opp_table: opp_table {
>>                       compatible = "operating-points-v2";
>>
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project

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

* Re: [PATCH 3/3] ARM64: DT: add iommu for msm8916
  2017-05-25 17:48 ` [PATCH 3/3] ARM64: DT: add iommu " Rob Clark
@ 2017-05-31  0:14   ` Stephen Boyd
  2017-05-31 11:58     ` Rob Clark
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Boyd @ 2017-05-31  0:14 UTC (permalink / raw)
  To: Rob Clark; +Cc: linux-arm-msm, Andy Gross, Stanimir Varbanov

On 05/25, Rob Clark wrote:
> +		apps_iommu: iommu@1ef0000 {
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			#iommu-cells = <1>;
> +			compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1";
> +			ranges = <0 0x1e20000 0x40000>;
> +			reg = <0x1ef0000 0x3000>;
> +			clocks = <&gcc GCC_SMMU_CFG_CLK>,
> +				 <&gcc GCC_APSS_TCU_CLK>;
> +			clock-names = "iface", "bus";
> +			qcom,iommu-secure-id = <17>;
> +
> +			// mdp_0:
> +			iommu-ctx@4000 {
> +				compatible = "qcom,msm-iommu-v1-ns";
> +				reg = <0x4000 0x1000>;
> +				interrupts = <GIC_SPI 70 0>;

s/0/IRQ_TYPE_LEVEL_HIGH/

> +			};
> +
> +			// venus_ns:
> +			iommu-ctx@5000 {
> +				compatible = "qcom,msm-iommu-v1-sec";
> +				reg = <0x5000 0x1000>;
> +				interrupts = <GIC_SPI 70 0>;

s/0/IRQ_TYPE_LEVEL_HIGH/ 

Is it the same interrupt number (70) twice? Not 71 or something?


> +			};
> +		};
> +
> +		gpu_iommu: iommu@1f08000 {
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +			#iommu-cells = <1>;
> +			compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1";
> +			ranges = <0 0x1f08000 0x10000>;
> +			clocks = <&gcc GCC_SMMU_CFG_CLK>,
> +				 <&gcc GCC_GFX_TCU_CLK>;
> +			clock-names = "iface", "bus";
> +			qcom,iommu-secure-id = <18>;
> +
> +			// gfx3d_user:
> +			iommu-ctx@1000 {
> +				compatible = "qcom,msm-iommu-v1-ns";
> +				reg = <0x1000 0x1000>;
> +				interrupts = <GIC_SPI 241 0>;

s/0/IRQ_TYPE_LEVEL_HIGH/ 

> +			};
> +
> +			// gfx3d_priv:
> +			iommu-ctx@2000 {
> +				compatible = "qcom,msm-iommu-v1-ns";
> +				reg = <0x2000 0x1000>;
> +				interrupts = <GIC_SPI 242 0>;

s/0/IRQ_TYPE_LEVEL_HIGH/ 

> +			};
> +		};
> +
>  		gpu_opp_table: opp_table {
>  			compatible = "operating-points-v2";
>  

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* [PATCH 3/3] ARM64: DT: add iommu for msm8916
  2017-05-25 17:48 [PATCH 0/3] gpu + venus + iommu dt nodes " Rob Clark
@ 2017-05-25 17:48 ` Rob Clark
  2017-05-31  0:14   ` Stephen Boyd
  0 siblings, 1 reply; 12+ messages in thread
From: Rob Clark @ 2017-05-25 17:48 UTC (permalink / raw)
  To: linux-arm-msm, Andy Gross; +Cc: Stanimir Varbanov, Rob Clark

Signed-off-by: Rob Clark <robdclark@gmail.com>
---
 arch/arm64/boot/dts/qcom/msm8916.dtsi | 57 +++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 2ef8f53..13bb079 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -705,6 +705,59 @@
 			#thermal-sensor-cells = <1>;
 		};
 
+		apps_iommu: iommu@1ef0000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			#iommu-cells = <1>;
+			compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1";
+			ranges = <0 0x1e20000 0x40000>;
+			reg = <0x1ef0000 0x3000>;
+			clocks = <&gcc GCC_SMMU_CFG_CLK>,
+				 <&gcc GCC_APSS_TCU_CLK>;
+			clock-names = "iface", "bus";
+			qcom,iommu-secure-id = <17>;
+
+			// mdp_0:
+			iommu-ctx@4000 {
+				compatible = "qcom,msm-iommu-v1-ns";
+				reg = <0x4000 0x1000>;
+				interrupts = <GIC_SPI 70 0>;
+			};
+
+			// venus_ns:
+			iommu-ctx@5000 {
+				compatible = "qcom,msm-iommu-v1-sec";
+				reg = <0x5000 0x1000>;
+				interrupts = <GIC_SPI 70 0>;
+			};
+		};
+
+		gpu_iommu: iommu@1f08000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			#iommu-cells = <1>;
+			compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1";
+			ranges = <0 0x1f08000 0x10000>;
+			clocks = <&gcc GCC_SMMU_CFG_CLK>,
+				 <&gcc GCC_GFX_TCU_CLK>;
+			clock-names = "iface", "bus";
+			qcom,iommu-secure-id = <18>;
+
+			// gfx3d_user:
+			iommu-ctx@1000 {
+				compatible = "qcom,msm-iommu-v1-ns";
+				reg = <0x1000 0x1000>;
+				interrupts = <GIC_SPI 241 0>;
+			};
+
+			// gfx3d_priv:
+			iommu-ctx@2000 {
+				compatible = "qcom,msm-iommu-v1-ns";
+				reg = <0x2000 0x1000>;
+				interrupts = <GIC_SPI 242 0>;
+			};
+		};
+
 		gpu_opp_table: opp_table {
 			compatible = "operating-points-v2";
 
@@ -738,6 +791,7 @@
 			    <&gcc GFX3D_CLK_SRC>;
 			power-domains = <&gcc OXILI_GDSC>;
 			operating-points-v2 = <&gpu_opp_table>;
+			iommus = <&gpu_iommu 1>, <&gpu_iommu 2>;
 		};
 
 		mdss: mdss@1a00000 {
@@ -781,6 +835,8 @@
 					      "core_clk",
 					      "vsync_clk";
 
+				iommus = <&apps_iommu 4>;
+
 				ports {
 					#address-cells = <1>;
 					#size-cells = <0>;
@@ -1231,6 +1287,7 @@
 				 <&gcc GCC_VENUS0_AHB_CLK>,
 				 <&gcc GCC_VENUS0_AXI_CLK>;
 			clock-names = "core", "iface", "bus";
+			iommus = <&apps_iommu 5>;
 			memory-region = <&venus_mem>;
 			status = "okay";
 
-- 
2.9.4

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

end of thread, other threads:[~2017-08-16 14:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-12 12:43 [PATCH 1/3] ARM64: DT: add gpu for msm8916 Rob Clark
2017-06-12 12:43 ` [PATCH 2/3] ARM64: DT: add video codec devicetree node Rob Clark
2017-06-13  2:12   ` Stephen Boyd
2017-08-16 14:31   ` Stanimir Varbanov
2017-08-16 14:53     ` Andy Gross
2017-06-12 12:43 ` [PATCH 3/3] ARM64: DT: add iommu for msm8916 Rob Clark
2017-06-13  2:12   ` Stephen Boyd
2017-06-13  2:11 ` [PATCH 1/3] ARM64: DT: add gpu " Stephen Boyd
  -- strict thread matches above, loose matches on Subject: below --
2017-05-25 17:48 [PATCH 0/3] gpu + venus + iommu dt nodes " Rob Clark
2017-05-25 17:48 ` [PATCH 3/3] ARM64: DT: add iommu " Rob Clark
2017-05-31  0:14   ` Stephen Boyd
2017-05-31 11:58     ` Rob Clark
2017-05-31 16:14       ` Stephen Boyd

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.