OpenWrt Forum Archive

Topic: RB411 Board Layout Changed - Ethernet chip changed to AR8012

The content of this topic has been archived on 1 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

So, we got a new shipment of RB411s in and I attempted to install OpenWRT on one of the new boxes.  Right away I ran into some issues.  The Ethernet driver is not being loaded properly.  It looks like the physical mapping has changed.

On one of the older boxes, everything boots fine and the Ethernet driver loads fine:

root@OpenWrt:~# dmesg | grep eth0
eth0: Atheros AG71xx at 0xb9000000, irq 4
eth0: connected to PHY at 0:00 [uid=00221512, driver=Generic PHY]
eth0: link up (100Mbps/Full duplex)

On one of the new boxes, I ran into issues:

root@OpenWrt:/# dmesg | grep eth0
eth0: Atheros AG71xx at 0xb9000000, irq 4
eth0: no PHY found with phy_mask=00000001

The main difference I see is the Ethernet chip has changed from a KSZ8041NL to a AR8012.  The layout on the board is moved around as well.  There are now mount points for SD, USB, and PCI-E.

I know I need to change the phy_mask in trunk/build_dir/linux-ar71xx/linux-2.6.30.10/arch/mips/ar71xx/mach-rb-4xx.c.   However, I have no idea what to change it to.  I've tried guessing few different addresses, but I've had no luck.  The most up-to-date setting is listed below:

static void __init rb411_setup(void)
{
        rb4xx_generic_setup();
        rb4xx_add_device_spi();

        ar71xx_add_device_mdio(0xfffffffe);

        ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
        ar71xx_eth0_data.phy_mask = 0x00000001;

        ar71xx_add_device_eth(0);

        ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
}

MIPS_MACHINE(AR71XX_MACH_RB_411, "MikroTik RouterBOARD 411/A/AH", rb411_setup);

I'm at a lost on how to resolve this issue.  If I knew what address to set ar71xx_eth0_data.phy_mask = 0x00000001 to, I'm sure I could get this fixed.  Has anyone else ran into this issue?  Does anyone have the spec sheet for the newer RB411 boards?

(Last edited by swolfe on 4 Dec 2009, 20:18)

Also, if anyone has any suggestions on how to figure out what address space to set the phy_mask to, that would be awesome.

So I figured out how to make this work.  I changed the phy_mask to 0x00000000 and also specified speeds:

static void __init rb411_setup(void)
{
        rb4xx_generic_setup();
        rb4xx_add_device_spi();

        ar71xx_add_device_mdio(0xfffffffe);

        ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
        ar71xx_eth0_data.phy_mask = 0x00000000;
        ar71xx_eth0_data.speed = SPEED_100;
        ar71xx_eth0_data.duplex = DUPLEX_FULL;

        ar71xx_add_device_eth(0);

        ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
}

MIPS_MACHINE(AR71XX_MACH_RB_411, "MikroTik RouterBOARD 411/A/AH", rb411_setup);

I'm thinking about switching to the RB411R for an openwrt project I'm working on and have a couple questions about the above fix.  I'm coming off a stubbornly clinging to the 54gl, so I'm a little rusty on how to hack this stuff for unusual platroms:

1. With this fix will openwrt work without modification on the Mikrotik RB411R? (the one with the built in radio).  In that vein, is the wiki page (http://oldwiki.openwrt.org/OpenWrtDocs%282f%29Hardware%282f%29Mikrotik%282f%29RB433.html  <-- this is for the 433, but I assume it's the same procedure.  there's no wiki page for the 411) current?
2. Have the changes above been integrated into one of the builds on the DL site (link?).  I'd love to avoid building images if possible...

Thanks!

(Last edited by WTGPhoben on 8 Jan 2010, 22:37)

Kamikaze doesn't work on the RB4xx boards.  You'll have to compile from the latest trunk.  As far as if it will work on the RB411R, I am not sure.  I don't have one to test.  But it is an Atheros radio, so it should work.

swolfe wrote:

So I figured out how to make this work.  I changed the phy_mask to 0x00000000 and also specified speeds: ...

Please open a ticket at http://dev.openwrt.org/ and attach your changes.

~ JoW

Hi swolfe.

I have the same problem than you. Did you solve the problem?


Thanks.

swolfe wrote:

So I figured out how to make this work.  I changed the phy_mask to 0x00000000 and also specified speeds:

I might be mistaken, but wouldn't this force the speed/duplex to 100Mbit/Full? Can you test whether 10Mbit or Half duplex still works? (not likely to be encountered anymore, but you never know ;-).

KM

dseira wrote:

Hi swolfe.

I have the same problem than you. Did you solve the problem?


Thanks.

Yes, I did.  Read the above posts with what build file I modified to get it to work.

KanjiMonster wrote:

I might be mistaken, but wouldn't this force the speed/duplex to 100Mbit/Full? Can you test whether 10Mbit or Half duplex still works? (not likely to be encountered anymore, but you never know ;-).

KM

Indeed.  I've been a bit swamped, so I haven't had a chance to mess with any other speeds/duplexes.  Our implementation always has the device connected to a 100/full switch, so I hadn't had much need.

jow wrote:

Please open a ticket at http://dev.openwrt.org/  and attach your changes.

~ JoW

Haven't been able to do so yet.  Eventually tongue

Hi.

Have you send the patch to the OpenWRT trunk? It's interesting send it because other people can have the same problem and it's a good solution.

Another thing, I have a RB433, it has 3 ethernet ports but openwrt only detect 2. Is it possible that the problem is in the same file (mach-rb-4xx.c)?

Regards,
David

The discussion might have continued from here.