Re: [PATCH v8 07/14] ARM: dts: rockchip: add clocks in iommu nodes

2018-04-10 Thread Heiko Stuebner
Am Freitag, 23. März 2018, 08:38:07 CEST schrieb Jeffy Chen:
> Add clocks in iommu nodes, since we are going to control clocks in
> rockchip iommu driver.
> 
> Signed-off-by: Jeffy Chen 

applied for 4.18 after splitting arm32+arm64 parts into 2 patches
and adapting the subject for the arm64 variant.

Please don't mix arm32+arm64 devicetree patches in the future.


Thanks
Heiko

> ---
> 
> Changes in v8: None
> Changes in v7: None
> Changes in v6:
> Add clk names, and modify all iommu nodes in all existing rockchip dts
> 
> Changes in v5:
> Remove clk names.
> 
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
> 
>  arch/arm/boot/dts/rk3036.dtsi|  2 ++
>  arch/arm/boot/dts/rk322x.dtsi|  8 
>  arch/arm/boot/dts/rk3288.dtsi| 12 
>  arch/arm64/boot/dts/rockchip/rk3328.dtsi | 10 ++
>  arch/arm64/boot/dts/rockchip/rk3368.dtsi | 10 ++
>  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 14 --
>  6 files changed, 54 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/rk3036.dtsi b/arch/arm/boot/dts/rk3036.dtsi
> index a97458112ff6..567a6a725f9c 100644
> --- a/arch/arm/boot/dts/rk3036.dtsi
> +++ b/arch/arm/boot/dts/rk3036.dtsi
> @@ -197,6 +197,8 @@
>   reg = <0x10118300 0x100>;
>   interrupts = ;
>   interrupt-names = "vop_mmu";
> + clocks = <&cru ACLK_LCDC>, <&cru HCLK_LCDC>;
> + clock-names = "aclk", "iface";
>   #iommu-cells = <0>;
>   status = "disabled";
>   };
> diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi
> index df1e47858675..be80e9a2c9af 100644
> --- a/arch/arm/boot/dts/rk322x.dtsi
> +++ b/arch/arm/boot/dts/rk322x.dtsi
> @@ -584,6 +584,8 @@
>   reg = <0x20020800 0x100>;
>   interrupts = ;
>   interrupt-names = "vpu_mmu";
> + clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
> + clock-names = "aclk", "iface";
>   iommu-cells = <0>;
>   status = "disabled";
>   };
> @@ -593,6 +595,8 @@
>   reg = <0x20030480 0x40>, <0x200304c0 0x40>;
>   interrupts = ;
>   interrupt-names = "vdec_mmu";
> + clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>;
> + clock-names = "aclk", "iface";
>   iommu-cells = <0>;
>   status = "disabled";
>   };
> @@ -602,6 +606,8 @@
>   reg = <0x20053f00 0x100>;
>   interrupts = ;
>   interrupt-names = "vop_mmu";
> + clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>;
> + clock-names = "aclk", "iface";
>   iommu-cells = <0>;
>   status = "disabled";
>   };
> @@ -611,6 +617,8 @@
>   reg = <0x20070800 0x100>;
>   interrupts = ;
>   interrupt-names = "iep_mmu";
> + clocks = <&cru ACLK_IEP>, <&cru HCLK_IEP>;
> + clock-names = "aclk", "iface";
>   iommu-cells = <0>;
>   status = "disabled";
>   };
> diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
> index be9acb6d28a1..d7e49d29ace5 100644
> --- a/arch/arm/boot/dts/rk3288.dtsi
> +++ b/arch/arm/boot/dts/rk3288.dtsi
> @@ -959,6 +959,8 @@
>   reg = <0x0 0xff900800 0x0 0x40>;
>   interrupts = ;
>   interrupt-names = "iep_mmu";
> + clocks = <&cru ACLK_IEP>, <&cru HCLK_IEP>;
> + clock-names = "aclk", "iface";
>   #iommu-cells = <0>;
>   status = "disabled";
>   };
> @@ -968,6 +970,8 @@
>   reg = <0x0 0xff914000 0x0 0x100>, <0x0 0xff915000 0x0 0x100>;
>   interrupts = ;
>   interrupt-names = "isp_mmu";
> + clocks = <&cru ACLK_ISP>, <&cru HCLK_ISP>;
> + clock-names = "aclk", "iface";
>   #iommu-cells = <0>;
>   rockchip,disable-mmu-reset;
>   status = "disabled";
> @@ -1027,6 +1031,8 @@
>   reg = <0x0 0xff930300 0x0 0x100>;
>   interrupts = ;
>   interrupt-names = "vopb_mmu";
> + clocks = <&cru ACLK_VOP0>, <&cru HCLK_VOP0>;
> + clock-names = "aclk", "iface";
>   power-domains = <&power RK3288_PD_VIO>;
>   #iommu-cells = <0>;
>   status = "disabled";
> @@ -1075,6 +1081,8 @@
>   reg = <0x0 0xff940300 0x0 0x100>;
>   interrupts = ;
>   interrupt-names = "vopl_mmu";
> + clocks = <&cru ACLK_VOP1>, <&cru HCLK_VOP1>;
> + clock-names = "aclk", "iface";
>   power-domains = <&power RK3288_PD_VIO>;
>   #iommu-cells = <0>;
>   status = "disabled";
> @@ -1206,6 +1214,8 @@
>   reg = <0x0 0xff9a0800 0x0 0x100>;
>   interrupts = ;
>   interrupt-names = "vpu_mmu";
> + clocks = <&cru

Re: [PATCH v8 07/14] ARM: dts: rockchip: add clocks in iommu nodes

2018-04-10 Thread Heiko Stuebner
Am Montag, 9. April 2018, 23:49:58 CEST schrieb Heiko Stübner:
> Am Montag, 9. April 2018, 17:55:40 CEST schrieb Heiko Stübner:
> > Am Montag, 9. April 2018, 17:53:01 CEST schrieb Robin Murphy:
> > > On 09/04/18 16:44, Heiko Stübner wrote:
> > > > Hi Tomeu,
> > > > 
> > > > Am Montag, 9. April 2018, 16:41:56 CEST schrieb Tomeu Vizoso:
> > > >> in today's linux-next, the DRM driver fails to probe because the iommu
> > > >> driver fails to find the aclk. I need to apply this patch for things
> > > >> to work again.
> > > > 
> > > > Thanks for catching that issue.
> > > > 
> > > > This seems to expose a backwards-compatibility issue, as this breaks
> > > > all old devicetrees, so should get a proper fix, apart from me applying
> > > > the dt-patch I missed.
> > > > 
> > > > Looking at the iommu-clock-handling patch, I imagine this part as
> > > > the culprit:
> > > > 
> > > > +   iommu->num_clocks = ARRAY_SIZE(rk_iommu_clocks);
> > > > +   iommu->clocks = devm_kcalloc(iommu->dev, iommu->num_clocks,
> > > > +sizeof(*iommu->clocks), 
> > > > GFP_KERNEL);
> > > > +   if (!iommu->clocks)
> > > > +   return -ENOMEM;
> > > > 
> > > > The clk-bulk functions seem to work with simple for loops and
> > > > should (as the other standard clock functions) just work fine with
> > > > an empty struct, so I guess a simple
> > > > 
> > > > if (!iommu->clocks && iommu->num_clocks > 0)
> > > > 
> > > > return -ENOMEM;
> > > > 
> > > > should hopefully be enough. I'll try to give this a test later on
> > > > if nobody beats me to it :-)
> > > 
> > > But iommu->num_clocks is clearly set to a nonzero compile-time constant
> > > at this point ;)
> > > 
> > > I'd assume it's the return from devm_clk_bulk_get() which needs to
> > > special-case the "no clocks found" case from any other error, and *then*
> > > blat num_clocks to 0 if so.
> > 
> > you're right of course. Looking at it again, I now clearly see the
> > ARRAY_SIZE and am wondering what made me think num_clocks would be
> > runtime-read.
> > 
> > Must be those 25°C today ;-)
> 
> In any case, this does not seem to fully fix the issue ... or be more exact 
> seems to be the only issue.
> 
> - With 4.16 both pinky and kevin have working displays.
> - When I was merging display patches to drm-misc, I did boot-tests on
>   both pinky and kevin, keeping their displays in a working state.
> 
> - With current torvalds head (iommu not merged yet)
> e9092d0d9796 ("Fix subtle macro variable shadowing in min_not_zero()")
> 
> I get display output on rk3399-kevin (edp), but not on
> rk3288-pinky (edp + hdmi). [components + hdmi device+modes get
> recognized correctly though]
> 
> - With iommu changes merged I end up with the failing clock issue
>   which can be countered by making the iommu-clocks optional.
> 
> - After that I get working display output again on kevin but not pinky.
> 
> Looks like this needs bisecting.

And it seems the dwc2 vbus thingy was responsible for the other issue I saw.
With Tomeus fixup patch applied and the series I sent an hour ago, I now
get display output again on both kevin (rk3399) and pinky (rk3288).

Heiko


Re: [PATCH v8 07/14] ARM: dts: rockchip: add clocks in iommu nodes

2018-04-09 Thread Heiko Stübner
Am Montag, 9. April 2018, 17:55:40 CEST schrieb Heiko Stübner:
> Am Montag, 9. April 2018, 17:53:01 CEST schrieb Robin Murphy:
> > On 09/04/18 16:44, Heiko Stübner wrote:
> > > Hi Tomeu,
> > > 
> > > Am Montag, 9. April 2018, 16:41:56 CEST schrieb Tomeu Vizoso:
> > >> in today's linux-next, the DRM driver fails to probe because the iommu
> > >> driver fails to find the aclk. I need to apply this patch for things
> > >> to work again.
> > > 
> > > Thanks for catching that issue.
> > > 
> > > This seems to expose a backwards-compatibility issue, as this breaks
> > > all old devicetrees, so should get a proper fix, apart from me applying
> > > the dt-patch I missed.
> > > 
> > > Looking at the iommu-clock-handling patch, I imagine this part as
> > > the culprit:
> > > 
> > > + iommu->num_clocks = ARRAY_SIZE(rk_iommu_clocks);
> > > + iommu->clocks = devm_kcalloc(iommu->dev, iommu->num_clocks,
> > > +  sizeof(*iommu->clocks), GFP_KERNEL);
> > > + if (!iommu->clocks)
> > > + return -ENOMEM;
> > > 
> > > The clk-bulk functions seem to work with simple for loops and
> > > should (as the other standard clock functions) just work fine with
> > > an empty struct, so I guess a simple
> > > 
> > >   if (!iommu->clocks && iommu->num_clocks > 0)
> > >   
> > >   return -ENOMEM;
> > > 
> > > should hopefully be enough. I'll try to give this a test later on
> > > if nobody beats me to it :-)
> > 
> > But iommu->num_clocks is clearly set to a nonzero compile-time constant
> > at this point ;)
> > 
> > I'd assume it's the return from devm_clk_bulk_get() which needs to
> > special-case the "no clocks found" case from any other error, and *then*
> > blat num_clocks to 0 if so.
> 
> you're right of course. Looking at it again, I now clearly see the
> ARRAY_SIZE and am wondering what made me think num_clocks would be
> runtime-read.
> 
> Must be those 25°C today ;-)

In any case, this does not seem to fully fix the issue ... or be more exact 
seems to be the only issue.

- With 4.16 both pinky and kevin have working displays.
- When I was merging display patches to drm-misc, I did boot-tests on
  both pinky and kevin, keeping their displays in a working state.

- With current torvalds head (iommu not merged yet)
e9092d0d9796 ("Fix subtle macro variable shadowing in min_not_zero()")

I get display output on rk3399-kevin (edp), but not on
rk3288-pinky (edp + hdmi). [components + hdmi device+modes get
recognized correctly though]

- With iommu changes merged I end up with the failing clock issue
  which can be countered by making the iommu-clocks optional.

- After that I get working display output again on kevin but not pinky.

Looks like this needs bisecting.



Re: [PATCH v8 07/14] ARM: dts: rockchip: add clocks in iommu nodes

2018-04-09 Thread Heiko Stübner
Am Montag, 9. April 2018, 17:53:01 CEST schrieb Robin Murphy:
> On 09/04/18 16:44, Heiko Stübner wrote:
> > Hi Tomeu,
> > 
> > Am Montag, 9. April 2018, 16:41:56 CEST schrieb Tomeu Vizoso:
> >> in today's linux-next, the DRM driver fails to probe because the iommu
> >> driver fails to find the aclk. I need to apply this patch for things
> >> to work again.
> > 
> > Thanks for catching that issue.
> > 
> > This seems to expose a backwards-compatibility issue, as this breaks
> > all old devicetrees, so should get a proper fix, apart from me applying
> > the dt-patch I missed.
> > 
> > Looking at the iommu-clock-handling patch, I imagine this part as
> > the culprit:
> > 
> > +   iommu->num_clocks = ARRAY_SIZE(rk_iommu_clocks);
> > +   iommu->clocks = devm_kcalloc(iommu->dev, iommu->num_clocks,
> > +sizeof(*iommu->clocks), GFP_KERNEL);
> > +   if (!iommu->clocks)
> > +   return -ENOMEM;
> > 
> > The clk-bulk functions seem to work with simple for loops and
> > should (as the other standard clock functions) just work fine with
> > an empty struct, so I guess a simple
> > 
> > if (!iommu->clocks && iommu->num_clocks > 0)
> > 
> > return -ENOMEM;
> > 
> > should hopefully be enough. I'll try to give this a test later on
> > if nobody beats me to it :-)
> 
> But iommu->num_clocks is clearly set to a nonzero compile-time constant
> at this point ;)
> 
> I'd assume it's the return from devm_clk_bulk_get() which needs to
> special-case the "no clocks found" case from any other error, and *then*
> blat num_clocks to 0 if so.

you're right of course. Looking at it again, I now clearly see the ARRAY_SIZE
and am wondering what made me think num_clocks would be runtime-read.

Must be those 25°C today ;-)



Re: [PATCH v8 07/14] ARM: dts: rockchip: add clocks in iommu nodes

2018-04-09 Thread Robin Murphy

On 09/04/18 16:44, Heiko Stübner wrote:

Hi Tomeu,

Am Montag, 9. April 2018, 16:41:56 CEST schrieb Tomeu Vizoso:

in today's linux-next, the DRM driver fails to probe because the iommu
driver fails to find the aclk. I need to apply this patch for things
to work again.


Thanks for catching that issue.

This seems to expose a backwards-compatibility issue, as this breaks
all old devicetrees, so should get a proper fix, apart from me applying
the dt-patch I missed.

Looking at the iommu-clock-handling patch, I imagine this part as
the culprit:

+   iommu->num_clocks = ARRAY_SIZE(rk_iommu_clocks);
+   iommu->clocks = devm_kcalloc(iommu->dev, iommu->num_clocks,
+sizeof(*iommu->clocks), GFP_KERNEL);
+   if (!iommu->clocks)
+   return -ENOMEM;

The clk-bulk functions seem to work with simple for loops and
should (as the other standard clock functions) just work fine with
an empty struct, so I guess a simple

if (!iommu->clocks && iommu->num_clocks > 0)
return -ENOMEM;

should hopefully be enough. I'll try to give this a test later on
if nobody beats me to it :-)


But iommu->num_clocks is clearly set to a nonzero compile-time constant 
at this point ;)


I'd assume it's the return from devm_clk_bulk_get() which needs to 
special-case the "no clocks found" case from any other error, and *then* 
blat num_clocks to 0 if so.


Robin.


Re: [PATCH v8 07/14] ARM: dts: rockchip: add clocks in iommu nodes

2018-04-09 Thread Heiko Stübner
Hi Tomeu,

Am Montag, 9. April 2018, 16:41:56 CEST schrieb Tomeu Vizoso:
> in today's linux-next, the DRM driver fails to probe because the iommu
> driver fails to find the aclk. I need to apply this patch for things
> to work again.

Thanks for catching that issue.

This seems to expose a backwards-compatibility issue, as this breaks
all old devicetrees, so should get a proper fix, apart from me applying
the dt-patch I missed.

Looking at the iommu-clock-handling patch, I imagine this part as
the culprit:

+   iommu->num_clocks = ARRAY_SIZE(rk_iommu_clocks);
+   iommu->clocks = devm_kcalloc(iommu->dev, iommu->num_clocks,
+sizeof(*iommu->clocks), GFP_KERNEL);
+   if (!iommu->clocks)
+   return -ENOMEM;

The clk-bulk functions seem to work with simple for loops and
should (as the other standard clock functions) just work fine with
an empty struct, so I guess a simple

if (!iommu->clocks && iommu->num_clocks > 0)
return -ENOMEM;

should hopefully be enough. I'll try to give this a test later on
if nobody beats me to it :-)


Heiko

> 
> Thanks,
> 
> Tomeu
> 
> On 23 March 2018 at 08:38, Jeffy Chen  wrote:
> > Add clocks in iommu nodes, since we are going to control clocks in
> > rockchip iommu driver.
> > 
> > Signed-off-by: Jeffy Chen 
> > ---
> > 
> > Changes in v8: None
> > Changes in v7: None
> > Changes in v6:
> > Add clk names, and modify all iommu nodes in all existing rockchip dts
> > 
> > Changes in v5:
> > Remove clk names.
> > 
> > Changes in v4: None
> > Changes in v3: None
> > Changes in v2: None
> > 
> >  arch/arm/boot/dts/rk3036.dtsi|  2 ++
> >  arch/arm/boot/dts/rk322x.dtsi|  8 
> >  arch/arm/boot/dts/rk3288.dtsi| 12 
> >  arch/arm64/boot/dts/rockchip/rk3328.dtsi | 10 ++
> >  arch/arm64/boot/dts/rockchip/rk3368.dtsi | 10 ++
> >  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 14 --
> >  6 files changed, 54 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/rk3036.dtsi b/arch/arm/boot/dts/rk3036.dtsi
> > index a97458112ff6..567a6a725f9c 100644
> > --- a/arch/arm/boot/dts/rk3036.dtsi
> > +++ b/arch/arm/boot/dts/rk3036.dtsi
> > @@ -197,6 +197,8 @@
> > 
> > reg = <0x10118300 0x100>;
> > interrupts = ;
> > interrupt-names = "vop_mmu";
> > 
> > +   clocks = <&cru ACLK_LCDC>, <&cru HCLK_LCDC>;
> > +   clock-names = "aclk", "iface";
> > 
> > #iommu-cells = <0>;
> > status = "disabled";
> > 
> > };
> > 
> > diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi
> > index df1e47858675..be80e9a2c9af 100644
> > --- a/arch/arm/boot/dts/rk322x.dtsi
> > +++ b/arch/arm/boot/dts/rk322x.dtsi
> > @@ -584,6 +584,8 @@
> > 
> > reg = <0x20020800 0x100>;
> > interrupts = ;
> > interrupt-names = "vpu_mmu";
> > 
> > +   clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
> > +   clock-names = "aclk", "iface";
> > 
> > iommu-cells = <0>;
> > status = "disabled";
> > 
> > };
> > 
> > @@ -593,6 +595,8 @@
> > 
> > reg = <0x20030480 0x40>, <0x200304c0 0x40>;
> > interrupts = ;
> > interrupt-names = "vdec_mmu";
> > 
> > +   clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>;
> > +   clock-names = "aclk", "iface";
> > 
> > iommu-cells = <0>;
> > status = "disabled";
> > 
> > };
> > 
> > @@ -602,6 +606,8 @@
> > 
> > reg = <0x20053f00 0x100>;
> > interrupts = ;
> > interrupt-names = "vop_mmu";
> > 
> > +   clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>;
> > +   clock-names = "aclk", "iface";
> > 
> > iommu-cells = <0>;
> > status = "disabled";
> > 
> > };
> > 
> > @@ -611,6 +617,8 @@
> > 
> > reg = <0x20070800 0x100>;
> > interrupts = ;
> > interrupt-names = "iep_mmu";
> > 
> > +   clocks = <&cru ACLK_IEP>, <&cru HCLK_IEP>;
> > +   clock-names = "aclk", "iface";
> > 
> > iommu-cells = <0>;
> > status = "disabled";
> > 
> > };
> > 
> > diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
> > index be9acb6d28a1..d7e49d29ace5 100644
> > --- a/arch/arm/boot/dts/rk3288.dtsi
> > +++ b/arch/arm/boot/dts/rk3288.dtsi
> > @@ -959,6 +959,8 @@
> > 
> > reg = <0x0 0xff900800 0x0 0x40>;
> > interrupts = ;
> > interrupt-names = "iep_mmu";
> > 
> > +   clocks = <&cru ACLK_IEP>, <&cru HCLK_IEP>;
> > +   clock-names = "aclk", "iface";
> > 
> > #iommu-cells = <0>;
> 

Re: [PATCH v8 07/14] ARM: dts: rockchip: add clocks in iommu nodes

2018-04-09 Thread Tomeu Vizoso
Hi there,

in today's linux-next, the DRM driver fails to probe because the iommu
driver fails to find the aclk. I need to apply this patch for things
to work again.

Thanks,

Tomeu

On 23 March 2018 at 08:38, Jeffy Chen  wrote:
> Add clocks in iommu nodes, since we are going to control clocks in
> rockchip iommu driver.
>
> Signed-off-by: Jeffy Chen 
> ---
>
> Changes in v8: None
> Changes in v7: None
> Changes in v6:
> Add clk names, and modify all iommu nodes in all existing rockchip dts
>
> Changes in v5:
> Remove clk names.
>
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  arch/arm/boot/dts/rk3036.dtsi|  2 ++
>  arch/arm/boot/dts/rk322x.dtsi|  8 
>  arch/arm/boot/dts/rk3288.dtsi| 12 
>  arch/arm64/boot/dts/rockchip/rk3328.dtsi | 10 ++
>  arch/arm64/boot/dts/rockchip/rk3368.dtsi | 10 ++
>  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 14 --
>  6 files changed, 54 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/rk3036.dtsi b/arch/arm/boot/dts/rk3036.dtsi
> index a97458112ff6..567a6a725f9c 100644
> --- a/arch/arm/boot/dts/rk3036.dtsi
> +++ b/arch/arm/boot/dts/rk3036.dtsi
> @@ -197,6 +197,8 @@
> reg = <0x10118300 0x100>;
> interrupts = ;
> interrupt-names = "vop_mmu";
> +   clocks = <&cru ACLK_LCDC>, <&cru HCLK_LCDC>;
> +   clock-names = "aclk", "iface";
> #iommu-cells = <0>;
> status = "disabled";
> };
> diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi
> index df1e47858675..be80e9a2c9af 100644
> --- a/arch/arm/boot/dts/rk322x.dtsi
> +++ b/arch/arm/boot/dts/rk322x.dtsi
> @@ -584,6 +584,8 @@
> reg = <0x20020800 0x100>;
> interrupts = ;
> interrupt-names = "vpu_mmu";
> +   clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
> +   clock-names = "aclk", "iface";
> iommu-cells = <0>;
> status = "disabled";
> };
> @@ -593,6 +595,8 @@
> reg = <0x20030480 0x40>, <0x200304c0 0x40>;
> interrupts = ;
> interrupt-names = "vdec_mmu";
> +   clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>;
> +   clock-names = "aclk", "iface";
> iommu-cells = <0>;
> status = "disabled";
> };
> @@ -602,6 +606,8 @@
> reg = <0x20053f00 0x100>;
> interrupts = ;
> interrupt-names = "vop_mmu";
> +   clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>;
> +   clock-names = "aclk", "iface";
> iommu-cells = <0>;
> status = "disabled";
> };
> @@ -611,6 +617,8 @@
> reg = <0x20070800 0x100>;
> interrupts = ;
> interrupt-names = "iep_mmu";
> +   clocks = <&cru ACLK_IEP>, <&cru HCLK_IEP>;
> +   clock-names = "aclk", "iface";
> iommu-cells = <0>;
> status = "disabled";
> };
> diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
> index be9acb6d28a1..d7e49d29ace5 100644
> --- a/arch/arm/boot/dts/rk3288.dtsi
> +++ b/arch/arm/boot/dts/rk3288.dtsi
> @@ -959,6 +959,8 @@
> reg = <0x0 0xff900800 0x0 0x40>;
> interrupts = ;
> interrupt-names = "iep_mmu";
> +   clocks = <&cru ACLK_IEP>, <&cru HCLK_IEP>;
> +   clock-names = "aclk", "iface";
> #iommu-cells = <0>;
> status = "disabled";
> };
> @@ -968,6 +970,8 @@
> reg = <0x0 0xff914000 0x0 0x100>, <0x0 0xff915000 0x0 0x100>;
> interrupts = ;
> interrupt-names = "isp_mmu";
> +   clocks = <&cru ACLK_ISP>, <&cru HCLK_ISP>;
> +   clock-names = "aclk", "iface";
> #iommu-cells = <0>;
> rockchip,disable-mmu-reset;
> status = "disabled";
> @@ -1027,6 +1031,8 @@
> reg = <0x0 0xff930300 0x0 0x100>;
> interrupts = ;
> interrupt-names = "vopb_mmu";
> +   clocks = <&cru ACLK_VOP0>, <&cru HCLK_VOP0>;
> +   clock-names = "aclk", "iface";
> power-domains = <&power RK3288_PD_VIO>;
> #iommu-cells = <0>;
> status = "disabled";
> @@ -1075,6 +1081,8 @@
> reg = <0x0 0xff940300 0x0 0x100>;
> interrupts = ;
> interrupt-names = "vopl_mmu";
> +   clocks = <&cru ACLK_VOP1>, <&cru HCLK_VOP1>;
> +   clock-names = "aclk", "iface";
> power-domains = <&power RK3288_PD_VIO>;
> #iommu-cells = <0>;
> status = "disabled";
> @@ -1206,6 +1214,8 @@
> reg = <0x0 0xff9a0800 0x0 0

[PATCH v8 07/14] ARM: dts: rockchip: add clocks in iommu nodes

2018-03-23 Thread Jeffy Chen
Add clocks in iommu nodes, since we are going to control clocks in
rockchip iommu driver.

Signed-off-by: Jeffy Chen 
---

Changes in v8: None
Changes in v7: None
Changes in v6:
Add clk names, and modify all iommu nodes in all existing rockchip dts

Changes in v5:
Remove clk names.

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/boot/dts/rk3036.dtsi|  2 ++
 arch/arm/boot/dts/rk322x.dtsi|  8 
 arch/arm/boot/dts/rk3288.dtsi| 12 
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 10 ++
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 10 ++
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 14 --
 6 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/rk3036.dtsi b/arch/arm/boot/dts/rk3036.dtsi
index a97458112ff6..567a6a725f9c 100644
--- a/arch/arm/boot/dts/rk3036.dtsi
+++ b/arch/arm/boot/dts/rk3036.dtsi
@@ -197,6 +197,8 @@
reg = <0x10118300 0x100>;
interrupts = ;
interrupt-names = "vop_mmu";
+   clocks = <&cru ACLK_LCDC>, <&cru HCLK_LCDC>;
+   clock-names = "aclk", "iface";
#iommu-cells = <0>;
status = "disabled";
};
diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi
index df1e47858675..be80e9a2c9af 100644
--- a/arch/arm/boot/dts/rk322x.dtsi
+++ b/arch/arm/boot/dts/rk322x.dtsi
@@ -584,6 +584,8 @@
reg = <0x20020800 0x100>;
interrupts = ;
interrupt-names = "vpu_mmu";
+   clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
+   clock-names = "aclk", "iface";
iommu-cells = <0>;
status = "disabled";
};
@@ -593,6 +595,8 @@
reg = <0x20030480 0x40>, <0x200304c0 0x40>;
interrupts = ;
interrupt-names = "vdec_mmu";
+   clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>;
+   clock-names = "aclk", "iface";
iommu-cells = <0>;
status = "disabled";
};
@@ -602,6 +606,8 @@
reg = <0x20053f00 0x100>;
interrupts = ;
interrupt-names = "vop_mmu";
+   clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>;
+   clock-names = "aclk", "iface";
iommu-cells = <0>;
status = "disabled";
};
@@ -611,6 +617,8 @@
reg = <0x20070800 0x100>;
interrupts = ;
interrupt-names = "iep_mmu";
+   clocks = <&cru ACLK_IEP>, <&cru HCLK_IEP>;
+   clock-names = "aclk", "iface";
iommu-cells = <0>;
status = "disabled";
};
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index be9acb6d28a1..d7e49d29ace5 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -959,6 +959,8 @@
reg = <0x0 0xff900800 0x0 0x40>;
interrupts = ;
interrupt-names = "iep_mmu";
+   clocks = <&cru ACLK_IEP>, <&cru HCLK_IEP>;
+   clock-names = "aclk", "iface";
#iommu-cells = <0>;
status = "disabled";
};
@@ -968,6 +970,8 @@
reg = <0x0 0xff914000 0x0 0x100>, <0x0 0xff915000 0x0 0x100>;
interrupts = ;
interrupt-names = "isp_mmu";
+   clocks = <&cru ACLK_ISP>, <&cru HCLK_ISP>;
+   clock-names = "aclk", "iface";
#iommu-cells = <0>;
rockchip,disable-mmu-reset;
status = "disabled";
@@ -1027,6 +1031,8 @@
reg = <0x0 0xff930300 0x0 0x100>;
interrupts = ;
interrupt-names = "vopb_mmu";
+   clocks = <&cru ACLK_VOP0>, <&cru HCLK_VOP0>;
+   clock-names = "aclk", "iface";
power-domains = <&power RK3288_PD_VIO>;
#iommu-cells = <0>;
status = "disabled";
@@ -1075,6 +1081,8 @@
reg = <0x0 0xff940300 0x0 0x100>;
interrupts = ;
interrupt-names = "vopl_mmu";
+   clocks = <&cru ACLK_VOP1>, <&cru HCLK_VOP1>;
+   clock-names = "aclk", "iface";
power-domains = <&power RK3288_PD_VIO>;
#iommu-cells = <0>;
status = "disabled";
@@ -1206,6 +1214,8 @@
reg = <0x0 0xff9a0800 0x0 0x100>;
interrupts = ;
interrupt-names = "vpu_mmu";
+   clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
+   clock-names = "aclk", "iface";
#iommu-cells = <0>;
status = "disabled";
};
@@ -1215,6 +1225,8 @@
reg = <0x0 0xff9c0440 0x0 0x40>, <0x0 0xff9c0480 0x0 0x40>;
interrupts = ;
interrupt-names = "hevc_mmu";
+