diff mbox

[U-Boot,v2,8/9] arm: dts: add ethernet node to Meson gxbb

Message ID 1459667897-2824-9-git-send-email-b.galvani@gmail.com
State Changes Requested
Delegated to: Tom Rini
Headers show

Commit Message

Beniamino Galvani April 3, 2016, 7:18 a.m. UTC
Add a node for the Synopsys Designware Ethernet adapter available on
Meson SoCs to the Meson GXBaby DTS files. The node is not present in
DTS files used in Linux kernel.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
---
 arch/arm/dts/meson-gxbb-odroidc2.dts | 4 ++++
 arch/arm/dts/meson-gxbb.dtsi         | 9 +++++++++
 2 files changed, 13 insertions(+)

Comments

Carlo Caione April 3, 2016, 9:12 a.m. UTC | #1
On Sun, Apr 3, 2016 at 9:18 AM, Beniamino Galvani <b.galvani@gmail.com> wrote:
> Add a node for the Synopsys Designware Ethernet adapter available on
> Meson SoCs to the Meson GXBaby DTS files. The node is not present in
> DTS files used in Linux kernel.
>
> Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
> ---
>  arch/arm/dts/meson-gxbb-odroidc2.dts | 4 ++++
>  arch/arm/dts/meson-gxbb.dtsi         | 9 +++++++++
>  2 files changed, 13 insertions(+)
>
> diff --git a/arch/arm/dts/meson-gxbb-odroidc2.dts b/arch/arm/dts/meson-gxbb-odroidc2.dts
> index 653c2fa..408235d 100644
> --- a/arch/arm/dts/meson-gxbb-odroidc2.dts
> +++ b/arch/arm/dts/meson-gxbb-odroidc2.dts
> @@ -67,3 +67,7 @@
>  &uart_AO {
>         status = "okay";
>  };
> +
> +&gmac0 {
> +       status = "okay";
> +};
> diff --git a/arch/arm/dts/meson-gxbb.dtsi b/arch/arm/dts/meson-gxbb.dtsi
> index 832815d..44a54e7 100644
> --- a/arch/arm/dts/meson-gxbb.dtsi
> +++ b/arch/arm/dts/meson-gxbb.dtsi
> @@ -167,6 +167,15 @@
>                         };
>                 };
>
> +               gmac0: ethernet@c9410000 {
> +                       compatible = "snps,dwmac";
> +                       reg = <0x0 0xc9410000 0x0 0x10000>;
> +                       interrupts = <0 8 1>;
> +                       interrupt-names = "macirq";
> +                       phy-mode = "rgmii";
> +                       status = "disabled";
> +               };
> +
>                 apb: apb@d0000000 {
>                         compatible = "simple-bus";
>                         reg = <0x0 0xd0000000 0x0 0x200000>;

Adding this gmac node means that this DTS is already different from
the DTS we have in mainline. This makes me wonder how in u-boot we
manages the difference in the DT between the kernel and u-boot. Are
they supposed to be always in sync or we expect to have two different
DTs?
Tom Rini April 3, 2016, 2:45 p.m. UTC | #2
On Sun, Apr 03, 2016 at 11:12:14AM +0200, Carlo Caione wrote:
> On Sun, Apr 3, 2016 at 9:18 AM, Beniamino Galvani <b.galvani@gmail.com> wrote:
> > Add a node for the Synopsys Designware Ethernet adapter available on
> > Meson SoCs to the Meson GXBaby DTS files. The node is not present in
> > DTS files used in Linux kernel.
> >
> > Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
> > ---
> >  arch/arm/dts/meson-gxbb-odroidc2.dts | 4 ++++
> >  arch/arm/dts/meson-gxbb.dtsi         | 9 +++++++++
> >  2 files changed, 13 insertions(+)
> >
> > diff --git a/arch/arm/dts/meson-gxbb-odroidc2.dts b/arch/arm/dts/meson-gxbb-odroidc2.dts
> > index 653c2fa..408235d 100644
> > --- a/arch/arm/dts/meson-gxbb-odroidc2.dts
> > +++ b/arch/arm/dts/meson-gxbb-odroidc2.dts
> > @@ -67,3 +67,7 @@
> >  &uart_AO {
> >         status = "okay";
> >  };
> > +
> > +&gmac0 {
> > +       status = "okay";
> > +};
> > diff --git a/arch/arm/dts/meson-gxbb.dtsi b/arch/arm/dts/meson-gxbb.dtsi
> > index 832815d..44a54e7 100644
> > --- a/arch/arm/dts/meson-gxbb.dtsi
> > +++ b/arch/arm/dts/meson-gxbb.dtsi
> > @@ -167,6 +167,15 @@
> >                         };
> >                 };
> >
> > +               gmac0: ethernet@c9410000 {
> > +                       compatible = "snps,dwmac";
> > +                       reg = <0x0 0xc9410000 0x0 0x10000>;
> > +                       interrupts = <0 8 1>;
> > +                       interrupt-names = "macirq";
> > +                       phy-mode = "rgmii";
> > +                       status = "disabled";
> > +               };
> > +
> >                 apb: apb@d0000000 {
> >                         compatible = "simple-bus";
> >                         reg = <0x0 0xd0000000 0x0 0x200000>;
> 
> Adding this gmac node means that this DTS is already different from
> the DTS we have in mainline. This makes me wonder how in u-boot we
> manages the difference in the DT between the kernel and u-boot. Are
> they supposed to be always in sync or we expect to have two different
> DTs?

The expectation is that we keep them in sync, aside from "u-boot,"
prefixed items.  It's OK to sync with whatever the authorative tree is
for a device if it hasn't made it into Linus' tree just yet.  New
bindings also need to be accepted upstream before we pull them in.
Tom Rini April 3, 2016, 4:09 p.m. UTC | #3
On Sun, Apr 03, 2016 at 09:18:16AM +0200, Beniamino Galvani wrote:

> Add a node for the Synopsys Designware Ethernet adapter available on
> Meson SoCs to the Meson GXBaby DTS files. The node is not present in
> DTS files used in Linux kernel.
> 
> Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

... but why is this not yet in the kernel device tree?  Has it just not
made it up from the SoC tree?
Beniamino Galvani April 3, 2016, 8:17 p.m. UTC | #4
On Sun, Apr 03, 2016 at 12:09:33PM -0400, Tom Rini wrote:
> > Add a node for the Synopsys Designware Ethernet adapter available on
> > Meson SoCs to the Meson GXBaby DTS files. The node is not present in
> > DTS files used in Linux kernel.
>
> ... but why is this not yet in the kernel device tree?  Has it just not
> made it up from the SoC tree?

Because kernel doesn't have yet an Ethernet driver for Meson GXBaby to
set the platform-specific registers needed to program the MII mode,
clocks and other things (the settings that are in patch 9/9 of this
submission). And without documentation it's hard to write one and get
it right.

So this patch adds a new uboot-only node to the DTS for Ethernet. This
doesn't seem problematic to me WRT synchronization with kernel DTS
because no new bindings or driver changes are needed; and whenever the
same node will be added to kernel we'll only have to update it in
u-boot.

If it is not acceptable to have a DTS different to kernel one, I'll
have to find a different solution, any suggestions? Should I use
U_BOOT_DEVICE and platform_data inside the board file instead?

Maybe I will submit v3 of the series without Ethernet while I figure
out this.

Beniamino
Tom Rini April 4, 2016, 4:47 a.m. UTC | #5
On Sun, Apr 03, 2016 at 10:17:05PM +0200, Beniamino Galvani wrote:
> On Sun, Apr 03, 2016 at 12:09:33PM -0400, Tom Rini wrote:
> > > Add a node for the Synopsys Designware Ethernet adapter available on
> > > Meson SoCs to the Meson GXBaby DTS files. The node is not present in
> > > DTS files used in Linux kernel.
> >
> > ... but why is this not yet in the kernel device tree?  Has it just not
> > made it up from the SoC tree?
> 
> Because kernel doesn't have yet an Ethernet driver for Meson GXBaby to
> set the platform-specific registers needed to program the MII mode,
> clocks and other things (the settings that are in patch 9/9 of this
> submission). And without documentation it's hard to write one and get
> it right.

So you're just not submitting the binding for the kernel at this point?
If so, yes, sticking with pdata is probably better since when we've been
in this situation before the bindings were actively being worked on the
kernel side as well and we just resynced when things were finalized.
diff mbox

Patch

diff --git a/arch/arm/dts/meson-gxbb-odroidc2.dts b/arch/arm/dts/meson-gxbb-odroidc2.dts
index 653c2fa..408235d 100644
--- a/arch/arm/dts/meson-gxbb-odroidc2.dts
+++ b/arch/arm/dts/meson-gxbb-odroidc2.dts
@@ -67,3 +67,7 @@ 
 &uart_AO {
 	status = "okay";
 };
+
+&gmac0 {
+	status = "okay";
+};
diff --git a/arch/arm/dts/meson-gxbb.dtsi b/arch/arm/dts/meson-gxbb.dtsi
index 832815d..44a54e7 100644
--- a/arch/arm/dts/meson-gxbb.dtsi
+++ b/arch/arm/dts/meson-gxbb.dtsi
@@ -167,6 +167,15 @@ 
 			};
 		};
 
+		gmac0: ethernet@c9410000 {
+			compatible = "snps,dwmac";
+			reg = <0x0 0xc9410000 0x0 0x10000>;
+			interrupts = <0 8 1>;
+			interrupt-names = "macirq";
+			phy-mode = "rgmii";
+			status = "disabled";
+		};
+
 		apb: apb@d0000000 {
 			compatible = "simple-bus";
 			reg = <0x0 0xd0000000 0x0 0x200000>;