Topic: RB450 - using Five Ethernet Ports

First, I like to collaborate, posting information , step by step , how to make a RB450 ready to use w/ kamikaze.
----
1) chose a Binary distribuiton, or compile your image.
1a ) http://downloads.openwrt.org/snapshots/ar71xx/
( ready to use kernel , from openwrt.org )
1b) http://wifi.ozo.com/airo/openwrt/firmware/kamikaze/2.6/ar71xx/
( ready to use kernel, from ozo)
1c) download kamikaze sources
( use a good linux distribuition ... )
- svn co https://svn.openwrt.org/openwrt/trunk
- make prereq
- chose Target System -> Atheros AR71xx
- chose Target Images -> ramdisk
- Configure other options
- make ... ( its take a long time)
... you will get your kernel image on trunk/bin
----
Configure a DHCP / TFTP server to send this
image to router board
-- dhcp.conf --
....
next-server 192.168.200.2;
filename "openwrt-ar71xx-vmlinux.elf";
....
---- xinetd.d/tftpd
disable     = no
server_args = -s /var/ftp/pub
----
copy  trunk/bin files to /var/ftp/pub
( or download from pre-compiled from above sites ... )
----
3) conect router board RB450 serial port to your serial port PC.
use hyperterminal or other serial software on this configuration
- COM1
- 115200 bits/s
- 8 data
- 1 stop
- no parity.
...
4) Poweron board, PRESS ANY KEY to access boot menu.
On boot menu, chose BOOT FROM NETWORK
====================================
after this you can load it on RB450 NAND by using wget2nand
# wget2nand ftp://[ip from your server, w/ftp started]/pub
----
use this command, from HYPERTERMINAL, because it reconfigure your
network adapter.
-----
this command will download 2 files to RB450 /tmp directory and copy it
to BOOT ROM partition and ROOT ROM partition
(*) you can browse this script to verify commands and debug it, if you have
any problems.
-----
if you see this script coping this files, and decompessing ROOT partition
( a lot of files untar messages on screen ) . you are ready to boot
openwrt on you RB 450.
------
Reboot, access boot menu again, and return boot to NAND
------
After boot, on HYPERTERMINAL, change root password
- passwd
And , change network config
- vi /etc/config/network
============================
good, look,
============================
Now my question follows ..

2 (edited by edison-nts 2008-10-29 03:59:13)

Re: RB450 - using Five Ethernet Ports

I want to use 5 ethernet port like 5 ethernet adapter.
Default kernel configuration is :
port 0, configured to eth0
port 1,2,3,4 , configured like switch to eth1
------------------------
Is very interting to use it separated to use dual link internet
connection.
-------------------------
I just tried to change compilation like showed in
http://wiki.openwrt.org/Ip175C.
but it not work in RB450.
--------------------------
I just tried to compile admswconfig , but it don't find compatible
hardware.
have any body a sugestion ?
-----
Thanks in advance.
Edison

Re: RB450 - using Five Ethernet Ports

Hi, I'm having the same problem, I can't see 5 ethernet ports on my BR450, I see just two of them.

Re: RB450 - using Five Ethernet Ports

does MikroTik OS offer 5 different ethernet ports?

Re: RB450 - using Five Ethernet Ports

Hi,
Sorry for the late reply.

I believe setting those flags in the .config is already the default so they don't do anything.
The VLAN support is not yet in OpenWRT trunk, so you need to get everything from here:
http://inst.eecs.berkeley.edu/~pathorn/ip175c/
(or the corresponding bug report here https://dev.openwrt.org/ticket/4050 )

Right now I think you still need to apply the "phyfix" kernel patch, which should go in your "target/linux/sometarget/patches-2.6.26/" and then you have a few choices for actually enabling the VLANs.  Since this uses ar7 I don't know if that goes in atheros or somewere else.  Also not sure if they switched to 2.6.27 or 26 so make sure the patch goes in the right place.

You will still need to set the switch section in your /etc/config/network which sets up the appropriate ethernet devices eth0.1 and eth0.2

If you want a simple fix, download the "user-switch" program and you can run it on the command line like:
./user-switch +v "" "0 1 2 3 5*" "4 5"
However these settings will be lost on each boot.
This is a quick C program I hacked up that's kind of like the admswconfig but of compatible with ip175c instead.

Also note that if you set up vlan network devices you will lose connection if you are plugged into the ethernet port (unless you also set up the same vlans on your linux computer) until you run the user-switch program.

If you want it to work directly with the /etc/config/network system and have an entry in /proc/switch/eth0 you should donwload the "switch-ip175c.c", and compile it in the package/switch directory. Then you have to copy the kernel modules switch-core and switch-ip175c over to /lib/modules and set them to load on boot.

Hope I'm not confusing you with all this.

Re: RB450 - using Five Ethernet Ports

does MikroTik OS offer 5 different ethernet ports?

Yes it does. I'm running an RB493AG with RouterOS 3.15 and all 9 ethernet ports have a mac address, can be assigned an ip address, and can be routed.

Re: RB450 - using Five Ethernet Ports

Wow, they stupidly made the IP175C and IP178C use different MII registers but have the same PHY ID so it's hard to tell them apart!

Luckily I just found out that somebody has written an updated icplus.c driver for the IP178C:
https://dev.openwrt.org/ticket/4075
This one seems to check the PHY ID of port 5 which does not exist on the 175 so I'll try doing that.

They also seem to have a patch for the RB493 in this tracker report.  Did you apply that?

Download that icplus.c (or icplus.2.c, not sure which one) and try it out: it should cause the chip to be detected so you can use the device albeit without vlan-port mappings.  You may need to put that at "drivers/net/phy/icplus.c" in your kernel tree after it is extracted since it's not in a patch format.

I'll try and add the register mappings in my switch-ip175c.c driver now that I know how to distinguish them, so you should also be able to have vlans.

Re: RB450 - using Five Ethernet Ports

I'll give the 493 patch a try and let you know how it goes.

Thanks phorn.

Re: RB450 - using Five Ethernet Ports

I just added IP178C support (untested but it's pretty similar to my 175C so it should work in theory) to my VLAN driver up here along with instructions for patching openwrt with everything:
http://inst.eecs.berkeley.edu/~pathorn/ip175c/

Re: RB450 - using Five Ethernet Ports

Thanks Patrick for the excellent how-to page, I'll try to get the RB493AH flashed tonight.

Re: RB450 - using Five Ethernet Ports

Patrick,

For the ip78c should the vlan look like this?

uci set network.eth0.vlan1="0 1 2 3 4 5 6 7 9*"
uci set network.eth0.vlan2="8 9"

Re: RB450 - using Five Ethernet Ports

not quite-- the CPU port is the last port but as there are only 9 ports and they are 0-indexed then the LAN ports go from 0-6, WAN is 7 and CPU is 8.  So you want to use:

uci set network.eth0.vlan1="0 1 2 3 4 5 6 8*"
uci set network.eth0.vlan2="7 8"

While the wan port should be port 7, some routers may decide to flip them around or do something else so you might need to try a few combinations.

13 (edited by robrob 2008-11-02 00:51:50)

Re: RB450 - using Five Ethernet Ports

Patrick,

The RB493 has 9 external ethernet sockets and the cpu for 10 total.

Re: RB450 - using Five Ethernet Ports

Patrick,

This is what I got when I tried to apply the patch:

rob@Server:~/kamikaze$ patch -p0 < icplus-all.patch
patching file target/linux/generic-2.6/patches-2.6.26/980-icplus178.patch
patching file target/linux/generic-2.6/patches-2.6.26/995-phyfix.patch
patching file package/switch/src/switch-ip175c.c
patching file package/switch/src/Makefile
Hunk #1 FAILED at 10.
1 out of 1 hunk FAILED -- saving rejects to file package/switch/src/Makefile.rej
patching file package/switch/Makefile
Hunk #1 FAILED at 16.
1 out of 1 hunk FAILED -- saving rejects to file package/switch/Makefile.rej
rob@Server:~/kamikaze$

Re: RB450 - using Five Ethernet Ports

Run make menuconfig, select "Kernel modules", "Network Support", and select kmod-switch

I don't have kmod-switch listed in kernel modules/network support (kamikaze trunk 13093)

Re: RB450 - using Five Ethernet Ports

That's really strange--it worked when I tried it and I'm also now at revision 13093:

$ svn revert -R .
$ svn st -q
$ wget http://inst.eecs.berkeley.edu/~pathorn/ip175c/icplus-all.patch
...
$ svn info
Revision: 13093
...
$ patch -p0 < icplus-all.patch 
patching file target/linux/generic-2.6/patches-2.6.26/980-icplus178.patch
patching file target/linux/generic-2.6/patches-2.6.26/995-phyfix.patch
patching file package/switch/src/switch-ip175c.c
patching file package/switch/src/Makefile
patching file package/switch/Makefile
patrick@quad:/ext/prog/ar430w/kamikaze$ svn st -q
M      package/switch/src/Makefile
M      package/switch/Makefile

I don't want to try and figure out what's wrong with the patch--it's really simple to do:

Index: package/switch/src/Makefile
===================================================================
--- package/switch/src/Makefile    (revision 13088)
+++ package/switch/src/Makefile    (working copy)
@@ -10,7 +10,7 @@
 # 2 of the License, or (at your option) any later version.
 #
 
-obj-m    := switch-core.o switch-adm.o switch-robo.o
+obj-m    := switch-core.o switch-ip175c.o switch-robo.o
 
 ifeq ($(MAKING_MODULES),1)
 export-objs := switch-core.o
Index: package/switch/Makefile
===================================================================
--- package/switch/Makefile    (revision 13088)
+++ package/switch/Makefile    (working copy)
@@ -16,13 +16,12 @@
 
 define KernelPackage/switch
   SUBMENU:=Other modules
-  DEPENDS:=@TARGET_brcm_2_4||TARGET_brcm47xx
   TITLE:=Switch drivers
   FILES:= \
     $(PKG_BUILD_DIR)/switch-core.$(LINUX_KMOD_SUFFIX) \
-    $(PKG_BUILD_DIR)/switch-adm.$(LINUX_KMOD_SUFFIX) \
+    $(PKG_BUILD_DIR)/switch-ip175c.$(LINUX_KMOD_SUFFIX) \
     $(PKG_BUILD_DIR)/switch-robo.$(LINUX_KMOD_SUFFIX)
-  AUTOLOAD:=$(call AutoLoad,20,switch-core switch-robo switch-adm)
+  AUTOLOAD:=$(call AutoLoad,20,switch-core switch-robo switch-ip175c)
 endef
 
 define KernelPackage/switch/description

Basically just replace "adm" (which doesn't compile on atheros) with "ip175c":

The other change I made was remove the DEPENDS line since no relevant code seems to be broadcom-specific... That should get it to show up in your menuconfig.

17 (edited by robrob 2008-11-02 14:17:34)

Re: RB450 - using Five Ethernet Ports

Patrick,

Thanks for all the hand-holding. I erased the build directory and started the svn from scratch and the patch works.

kmod-switch is listed in Kernel Modules/Other Modules, not Network Support (for me anyway).

I'm compiling right now, I'll update soon.

Rob

Re: RB450 - using Five Ethernet Ports

Verify that the switch_ip175c and switch_core modules are loaded into the kernel by running lsmod.

switch_core is loaded but switch_ip175c isn't.

The only communication I have with the router is through the serial port so how can I "copy or enable them manually?"

Re: RB450 - using Five Ethernet Ports

The switch-ip175c is not important for basic operation--you should be able to connect to the router via network now.  If not, then the switch driver isn't going to help much.

The icplus.c that I included in the patch from https://dev.openwrt.org/ticket/4075 was supposed to solve that.

Can you do a "ifconfig" and "dmesg" to see what the status is of the network devices.  In mine I see:

eth0: Atheros AR231x: 00:18:02:78:b9:50, irq 4
ICPlus: IP175C detected
ar2313_eth_mii: probed
eth0: attached PHY driver [ICPlus] (mii_bus:phy_addr=0:00)

Yours should probably have a different network device instead of the "ar2313" and most importantly you should see the message "ICPlus: IP178C detected".

If you want to include the switch-ip175c, the only reference I can find is in "package/switch/src/Makefile". If you open that in a text editor and go to the "export-objs" line and add the switch-ip175c.o next to the switch-core.o that may cause it to be correctly included.  But I am not completely sure.

Re: RB450 - using Five Ethernet Ports

Just a thought, but it's likely that these patches have not been included in SVN:
https://dev.openwrt.org/raw-attachment/ticket/4075/rb493_eth_pci.patch
https://dev.openwrt.org/raw-attachment/ticket/4075/rb493.patch

Since you have a 493 and it looks like these are what enable the network device, maybe you should give them a try, again applying them with "patch -p0 < file.patch". 

That, and try editing the package/switch/src/Makefile like I said in the previous post.

21 (edited by robrob 2008-11-03 02:53:33)

Re: RB450 - using Five Ethernet Ports

Patrick,

My fundamental problem is that the pci interface isn't working. I get an:

Checking kernel configuration... FAILED
Please enable PCI support.

error when I compile. The rb493_eth_pci.patch installs fine, but rb493.patch says "previous patch detected" and won't install.

I give up, I'm going back to the rb493's RouterOS. It's really too bad because the RB493AH is a monster with 128MB of RAM, 64MB of flash, a 680MHz MIPS CPU, and 9 external ethernet ports. Hopefully it will end up a build choice in make menuconfig.

Thanks for all the help,

Rob

Re: RB450 - using Five Ethernet Ports

I wish my router had that much memory :-D

But I don't think you should be having that error.  What's you .config say?  Are you sure you picked the "Atheros AR71xx" configuration in your make menuconfig?  Because that one has CONFIG_PCI=y

I have the feeling that your setup should be working if you got it to boot before -- those patches shouldn't have disabled pci support in the kernel.

If not, you may at least want to reply to the bug report at https://dev.openwrt.org/ticket/4075

Re: RB450 - using Five Ethernet Ports

I've never been able to boot kamikaze on the RB493AH with any ethernet port working and I have been using the AR71xx target image.

Which svn are you working with? It appears the rb493.patch is for 8.09, not the trunk. Does the order of patches matter? It seems the first patch installed, rb493 or rb493_eth_pci will install and the second gives an error.

When I compile after using the rb493_eth_pci patch I get a dialog asking about installing EISA support and a bunch of ethernet adapters, none of which look familiar.

Re: RB450 - using Five Ethernet Ports

I just looked at those patches and they don't exactly make sense to me since they do seem conflicting and somewhat overlap what is in trunk.

I was a bit confused and thought you got farther than you really did because I saw the "eth0: no PHY found" error you posted in the other thread which would imply that ethernet was working.

Well hopefully 493 support will be fixed some day.  If you want you can make a wiki page detailing what you tried.

Re: RB450 - using Five Ethernet Ports

The "eth0: no PHY found" error happened long ago during one of the many trunk builds, but even then I couldn't ifconfig eth0 up the interface.