Re: [PATCH v2 1/4] arm64: dts: rockchip: Split out common nodes for Rock960 based boards

2018-09-12 Thread Heiko Stuebner
Am Mittwoch, 12. September 2018, 10:22:44 CEST schrieb Manivannan Sadhasivam:
> On Wed, Sep 12, 2018 at 09:26:12AM +0200, Heiko Stübner wrote:
> > Am Mittwoch, 12. September 2018, 05:12:48 CEST schrieb Manivannan 
> > Sadhasivam:
> > > Hi Ezequiel,
> > > 
> > > On Tue, Sep 11, 2018 at 04:40:29PM -0300, Ezequiel Garcia wrote:
> > > > On Tue, 2018-09-11 at 08:00 +0530, Manivannan Sadhasivam wrote:
> > > > > Since the same family members of Rock960 boards (Rock960 and Ficus)
> > > > > share the same configuration, split out the common nodes into a common
> > > > > dtsi file for reducing code duplication. The board specific nodes for
> > > > > Ficus boards are then placed in corresponding board DTS file.
> > > > 
> > > > I think it should be possible to move the common USB nodes to the dtsi
> > > > file, and keep the board-specific (phy-supply property) in the dts 
> > > > files:
> > > > 
> > > > _host {
> > > > 
> > > > phy-supply = <_host>;
> > > > 
> > > > };
> > > > 
> > > > _host {
> > > > 
> > > > phy-supply = <_host>;
> > > > 
> > > > };
> > > 
> > > We can do that but my intention was to entirely partition the nodes
> > > which are not common. So that it would be less confusing when someone
> > > looks at it (please correct me if I'm wrong).
> > 
> > The supply is actually named the same on both boards, so you could move
> > all the usb-nodes to the main dtsi, including the reference to vcc5v0_host
> > which would then get defined itself in the two board dts.
> > 
> > Then again, seeing that the vcc5v0_host also only differs in the actually
> > used gpio another option would be to move the whole regulator node
> > to the dtsi and just define the gpio properties in the board dts files.
> >
> 
> Hmm, if that's the preferred option then I guess this applies to pcie
> nodes also. At the end, usb and pcie nodes will be shrinked to below in
> board dts:
> 
>  {
> pcie {
> pcie_drv: pcie-drv {
> rockchip,pins =
> <2 RK_PA5 RK_FUNC_GPIO _pull_none>;
> };
> };
> 
> usb2 {
> host_vbus_drv: host-vbus-drv {
> rockchip,pins =
> <4 RK_PD1 RK_FUNC_GPIO _pull_none>;
> };
> };
> };
> 
>  {
> ep-gpios = < RK_PA2 GPIO_ACTIVE_HIGH>;
> status = "okay";
> };
> 
> _pcie {
> gpio = < 5 GPIO_ACTIVE_HIGH>;
> };
> 
> _host {
> gpio = < 25 GPIO_ACTIVE_HIGH>;
> };

yep, ideally we could go that way. It's way easier to determine the
actual differences between boards that way as well.


Heiko




Re: [PATCH v2 1/4] arm64: dts: rockchip: Split out common nodes for Rock960 based boards

2018-09-12 Thread Heiko Stuebner
Am Mittwoch, 12. September 2018, 10:22:44 CEST schrieb Manivannan Sadhasivam:
> On Wed, Sep 12, 2018 at 09:26:12AM +0200, Heiko Stübner wrote:
> > Am Mittwoch, 12. September 2018, 05:12:48 CEST schrieb Manivannan 
> > Sadhasivam:
> > > Hi Ezequiel,
> > > 
> > > On Tue, Sep 11, 2018 at 04:40:29PM -0300, Ezequiel Garcia wrote:
> > > > On Tue, 2018-09-11 at 08:00 +0530, Manivannan Sadhasivam wrote:
> > > > > Since the same family members of Rock960 boards (Rock960 and Ficus)
> > > > > share the same configuration, split out the common nodes into a common
> > > > > dtsi file for reducing code duplication. The board specific nodes for
> > > > > Ficus boards are then placed in corresponding board DTS file.
> > > > 
> > > > I think it should be possible to move the common USB nodes to the dtsi
> > > > file, and keep the board-specific (phy-supply property) in the dts 
> > > > files:
> > > > 
> > > > _host {
> > > > 
> > > > phy-supply = <_host>;
> > > > 
> > > > };
> > > > 
> > > > _host {
> > > > 
> > > > phy-supply = <_host>;
> > > > 
> > > > };
> > > 
> > > We can do that but my intention was to entirely partition the nodes
> > > which are not common. So that it would be less confusing when someone
> > > looks at it (please correct me if I'm wrong).
> > 
> > The supply is actually named the same on both boards, so you could move
> > all the usb-nodes to the main dtsi, including the reference to vcc5v0_host
> > which would then get defined itself in the two board dts.
> > 
> > Then again, seeing that the vcc5v0_host also only differs in the actually
> > used gpio another option would be to move the whole regulator node
> > to the dtsi and just define the gpio properties in the board dts files.
> >
> 
> Hmm, if that's the preferred option then I guess this applies to pcie
> nodes also. At the end, usb and pcie nodes will be shrinked to below in
> board dts:
> 
>  {
> pcie {
> pcie_drv: pcie-drv {
> rockchip,pins =
> <2 RK_PA5 RK_FUNC_GPIO _pull_none>;
> };
> };
> 
> usb2 {
> host_vbus_drv: host-vbus-drv {
> rockchip,pins =
> <4 RK_PD1 RK_FUNC_GPIO _pull_none>;
> };
> };
> };
> 
>  {
> ep-gpios = < RK_PA2 GPIO_ACTIVE_HIGH>;
> status = "okay";
> };
> 
> _pcie {
> gpio = < 5 GPIO_ACTIVE_HIGH>;
> };
> 
> _host {
> gpio = < 25 GPIO_ACTIVE_HIGH>;
> };

yep, ideally we could go that way. It's way easier to determine the
actual differences between boards that way as well.


Heiko




Re: [PATCH v2 1/4] arm64: dts: rockchip: Split out common nodes for Rock960 based boards

2018-09-12 Thread Manivannan Sadhasivam
On Wed, Sep 12, 2018 at 09:26:12AM +0200, Heiko Stübner wrote:
> Am Mittwoch, 12. September 2018, 05:12:48 CEST schrieb Manivannan Sadhasivam:
> > Hi Ezequiel,
> > 
> > On Tue, Sep 11, 2018 at 04:40:29PM -0300, Ezequiel Garcia wrote:
> > > On Tue, 2018-09-11 at 08:00 +0530, Manivannan Sadhasivam wrote:
> > > > Since the same family members of Rock960 boards (Rock960 and Ficus)
> > > > share the same configuration, split out the common nodes into a common
> > > > dtsi file for reducing code duplication. The board specific nodes for
> > > > Ficus boards are then placed in corresponding board DTS file.
> > > 
> > > I think it should be possible to move the common USB nodes to the dtsi
> > > file, and keep the board-specific (phy-supply property) in the dts files:
> > > 
> > > _host {
> > > 
> > > phy-supply = <_host>;
> > > 
> > > };
> > > 
> > > _host {
> > > 
> > > phy-supply = <_host>;
> > > 
> > > };
> > 
> > We can do that but my intention was to entirely partition the nodes
> > which are not common. So that it would be less confusing when someone
> > looks at it (please correct me if I'm wrong).
> 
> The supply is actually named the same on both boards, so you could move
> all the usb-nodes to the main dtsi, including the reference to vcc5v0_host
> which would then get defined itself in the two board dts.
> 
> Then again, seeing that the vcc5v0_host also only differs in the actually
> used gpio another option would be to move the whole regulator node
> to the dtsi and just define the gpio properties in the board dts files.
>

Hmm, if that's the preferred option then I guess this applies to pcie
nodes also. At the end, usb and pcie nodes will be shrinked to below in
board dts:

 {
pcie {
pcie_drv: pcie-drv {
rockchip,pins =
<2 RK_PA5 RK_FUNC_GPIO _pull_none>;
};
};

usb2 {
host_vbus_drv: host-vbus-drv {
rockchip,pins =
<4 RK_PD1 RK_FUNC_GPIO _pull_none>;
};
};
};

 {
ep-gpios = < RK_PA2 GPIO_ACTIVE_HIGH>;
status = "okay";
};

_pcie {
gpio = < 5 GPIO_ACTIVE_HIGH>;
};

_host {
gpio = < 25 GPIO_ACTIVE_HIGH>;
};

Thanks,
Mani

> 
> Heiko
> 
> 


Re: [PATCH v2 1/4] arm64: dts: rockchip: Split out common nodes for Rock960 based boards

2018-09-12 Thread Manivannan Sadhasivam
On Wed, Sep 12, 2018 at 09:26:12AM +0200, Heiko Stübner wrote:
> Am Mittwoch, 12. September 2018, 05:12:48 CEST schrieb Manivannan Sadhasivam:
> > Hi Ezequiel,
> > 
> > On Tue, Sep 11, 2018 at 04:40:29PM -0300, Ezequiel Garcia wrote:
> > > On Tue, 2018-09-11 at 08:00 +0530, Manivannan Sadhasivam wrote:
> > > > Since the same family members of Rock960 boards (Rock960 and Ficus)
> > > > share the same configuration, split out the common nodes into a common
> > > > dtsi file for reducing code duplication. The board specific nodes for
> > > > Ficus boards are then placed in corresponding board DTS file.
> > > 
> > > I think it should be possible to move the common USB nodes to the dtsi
> > > file, and keep the board-specific (phy-supply property) in the dts files:
> > > 
> > > _host {
> > > 
> > > phy-supply = <_host>;
> > > 
> > > };
> > > 
> > > _host {
> > > 
> > > phy-supply = <_host>;
> > > 
> > > };
> > 
> > We can do that but my intention was to entirely partition the nodes
> > which are not common. So that it would be less confusing when someone
> > looks at it (please correct me if I'm wrong).
> 
> The supply is actually named the same on both boards, so you could move
> all the usb-nodes to the main dtsi, including the reference to vcc5v0_host
> which would then get defined itself in the two board dts.
> 
> Then again, seeing that the vcc5v0_host also only differs in the actually
> used gpio another option would be to move the whole regulator node
> to the dtsi and just define the gpio properties in the board dts files.
>

Hmm, if that's the preferred option then I guess this applies to pcie
nodes also. At the end, usb and pcie nodes will be shrinked to below in
board dts:

 {
pcie {
pcie_drv: pcie-drv {
rockchip,pins =
<2 RK_PA5 RK_FUNC_GPIO _pull_none>;
};
};

usb2 {
host_vbus_drv: host-vbus-drv {
rockchip,pins =
<4 RK_PD1 RK_FUNC_GPIO _pull_none>;
};
};
};

 {
ep-gpios = < RK_PA2 GPIO_ACTIVE_HIGH>;
status = "okay";
};

_pcie {
gpio = < 5 GPIO_ACTIVE_HIGH>;
};

_host {
gpio = < 25 GPIO_ACTIVE_HIGH>;
};

Thanks,
Mani

> 
> Heiko
> 
> 


Re: [PATCH v2 1/4] arm64: dts: rockchip: Split out common nodes for Rock960 based boards

2018-09-12 Thread Heiko Stübner
Am Mittwoch, 12. September 2018, 05:12:48 CEST schrieb Manivannan Sadhasivam:
> Hi Ezequiel,
> 
> On Tue, Sep 11, 2018 at 04:40:29PM -0300, Ezequiel Garcia wrote:
> > On Tue, 2018-09-11 at 08:00 +0530, Manivannan Sadhasivam wrote:
> > > Since the same family members of Rock960 boards (Rock960 and Ficus)
> > > share the same configuration, split out the common nodes into a common
> > > dtsi file for reducing code duplication. The board specific nodes for
> > > Ficus boards are then placed in corresponding board DTS file.
> > 
> > I think it should be possible to move the common USB nodes to the dtsi
> > file, and keep the board-specific (phy-supply property) in the dts files:
> > 
> > _host {
> > 
> > phy-supply = <_host>;
> > 
> > };
> > 
> > _host {
> > 
> > phy-supply = <_host>;
> > 
> > };
> 
> We can do that but my intention was to entirely partition the nodes
> which are not common. So that it would be less confusing when someone
> looks at it (please correct me if I'm wrong).

The supply is actually named the same on both boards, so you could move
all the usb-nodes to the main dtsi, including the reference to vcc5v0_host
which would then get defined itself in the two board dts.

Then again, seeing that the vcc5v0_host also only differs in the actually
used gpio another option would be to move the whole regulator node
to the dtsi and just define the gpio properties in the board dts files.


Heiko




Re: [PATCH v2 1/4] arm64: dts: rockchip: Split out common nodes for Rock960 based boards

2018-09-12 Thread Heiko Stübner
Am Mittwoch, 12. September 2018, 05:12:48 CEST schrieb Manivannan Sadhasivam:
> Hi Ezequiel,
> 
> On Tue, Sep 11, 2018 at 04:40:29PM -0300, Ezequiel Garcia wrote:
> > On Tue, 2018-09-11 at 08:00 +0530, Manivannan Sadhasivam wrote:
> > > Since the same family members of Rock960 boards (Rock960 and Ficus)
> > > share the same configuration, split out the common nodes into a common
> > > dtsi file for reducing code duplication. The board specific nodes for
> > > Ficus boards are then placed in corresponding board DTS file.
> > 
> > I think it should be possible to move the common USB nodes to the dtsi
> > file, and keep the board-specific (phy-supply property) in the dts files:
> > 
> > _host {
> > 
> > phy-supply = <_host>;
> > 
> > };
> > 
> > _host {
> > 
> > phy-supply = <_host>;
> > 
> > };
> 
> We can do that but my intention was to entirely partition the nodes
> which are not common. So that it would be less confusing when someone
> looks at it (please correct me if I'm wrong).

The supply is actually named the same on both boards, so you could move
all the usb-nodes to the main dtsi, including the reference to vcc5v0_host
which would then get defined itself in the two board dts.

Then again, seeing that the vcc5v0_host also only differs in the actually
used gpio another option would be to move the whole regulator node
to the dtsi and just define the gpio properties in the board dts files.


Heiko




Re: [PATCH v2 1/4] arm64: dts: rockchip: Split out common nodes for Rock960 based boards

2018-09-11 Thread Manivannan Sadhasivam
Hi Ezequiel,

On Tue, Sep 11, 2018 at 04:40:29PM -0300, Ezequiel Garcia wrote:
> On Tue, 2018-09-11 at 08:00 +0530, Manivannan Sadhasivam wrote:
> > Since the same family members of Rock960 boards (Rock960 and Ficus)
> > share the same configuration, split out the common nodes into a common
> > dtsi file for reducing code duplication. The board specific nodes for
> > Ficus boards are then placed in corresponding board DTS file.
> > 
> 
> I think it should be possible to move the common USB nodes to the dtsi file,
> and keep the board-specific (phy-supply property) in the dts files:
> 
> _host {
> phy-supply = <_host>;
> };
> 
> _host {
> phy-supply = <_host>;
> };
> 

We can do that but my intention was to entirely partition the nodes
which are not common. So that it would be less confusing when someone
looks at it (please correct me if I'm wrong).

> Also, I believe it would be good to have some more details
> in this commit log. The information on the cover letter is great,
> so I'd just repeat some of that here.
> 

Sure, will add it in next iteration.

> Other than that, for the ficus bits:
> 
> Reviewed-by: Ezequiel Garcia 
> 

Thanks a lot for the review!

Regards,
Mani

> Thanks very much for this work!
> Ezequiel
> 
> 
> > Signed-off-by: Manivannan Sadhasivam 
> > ---
> >  arch/arm64/boot/dts/rockchip/rk3399-ficus.dts | 429 +
> >  .../boot/dts/rockchip/rk3399-rock960.dtsi | 439 ++
> >  2 files changed, 440 insertions(+), 428 deletions(-)
> >  create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi
> > 
> > diff --git a/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts 
> > b/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
> > index 8978d924eb83..7f6ec37d5a69 100644
> > --- a/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
> > +++ b/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
> > @@ -7,8 +7,7 @@
> >   */
> >  
> >  /dts-v1/;
> > -#include "rk3399.dtsi"
> > -#include "rk3399-opp.dtsi"
> > +#include "rk3399-rock960.dtsi"
> >  
> >  / {
> > model = "96boards RK3399 Ficus";
> > @@ -25,31 +24,6 @@
> > #clock-cells = <0>;
> > };
> >  
> > -   vcc1v8_s0: vcc1v8-s0 {
> > -   compatible = "regulator-fixed";
> > -   regulator-name = "vcc1v8_s0";
> > -   regulator-min-microvolt = <180>;
> > -   regulator-max-microvolt = <180>;
> > -   regulator-always-on;
> > -   };
> > -
> > -   vcc_sys: vcc-sys {
> > -   compatible = "regulator-fixed";
> > -   regulator-name = "vcc_sys";
> > -   regulator-min-microvolt = <500>;
> > -   regulator-max-microvolt = <500>;
> > -   regulator-always-on;
> > -   };
> > -
> > -   vcc3v3_sys: vcc3v3-sys {
> > -   compatible = "regulator-fixed";
> > -   regulator-name = "vcc3v3_sys";
> > -   regulator-min-microvolt = <330>;
> > -   regulator-max-microvolt = <330>;
> > -   regulator-always-on;
> > -   vin-supply = <_sys>;
> > -   };
> > -
> > vcc3v3_pcie: vcc3v3-pcie-regulator {
> > compatible = "regulator-fixed";
> > enable-active-high;
> > @@ -75,46 +49,6 @@
> > regulator-always-on;
> > vin-supply = <_sys>;
> > };
> > -
> > -   vdd_log: vdd-log {
> > -   compatible = "pwm-regulator";
> > -   pwms = < 0 25000 0>;
> > -   regulator-name = "vdd_log";
> > -   regulator-min-microvolt = <80>;
> > -   regulator-max-microvolt = <140>;
> > -   regulator-always-on;
> > -   regulator-boot-on;
> > -   vin-supply = <_sys>;
> > -   };
> > -
> > -};
> > -
> > -_l0 {
> > -   cpu-supply = <_cpu_l>;
> > -};
> > -
> > -_l1 {
> > -   cpu-supply = <_cpu_l>;
> > -};
> > -
> > -_l2 {
> > -   cpu-supply = <_cpu_l>;
> > -};
> > -
> > -_l3 {
> > -   cpu-supply = <_cpu_l>;
> > -};
> > -
> > -_b0 {
> > -   cpu-supply = <_cpu_b>;
> > -};
> > -
> > -_b1 {
> > -   cpu-supply = <_cpu_b>;
> > -};
> > -
> > -_phy {
> > -   status = "okay";
> >  };
> >  
> >   {
> > @@ -133,263 +67,6 @@
> > status = "okay";
> >  };
> >  
> > - {
> > -   ddc-i2c-bus = <>;
> > -   pinctrl-names = "default";
> > -   pinctrl-0 = <_cec>;
> > -   status = "okay";
> > -};
> > -
> > - {
> > -   clock-frequency = <40>;
> > -   i2c-scl-rising-time-ns = <168>;
> > -   i2c-scl-falling-time-ns = <4>;
> > -   status = "okay";
> > -
> > -   vdd_cpu_b: regulator@40 {
> > -   compatible = "silergy,syr827";
> > -   reg = <0x40>;
> > -   fcs,suspend-voltage-selector = <1>;
> > -   regulator-name = "vdd_cpu_b";
> > -   regulator-min-microvolt = <712500>;
> > -   regulator-max-microvolt = <150>;
> > -   regulator-ramp-delay = <1000>;
> > -   regulator-always-on;
> > -   regulator-boot-on;
> > -   vin-supply = <_sys>;
> > -   status = "okay";
> > -
> > -   regulator-state-mem {
> > - 

Re: [PATCH v2 1/4] arm64: dts: rockchip: Split out common nodes for Rock960 based boards

2018-09-11 Thread Manivannan Sadhasivam
Hi Ezequiel,

On Tue, Sep 11, 2018 at 04:40:29PM -0300, Ezequiel Garcia wrote:
> On Tue, 2018-09-11 at 08:00 +0530, Manivannan Sadhasivam wrote:
> > Since the same family members of Rock960 boards (Rock960 and Ficus)
> > share the same configuration, split out the common nodes into a common
> > dtsi file for reducing code duplication. The board specific nodes for
> > Ficus boards are then placed in corresponding board DTS file.
> > 
> 
> I think it should be possible to move the common USB nodes to the dtsi file,
> and keep the board-specific (phy-supply property) in the dts files:
> 
> _host {
> phy-supply = <_host>;
> };
> 
> _host {
> phy-supply = <_host>;
> };
> 

We can do that but my intention was to entirely partition the nodes
which are not common. So that it would be less confusing when someone
looks at it (please correct me if I'm wrong).

> Also, I believe it would be good to have some more details
> in this commit log. The information on the cover letter is great,
> so I'd just repeat some of that here.
> 

Sure, will add it in next iteration.

> Other than that, for the ficus bits:
> 
> Reviewed-by: Ezequiel Garcia 
> 

Thanks a lot for the review!

Regards,
Mani

> Thanks very much for this work!
> Ezequiel
> 
> 
> > Signed-off-by: Manivannan Sadhasivam 
> > ---
> >  arch/arm64/boot/dts/rockchip/rk3399-ficus.dts | 429 +
> >  .../boot/dts/rockchip/rk3399-rock960.dtsi | 439 ++
> >  2 files changed, 440 insertions(+), 428 deletions(-)
> >  create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi
> > 
> > diff --git a/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts 
> > b/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
> > index 8978d924eb83..7f6ec37d5a69 100644
> > --- a/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
> > +++ b/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
> > @@ -7,8 +7,7 @@
> >   */
> >  
> >  /dts-v1/;
> > -#include "rk3399.dtsi"
> > -#include "rk3399-opp.dtsi"
> > +#include "rk3399-rock960.dtsi"
> >  
> >  / {
> > model = "96boards RK3399 Ficus";
> > @@ -25,31 +24,6 @@
> > #clock-cells = <0>;
> > };
> >  
> > -   vcc1v8_s0: vcc1v8-s0 {
> > -   compatible = "regulator-fixed";
> > -   regulator-name = "vcc1v8_s0";
> > -   regulator-min-microvolt = <180>;
> > -   regulator-max-microvolt = <180>;
> > -   regulator-always-on;
> > -   };
> > -
> > -   vcc_sys: vcc-sys {
> > -   compatible = "regulator-fixed";
> > -   regulator-name = "vcc_sys";
> > -   regulator-min-microvolt = <500>;
> > -   regulator-max-microvolt = <500>;
> > -   regulator-always-on;
> > -   };
> > -
> > -   vcc3v3_sys: vcc3v3-sys {
> > -   compatible = "regulator-fixed";
> > -   regulator-name = "vcc3v3_sys";
> > -   regulator-min-microvolt = <330>;
> > -   regulator-max-microvolt = <330>;
> > -   regulator-always-on;
> > -   vin-supply = <_sys>;
> > -   };
> > -
> > vcc3v3_pcie: vcc3v3-pcie-regulator {
> > compatible = "regulator-fixed";
> > enable-active-high;
> > @@ -75,46 +49,6 @@
> > regulator-always-on;
> > vin-supply = <_sys>;
> > };
> > -
> > -   vdd_log: vdd-log {
> > -   compatible = "pwm-regulator";
> > -   pwms = < 0 25000 0>;
> > -   regulator-name = "vdd_log";
> > -   regulator-min-microvolt = <80>;
> > -   regulator-max-microvolt = <140>;
> > -   regulator-always-on;
> > -   regulator-boot-on;
> > -   vin-supply = <_sys>;
> > -   };
> > -
> > -};
> > -
> > -_l0 {
> > -   cpu-supply = <_cpu_l>;
> > -};
> > -
> > -_l1 {
> > -   cpu-supply = <_cpu_l>;
> > -};
> > -
> > -_l2 {
> > -   cpu-supply = <_cpu_l>;
> > -};
> > -
> > -_l3 {
> > -   cpu-supply = <_cpu_l>;
> > -};
> > -
> > -_b0 {
> > -   cpu-supply = <_cpu_b>;
> > -};
> > -
> > -_b1 {
> > -   cpu-supply = <_cpu_b>;
> > -};
> > -
> > -_phy {
> > -   status = "okay";
> >  };
> >  
> >   {
> > @@ -133,263 +67,6 @@
> > status = "okay";
> >  };
> >  
> > - {
> > -   ddc-i2c-bus = <>;
> > -   pinctrl-names = "default";
> > -   pinctrl-0 = <_cec>;
> > -   status = "okay";
> > -};
> > -
> > - {
> > -   clock-frequency = <40>;
> > -   i2c-scl-rising-time-ns = <168>;
> > -   i2c-scl-falling-time-ns = <4>;
> > -   status = "okay";
> > -
> > -   vdd_cpu_b: regulator@40 {
> > -   compatible = "silergy,syr827";
> > -   reg = <0x40>;
> > -   fcs,suspend-voltage-selector = <1>;
> > -   regulator-name = "vdd_cpu_b";
> > -   regulator-min-microvolt = <712500>;
> > -   regulator-max-microvolt = <150>;
> > -   regulator-ramp-delay = <1000>;
> > -   regulator-always-on;
> > -   regulator-boot-on;
> > -   vin-supply = <_sys>;
> > -   status = "okay";
> > -
> > -   regulator-state-mem {
> > - 

Re: [PATCH v2 1/4] arm64: dts: rockchip: Split out common nodes for Rock960 based boards

2018-09-11 Thread Ezequiel Garcia
On Tue, 2018-09-11 at 08:00 +0530, Manivannan Sadhasivam wrote:
> Since the same family members of Rock960 boards (Rock960 and Ficus)
> share the same configuration, split out the common nodes into a common
> dtsi file for reducing code duplication. The board specific nodes for
> Ficus boards are then placed in corresponding board DTS file.
> 

I think it should be possible to move the common USB nodes to the dtsi file,
and keep the board-specific (phy-supply property) in the dts files:

_host {
phy-supply = <_host>;
};

_host {
phy-supply = <_host>;
};

Also, I believe it would be good to have some more details
in this commit log. The information on the cover letter is great,
so I'd just repeat some of that here.

Other than that, for the ficus bits:

Reviewed-by: Ezequiel Garcia 

Thanks very much for this work!
Ezequiel


> Signed-off-by: Manivannan Sadhasivam 
> ---
>  arch/arm64/boot/dts/rockchip/rk3399-ficus.dts | 429 +
>  .../boot/dts/rockchip/rk3399-rock960.dtsi | 439 ++
>  2 files changed, 440 insertions(+), 428 deletions(-)
>  create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts 
> b/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
> index 8978d924eb83..7f6ec37d5a69 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
> @@ -7,8 +7,7 @@
>   */
>  
>  /dts-v1/;
> -#include "rk3399.dtsi"
> -#include "rk3399-opp.dtsi"
> +#include "rk3399-rock960.dtsi"
>  
>  / {
>   model = "96boards RK3399 Ficus";
> @@ -25,31 +24,6 @@
>   #clock-cells = <0>;
>   };
>  
> - vcc1v8_s0: vcc1v8-s0 {
> - compatible = "regulator-fixed";
> - regulator-name = "vcc1v8_s0";
> - regulator-min-microvolt = <180>;
> - regulator-max-microvolt = <180>;
> - regulator-always-on;
> - };
> -
> - vcc_sys: vcc-sys {
> - compatible = "regulator-fixed";
> - regulator-name = "vcc_sys";
> - regulator-min-microvolt = <500>;
> - regulator-max-microvolt = <500>;
> - regulator-always-on;
> - };
> -
> - vcc3v3_sys: vcc3v3-sys {
> - compatible = "regulator-fixed";
> - regulator-name = "vcc3v3_sys";
> - regulator-min-microvolt = <330>;
> - regulator-max-microvolt = <330>;
> - regulator-always-on;
> - vin-supply = <_sys>;
> - };
> -
>   vcc3v3_pcie: vcc3v3-pcie-regulator {
>   compatible = "regulator-fixed";
>   enable-active-high;
> @@ -75,46 +49,6 @@
>   regulator-always-on;
>   vin-supply = <_sys>;
>   };
> -
> - vdd_log: vdd-log {
> - compatible = "pwm-regulator";
> - pwms = < 0 25000 0>;
> - regulator-name = "vdd_log";
> - regulator-min-microvolt = <80>;
> - regulator-max-microvolt = <140>;
> - regulator-always-on;
> - regulator-boot-on;
> - vin-supply = <_sys>;
> - };
> -
> -};
> -
> -_l0 {
> - cpu-supply = <_cpu_l>;
> -};
> -
> -_l1 {
> - cpu-supply = <_cpu_l>;
> -};
> -
> -_l2 {
> - cpu-supply = <_cpu_l>;
> -};
> -
> -_l3 {
> - cpu-supply = <_cpu_l>;
> -};
> -
> -_b0 {
> - cpu-supply = <_cpu_b>;
> -};
> -
> -_b1 {
> - cpu-supply = <_cpu_b>;
> -};
> -
> -_phy {
> - status = "okay";
>  };
>  
>   {
> @@ -133,263 +67,6 @@
>   status = "okay";
>  };
>  
> - {
> - ddc-i2c-bus = <>;
> - pinctrl-names = "default";
> - pinctrl-0 = <_cec>;
> - status = "okay";
> -};
> -
> - {
> - clock-frequency = <40>;
> - i2c-scl-rising-time-ns = <168>;
> - i2c-scl-falling-time-ns = <4>;
> - status = "okay";
> -
> - vdd_cpu_b: regulator@40 {
> - compatible = "silergy,syr827";
> - reg = <0x40>;
> - fcs,suspend-voltage-selector = <1>;
> - regulator-name = "vdd_cpu_b";
> - regulator-min-microvolt = <712500>;
> - regulator-max-microvolt = <150>;
> - regulator-ramp-delay = <1000>;
> - regulator-always-on;
> - regulator-boot-on;
> - vin-supply = <_sys>;
> - status = "okay";
> -
> - regulator-state-mem {
> - regulator-off-in-suspend;
> - };
> - };
> -
> - vdd_gpu: regulator@41 {
> - compatible = "silergy,syr828";
> - reg = <0x41>;
> - fcs,suspend-voltage-selector = <1>;
> - regulator-name = "vdd_gpu";
> - regulator-min-microvolt = <712500>;
> - regulator-max-microvolt = <150>;
> - regulator-ramp-delay = <1000>;
> - regulator-always-on;
> - regulator-boot-on;
> - vin-supply = <_sys>;
> -   

Re: [PATCH v2 1/4] arm64: dts: rockchip: Split out common nodes for Rock960 based boards

2018-09-11 Thread Ezequiel Garcia
On Tue, 2018-09-11 at 08:00 +0530, Manivannan Sadhasivam wrote:
> Since the same family members of Rock960 boards (Rock960 and Ficus)
> share the same configuration, split out the common nodes into a common
> dtsi file for reducing code duplication. The board specific nodes for
> Ficus boards are then placed in corresponding board DTS file.
> 

I think it should be possible to move the common USB nodes to the dtsi file,
and keep the board-specific (phy-supply property) in the dts files:

_host {
phy-supply = <_host>;
};

_host {
phy-supply = <_host>;
};

Also, I believe it would be good to have some more details
in this commit log. The information on the cover letter is great,
so I'd just repeat some of that here.

Other than that, for the ficus bits:

Reviewed-by: Ezequiel Garcia 

Thanks very much for this work!
Ezequiel


> Signed-off-by: Manivannan Sadhasivam 
> ---
>  arch/arm64/boot/dts/rockchip/rk3399-ficus.dts | 429 +
>  .../boot/dts/rockchip/rk3399-rock960.dtsi | 439 ++
>  2 files changed, 440 insertions(+), 428 deletions(-)
>  create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts 
> b/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
> index 8978d924eb83..7f6ec37d5a69 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
> @@ -7,8 +7,7 @@
>   */
>  
>  /dts-v1/;
> -#include "rk3399.dtsi"
> -#include "rk3399-opp.dtsi"
> +#include "rk3399-rock960.dtsi"
>  
>  / {
>   model = "96boards RK3399 Ficus";
> @@ -25,31 +24,6 @@
>   #clock-cells = <0>;
>   };
>  
> - vcc1v8_s0: vcc1v8-s0 {
> - compatible = "regulator-fixed";
> - regulator-name = "vcc1v8_s0";
> - regulator-min-microvolt = <180>;
> - regulator-max-microvolt = <180>;
> - regulator-always-on;
> - };
> -
> - vcc_sys: vcc-sys {
> - compatible = "regulator-fixed";
> - regulator-name = "vcc_sys";
> - regulator-min-microvolt = <500>;
> - regulator-max-microvolt = <500>;
> - regulator-always-on;
> - };
> -
> - vcc3v3_sys: vcc3v3-sys {
> - compatible = "regulator-fixed";
> - regulator-name = "vcc3v3_sys";
> - regulator-min-microvolt = <330>;
> - regulator-max-microvolt = <330>;
> - regulator-always-on;
> - vin-supply = <_sys>;
> - };
> -
>   vcc3v3_pcie: vcc3v3-pcie-regulator {
>   compatible = "regulator-fixed";
>   enable-active-high;
> @@ -75,46 +49,6 @@
>   regulator-always-on;
>   vin-supply = <_sys>;
>   };
> -
> - vdd_log: vdd-log {
> - compatible = "pwm-regulator";
> - pwms = < 0 25000 0>;
> - regulator-name = "vdd_log";
> - regulator-min-microvolt = <80>;
> - regulator-max-microvolt = <140>;
> - regulator-always-on;
> - regulator-boot-on;
> - vin-supply = <_sys>;
> - };
> -
> -};
> -
> -_l0 {
> - cpu-supply = <_cpu_l>;
> -};
> -
> -_l1 {
> - cpu-supply = <_cpu_l>;
> -};
> -
> -_l2 {
> - cpu-supply = <_cpu_l>;
> -};
> -
> -_l3 {
> - cpu-supply = <_cpu_l>;
> -};
> -
> -_b0 {
> - cpu-supply = <_cpu_b>;
> -};
> -
> -_b1 {
> - cpu-supply = <_cpu_b>;
> -};
> -
> -_phy {
> - status = "okay";
>  };
>  
>   {
> @@ -133,263 +67,6 @@
>   status = "okay";
>  };
>  
> - {
> - ddc-i2c-bus = <>;
> - pinctrl-names = "default";
> - pinctrl-0 = <_cec>;
> - status = "okay";
> -};
> -
> - {
> - clock-frequency = <40>;
> - i2c-scl-rising-time-ns = <168>;
> - i2c-scl-falling-time-ns = <4>;
> - status = "okay";
> -
> - vdd_cpu_b: regulator@40 {
> - compatible = "silergy,syr827";
> - reg = <0x40>;
> - fcs,suspend-voltage-selector = <1>;
> - regulator-name = "vdd_cpu_b";
> - regulator-min-microvolt = <712500>;
> - regulator-max-microvolt = <150>;
> - regulator-ramp-delay = <1000>;
> - regulator-always-on;
> - regulator-boot-on;
> - vin-supply = <_sys>;
> - status = "okay";
> -
> - regulator-state-mem {
> - regulator-off-in-suspend;
> - };
> - };
> -
> - vdd_gpu: regulator@41 {
> - compatible = "silergy,syr828";
> - reg = <0x41>;
> - fcs,suspend-voltage-selector = <1>;
> - regulator-name = "vdd_gpu";
> - regulator-min-microvolt = <712500>;
> - regulator-max-microvolt = <150>;
> - regulator-ramp-delay = <1000>;
> - regulator-always-on;
> - regulator-boot-on;
> - vin-supply = <_sys>;
> -   

[PATCH v2 1/4] arm64: dts: rockchip: Split out common nodes for Rock960 based boards

2018-09-10 Thread Manivannan Sadhasivam
Since the same family members of Rock960 boards (Rock960 and Ficus)
share the same configuration, split out the common nodes into a common
dtsi file for reducing code duplication. The board specific nodes for
Ficus boards are then placed in corresponding board DTS file.

Signed-off-by: Manivannan Sadhasivam 
---
 arch/arm64/boot/dts/rockchip/rk3399-ficus.dts | 429 +
 .../boot/dts/rockchip/rk3399-rock960.dtsi | 439 ++
 2 files changed, 440 insertions(+), 428 deletions(-)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts 
b/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
index 8978d924eb83..7f6ec37d5a69 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
@@ -7,8 +7,7 @@
  */
 
 /dts-v1/;
-#include "rk3399.dtsi"
-#include "rk3399-opp.dtsi"
+#include "rk3399-rock960.dtsi"
 
 / {
model = "96boards RK3399 Ficus";
@@ -25,31 +24,6 @@
#clock-cells = <0>;
};
 
-   vcc1v8_s0: vcc1v8-s0 {
-   compatible = "regulator-fixed";
-   regulator-name = "vcc1v8_s0";
-   regulator-min-microvolt = <180>;
-   regulator-max-microvolt = <180>;
-   regulator-always-on;
-   };
-
-   vcc_sys: vcc-sys {
-   compatible = "regulator-fixed";
-   regulator-name = "vcc_sys";
-   regulator-min-microvolt = <500>;
-   regulator-max-microvolt = <500>;
-   regulator-always-on;
-   };
-
-   vcc3v3_sys: vcc3v3-sys {
-   compatible = "regulator-fixed";
-   regulator-name = "vcc3v3_sys";
-   regulator-min-microvolt = <330>;
-   regulator-max-microvolt = <330>;
-   regulator-always-on;
-   vin-supply = <_sys>;
-   };
-
vcc3v3_pcie: vcc3v3-pcie-regulator {
compatible = "regulator-fixed";
enable-active-high;
@@ -75,46 +49,6 @@
regulator-always-on;
vin-supply = <_sys>;
};
-
-   vdd_log: vdd-log {
-   compatible = "pwm-regulator";
-   pwms = < 0 25000 0>;
-   regulator-name = "vdd_log";
-   regulator-min-microvolt = <80>;
-   regulator-max-microvolt = <140>;
-   regulator-always-on;
-   regulator-boot-on;
-   vin-supply = <_sys>;
-   };
-
-};
-
-_l0 {
-   cpu-supply = <_cpu_l>;
-};
-
-_l1 {
-   cpu-supply = <_cpu_l>;
-};
-
-_l2 {
-   cpu-supply = <_cpu_l>;
-};
-
-_l3 {
-   cpu-supply = <_cpu_l>;
-};
-
-_b0 {
-   cpu-supply = <_cpu_b>;
-};
-
-_b1 {
-   cpu-supply = <_cpu_b>;
-};
-
-_phy {
-   status = "okay";
 };
 
  {
@@ -133,263 +67,6 @@
status = "okay";
 };
 
- {
-   ddc-i2c-bus = <>;
-   pinctrl-names = "default";
-   pinctrl-0 = <_cec>;
-   status = "okay";
-};
-
- {
-   clock-frequency = <40>;
-   i2c-scl-rising-time-ns = <168>;
-   i2c-scl-falling-time-ns = <4>;
-   status = "okay";
-
-   vdd_cpu_b: regulator@40 {
-   compatible = "silergy,syr827";
-   reg = <0x40>;
-   fcs,suspend-voltage-selector = <1>;
-   regulator-name = "vdd_cpu_b";
-   regulator-min-microvolt = <712500>;
-   regulator-max-microvolt = <150>;
-   regulator-ramp-delay = <1000>;
-   regulator-always-on;
-   regulator-boot-on;
-   vin-supply = <_sys>;
-   status = "okay";
-
-   regulator-state-mem {
-   regulator-off-in-suspend;
-   };
-   };
-
-   vdd_gpu: regulator@41 {
-   compatible = "silergy,syr828";
-   reg = <0x41>;
-   fcs,suspend-voltage-selector = <1>;
-   regulator-name = "vdd_gpu";
-   regulator-min-microvolt = <712500>;
-   regulator-max-microvolt = <150>;
-   regulator-ramp-delay = <1000>;
-   regulator-always-on;
-   regulator-boot-on;
-   vin-supply = <_sys>;
-   regulator-state-mem {
-   regulator-off-in-suspend;
-   };
-   };
-
-   rk808: pmic@1b {
-   compatible = "rockchip,rk808";
-   reg = <0x1b>;
-   interrupt-parent = <>;
-   interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
-   pinctrl-names = "default";
-   pinctrl-0 = <_int_l>;
-   rockchip,system-power-controller;
-   wakeup-source;
-   #clock-cells = <1>;
-   clock-output-names = "xin32k", "rk808-clkout2";
-
-   vcc1-supply = <_sys>;
-   vcc2-supply = <_sys>;
-   vcc3-supply = <_sys>;
-   

[PATCH v2 1/4] arm64: dts: rockchip: Split out common nodes for Rock960 based boards

2018-09-10 Thread Manivannan Sadhasivam
Since the same family members of Rock960 boards (Rock960 and Ficus)
share the same configuration, split out the common nodes into a common
dtsi file for reducing code duplication. The board specific nodes for
Ficus boards are then placed in corresponding board DTS file.

Signed-off-by: Manivannan Sadhasivam 
---
 arch/arm64/boot/dts/rockchip/rk3399-ficus.dts | 429 +
 .../boot/dts/rockchip/rk3399-rock960.dtsi | 439 ++
 2 files changed, 440 insertions(+), 428 deletions(-)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts 
b/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
index 8978d924eb83..7f6ec37d5a69 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-ficus.dts
@@ -7,8 +7,7 @@
  */
 
 /dts-v1/;
-#include "rk3399.dtsi"
-#include "rk3399-opp.dtsi"
+#include "rk3399-rock960.dtsi"
 
 / {
model = "96boards RK3399 Ficus";
@@ -25,31 +24,6 @@
#clock-cells = <0>;
};
 
-   vcc1v8_s0: vcc1v8-s0 {
-   compatible = "regulator-fixed";
-   regulator-name = "vcc1v8_s0";
-   regulator-min-microvolt = <180>;
-   regulator-max-microvolt = <180>;
-   regulator-always-on;
-   };
-
-   vcc_sys: vcc-sys {
-   compatible = "regulator-fixed";
-   regulator-name = "vcc_sys";
-   regulator-min-microvolt = <500>;
-   regulator-max-microvolt = <500>;
-   regulator-always-on;
-   };
-
-   vcc3v3_sys: vcc3v3-sys {
-   compatible = "regulator-fixed";
-   regulator-name = "vcc3v3_sys";
-   regulator-min-microvolt = <330>;
-   regulator-max-microvolt = <330>;
-   regulator-always-on;
-   vin-supply = <_sys>;
-   };
-
vcc3v3_pcie: vcc3v3-pcie-regulator {
compatible = "regulator-fixed";
enable-active-high;
@@ -75,46 +49,6 @@
regulator-always-on;
vin-supply = <_sys>;
};
-
-   vdd_log: vdd-log {
-   compatible = "pwm-regulator";
-   pwms = < 0 25000 0>;
-   regulator-name = "vdd_log";
-   regulator-min-microvolt = <80>;
-   regulator-max-microvolt = <140>;
-   regulator-always-on;
-   regulator-boot-on;
-   vin-supply = <_sys>;
-   };
-
-};
-
-_l0 {
-   cpu-supply = <_cpu_l>;
-};
-
-_l1 {
-   cpu-supply = <_cpu_l>;
-};
-
-_l2 {
-   cpu-supply = <_cpu_l>;
-};
-
-_l3 {
-   cpu-supply = <_cpu_l>;
-};
-
-_b0 {
-   cpu-supply = <_cpu_b>;
-};
-
-_b1 {
-   cpu-supply = <_cpu_b>;
-};
-
-_phy {
-   status = "okay";
 };
 
  {
@@ -133,263 +67,6 @@
status = "okay";
 };
 
- {
-   ddc-i2c-bus = <>;
-   pinctrl-names = "default";
-   pinctrl-0 = <_cec>;
-   status = "okay";
-};
-
- {
-   clock-frequency = <40>;
-   i2c-scl-rising-time-ns = <168>;
-   i2c-scl-falling-time-ns = <4>;
-   status = "okay";
-
-   vdd_cpu_b: regulator@40 {
-   compatible = "silergy,syr827";
-   reg = <0x40>;
-   fcs,suspend-voltage-selector = <1>;
-   regulator-name = "vdd_cpu_b";
-   regulator-min-microvolt = <712500>;
-   regulator-max-microvolt = <150>;
-   regulator-ramp-delay = <1000>;
-   regulator-always-on;
-   regulator-boot-on;
-   vin-supply = <_sys>;
-   status = "okay";
-
-   regulator-state-mem {
-   regulator-off-in-suspend;
-   };
-   };
-
-   vdd_gpu: regulator@41 {
-   compatible = "silergy,syr828";
-   reg = <0x41>;
-   fcs,suspend-voltage-selector = <1>;
-   regulator-name = "vdd_gpu";
-   regulator-min-microvolt = <712500>;
-   regulator-max-microvolt = <150>;
-   regulator-ramp-delay = <1000>;
-   regulator-always-on;
-   regulator-boot-on;
-   vin-supply = <_sys>;
-   regulator-state-mem {
-   regulator-off-in-suspend;
-   };
-   };
-
-   rk808: pmic@1b {
-   compatible = "rockchip,rk808";
-   reg = <0x1b>;
-   interrupt-parent = <>;
-   interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
-   pinctrl-names = "default";
-   pinctrl-0 = <_int_l>;
-   rockchip,system-power-controller;
-   wakeup-source;
-   #clock-cells = <1>;
-   clock-output-names = "xin32k", "rk808-clkout2";
-
-   vcc1-supply = <_sys>;
-   vcc2-supply = <_sys>;
-   vcc3-supply = <_sys>;
-