Welcome! Log In Create A New Profile

Advanced

Ethernet Problem on NSA310S

Posted by giggls 
Ethernet Problem on NSA310S
October 31, 2015 01:08PM
Hello,

I just tried to install your latest kernel on my NSA310S

4.2.0-kirkwood-tld-1

Unfortunately ethernet does not seem to work.

When I try to enable the interface all I get is:
mv643xx_eth: Set the PHY back to auto-negotiation mode

Ethernet works fine booting the stock image in mtd (Is called egiga0 in this case).

----------------------------------------------
Moderator edit: made this its own topic.



Edited 1 time(s). Last edit at 10/31/2015 05:10PM by bodhi.
Re: Ethernet Problem on NSA310S
October 31, 2015 04:22PM
giggls,

> Ethernet works fine booting the stock image in mtd
> (Is called egiga0 in this case).

Yes we knew about this, so the patch in the latest kernel 4.2.0-kirkwood-tld-1 should get ethernet PHY working. Since you are booting stock u-boot, look at of u-boot env ethaddr setting make sure it is set to a good one.

Can you post:

- the entire serial console log if you have one, if not post the entire dmesg log.
- list of u-boot envs settings
fw_printenv

Here is the new u-boot in case you are interested.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet Problem on NSA310S
November 01, 2015 09:22AM
Looking at the code it looks like I'm already using the latest kernel.

Attached is a complete log of the serial console.

I'm using the stock uboot because I'm afarid bricking the device flasing a new uboot.

System is loaded from a smal vfat partition and root-fs is located on f2fs.

This message looks strange to me:
[Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set

Do I need to somehow pass the MAC-adress to the kernel?

This does however look good to me:
[ 1.940568] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[ 2.023864] mv643xx_eth: Set the PHY to fix link down
[ 2.029535] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 90:ef:68:15:69:87

Still when I try to enable the Intferace all I get is this:

root@debian:~# ifconfig eth0 192.168.3.200
[ 57.954458] mv643xx_eth: Set the PHY back to auto-negotiation mode
[ 57.961212] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

Regards

Sven
Attachments:
open | download - screenlog.0 (24.2 KB)
Re: Ethernet Problem on NSA310S
November 01, 2015 03:24PM
giggls,

> This message looks strange to me:
> [Firmware Info]:
> /ocp@f1000000/ethernet-controller@72000/ethernet0-
> port@0: local-mac-address is not set
>

This is OK.

> This does however look good to me:
> [ 1.940568] mv643xx_eth: MV-643xx 10/100/1000
> ethernet driver version 1.4
> [ 2.023864] mv643xx_eth: Set the PHY to fix
> link down
> [ 2.029535] mv643xx_eth_port mv643xx_eth_port.0
> eth0: port 0 with MAC address 90:ef:68:15:69:87
>

After this point, it should bring up the link during Debian start up. You don't really need to trigger it. If you don't see any ethernet activity in the serial console log after this, then there must be a lack of something in the rootfs.

What is output of:

cat /etc/network/interfaces
ifconfig -a

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet Problem on NSA310S
November 01, 2015 03:41PM
bodhi Wrote:

> After this point, it should bring up the link during Debian start up. You don't really need to
> trigger it.

I needed to do it manually because I removed "auto eth0" from /etc/network/interfaces

However this does not change the broken behaviour at all :(

I am unable to bring up eth0 either way.

Looking at your patch it looks like changes in the code are already trying to do the right thing.
However it just does not help in my case. I never get a link on eth0 with this kernel.

Sven
Re: Ethernet Problem on NSA310S
November 01, 2015 03:44PM
giggls Wrote:
-------------------------------------------------------
> bodhi Wrote:
>
> > After this point, it should bring up the link
> during Debian start up. You don't really need to
> > trigger it.
>
> I needed to do it manually because I removed "auto
> eth0" from /etc/network/interfaces
>
> However this does not change the broken behaviour
> at all :(
>
> I am unable to bring up eth0 either way.
>
> Looking at your patch it looks like changes in the
> code are already trying to do the right thing.
> However it just does not help in my case. I never
> get a link on eth0 with this kernel.
>
> Sven

Does ifconfig -a show the correct MAC Addr?

Also I should mention that it has been tested before to bring up the link (if I remember correctly) with stock u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 11/01/2015 03:48PM by bodhi.
Re: Ethernet Problem on NSA310S
November 01, 2015 04:21PM
bodhi Wrote:

> Does ifconfig -a show the correct MAC Addr?

Yes, it does. Same address as egiga0 uses in stock Kernel:

Despite the problem I had this afternoon, for some reason it does
kind of work at this moment, (100 Mb/s instead of 1000Mb/s).

Looks like to make it work I currently have to boot into the stock kernel first and
reboot into debian afterwards...

If I remove power and boot into debian right after re-powering everything is broken again.

Sven
Re: Ethernet Problem on NSA310S
November 01, 2015 05:26PM
I have the same box and ethernet is working fine.
You don't have to set the MAC adress via /etc/network/interfaces, it's taken from the U-Boot env correctly.

Perhaps it could be a cable/switch/router issue?
Re: Ethernet Problem on NSA310S
November 01, 2015 06:05PM
giggls,

> Looks like to make it work I currently have to
> boot into the stock kernel first and
> reboot into debian afterwards...
>
> If I remove power and boot into debian right after
> re-powering everything is broken again.
>
> Sven

This is the exact symptom that we saw. That the patch is suppose to fix.

Please try this script by superelchi. Execute this script after you logged into Debian with serial console:
http://forum.doozan.com/read.php?2,22241,22784#msg-22784

If this works, then our kernel tests for this case was kind of screw up :). And it's not the first time :)) I might have to boot back to stock u-boot to see it.

Other thought, I have just a binary to do UART booting for this purpose.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 11/01/2015 06:08PM by bodhi.
Re: Ethernet Problem on NSA310S
November 03, 2015 01:51PM
bodhi Wrote:
-------------------------------------------------------

> Please try this script by superelchi. Execute this
> script after you logged into Debian with serial
> console:
> http://forum.doozan.com/read.php?2,22241,22784#msg-22784

OK, this seems to work. I tried to put the script into /etc/network/interfaces
as a pre-up script, which does not work.

However, looks like it works as a post-up script which is sufficient for non-dhcp use.

Something else:
As I do hopefully not need the stock ROM. Would it be possible to put the kernel and initrd
into mtd and if so how would I do this?

Sven
Re: Ethernet Problem on NSA310S
November 03, 2015 04:40PM
giggls Wrote:
-------------------------------------------------------
> bodhi Wrote:
> --------------------------------------------------
> -----
>
> > Please try this script by superelchi. Execute
> this
> > script after you logged into Debian with
> serial
> > console:
> >
> http://forum.doozan.com/read.php?2,22241,22784#msg
> -22784
>
> OK, this seems to work. I tried to put the script
> into /etc/network/interfaces
> as a pre-up script, which does not work.
>
> However, looks like it works as a post-up script
> which is sufficient for non-dhcp
>
> Sven

This is bad news! I will have to restest the kernel patch then! and perhaps fire the testers :)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet Problem on NSA310S
November 04, 2015 02:27AM
bodhi Wrote:
-------------------------------------------------------

> This is bad news! I will have to restest the kernel patch then! and perhaps fire the testers :)

I might be able to help out testing patches. Will try to compile and run 4.1.12 anyway.

Sven
Re: Ethernet Problem on NSA310S
November 04, 2015 03:05AM
giggls,

The good news: the patch works as it should. I've verified with stock u-boot that:

- After a shutdown, boot up with stock u-boot, the link is INACTIVE.
- Then booted into Debian with kernel 4.2.0-kirkwood-tld-1, the link brought up ACTIVE with 1Gbs speed.

The bad news: so it's your particular environment (i.e. rootfs) that seems to be the problem.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet Problem on NSA310S
November 04, 2015 03:22AM
bodhi Wrote:
-------------------------------------------------------

> - After a shutdown, boot up with stock u-boot, the link is INACTIVE.
> - Then booted into Debian with kernel 4.2.0-kirkwood-tld-1, the link
> brought up ACTIVE with 1Gbs speed.

Did you try booting into debian right after completely removing power for
30 seconds or so? It seems to always work here after booting the stock
image and not removing power.

> The bad news: so it's your particular environment (i.e. rootfs) that seems
> to be the problem.

Probably some subtle hardware difference? My rootfs is actually the
Debian-3.18.5-kirkwood-tld-1-rootfs-bodhi.tar.bz2 you have been offering here.

All that I have been changing initially is chrooting into it using qemu to install the
newer kernel.

Sven
Re: Ethernet Problem on NSA310S
November 04, 2015 04:52PM
giggls Wrote:
-------------------------------------------------------
> bodhi Wrote:
> --------------------------------------------------
> -----
>
> > - After a shutdown, boot up with stock u-boot,
> the link is INACTIVE.
> > - Then booted into Debian with kernel
> 4.2.0-kirkwood-tld-1, the link
> > brought up ACTIVE with 1Gbs speed.
>
> Did you try booting into debian right after
> completely removing power for
> 30 seconds or so? It seems to always work here
> after booting the stock
> image and not removing power.
>
> > The bad news: so it's your particular
> environment (i.e. rootfs) that seems
> > to be the problem.
>
> Probably some subtle hardware difference? My
> rootfs is actually the
> Debian-3.18.5-kirkwood-tld-1-rootfs-bodhi.tar.bz2
> you have been offering here.
>
> All that I have been changing initially is
> chrooting into it using qemu to install the
> newer kernel.
>
> Sven

We went through all these tests before here in a different thread. After a shutdown, booting with stock uboot always results in an inactive Ethernet PHY. That was test I just did. The kernel activated the PHY during start.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet Problem on NSA310S
November 04, 2015 04:58PM
bodhi Wrote:

> We went through all these tests before here in a
> different thread. After a shutdown, booting with
> stock uboot always results in an inactive Ethernet
> PHY. That was test I just did. The kernel
> activated the PHY during start.

Which is not the case here for whatever reason. Would I get rid of this problem by flashing a new version fo uboot? If so, is there a short howto somewhere how to do this?

Sven
Re: Ethernet Problem on NSA310S
November 04, 2015 06:49PM
giggls Wrote:
-------------------------------------------------------
> bodhi Wrote:
>
> > We went through all these tests before here in
> a
> > different thread. After a shutdown, booting
> with
> > stock uboot always results in an inactive
> Ethernet
> > PHY. That was test I just did. The kernel
> > activated the PHY during start.
>
> Which is not the case here for whatever reason.
> Would I get rid of this problem by flashing a new
> version fo uboot? If so, is there a short howto
> somewhere how to do this?
>
> Sven

I think we should troubleshoot your problem first, while we are at it.

Could you add "auto eth0" to your /etc/network/interfaces, and shutdown. Power up, in serial console, ping the router, then boot into Debian. Please pist the entire serial boot log and the content of your nework/interfaces.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 11/04/2015 07:00PM by bodhi.
Re: Ethernet Problem on NSA310S
November 05, 2015 10:33AM
Strange thing is, for me it's working fine now. And you guys know i've had the same problems as @giggls.
Re: Ethernet Problem on NSA310S
November 05, 2015 01:12PM
JohnnyUSA Wrote:
-------------------------------------------------------
> Strange thing is, for me it's working fine now.
> And you guys know i've had the same problems as
> @giggls.

Johnny,

Are you running stock u-boot?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet Problem on NSA310S
November 05, 2015 01:22PM
Hello,

sorry for confusion. I found the problem and its mostly unrelated.

I seemed to use a broken ethernet-cable which is unable to run at gigabit ethernet speed at all.

Replacing the cable made everything work as expected.
I even managed to compile and run a 4.2.5 Kernel using your linux-4.2.0-kirkwood-tld-1.patch

Unfortunately the stock image was still able to establish the link using the cable with 100MBit speed.

Sven
Re: Ethernet Problem on NSA310S
November 05, 2015 01:44PM
for me, it's working with stock and newer U-Boot.
osa
Re: Ethernet Problem on NSA310S
November 05, 2015 01:49PM
@Bohdi

Here's my original 3.2 kernel patch
@@ -2777,6 +2777,23 @@
 {
        struct phy_device *phy = mp->phy;

+       int reg;
+
+       /*Leds link and activity */
+       phy_write(mp->phy, 22, 0x3);
+       reg = phy_read(mp->phy, 16);
+       reg &=~0xf;
+       reg |=0xf;
+       phy_write(mp->phy, 16, reg);
+       phy_write(mp->phy, 22, 0x0);
+
+       /* Enable downshift; 4-pin cable may plug into gigabit switch */
+       phy_write(mp->phy, 22, 0x0);
+        reg = phy_read(mp->phy, 16);
+        reg |=(1<<11);
+        phy_write(mp->phy, 16, reg);
+
+
        phy_reset(mp);

        phy_attach(mp->dev, dev_name(&phy->dev), 0, PHY_INTERFACE_MODE_GMII);
We do not have "downshifting" in our previous patch. Could it be the answer for "bad cable" case?
Re: Ethernet Problem on NSA310S
November 05, 2015 02:21PM
bodhi Wrote:
-------------------------------------------------------
> JohnnyUSA Wrote:
> --------------------------------------------------
> -----
> > Strange thing is, for me it's working fine now.
> > And you guys know i've had the same problems as
> > @giggls.
>
> Johnny,
>
> Are you running stock u-boot?

@bodhi,
No more, i've updated to your u-boot long time ago. Sadly i don't remember if eth worked fine before the u-boot upgrade. But i remember i somehow make it work with stock u-boot at some point by using that script you recommended already on this topic.
Re: Ethernet Problem on NSA310S
November 05, 2015 02:25PM
osa Wrote:
-------------------------------------------------------
> @Bohdi
>
> Here's my original 3.2 kernel patch
>
> @@ -2777,6 +2777,23 @@
>  {
>         struct phy_device *phy = mp->phy;
> 
> +       int reg;
> +
> +       /*Leds link and activity */
> +       phy_write(mp->phy, 22, 0x3);
> +       reg = phy_read(mp->phy, 16);
> +       reg &=~0xf;
> +       reg |=0xf;
> +       phy_write(mp->phy, 16, reg);
> +       phy_write(mp->phy, 22, 0x0);
> +
> +       /* Enable downshift; 4-pin cable may plug
> into gigabit switch */
> +       phy_write(mp->phy, 22, 0x0);
> +        reg = phy_read(mp->phy, 16);
> +        reg |=(1<<11);
> +        phy_write(mp->phy, 16, reg);
> +
> +
>         phy_reset(mp);
> 
>         phy_attach(mp->dev, dev_name(&phy->dev),
> 0, PHY_INTERFACE_MODE_GMII);
> 
>
> We do not have "downshifting" in our previous
> patch. Could it be the answer for "bad cable"
> case?

Possibly! I guess one way to find out is to use a slower cable with stock u-boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet Problem on NSA310S
November 05, 2015 05:52PM
giggls,

> sorry for confusion. I found the problem and its
> mostly unrelated.
>
> I seemed to use a broken ethernet-cable which is
> unable to run at gigabit ethernet speed at all.

That's OK. As osa said above, this might be a good test case that we possibly have not encountered!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Ethernet Problem on NSA310S
November 05, 2015 06:10PM
osa,

> We do not have "downshifting" in our previous
> patch. Could it be the answer for "bad cable"
> case?

I have not try the test yet, but I took a look at the u-boot patch and kernel patch: I do have the downshift code in new u-boot, but not in the kernel patch.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: