linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] DT node for SiFive FU540 Ethernet Controller driver
@ 2019-06-21 10:53 Yash Shah
  2019-06-21 10:53 ` [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver Yash Shah
  0 siblings, 1 reply; 10+ messages in thread
From: Yash Shah @ 2019-06-21 10:53 UTC (permalink / raw)
  To: robh+dt, paul.walmsley, devicetree, linux-riscv, linux-kernel
  Cc: mark.rutland, palmer, aou, sachin.ghadi, Yash Shah

This patch-set is based on 'riscv-for-v5.2/fixes-rc6' tag of
git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git

Tested on HiFive Unleashed board with additional patches required for
testing can be found at dev/yashs/ethernet_dt_v2 branch of:
https://github.com/yashshah7/riscv-linux.git

Change history:
v2:
- Set "status = disabled" in DTSI file and enable it in Board DTS file
- Move PHY related nodes into board DTS file

Yash Shah (1):
  riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver

 arch/riscv/boot/dts/sifive/fu540-c000.dtsi          | 16 ++++++++++++++++
 arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts |  9 +++++++++
 2 files changed, 25 insertions(+)

-- 
1.9.1


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

* [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver
  2019-06-21 10:53 [PATCH v2] DT node for SiFive FU540 Ethernet Controller driver Yash Shah
@ 2019-06-21 10:53 ` Yash Shah
  2019-06-21 11:20   ` Anup Patel
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Yash Shah @ 2019-06-21 10:53 UTC (permalink / raw)
  To: robh+dt, paul.walmsley, devicetree, linux-riscv, linux-kernel
  Cc: mark.rutland, palmer, aou, sachin.ghadi, Yash Shah

DT node for SiFive FU540-C000 GEMGXL Ethernet controller driver added

Signed-off-by: Yash Shah <yash.shah@sifive.com>
---
 arch/riscv/boot/dts/sifive/fu540-c000.dtsi          | 16 ++++++++++++++++
 arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts |  9 +++++++++
 2 files changed, 25 insertions(+)

diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
index 4e8fbde..c53b4ea 100644
--- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
+++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
@@ -225,5 +225,21 @@
 			#address-cells = <1>;
 			#size-cells = <0>;
 		};
+		eth0: ethernet@10090000 {
+			compatible = "sifive,fu540-macb";
+			interrupt-parent = <&plic0>;
+			interrupts = <53>;
+			reg = <0x0 0x10090000 0x0 0x2000
+			       0x0 0x100a0000 0x0 0x1000>;
+			reg-names = "control";
+			status = "disabled";
+			local-mac-address = [00 00 00 00 00 00];
+			clock-names = "pclk", "hclk";
+			clocks = <&prci PRCI_CLK_GEMGXLPLL>,
+				 <&prci PRCI_CLK_GEMGXLPLL>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
 	};
 };
diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
index 4da8870..d783bf2 100644
--- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
+++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
@@ -63,3 +63,12 @@
 		disable-wp;
 	};
 };
+
+&eth0 {
+	status = "okay";
+	phy-mode = "gmii";
+	phy-handle = <&phy1>;
+	phy1: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
-- 
1.9.1


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

* Re: [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver
  2019-06-21 10:53 ` [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver Yash Shah
@ 2019-06-21 11:20   ` Anup Patel
  2019-06-21 19:14   ` Atish Patra
  2019-06-21 22:06   ` Paul Walmsley
  2 siblings, 0 replies; 10+ messages in thread
From: Anup Patel @ 2019-06-21 11:20 UTC (permalink / raw)
  To: Yash Shah
  Cc: Rob Herring, Paul Walmsley, devicetree, linux-riscv,
	linux-kernel@vger.kernel.org List, Mark Rutland, Palmer Dabbelt,
	Albert Ou, sachin.ghadi

On Fri, Jun 21, 2019 at 4:27 PM Yash Shah <yash.shah@sifive.com> wrote:
>
> DT node for SiFive FU540-C000 GEMGXL Ethernet controller driver added
>
> Signed-off-by: Yash Shah <yash.shah@sifive.com>
> ---
>  arch/riscv/boot/dts/sifive/fu540-c000.dtsi          | 16 ++++++++++++++++
>  arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts |  9 +++++++++
>  2 files changed, 25 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
> index 4e8fbde..c53b4ea 100644
> --- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
> +++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
> @@ -225,5 +225,21 @@
>                         #address-cells = <1>;
>                         #size-cells = <0>;
>                 };
> +               eth0: ethernet@10090000 {
> +                       compatible = "sifive,fu540-macb";
> +                       interrupt-parent = <&plic0>;
> +                       interrupts = <53>;
> +                       reg = <0x0 0x10090000 0x0 0x2000
> +                              0x0 0x100a0000 0x0 0x1000>;
> +                       reg-names = "control";
> +                       status = "disabled";
> +                       local-mac-address = [00 00 00 00 00 00];
> +                       clock-names = "pclk", "hclk";
> +                       clocks = <&prci PRCI_CLK_GEMGXLPLL>,
> +                                <&prci PRCI_CLK_GEMGXLPLL>;
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +               };
> +
>         };
>  };
> diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> index 4da8870..d783bf2 100644
> --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> @@ -63,3 +63,12 @@
>                 disable-wp;
>         };
>  };
> +
> +&eth0 {
> +       status = "okay";
> +       phy-mode = "gmii";
> +       phy-handle = <&phy1>;
> +       phy1: ethernet-phy@0 {
> +               reg = <0>;
> +       };
> +};
> --
> 1.9.1
>

LGTM.

Reviewed-by: Anup Patel <anup@brainfault.org>

Regards,
Anup

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

* Re: [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver
  2019-06-21 10:53 ` [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver Yash Shah
  2019-06-21 11:20   ` Anup Patel
@ 2019-06-21 19:14   ` Atish Patra
       [not found]     ` <CAF5mof3QB8C7VjOyEvCsf9NEDkJhV3cBO5sBD+8z-GrWrnrAyg@mail.gmail.com>
  2019-06-22 18:15     ` Troy Benjegerdes
  2019-06-21 22:06   ` Paul Walmsley
  2 siblings, 2 replies; 10+ messages in thread
From: Atish Patra @ 2019-06-21 19:14 UTC (permalink / raw)
  To: paul.walmsley, linux-riscv, devicetree, linux-kernel, yash.shah, robh+dt
  Cc: sachin.ghadi, mark.rutland, palmer, aou

On Fri, 2019-06-21 at 16:23 +0530, Yash Shah wrote:
> DT node for SiFive FU540-C000 GEMGXL Ethernet controller driver added
> 
> Signed-off-by: Yash Shah <yash.shah@sifive.com>
> ---
>  arch/riscv/boot/dts/sifive/fu540-c000.dtsi          | 16
> ++++++++++++++++
>  arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts |  9 +++++++++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
> b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
> index 4e8fbde..c53b4ea 100644
> --- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
> +++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
> @@ -225,5 +225,21 @@
>  			#address-cells = <1>;
>  			#size-cells = <0>;
>  		};
> +		eth0: ethernet@10090000 {
> +			compatible = "sifive,fu540-macb";
> +			interrupt-parent = <&plic0>;
> +			interrupts = <53>;
> +			reg = <0x0 0x10090000 0x0 0x2000
> +			       0x0 0x100a0000 0x0 0x1000>;
> +			reg-names = "control";
> +			status = "disabled";
> +			local-mac-address = [00 00 00 00 00 00];
> +			clock-names = "pclk", "hclk";
> +			clocks = <&prci PRCI_CLK_GEMGXLPLL>,
> +				 <&prci PRCI_CLK_GEMGXLPLL>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +		};
> +
>  	};
>  };
> diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> index 4da8870..d783bf2 100644
> --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> @@ -63,3 +63,12 @@
>  		disable-wp;
>  	};
>  };
> +
> +&eth0 {
> +	status = "okay";
> +	phy-mode = "gmii";
> +	phy-handle = <&phy1>;
> +	phy1: ethernet-phy@0 {
> +		reg = <0>;
> +	};
> +};

Thanks. I am able to boot Unleashed with networking enabled with this
patch.

FWIW, 
Tested-by: Atish Patra <atish.patra@wdc.com>

Regards,
Atish

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

* Re: [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver
       [not found]       ` <3f91c8032e113a19dcec10ca71b017af1427ef7e.camel@wdc.com>
@ 2019-06-21 21:59         ` Atish Patra
  2019-06-22  0:33           ` Troy Benjegerdes
  0 siblings, 1 reply; 10+ messages in thread
From: Atish Patra @ 2019-06-21 21:59 UTC (permalink / raw)
  To: troy.benjegerdes
  Cc: linux-riscv, sachin.ghadi, devicetree, paul.walmsley,
	linux-kernel, mark.rutland, aou, robh+dt, yash.shah, palmer

On Fri, 2019-06-21 at 14:46 -0700, Atish Patra wrote:
> On Fri, 2019-06-21 at 14:18 -0500, Troy Benjegerdes wrote:
> > Can you post the fsbl and other images you used to boot/test this?
> > 
> 

Resending it without the attachment. Obviously, the mail did not go
through with the binary blob attached :( :(. My bad.

Let me know if you still want me to share the binary with you. I will
probably share it via some other method.

> I have not changed fsbl. It's the default one came with the board.
> Here are the heads of OpenSBI + U-Boot + Linux repo.
> 
> OpenSBI: cd2dfdc870ed (master)
> U-boot: 77f6e2dd0551 + Anup's patch series (v4)
> https://github.com/atishp04/u-boot/tree/unleashed_working
> 
> Linux: bed3c0d84e7e + Yash's Macb Series + this patch
> https://github.com/atishp04/linux/tree/5.2-rc6-pre
> 
> I have also attached the OpenSBI + U-boot binary as well. But this is
> pre-configured with my tftpboot server. You need to change that.
> 
> > I keep running into various failures when I build from source and I
> > want to rule out potential hardware issues related to clock and/or
> > ddr initialization
> > 
> > On Fri, Jun 21, 2019, 2:14 PM Atish Patra <Atish.Patra@wdc.com>
> > wrote:
> > > On Fri, 2019-06-21 at 16:23 +0530, Yash Shah wrote:
> > > > DT node for SiFive FU540-C000 GEMGXL Ethernet controller driver
> > > added
> > > > Signed-off-by: Yash Shah <yash.shah@sifive.com>
> > > > ---
> > > >  arch/riscv/boot/dts/sifive/fu540-c000.dtsi          | 16
> > > > ++++++++++++++++
> > > >  arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts |  9
> > > +++++++++
> > > >  2 files changed, 25 insertions(+)
> > > > 
> > > > diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
> > > > b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
> > > > index 4e8fbde..c53b4ea 100644
> > > > --- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
> > > > +++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
> > > > @@ -225,5 +225,21 @@
> > > >                       #address-cells = <1>;
> > > >                       #size-cells = <0>;
> > > >               };
> > > > +             eth0: ethernet@10090000 {
> > > > +                     compatible = "sifive,fu540-macb";
> > > > +                     interrupt-parent = <&plic0>;
> > > > +                     interrupts = <53>;
> > > > +                     reg = <0x0 0x10090000 0x0 0x2000
> > > > +                            0x0 0x100a0000 0x0 0x1000>;
> > > > +                     reg-names = "control";
> > > > +                     status = "disabled";
> > > > +                     local-mac-address = [00 00 00 00 00 00];
> > > > +                     clock-names = "pclk", "hclk";
> > > > +                     clocks = <&prci PRCI_CLK_GEMGXLPLL>,
> > > > +                              <&prci PRCI_CLK_GEMGXLPLL>;
> > > > +                     #address-cells = <1>;
> > > > +                     #size-cells = <0>;
> > > > +             };
> > > > +
> > > >       };
> > > >  };
> > > > diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-
> > > > a00.dts
> > > > b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> > > > index 4da8870..d783bf2 100644
> > > > --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> > > > +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
> > > > @@ -63,3 +63,12 @@
> > > >               disable-wp;
> > > >       };
> > > >  };
> > > > +
> > > > +&eth0 {
> > > > +     status = "okay";
> > > > +     phy-mode = "gmii";
> > > > +     phy-handle = <&phy1>;
> > > > +     phy1: ethernet-phy@0 {
> > > > +             reg = <0>;
> > > > +     };
> > > > +};
> > > 
> > > Thanks. I am able to boot Unleashed with networking enabled with
> > > this
> > > patch.
> > > 
> > > FWIW, 
> > > Tested-by: Atish Patra <atish.patra@wdc.com>
> > > 
> > > Regards,
> > > Atish
> > > _______________________________________________
> > > linux-riscv mailing list
> > > linux-riscv@lists.infradead.org
> > > http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver
  2019-06-21 10:53 ` [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver Yash Shah
  2019-06-21 11:20   ` Anup Patel
  2019-06-21 19:14   ` Atish Patra
@ 2019-06-21 22:06   ` Paul Walmsley
  2 siblings, 0 replies; 10+ messages in thread
From: Paul Walmsley @ 2019-06-21 22:06 UTC (permalink / raw)
  To: Yash Shah
  Cc: robh+dt, devicetree, linux-riscv, linux-kernel, mark.rutland,
	palmer, aou, sachin.ghadi

On Fri, 21 Jun 2019, Yash Shah wrote:

> DT node for SiFive FU540-C000 GEMGXL Ethernet controller driver added
> 
> Signed-off-by: Yash Shah <yash.shah@sifive.com>

Thanks, dropped the "reg-names" property from the patch, and queued the 
following updated version for v5.2-rc.


- Paul

From: Yash Shah <yash.shah@sifive.com>
Date: Fri, 21 Jun 2019 16:23:49 +0530
Subject: [PATCH] riscv: dts: Add DT node for SiFive FU540 Ethernet controller
 driver

DT node for SiFive FU540-C000 GEMGXL Ethernet controller driver added

Signed-off-by: Yash Shah <yash.shah@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Tested-by: Atish Patra <atish.patra@wdc.com>
[paul.walmsley@sifive.com: dropped the "reg-names" property, as it
 is not documented in the binding nor used in the driver]
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
---
 arch/riscv/boot/dts/sifive/fu540-c000.dtsi       | 16 ++++++++++++++++
 .../boot/dts/sifive/hifive-unleashed-a00.dts     |  9 +++++++++
 2 files changed, 25 insertions(+)

diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
index 3c06ee4b2b29..83f40b00ab63 100644
--- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
+++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
@@ -211,5 +211,21 @@
 			#address-cells = <1>;
 			#size-cells = <0>;
 		};
+		eth0: ethernet@10090000 {
+			compatible = "sifive,fu540-macb";
+			interrupt-parent = <&plic0>;
+			interrupts = <53>;
+			reg = <0x0 0x10090000 0x0 0x2000
+			       0x0 0x100a0000 0x0 0x1000>;
+			reg-names = "control";
+			status = "disabled";
+			local-mac-address = [00 00 00 00 00 00];
+			clock-names = "pclk", "hclk";
+			clocks = <&prci PRCI_CLK_GEMGXLPLL>,
+				 <&prci PRCI_CLK_GEMGXLPLL>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
 	};
 };
diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
index 4da88707e28f..d783bf2c3507 100644
--- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
+++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
@@ -63,3 +63,12 @@
 		disable-wp;
 	};
 };
+
+&eth0 {
+	status = "okay";
+	phy-mode = "gmii";
+	phy-handle = <&phy1>;
+	phy1: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
-- 
2.20.1


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

* Re: [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver
  2019-06-21 21:59         ` Atish Patra
@ 2019-06-22  0:33           ` Troy Benjegerdes
  2019-06-22  1:57             ` Troy Benjegerdes
  0 siblings, 1 reply; 10+ messages in thread
From: Troy Benjegerdes @ 2019-06-22  0:33 UTC (permalink / raw)
  To: Atish Patra
  Cc: linux-riscv, sachin.ghadi, devicetree, paul.walmsley,
	linux-kernel, mark.rutland, aou, robh+dt, yash.shah, palmer



> On Jun 21, 2019, at 4:59 PM, Atish Patra <Atish.Patra@wdc.com> wrote:
> 
> On Fri, 2019-06-21 at 14:46 -0700, Atish Patra wrote:
>> On Fri, 2019-06-21 at 14:18 -0500, Troy Benjegerdes wrote:
>>> Can you post the fsbl and other images you used to boot/test this?
>>> 
>> 
> 
> Resending it without the attachment. Obviously, the mail did not go
> through with the binary blob attached :( :(. My bad.
> 
> Let me know if you still want me to share the binary with you. I will
> probably share it via some other method.

The bl came through as it was sent direct to me, and I can deal with
the tftp config manually. I have a kernel image, but not the boot.scr.uimg
that it looks like you are using. Is that from Yocto?

> 
>> I have not changed fsbl. It's the default one came with the board.
>> Here are the heads of OpenSBI + U-Boot + Linux repo.
>> 
>> OpenSBI: cd2dfdc870ed (master)
>> U-boot: 77f6e2dd0551 + Anup's patch series (v4)
>> https://github.com/atishp04/u-boot/tree/unleashed_working
>> 
>> Linux: bed3c0d84e7e + Yash's Macb Series + this patch
>> https://github.com/atishp04/linux/tree/5.2-rc6-pre
>> 
>> I have also attached the OpenSBI + U-boot binary as well. But this is
>> pre-configured with my tftpboot server. You need to change that.
>> 
>>> I keep running into various failures when I build from source and I
>>> want to rule out potential hardware issues related to clock and/or
>>> ddr initialization
>>> 
>>> On Fri, Jun 21, 2019, 2:14 PM Atish Patra <Atish.Patra@wdc.com>
>>> wrote:
>>>> On Fri, 2019-06-21 at 16:23 +0530, Yash Shah wrote:
>>>>> DT node for SiFive FU540-C000 GEMGXL Ethernet controller driver
>>>> added
>>>>> Signed-off-by: Yash Shah <yash.shah@sifive.com>
>>>>> ---
>>>>> arch/riscv/boot/dts/sifive/fu540-c000.dtsi          | 16
>>>>> ++++++++++++++++
>>>>> arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts |  9
>>>> +++++++++
>>>>> 2 files changed, 25 insertions(+)
>>>>> 
>>>>> diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>>>>> b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>>>>> index 4e8fbde..c53b4ea 100644
>>>>> --- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>>>>> +++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>>>>> @@ -225,5 +225,21 @@
>>>>>                      #address-cells = <1>;
>>>>>                      #size-cells = <0>;
>>>>>              };
>>>>> +             eth0: ethernet@10090000 {
>>>>> +                     compatible = "sifive,fu540-macb";
>>>>> +                     interrupt-parent = <&plic0>;
>>>>> +                     interrupts = <53>;
>>>>> +                     reg = <0x0 0x10090000 0x0 0x2000
>>>>> +                            0x0 0x100a0000 0x0 0x1000>;
>>>>> +                     reg-names = "control";
>>>>> +                     status = "disabled";
>>>>> +                     local-mac-address = [00 00 00 00 00 00];
>>>>> +                     clock-names = "pclk", "hclk";
>>>>> +                     clocks = <&prci PRCI_CLK_GEMGXLPLL>,
>>>>> +                              <&prci PRCI_CLK_GEMGXLPLL>;
>>>>> +                     #address-cells = <1>;
>>>>> +                     #size-cells = <0>;
>>>>> +             };
>>>>> +
>>>>>      };
>>>>> };
>>>>> diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-
>>>>> a00.dts
>>>>> b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>>>>> index 4da8870..d783bf2 100644
>>>>> --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>>>>> +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>>>>> @@ -63,3 +63,12 @@
>>>>>              disable-wp;
>>>>>      };
>>>>> };
>>>>> +
>>>>> +&eth0 {
>>>>> +     status = "okay";
>>>>> +     phy-mode = "gmii";
>>>>> +     phy-handle = <&phy1>;
>>>>> +     phy1: ethernet-phy@0 {
>>>>> +             reg = <0>;
>>>>> +     };
>>>>> +};
>>>> 
>>>> Thanks. I am able to boot Unleashed with networking enabled with
>>>> this
>>>> patch.
>>>> 
>>>> FWIW, 
>>>> Tested-by: Atish Patra <atish.patra@wdc.com>
>>>> 
>>>> Regards,
>>>> Atish
>>>> _______________________________________________
>>>> linux-riscv mailing list
>>>> linux-riscv@lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/linux-riscv


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

* Re: [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver
  2019-06-22  0:33           ` Troy Benjegerdes
@ 2019-06-22  1:57             ` Troy Benjegerdes
  2019-06-23  7:04               ` Atish Patra
  0 siblings, 1 reply; 10+ messages in thread
From: Troy Benjegerdes @ 2019-06-22  1:57 UTC (permalink / raw)
  To: Atish Patra
  Cc: linux-riscv, sachin.ghadi, devicetree, paul.walmsley,
	linux-kernel, mark.rutland, aou, robh+dt, yash.shah, palmer



> On Jun 21, 2019, at 7:33 PM, Troy Benjegerdes <troy.benjegerdes@sifive.com> wrote:
> 
> 
> 
>> On Jun 21, 2019, at 4:59 PM, Atish Patra <Atish.Patra@wdc.com> wrote:
>> 
>> On Fri, 2019-06-21 at 14:46 -0700, Atish Patra wrote:
>>> On Fri, 2019-06-21 at 14:18 -0500, Troy Benjegerdes wrote:
>>>> Can you post the fsbl and other images you used to boot/test this?
>>>> 
>>> 
>> 
>> Resending it without the attachment. Obviously, the mail did not go
>> through with the binary blob attached :( :(. My bad.
>> 
>> Let me know if you still want me to share the binary with you. I will
>> probably share it via some other method.
> 
> The bl came through as it was sent direct to me, and I can deal with
> the tftp config manually. I have a kernel image, but not the boot.scr.uimg
> that it looks like you are using. Is that from Yocto?

I got console output, after extracting the boot script from yocto.

The important part seems to be calling
‘bootm $kernel_addr_r - $fdt_addr_r’

Which maybe leads into a discussion of what can we do to at
least output some sort of useful debug information if the device
tree is not found or invalid?

I’d also like to propose that on RiscV, we use the chosen node
for kernel command line and initrd location (like qemu does), and
in u-boot, default to always passing the device tree from bootm
and other commands (like bootelf)

> 
>> 
>>> I have not changed fsbl. It's the default one came with the board.
>>> Here are the heads of OpenSBI + U-Boot + Linux repo.
>>> 
>>> OpenSBI: cd2dfdc870ed (master)
>>> U-boot: 77f6e2dd0551 + Anup's patch series (v4)
>>> https://github.com/atishp04/u-boot/tree/unleashed_working
>>> 
>>> Linux: bed3c0d84e7e + Yash's Macb Series + this patch
>>> https://github.com/atishp04/linux/tree/5.2-rc6-pre
>>> 
>>> I have also attached the OpenSBI + U-boot binary as well. But this is
>>> pre-configured with my tftpboot server. You need to change that.
>>> 
>>>> I keep running into various failures when I build from source and I
>>>> want to rule out potential hardware issues related to clock and/or
>>>> ddr initialization
>>>> 
>>>> On Fri, Jun 21, 2019, 2:14 PM Atish Patra <Atish.Patra@wdc.com>
>>>> wrote:
>>>>> On Fri, 2019-06-21 at 16:23 +0530, Yash Shah wrote:
>>>>>> DT node for SiFive FU540-C000 GEMGXL Ethernet controller driver
>>>>> added
>>>>>> Signed-off-by: Yash Shah <yash.shah@sifive.com>
>>>>>> ---
>>>>>> arch/riscv/boot/dts/sifive/fu540-c000.dtsi          | 16
>>>>>> ++++++++++++++++
>>>>>> arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts |  9
>>>>> +++++++++
>>>>>> 2 files changed, 25 insertions(+)
>>>>>> 
>>>>>> diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>>>>>> b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>>>>>> index 4e8fbde..c53b4ea 100644
>>>>>> --- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>>>>>> +++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>>>>>> @@ -225,5 +225,21 @@
>>>>>>                     #address-cells = <1>;
>>>>>>                     #size-cells = <0>;
>>>>>>             };
>>>>>> +             eth0: ethernet@10090000 {
>>>>>> +                     compatible = "sifive,fu540-macb";
>>>>>> +                     interrupt-parent = <&plic0>;
>>>>>> +                     interrupts = <53>;
>>>>>> +                     reg = <0x0 0x10090000 0x0 0x2000
>>>>>> +                            0x0 0x100a0000 0x0 0x1000>;
>>>>>> +                     reg-names = "control";
>>>>>> +                     status = "disabled";
>>>>>> +                     local-mac-address = [00 00 00 00 00 00];
>>>>>> +                     clock-names = "pclk", "hclk";
>>>>>> +                     clocks = <&prci PRCI_CLK_GEMGXLPLL>,
>>>>>> +                              <&prci PRCI_CLK_GEMGXLPLL>;
>>>>>> +                     #address-cells = <1>;
>>>>>> +                     #size-cells = <0>;
>>>>>> +             };
>>>>>> +
>>>>>>     };
>>>>>> };
>>>>>> diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-
>>>>>> a00.dts
>>>>>> b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>>>>>> index 4da8870..d783bf2 100644
>>>>>> --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>>>>>> +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>>>>>> @@ -63,3 +63,12 @@
>>>>>>             disable-wp;
>>>>>>     };
>>>>>> };
>>>>>> +
>>>>>> +&eth0 {
>>>>>> +     status = "okay";
>>>>>> +     phy-mode = "gmii";
>>>>>> +     phy-handle = <&phy1>;
>>>>>> +     phy1: ethernet-phy@0 {
>>>>>> +             reg = <0>;
>>>>>> +     };
>>>>>> +};
>>>>> 
>>>>> Thanks. I am able to boot Unleashed with networking enabled with
>>>>> this
>>>>> patch.
>>>>> 
>>>>> FWIW, 
>>>>> Tested-by: Atish Patra <atish.patra@wdc.com>
>>>>> 
>>>>> Regards,
>>>>> Atish
>>>>> _______________________________________________
>>>>> linux-riscv mailing list
>>>>> linux-riscv@lists.infradead.org
>>>>> http://lists.infradead.org/mailman/listinfo/linux-riscv
> 


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

* Re: [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver
  2019-06-21 19:14   ` Atish Patra
       [not found]     ` <CAF5mof3QB8C7VjOyEvCsf9NEDkJhV3cBO5sBD+8z-GrWrnrAyg@mail.gmail.com>
@ 2019-06-22 18:15     ` Troy Benjegerdes
  1 sibling, 0 replies; 10+ messages in thread
From: Troy Benjegerdes @ 2019-06-22 18:15 UTC (permalink / raw)
  To: Atish Patra, yash.shah
  Cc: paul.walmsley, linux-riscv, devicetree, linux-kernel, robh+dt,
	mark.rutland, sachin.ghadi, palmer, aou



> On Jun 21, 2019, at 2:14 PM, Atish Patra <Atish.Patra@wdc.com> wrote:
> 
> On Fri, 2019-06-21 at 16:23 +0530, Yash Shah wrote:
>> DT node for SiFive FU540-C000 GEMGXL Ethernet controller driver added
>> 
>> Signed-off-by: Yash Shah <yash.shah@sifive.com>
>> ---
>> arch/riscv/boot/dts/sifive/fu540-c000.dtsi          | 16
>> ++++++++++++++++
>> arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts |  9 +++++++++
>> 2 files changed, 25 insertions(+)
>> 
>> diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>> b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>> index 4e8fbde..c53b4ea 100644
>> --- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>> +++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>> @@ -225,5 +225,21 @@
>> 			#address-cells = <1>;
>> 			#size-cells = <0>;
>> 		};
>> +		eth0: ethernet@10090000 {
>> +			compatible = "sifive,fu540-macb";
>> +			interrupt-parent = <&plic0>;
>> +			interrupts = <53>;
>> +			reg = <0x0 0x10090000 0x0 0x2000
>> +			       0x0 0x100a0000 0x0 0x1000>;
>> +			reg-names = "control";
>> +			status = "disabled";
>> +			local-mac-address = [00 00 00 00 00 00];
>> +			clock-names = "pclk", "hclk";
>> +			clocks = <&prci PRCI_CLK_GEMGXLPLL>,
>> +				 <&prci PRCI_CLK_GEMGXLPLL>;
>> +			#address-cells = <1>;
>> +			#size-cells = <0>;
>> +		};
>> +
>> 	};
>> };
>> diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>> b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>> index 4da8870..d783bf2 100644
>> --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>> +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>> @@ -63,3 +63,12 @@
>> 		disable-wp;
>> 	};
>> };
>> +
>> +&eth0 {
>> +	status = "okay";
>> +	phy-mode = "gmii";
>> +	phy-handle = <&phy1>;
>> +	phy1: ethernet-phy@0 {
>> +		reg = <0>;
>> +	};
>> +};
> 
> Thanks. I am able to boot Unleashed with networking enabled with this
> patch.
> 
> FWIW, 
> Tested-by: Atish Patra <atish.patra@wdc.com>
> 
> Regards,
> Atish

I am able to boot using a build from the dev/new-dts branch of
my freedom-u-sdk development tree [1] which has this patch
with an additional reset-gpios entry for the ethernet phy in the
DTS provided by the legacy U-boot[2].

Tested-by: Troy Benjegerdes <troy.benjegerdes@sifive.com>

[1] https://github.com/tmagik/freedom-u-sdk 
[2] https://github.com/sifive/HiFive_U-Boot/blob/081373fa3eb0ca79ba3f4a703e8e83a15135a6d1/arch/riscv/dts/hifive_u540.dts#L73

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

* Re: [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver
  2019-06-22  1:57             ` Troy Benjegerdes
@ 2019-06-23  7:04               ` Atish Patra
  0 siblings, 0 replies; 10+ messages in thread
From: Atish Patra @ 2019-06-23  7:04 UTC (permalink / raw)
  To: Troy Benjegerdes
  Cc: linux-riscv, sachin.ghadi, devicetree, paul.walmsley,
	linux-kernel, mark.rutland, aou, robh+dt, yash.shah, palmer

On 6/21/19 6:57 PM, Troy Benjegerdes wrote:
> 
> 
>> On Jun 21, 2019, at 7:33 PM, Troy Benjegerdes <troy.benjegerdes@sifive.com> wrote:
>>
>>
>>
>>> On Jun 21, 2019, at 4:59 PM, Atish Patra <Atish.Patra@wdc.com> wrote:
>>>
>>> On Fri, 2019-06-21 at 14:46 -0700, Atish Patra wrote:
>>>> On Fri, 2019-06-21 at 14:18 -0500, Troy Benjegerdes wrote:
>>>>> Can you post the fsbl and other images you used to boot/test this?
>>>>>
>>>>
>>>
>>> Resending it without the attachment. Obviously, the mail did not go
>>> through with the binary blob attached :( :(. My bad.
>>>
>>> Let me know if you still want me to share the binary with you. I will
>>> probably share it via some other method.
>>
>> The bl came through as it was sent direct to me, and I can deal with
>> the tftp config manually. I have a kernel image, but not the boot.scr.uimg
>> that it looks like you are using. Is that from Yocto?
> 
> I got console output, after extracting the boot script from yocto.
> 

Glad it worked for you.
> The important part seems to be calling
> ‘bootm $kernel_addr_r - $fdt_addr_r’
> 
> Which maybe leads into a discussion of what can we do to at
> least output some sort of useful debug information if the device
> tree is not found or invalid?
> 
At least serial & clock needs to be correct for uart to work so that 
useful debug information can be displayed.

> I’d also like to propose that on RiscV, we use the chosen node
> for kernel command line
and initrd location (like qemu does), and
> in u-boot, default to always passing the device tree from bootm
> and other commands (like bootelf)
> 

If I understand you correctly, you want a kernel command line with fixed 
initrd location set in chosen node that U-Boot can pass on to kernel ?

If that's the case, that's not feasible as everybody's kernel command 
line may not be same and will probably override it using CONFIG_CMDLINE.

So I don't see the point int setting a fixed one. What's the advantage 
in doing that ?

>>
>>>
>>>> I have not changed fsbl. It's the default one came with the board.
>>>> Here are the heads of OpenSBI + U-Boot + Linux repo.
>>>>
>>>> OpenSBI: cd2dfdc870ed (master)
>>>> U-boot: 77f6e2dd0551 + Anup's patch series (v4)
>>>> https://github.com/atishp04/u-boot/tree/unleashed_working
>>>>
>>>> Linux: bed3c0d84e7e + Yash's Macb Series + this patch
>>>> https://github.com/atishp04/linux/tree/5.2-rc6-pre
>>>>
>>>> I have also attached the OpenSBI + U-boot binary as well. But this is
>>>> pre-configured with my tftpboot server. You need to change that.
>>>>
>>>>> I keep running into various failures when I build from source and I
>>>>> want to rule out potential hardware issues related to clock and/or
>>>>> ddr initialization
>>>>>
>>>>> On Fri, Jun 21, 2019, 2:14 PM Atish Patra <Atish.Patra@wdc.com>
>>>>> wrote:
>>>>>> On Fri, 2019-06-21 at 16:23 +0530, Yash Shah wrote:
>>>>>>> DT node for SiFive FU540-C000 GEMGXL Ethernet controller driver
>>>>>> added
>>>>>>> Signed-off-by: Yash Shah <yash.shah@sifive.com>
>>>>>>> ---
>>>>>>> arch/riscv/boot/dts/sifive/fu540-c000.dtsi          | 16
>>>>>>> ++++++++++++++++
>>>>>>> arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts |  9
>>>>>> +++++++++
>>>>>>> 2 files changed, 25 insertions(+)
>>>>>>>
>>>>>>> diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>>>>>>> b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>>>>>>> index 4e8fbde..c53b4ea 100644
>>>>>>> --- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>>>>>>> +++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
>>>>>>> @@ -225,5 +225,21 @@
>>>>>>>                      #address-cells = <1>;
>>>>>>>                      #size-cells = <0>;
>>>>>>>              };
>>>>>>> +             eth0: ethernet@10090000 {
>>>>>>> +                     compatible = "sifive,fu540-macb";
>>>>>>> +                     interrupt-parent = <&plic0>;
>>>>>>> +                     interrupts = <53>;
>>>>>>> +                     reg = <0x0 0x10090000 0x0 0x2000
>>>>>>> +                            0x0 0x100a0000 0x0 0x1000>;
>>>>>>> +                     reg-names = "control";
>>>>>>> +                     status = "disabled";
>>>>>>> +                     local-mac-address = [00 00 00 00 00 00];
>>>>>>> +                     clock-names = "pclk", "hclk";
>>>>>>> +                     clocks = <&prci PRCI_CLK_GEMGXLPLL>,
>>>>>>> +                              <&prci PRCI_CLK_GEMGXLPLL>;
>>>>>>> +                     #address-cells = <1>;
>>>>>>> +                     #size-cells = <0>;
>>>>>>> +             };
>>>>>>> +
>>>>>>>      };
>>>>>>> };
>>>>>>> diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-
>>>>>>> a00.dts
>>>>>>> b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>>>>>>> index 4da8870..d783bf2 100644
>>>>>>> --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>>>>>>> +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
>>>>>>> @@ -63,3 +63,12 @@
>>>>>>>              disable-wp;
>>>>>>>      };
>>>>>>> };
>>>>>>> +
>>>>>>> +&eth0 {
>>>>>>> +     status = "okay";
>>>>>>> +     phy-mode = "gmii";
>>>>>>> +     phy-handle = <&phy1>;
>>>>>>> +     phy1: ethernet-phy@0 {
>>>>>>> +             reg = <0>;
>>>>>>> +     };
>>>>>>> +};
>>>>>>
>>>>>> Thanks. I am able to boot Unleashed with networking enabled with
>>>>>> this
>>>>>> patch.
>>>>>>
>>>>>> FWIW,
>>>>>> Tested-by: Atish Patra <atish.patra@wdc.com>
>>>>>>
>>>>>> Regards,
>>>>>> Atish
>>>>>> _______________________________________________
>>>>>> linux-riscv mailing list
>>>>>> linux-riscv@lists.infradead.org
>>>>>> http://lists.infradead.org/mailman/listinfo/linux-riscv
>>
> 
> 


-- 
Regards,
Atish

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

end of thread, other threads:[~2019-06-23  7:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-21 10:53 [PATCH v2] DT node for SiFive FU540 Ethernet Controller driver Yash Shah
2019-06-21 10:53 ` [PATCH v2] riscv: dts: Add DT node for SiFive FU540 Ethernet controller driver Yash Shah
2019-06-21 11:20   ` Anup Patel
2019-06-21 19:14   ` Atish Patra
     [not found]     ` <CAF5mof3QB8C7VjOyEvCsf9NEDkJhV3cBO5sBD+8z-GrWrnrAyg@mail.gmail.com>
     [not found]       ` <3f91c8032e113a19dcec10ca71b017af1427ef7e.camel@wdc.com>
2019-06-21 21:59         ` Atish Patra
2019-06-22  0:33           ` Troy Benjegerdes
2019-06-22  1:57             ` Troy Benjegerdes
2019-06-23  7:04               ` Atish Patra
2019-06-22 18:15     ` Troy Benjegerdes
2019-06-21 22:06   ` Paul Walmsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).