OpenWrt Forum Archive

Topic: RB450 - using Five Ethernet Ports

The content of this topic has been archived between 6 Feb 2018 and 6 May 2018. Unfortunately there are posts – most likely complete pages – missing.

duvi

I think, as Patrick said, we both have the same problem: kernel (ag71xx?) is not config_init'ing the switch.
IP17xx is kind of silent in what it is doing. I myself don´t know anymore what are the original messages. I tampered with the sources a lot.
Module maintainers are already on the way to rescue us! Right, Patrick?

Hi
I have rb433uah with ip175d chip, with original patch from Martin Mares and revision 19705 i can use my switch with these changes:

gencho@lamq:~/openwrt$ diff -uaH 19705_orig/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c 19705/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c
--- 19705_orig/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c 2010-05-14 09:15:44.000000000 +0300
+++ 19705/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c      2010-05-13 18:46:58.000000000 +0300
@@ -213,10 +213,10 @@
        rb4xx_generic_setup();
        rb433_add_device_spi();

-       ar71xx_add_device_mdio(0xffffffe9);
+       ar71xx_add_device_mdio(0xffffffe0);

        ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
-       ar71xx_eth0_data.phy_mask = 0x00000006;
+       ar71xx_eth0_data.phy_mask = 0x00000001;
        ar71xx_eth0_data.speed = SPEED_100;
        ar71xx_eth0_data.duplex = DUPLEX_FULL;

But it's not possible to configure vlans, ports 1 and 2 works like switch and port 4 is my wan and it's possible to set an ipaddress, routing, bridging etc...
I try this configuration with patch from Patrick Horn and i can see my switch and swconfig works on dev eth1 but i have no luck to configure it (set ipaddress, vlans, etc...).

I am with similar problems in rb450 with IP175D:

dmesg |grep eth
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: connected to PHY at ag71xx-mdio:04 [uid=02430d80, driver=Generic PHY]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: using fixed link parameters
eth0: link up (100Mbps/Full duplex)
eth0: link down
device eth0 entered promiscuous mode
eth1: link up (100Mbps/Full duplex)
eth0: link up (100Mbps/Full duplex)
br-lan: port 1(eth0) entering forwarding state

dmesg |grep IP17
IP17xx: Found IP175D at ag71xx-mdio:00

swconfig dev 0 show
Failed to connect to the switch
swconfig dev eth0 show
Failed to connect to the switch

br-lan    Link encap:Ethernet  HWaddr 00:0C:42:52:2F:3C
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1750 (1.7 KiB)  TX bytes:994 (994.0 B)

eth0      Link encap:Ethernet  HWaddr 00:0C:42:52:2F:3C
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1992 (1.9 KiB)  TX bytes:994 (994.0 B)
          Interrupt:5

eth1      Link encap:Ethernet  HWaddr 00:0C:42:52:2F:3D
          inet addr:192.168.10.118  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:929 errors:0 dropped:0 overruns:0 frame:0
          TX packets:187 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:93482 (91.2 KiB)  TX bytes:73195 (71.4 KiB)
          Interrupt:4

Hi all,

Thanks all for trying this out. Too bad it's not showing up. If anyone has , it would be good to trace the ag71xx_phy code between the probe() call and config_init(). Some of it might go into drivers/net/phy/ as well. I don't really have a router to test with, so it's a bit tricky for me to try stuff.

I find it easiest to edit the code directly inside build_dir/linux-* It will go away if you make clean, but for debugging it's pretty simple since it only has to recompile the files you changed.

I think the reason that martin's original driver works is that I think it's for an older SVN version, before the change to ag71xx_phy. luboznaiko, which SVN version were you testing on?

While I may have made a mistake porting the code, I don't think it's likely to be in the probe() or config_init() functions, and we can see it's never seems to get initialized.

Here's what I'm thinking:
There are 5 ethernet phy/mdio addresses associated with eth0. ag71xx_phy is doing a loop through all of them, and it gets "ip17xx" for ports 0,1,2,3. However, port 4 is actually attached to eth1, not the switch so it gets "Generic Phy".

Since Generic Phy is the last one to be probed, perhaps it is the only one ag71xx decides to call config_init for, and not the others.

Patrick

the only reference to config-init is inside drivers/net/phy/phy.c (around line 402 in phy_mii_ioctl()) .

This is what I did:

        pr_info("PHY MII IOCTL: Should I call config_init for %s: ", phydev->attached_dev->name);
        if (mii_data->reg_num == MII_BMCR
                         && val & BMCR_RESET
                         && phydev->drv->config_init) {
                 phy_scan_fixups(phydev);
                 phydev->drv->config_init(phydev); 
                 pr_info("YES\n");
         }
         else
                 pr_info("NO\n");

Yesterday I played with it a little and found this code is never executed.
ioctl with method SIOCSMIIREG is never called.
Any other place I could poke some lines?

I have some success on RB433UAH!

After playing a little in mach-rb4xx.c, I managed to get 'ether2' and 'ether3' ports working (ping), and swconfig also sees the switch. Unfortunately, ether1 doesn't work anymore ): , which was the only one working before. Somehow we have to find this out (:

Here's what I modified in mach-rb4xx.c (almost the same as luboznaiko suggested):

@@static void __init rb433_setup(void)

-       ar71xx_add_device_mdio(0xffffffe9);
+       ar71xx_add_device_mdio(0xffffffe0);

-       ar71xx_eth1_data.phy_mask = 0x00000010;
+       ar71xx_eth1_data.phy_mask = 0x00000001;

This makes the switch work, but it is seen as eth0, not eth1 as it's supposed to be I guess.
Maybe that's the reason 'ether1' stops working.

Regarding to swconfig 'ether2' is port1, 'ether3' is port2, and 'ether1' is port4.
This is also strange, because i thought 'ether1' is a stand alone port, it shouldn't be seen as a switch port. Right?

And also there is no Generic PHY detected in dmesg, only IP17XX PHY.

I'll post dmesg later, now I'm not with the board.

Maybe a little more play with those addresses and masks should get everything working. Isn't there any way to find the correct values for them.

(Last edited by duvi on 2 Jun 2010, 12:36)

phorn wrote:

I think the reason that martin's original driver works is that I think it's for an older SVN version, before the change to ag71xx_phy. luboznaiko, which SVN version were you testing on?

While I may have made a mistake porting the code, I don't think it's likely to be in the probe() or config_init() functions, and we can see it's never seems to get initialized.

Here's what I'm thinking:
There are 5 ethernet phy/mdio addresses associated with eth0. ag71xx_phy is doing a loop through all of them, and it gets "ip17xx" for ports 0,1,2,3. However, port 4 is actually attached to eth1, not the switch so it gets "Generic Phy".

Since Generic Phy is the last one to be probed, perhaps it is the only one ag71xx decides to call config_init for, and not the others.

My SVN version -> 21648

I have an RB433UAH with IP175D.
I'm working with trunk 21642 patched with http://www-inst.eecs.berkeley.edu/~path … -05-31.zip

I've made the following changes in mach-rb4xx.c ( after luboznaiko and duvi )

@@static void __init rb433_setup(void)

-       ar71xx_add_device_mdio(0xffffffe9);
+       ar71xx_add_device_mdio(0xffffffe0);

+       ar71xx_eth0_data.phy_mask = 0x00000001;

I don't know what these 'magic' numbers mean!

The result:
- well functioning eth0
- half functioning eth1

No outgoing packets on eth1. Incoming is processed (mac address picked up...)
The ifconfig shows dropped TX packets.
The ethertool shows no link on eth1:

root@OpenWrt:~# ethtool eth1
Settings for eth1:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: external
        Auto-negotiation: on
        Current message level: 0x000000ff (255)
        Link detected: no

Do you have any ideas?

Hi again,
I have some kind of solution for our problem.
I'm not sure what is the problem with patching SVN checkouts but there is a problem.
Because of that I use "git" like described in https://forum.openwrt.org/viewtopic.php … 58#p110258 from phorn
And after applying patches I just copying the file ip17xx.c from SVN revission 19075, patched with original patches from Martin Mares.
After that i have working eth0 and eth1 but with no VLAN support (or I don't know how to do it)
Phorn, please post a link to the original patches from Martin Mares, and maybe someone will help us to solve this problem.

I'm again,
for the people with rb433uah i make a dirty patch for SVN revision 21642
http://liut.org/rb433uah/rb433uah.patch
eth1 works like switch but i have no luck to configure vlans
this patch is just a diff between original 21642 revision and patched one
the steps are:
svn co svn://svn.openwrt.org/openwrt/trunk@21642 21642
cd 21642
patch -p1 < rb433uah.patch
and after make you must have working eth0 and eth1

I can confirm that this way the ports are working but vlans are not on RB433UAH.

make[8]: *** No rule to make target `drivers/net/phy/ip17xx.o', needed by `drivers/net/phy/built-in.o'.  Stop.

I think you forgot rename /drivers/net/phy/ip175c.c to /drivers/net/phy/ip17xx.c.

My fault, you must copy or rename ip175c.c to ip17xx.c

patch -p1 < rb433uah.patch; cp target/linux/generic-2.6/files/drivers/net/phy/{ip175c.c,ip17xx.c}

Here are the original patches:
http://inst.eecs.berkeley.edu/~pathorn/ … ip17xx.zip
Sorry for not having a link to them earlier. That could have been useful.

Luboznaiko, does your patch do something different to cause the switch to be inited? I might give this another look over the weekend.

The phy masks look interesting, but I'd rather avoid having to change all the different routerboard models (as well as other ar71xx devices) just to make this switch driver work. Or was the phy mask actually completely wrong and the old driver was just ignoring it?

You don't need to patch anymore, IP17xx driver has been in trunk for a day.

The wan port, the switch and vlans are all working fine on RB433UAH.

Hi All

Anyone had the same luck with RB450 with 175D chipset ??

duvi , did you change the values in mach-rb4xx.c or are they the originals??

(Last edited by BitBrusher on 10 Jun 2010, 14:52)

No, I didn't change anything, everything works out of the box.

Okay, one thing doesn't. You have to modify the network config file, swap eth0 and eth1 or something. I see there is a default network config file for rb433, but for me it didn't make it to the rootfs during compilation.

I use RB450 with 175D. trunk r22372.  All ports works fine in individual VLAN.
dmesg relevant part

MIPS: machine is MikroTik RouterBOARD 450                                                                                                                     
Atheros AR71xx SPI Controller driver version 0.2.4                                                                                                            
IP17xx: Found IP175D at ag71xx-mdio:00                                                                                                                        
ag71xx_mdio: probed                                                                                                                                           
eth0: Atheros AG71xx at 0xba000000, irq 5                                                                                                                     
eth0: connected to PHY at ag71xx-mdio:04 [uid=02430d80, driver=Generic PHY]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: connected to PHY at ag71xx-mdio:00 [uid=02430d80, driver=IC+ IP17xx]

etc/config/network
config switch eth1
        option name     eth1
        option reset    1
        option enable_vlan 1

config switch_vlan
        option device   eth1
        option vlan     5
        option ports    "5t 0"

config switch_vlan
        option device   eth1
        option vlan     4
        option ports    "5t 1"

config switch_vlan
        option device   eth1
        option vlan     3
        option ports    "5t 2"

config switch_vlan
        option device   eth1
        option vlan     2
        option ports    "5t 3"

(Last edited by mtadeu on 26 Jul 2010, 03:04)

The same image works fine in rb450G. eth0 and four VLANs in eth1 are ok.

CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7161 rev 2, CPU:680.000 MHz, AHB:170.000 MHz, DDR:340.000 MHz
MIPS: machine is MikroTik RouterBOARD 450G
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: connected to PHY at ag71xx-mdio:04 [uid=004dd041, driver=Atheros AR8216/AR8316]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: AR8316 switch driver attached
eth1: connected to PHY at ag71xx-mdio:00 [uid=004dd041, driver=Atheros AR8216/AR8316]

Hi
Does anyone know if ip17xx is already supported in Backfire main stream??

BitBrusher wrote:

Hi
Does anyone know if ip17xx is already supported in Backfire main stream??

I try backfire 22933 and don't work. The VLAN do not work:

root@OpenWrt:/# swconfig dev eth0 show
Failed to connect to the switch
root@OpenWrt:/# swconfig dev eth1 show
Failed to connect to the switch

Greetings

I've been looking into the IP17xx driver as this board has the IP175D switch chip.  I'm interested in trying out the mirroring support that is mentioned on the vendors web page for the pp-IP175D switch chip.

I cant find the datasheet anywhere, does anyone know if the datasheet is available?  If not can anyone share the registers I should be looking for?

Thanks everyone for your work on the RB433UAH, and openwrt so far.

sml

[/edit]malformed url

(Last edited by smalltime on 17 Sep 2010, 01:13)

Hi,

We are trying to get Backfire working on a RB433 with an IP175D switch chip.  Our basic image is built on a recent trunk and we have tried a variety of patches for both the IP175D and the AR7130.  This is what we can get it to do...

The AR7130 Eth0 works okay at 10/100MB through Phy4 and recognises it as Generic Phy.  This is understandable as it is really just using Phy4 as a dumb interface.

Eth1 on the AR7130 recognises the switch as a IP17xx but it won't transmit or receive data through to either Port 1 or Port 2.

Port 1 and Port work and VLANs work on these.  We have been able to test this by plugging in a couple of computers and see traffic through the switch.

So just to re-iterate, we seem to be setting up the switch, but whilst the two physical ports work, we can't get anything in or out of the AR7130.

We are just going back to a previous trunk release and we are going to check whether the 'auto-baud' rate has been turned off, to see if that makes any difference.

If anyone has it working on a RB433 or RB450 could you post the trunk version and any other useful information please?

On a slightly different tack I note that this issue is a current ticket (#6119) and is four from the top of the list.  Anyone know if it is going to be addressed soon?

Regards

Robin

(Last edited by DrRobin on 12 Jun 2012, 17:21)

The discussion might have continued from here.