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.

I think the bridge is a separate issue. Based on what you posted, it looks like the bridge is working. But just to make sure, could you run

brctl show

That should list the interfaces attached to each bridge port.

In order to get forwarding to properly work in a bridge, you need to enable lan<->lan forwarding in your firewall configuration.

From what you posted, others are trying to ping the router, but the packets are coming in untagged.  The openwrt system did manage to send just one packet (possibly an ARP packet which might ignore vlans).

Here is a simple shell command to print the status of all the ports and some of the vlans.

swconfig dev eth1 vlan $v get enable_vlan
swconfig dev eth1 vlan $v get name
for v in 0 1 2 3; do swconfig dev eth1 vlan $v get ports; done
for p in 0 1 7 8; do swconfig dev eth1 port $p get status; swconfig dev eth1 port $p get tagged; done

The output will read the status from the switch, so this should tell us if something is being configured wrong. I don't own any device with a IP178C so I was just going off the spec sheet, and there is a chance that I made a mistake somewhere. It is possible that the tagged bit for the CPU is not being set correctly, so everything is coming in untagged.

Have you tried doing a ping from openwrt to someone else attached to the switch? Or an arping?

This is just a random guess, but another thing to try is this:

swconfig dev eth1 port 4 set tagged 2

The bit for removing vlan tags on port 4 is the same as adding tags for the cpu port 8, so there's a chance that is mixed up.

(Last edited by phorn on 25 May 2009, 22:06)

root@OpenWrt:/# brctl show
bridge name     bridge id               STP enabled     interfaces
br-lan          8000.000c42332b86       no              eth0
                                                        eth1
root@OpenWrt:/#
root@OpenWrt:/# swconfig dev eth1 vlan $v get enable_vlan
Unknown attribute "enable_vlan"
root@OpenWrt:/# swconfig dev eth1 vlan $v get name
Unknown attribute "name"
root@OpenWrt:/# for v in 0 1 2 3; do swconfig dev eth1 vlan $v get ports; done
0 1 2 3 4 5 6 7 8
0 1 2 3 4 5 6 8
7 8
0 1 2 3 4 5 6 7 8
root@OpenWrt:/#

root@OpenWrt:/# for p in 0 1 7 8; do swconfig dev eth1 port $p get status; swcon
fig dev eth1 port $p get tagged; done
up, 100 Mbps, full duplex, auto-negotiate
2
down, auto-negotiate (in progress)
2
down, auto-negotiate (in progress)
2
up, 100 Mbps, cpu port
2
root@OpenWrt:/#

Have you tried doing a ping from openwrt to someone else attached to the switch? Or an arping?

Yes, I can ping from the kamikaze command line out the wan port (eth0) and it will respond to outside pings, but the switch ports will neither send or receive pings--through the router or port to port.

(Last edited by robrob on 26 May 2009, 03:02)

To start with, your configuration is such that all the interfaces are bridged together.  This has nothing to do with VLANs. If you intend to do this, I think you may need to read up on STP (Spanning Tree Protocol) which is how bridges work across different switches.

Just to make it clear, I highly recommend not bridging eth0 and eth1 together, just to gain one additional port. The performance is so poor that you are better off buying an additional 4 or 8-port switch than using a software bridge. I merely suggested that as an example, but if you do this, you'll still be stuck with the whole 20Mbps limit going between them due to the ag71xx driver performance.

Can you please explain exactly what you intend to do with your RB492 (and what you are putting in your /etc/config/network).

Patrick,

Thanks again for all the hand holding. This router and networking thing is just a hobby for me and I obviously still have a lot to learn. I removed the 'eth0 eth1' bridge and set up the network file as you suggested several posts back. Everything is now working as it should using this network file:

config switch eth1
option reset 1
option enable_vlan 1

config switch_vlan
option device eth1
option vlan 1
option ports "0 1 2 3 4 5 8t"

config switch_vlan
option device eth1
option vlan 2
option ports "6 7 8t"

config interface lan
option ifname "eth1.1"
option proto static
option type bridge
option ipaddr 192.168.2.1
option netmask 255.255.255.0

config interface lan2
option ifname "eth1.2"
option proto static
option ipaddr 192.168.3.1
option netmask 255.255.255.0

config interface wan
option ifname "eth0"
option proto static
option ipaddr 192.168.1.7
option netmask 255.255.255.0
option gateway 192.168.1.1
option dns 208.67.222.222

To recap what was done to get the RB493AH working:

Fresh svn checkout
Placed your patch http://inst.eecs.berkeley.edu/~pathorn/ … 175c.patch in the top kamikaze directory
implemented the patch with this command: patch -p0 < ar71xx-ip175c.patch
Selected "Target Profile/AR7xx" and "Base system/swconfig" in "make menuconfig"
Compiled Kamikaze
Edited the /etc/config/network file as shown above.
Edited the /etc/config/firewall.

Thanks Patrick for all the work on the IP175 and 178 swtich driver and getting it running on the RB4xx routers.

Rob

(Last edited by robrob on 27 May 2009, 12:22)

Could you please open a ticket for the switch support patches? Since Patrick's previous work is already integrated into trunk, it would be good to have the latest fixes there too smile

~ JoW

What a pisser. After "svn up"'ing a few times the IPC 178 switch driver is no longer working. The dmesg lists "driver=Generic PHY" I verifed 2.6.28.10 is being compiled (uname -a) and all of Patrick's edits are in the three files that are patched.

"swconfig dev eth1 help" gives "failed to connect to the switch"

Argh, I can't find enough reliable info on the routerboards. I want a 8+ port Gigabit switch and would love to have it running OpenWRT or linux or what have you. I went to the mikrotik site and nothing there was fitting the bill. But the link you posted has all sorts of models I haven't seen on the Mikrotik site (but still don't fit). Is there something I'm missing? Can someone point me in the right direction here?

As long as we're dreaming, give me an RB493AH with an 8 port giga switch, dual USB, and of course OpenWrt.

robrob wrote:

What a pisser. After "svn up"'ing a few times the IPC 178 switch driver is no longer working. The dmesg lists "driver=Generic PHY" I verifed 2.6.28.10 is being compiled (uname -a) and all of Patrick's edits are in the three files that are patched.

I can't find any reason for it to have changed with the latest updates.

After running "make", go to the bottom of "build_dir/linux-ar71xx/linux-2.6.28.10/drivers/net/phy/ip175c.c" and add this printk statement:

int __init ip175c_init(void)
{
        printk(KERN_WARN "Registered ip175c\n");
        return phy_driver_register(&ip175c_driver);
}

Then, run "make" again.

This should help narrow down if there is another problem with loading order.

You could try updating back to an older revision but I don't think that is related.

I try svv 16299, download patch from #5193, and the printk. Install it (rb450):

Atheros AR7130 rev 2 (id:0xa8), CPU:300.000 MHz, AHB:150.000 MHz, DDR:300.000 MHz
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
...
Serial: 8250/16550 driver1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console handover: boot [early0] -> real [ttyS0]
Registered ip175c
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth1: Atheros AG71xx at 0xb9000000, irq 4                                                                                                                   
....
# swconfig dev eth1 help
Switch 1: eth1(eth1), ports: 6, vlans: 16
...
# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:0C:42:2E:C3:07
          inet addr:10.10.0.52  Bcast:10.10.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 00:0C:42:2E:C3:07
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:5


# ping 10.10.0.52
Segmentation fault

I try remove the bridge

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:42:2E:C3:07
          inet addr:10.10.0.52  Bcast:10.10.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:5

Same seg fault
in logread

Jan  1 00:00:09 OpenWrt user.info kernel: input: gpio-buttons as /devices/platform/gpio-buttons/input/input0
Jan  1 00:00:09 OpenWrt user.info sysinit: Aiee, segfault! You should probably report this as a bug to the developer
Jan  1 00:00:09 OpenWrt user.debug kernel: ar71xx-wdt: enabling watchdog timer
Jan  1 00:00:09 OpenWrt user.info sysinit: watchdog: WDIOC_SETTIMEOUT: Invalid argument
Jan  1 00:00:25 OpenWrt daemon.info init: starting pid 179, tty '/dev/ttyS0': '/bin/ash --login'

Good news: SVN 16316 have some patchs to ar71xx. svn up and I Include #5193 patchs, without phorn printk. Also, the correct is KERN_WARNING smile
robrob: The #5193 patchs is not applied to trunk, yet.
Need more tests, but now I can ping !

Linux version 2.6.28.10 (marcos@nbmt) (gcc version 4.1.2) #1 Wed Jun 3 20:56:30 BRT 2009
prom: fw_arg0=00000007, fw_arg1=a0861c00, fw_arg2=00000000, fw_arg3=00000000
MyLoader: sysp=fbe3d6e0, boardp=d1b0e9fb, parts=10fb9599
console [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7130 rev 2 (id:0xa8), CPU:300.000 MHz, AHB:150.000 MHz, DDR:300.000 MHz
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)                                                                                                                       
...
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: connected to PHY at 0:04 [uid=02430d80, driver=Generic PHY]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: connected to 4 PHYs
eth1: connected to PHY at 0:00 [uid=02430d80, driver=IC+ IP175C]

Well, I need to try trunk because when run kamikaze 8.09 with icplus-patch.v3.1, the interface hang after random time (hours or days), in RB450,
The watchdog do not boot. Only interfaces hang. I put the "lost ping watchdog" script to save some data. dmesg show notting abnormal. load average is HI (6 or more).

(Last edited by mtadeu on 4 Jun 2009, 16:47)

Patrick, I tried to add your printk statement but couldn't get it to compile so I started over with a new svn, then tried the patch from this thread, and then the two #5193 patches. All three builds dmesg still showed eth1: driver=Generic PHY

But I can now ping without a segfault.

(Last edited by robrob on 6 Jun 2009, 02:59)

Also, what do you mean by "all three builds"? Just apply both of the patches from #5193.

Then, run "make". After building it, edit "build_dir/linux-ar71xx/linux-2.6.28.10/drivers/net/phy/ip175c.c" like before, and add:
printk(KERN_WARNING "Registered ip175c\n");

(I had forgotten the ING on KERN_WARNING)
Then, run "make" one more time and it should build that file.

Then, could you post the output of "dmesg", at least until it has printed the "registered ip175c" and the "eth1: using Generic PHY"

Patrick,

I compiled  a fresh svn with no patches and flashed the router, tried your patch and flashed, then reverted the patch and applied the  two #5193 patches, compiled and flashed. All 3 images gave the phy=generic dmesg.

I get an error when I insert your printk statement. Where exactly does it go in the ip175c.c file?

Thanks again for the help.

I compiled  a fresh svn with no patches and flashed the router
You sure you cleaned out the kernel sources? It's not smart enough to figure out exactly which .patch files changed since the last build, so you may have just compiled the same kernel three times unless you made clean.

Just to make absolutely sure, do:
TOPDIR=$PWD make -C target/linux clean

make: Entering directory `/home/ext/prog/kamikaze/target/linux'
make[1]: Entering directory `/home/ext/prog/kamikaze/target/linux/ar71xx'
rm -rf /ext/prog/kamikaze/build_dir/linux-ar71xx
make[1]: Leaving directory `/home/ext/prog/kamikaze/target/linux/ar71xx'
make: Leaving directory `/home/ext/prog/kamikaze/target/linux'

Download this one-line diff: http://www-inst.eecs.berkeley.edu/~path … ment.patch
Save it in the "target/linux/ar71xx/patches-2.6.28/" directory.

Then, type "make".  To check, you can afterwards open up "build_dir/linux-ar71xx/linux-2.6.28.10/drivers/net/phy/ip175c.c" and make sure there is a print statement near the bottom.
You can also check build_dir/linux-ar71xx/linux-2.6.28.10/drivers/net/Makefile and make sure CONFIG_AG71XX is in the middle of the makefile instead of the 10th line.

(Last edited by phorn on 11 Jun 2009, 06:41)

Patrick,

Your were right again, after the "make clean" the patches were applied and the IP175 driver is being used.

Here's the dmesg:

dmesg
Linux version 2.6.28.10 (rob@Server) (gcc version 4.1.2) #1 Thu Jun 11 10:48:50 EDT 2009
prom: fw_arg0=00000007, fw_arg1=a0861c00, fw_arg2=00000000, fw_arg3=00000000
MyLoader: sysp=f5fff9f9, boardp=fbfbffd3, parts=fffefffe
console [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7161 rev 2 (id:0xaa), CPU:680.000 MHz, AHB:170.000 MHz, DDR:340.000 MHz
Determined physical RAM map:
 memory: 08000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00008000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00008000
On node 0 totalpages: 32768
free_area_init_node: node 0, pgdat 80282480, node_mem_map 81000000
  Normal zone: 256 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 32512 pages, LIFO batch:7
  Movable zone: 0 pages used for memmap
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115200
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000800
Readback ErrCtl register=00000800
PID hash table entries: 512 (order: 9, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 126960k/131072k available (1853k kernel code, 3944k reserved, 337k data, 136k init, 0k highmem)
SLUB: Genslabs=6, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
Mount-cache hash table entries: 512
net_namespace: 480 bytes
NET: Registered protocol family 16
MIPS: machine is MikroTik RouterBOARD 493/AH
registering PCI controller with io_map_base unset
pci 0000:00:00.0: reg 10 32bit mmio: [0x000000-0xfffffff]
pci 0000:00:00.0: reg 14 io port: [0x00-0xff]
pci 0000:00:00.0: supports D1 D2
pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot
pci 0000:00:00.0: PME# disabled
pci 0000:00:12.0: reg 10 32bit mmio: [0x000000-0x00ffff]
pci 0000:00:14.0: reg 10 32bit mmio: [0x000000-0x00ffff]
pci 0000:00:14.0: PME# supported from D0 D3hot
pci 0000:00:14.0: PME# disabled
PCI: mapping irq 32 to pin1@0000:00:12.0
PCI: mapping irq 34 to pin1@0000:00:14.0
NET: Registered protocol family 2
Switched to high resolution mode on CPU 0
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
yaffs Jun 11 2009 10:46:04 Installing.
msgmni has been set to 248
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console handover: boot [early0] -> real [ttyS0]
ip175c_init called.
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xb9000000, irq 4
eth1: Atheros AG71xx at 0xba000000, irq 5
eth1: connected to PHY at 0:00 [uid=02430d80, driver=IC+ IP175C]
NAND flash driver for RouterBoard 4xx series version 0.1.10
NAND SPI clock 28333 kHz (AHB 170000 kHz / 6)
FLASH SPI clock 28333 kHz (AHB 170000 kHz / 6)
NAND device: Manufacturer ID: 0xad, Chip ID: 0x76 (Hynix NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00040000 : "booter"
0x00040000-0x00400000 : "kernel"
0x00400000-0x04000000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
split_squashfs: error occured while reading from "NAND 64MiB 3,3V 8-bit"
Atheros AR71xx SPI Controller driver version 0.2.2
Atheros AR71xx hardware watchdog driver version 0.1.0
ar71xx-wdt: timeout=15 secs (max=25)
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) readonly.
Freeing unused kernel memory: 136k freed
Please be patient, while OpenWrt loads ...
Algorithmics/MIPS FPU Emulator v1.5
save exit: isCheckpointed 0
ar71xx: pll_reg 0xb8050010: 0x1099
eth0: link up (100Mbps/Full duplex)
device eth0 entered promiscuous mode
br-lan: topology change detected, propagating
br-lan: port 1(eth0) entering forwarding state
cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: US
        (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
        (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
        (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
        (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: US
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Enabling device 0000:00:14.0 (0000 -> 0002)
ath: Country alpha2 being used: AM
ath: Regpair detected: 0x30
phy0: Selected rate control algorithm 'ath9k_rate_control'
Registered led device: ath9k-phy0::radio
Registered led device: ath9k-phy0::assoc
Registered led device: ath9k-phy0::tx
Registered led device: ath9k-phy0::rx
phy0: Atheros AR9160 MAC/BB Rev:0 AR5133 RF Rev:b0: mem=0xb0010000, irq=34
cfg80211: Calling CRDA for country: AM
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
Driver 'sd' needs updating - please use bus_type methods
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel paramater, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
IMQ driver loaded successfully.
        Hooking IMQ before NAT on PREROUTING.
        Hooking IMQ after NAT on POSTROUTING.
wlan: trunk
ath_hal: module license 'Proprietary' taints kernel.
ath_hal: 2009-05-08 (AR5210, AR5211, AR5212, AR5416, RF5111, RF5112, RF2413, RF5413, RF2133, RF2425, REGOPS_FUNC, XR)
ath_rate_minstrel: Minstrel automatic rate control algorithm 1.2 (trunk)
ath_rate_minstrel: look around rate set to 10%
ath_rate_minstrel: EWMA rolloff level set to 75%
ath_rate_minstrel: max segment size in the mrr set to 6000 us
wlan: mac acl policy registered
ath_pci: trunk
PCI: Enabling device 0000:00:12.0 (0000 -> 0002)
Atheros HAL provided by OpenWrt, DD-WRT and MakSat Technologies
wifi0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: turboA rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
ath_pci: wifi0: Atheros 5212: mem=0x10000000, irq=32
uhci_hcd: USB Universal Host Controller Interface driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
gpio-buttons driver version 0.1.1
input: gpio-buttons as /devices/platform/gpio-buttons/input/input0

Once again, thanks for the help.

I'm getting these messages every 10 seconds or so when nothing is plugged into the switch. Any way to stop it other than making sure an active connection is up?

Trying 10/HALF
Trying 10/HALF
Trying 10/HALF
Trying 10/HALF
Trying 10/HALF
Trying 10/HALF
Trying 10/HALF
Trying 10/HALF
Trying 10/HALF
Trying 10/HALF
Trying 10/HALF
Trying 10/HALF
Trying 10/HALF
Trying 10/HALF
Trying 10/HALF

Hi,
I compiled a latest openwrt without patches and flashed the RB450.  SVN was "svn.openwrt.org/openwrt/trunk" and Revision 16438.
I added:
- message "ip175c: LOADED" into ip175.c
- compilation flags SW_CONFIG=y, SW_IP175=y ... .

I have tried:
root@OpenWrt:/# swconfig dev eth0 help
Failed to connect to the switch

Where is mistake ?
Can I compile kernel with debug info messages to solve this problem ?
Is PCI needed in RB450 ? I have read dmesg from RB493 and there area messages about connection PCI to the switch.

Thanks for help
Jirka


root@OpenWrt:/# dmesg
Linux version 2.6.28.10 (vyvojar@linxdevel) (gcc version 4.1.2) #1 Mon Jun 15 12
:38:40 CEST 2009
prom: fw_arg0=00000007, fw_arg1=a0861c00, fw_arg2=00000000, fw_arg3=00000000
MyLoader: sysp=36e053bc, boardp=927fbb7f, parts=f0e1f3f1
console [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
Atheros AR7130 rev 2 (id:0xa8), CPU:300.000 MHz, AHB:150.000 MHz, DDR:300.000 MH
z
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal   0x00000000 -> 0x00002000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00002000
On node 0 totalpages: 8192
free_area_init_node: node 0, pgdat 802824f0, node_mem_map 81000000
  Normal zone: 64 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 8128 pages, LIFO batch:0
  Movable zone: 0 pages used for memmap
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,1152
00
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=0000c040
Readback ErrCtl register=0000c040
PID hash table entries: 128 (order: 7, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 29664k/32768k available (1854k kernel code, 3104k reserved, 336k data, 1
36k init, 0k highmem)
SLUB: Genslabs=6, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 199.88 BogoMIPS (lpj=999424)
Mount-cache hash table entries: 512
net_namespace: 480 bytes
NET: Registered protocol family 16
MIPS: machine is MikroTik RouterBOARD 450
NET: Registered protocol family 2
Switched to high resolution mode on CPU 0
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
yaffs Jun 15 2009 12:35:09 Installing.
msgmni has been set to 57
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
console handover: boot [early0] -> real [ttyS0]
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: connected to PHY at 0:04 [uid=02430d80, driver=Generic PHY]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: connected to 4 PHYs
ip175c: LOADED
NAND flash driver for RouterBoard 4xx series version 0.1.10
NAND SPI clock 25000 kHz (AHB 150000 kHz / 6)
FLASH SPI clock 25000 kHz (AHB 150000 kHz / 6)
NAND device: Manufacturer ID: 0xad, Chip ID: 0x76 (Hynix NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 3217 at 0x03244000
Creating 3 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x00000000-0x00040000 : "booter"
0x00040000-0x00400000 : "kernel"
0x00400000-0x04000000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
split_squashfs: no squashfs found in "NAND 64MiB 3,3V 8-bit"
Atheros AR71xx SPI Controller driver version 0.2.2
Atheros AR71xx hardware watchdog driver version 0.1.0
ar71xx-wdt: timeout=15 secs (max=28)
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: block 2961 is marked bad
block 2962 is bad
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem) readonly.
Freeing unused kernel memory: 136k freed
Please be patient, while OpenWrt loads ...
Algorithmics/MIPS FPU Emulator v1.5
save exit: isCheckpointed 0
device eth0 entered promiscuous mode
ar71xx: pll_reg 0xb8050010: 0x1099
eth1: link up (100Mbps/Full duplex)
PPP generic driver version 2.4.2
ip_tables: (C) 2000-2006 Netfilter Core Team
ar71xx: pll_reg 0xb8050014: 0x1099
eth0: link up (100Mbps/Full duplex)
br-lan: topology change detected, propagating
br-lan: port 1(eth0) entering forwarding state
nf_conntrack version 0.5.0 (512 buckets, 2048 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel paramater, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
gpio-buttons driver version 0.1.1
input: gpio-buttons as /devices/platform/gpio-buttons/input/input0
ar71xx-wdt: enabling watchdog timer
root@OpenWrt:/#

root@OpenWrt:/# lsmod | grep sw
root@OpenWrt:/# 

root@OpenWrt:/# ls /lib/modules/2.6.28.10/
button-hotplug.ko     iptable_raw.ko        ppp_generic.ko
crc-ccitt.ko          nf_conntrack.ko       pppoe.ko
gpio_buttons.ko       nf_conntrack_ftp.ko   pppox.ko
input-core.ko         nf_conntrack_ipv4.ko  slhc.ko
input-polldev.ko      nf_conntrack_irc.ko   x_tables.ko
ip_tables.ko          nf_conntrack_tftp.ko  xt_NOTRACK.ko
ipt_LOG.ko            nf_defrag_ipv4.ko     xt_TCPMSS.ko
ipt_MASQUERADE.ko     nf_nat.ko             xt_limit.ko
ipt_REJECT.ko         nf_nat_ftp.ko         xt_mac.ko
iptable_filter.ko     nf_nat_irc.ko         xt_multiport.ko
iptable_mangle.ko     nf_nat_tftp.ko        xt_state.ko
iptable_nat.ko        ppp_async.ko          xt_tcpudp.ko
root@OpenWrt:/#
root@OpenWrt:/#
root@OpenWrt:/# lspci
root@OpenWrt:/#
root@OpenWrt:/# swconfig dev eth0 help
Failed to connect to the switch
root@OpenWrt:/#
root@OpenWrt:/# ls /proc/net/
arp                  netfilter            rt_cache
dev                  netlink              snmp
dev_mcast            netstat              sockstat
igmp                 nf_conntrack         softnet_stat
ip_conntrack         nf_conntrack_expect  stat
ip_conntrack_expect  packet               tcp
ip_mr_cache          protocols            udp
ip_mr_vif            psched               udplite
ip_tables_matches    ptype                unix
ip_tables_names      raw                  vlan
ip_tables_targets    route                wireless
mcfilter             rt_acct
root@OpenWrt:/#
root@OpenWrt:/#
root@OpenWrt:/#
root@OpenWrt:/#
root@OpenWrt:/# ps -a
  PID USER       VSZ STAT COMMAND
    1 root      1396 S    init
    2 root         0 SW<  [kthreadd]
    3 root         0 SW<  [ksoftirqd/0]
    4 root         0 SW<  [events/0]
    5 root         0 SW<  [khelper]
   38 root         0 SW<  [kblockd/0]
   61 root         0 SW   [pdflush]
   62 root         0 SW   [pdflush]
   63 root         0 SW<  [kswapd0]
   64 root         0 SW<  [aio/0]
   87 root         0 SW<  [mtdblockd]
  178 root      1388 S    /bin/sh /etc/init.d/rcS S boot
  183 root      1388 S    logger -s -p 6 -t sysinit
  184 root      1408 R    /bin/ash --login
  195 root      1400 S    syslogd -C16
  197 root      1380 S    klogd
  209 root       916 S    /sbin/hotplug2 --override --persistent --set-worker /
  328 root      1396 S    udhcpc -t 0 -i eth1 -b -p /var/run/eth1.pid -R
  598 root      1384 S    /usr/sbin/httpd -p 80 -h /www -r OpenWrt
  602 root      1384 S    telnetd -l /bin/login.sh
  620 nobody     896 S    /usr/sbin/dnsmasq -K -D -y -Z -b -E -s lan -S /lan/ -
  627 root      1392 S    watchdog -t 5 /dev/watchdog
  649 root      1168 S    /usr/sbin/dropbear -p 22
  695 root      1388 R    ps -a
root@OpenWrt:/#

@robrob:
Port 4 on the routerboards is physically isolated and for all practical purposes is a standalone network port.  That message comes from the generic autonegotiation code in drivers/net/phy.c. I don't think there is anything you can do about it, except comment out the pr_info line in that file.

The original version of icplus.c seemed to also call "genphy_..." for port 4, but maybe it disabled that autonegotiation somehow.  You should also be able to get rid of it by turning the dmesg log level down, by setting some flag in /proc.

I would really only be concerned if the message was incorrect (if you plugged it into a host capable of 100/full, and it continued to print out "10/half")

@jirka:
The bug report has not been included in OpenWRT SVN yet, so that would explain why you ran into trouble. You need to apply it yourself:
https://dev.openwrt.org/attachment/tick … _phy.patch

Click to download in Original Format, and then apply it with "patch -p0 < ag71xx_phy.patch" from your kamikaze trunk.

You will also have to run:

TOPDIR=$PWD make -C target/linux clean

*after* applying the patches, in order to ensure that the extracted kernel tree is re-extracted. Just running "make" without cleaning will lead you to the same problem robrob had.

I will try to pester the openwrt channel and maybe send an email to the dev list. These patches are relatively simple so they should be included without much trouble.

Ok, i will ignore the message:
swconfig dev eth0 help ... -> Failed to connect to the switch

But, I have tried to setup interfaces separetly not in bridge. ETH0 is ok. I used script in this thread /etc/config/network ... and  ETH1.2,ETH1.3,ETH1.4 and ETH1.5 are wrong. I have tried "ping -I from this interfaces" and "ping from the PC to". There was not response.
I have watched some packes on eth1 ... tcpdump -i eth1.

I would like to know If i can compile some revision of openwrt for RB450 whitch supporting ethx interfaces separetly. Now I'm trying Revision 15328.

Thanks for help
Jirka


phorn wrote:

@robrob:
Port 4 on the routerboards is physically isolated and for all practical purposes is a standalone network port.  That message comes from the generic autonegotiation code in drivers/net/phy.c. I don't think there is anything you can do about it, except comment out the pr_info line in that file.

The original version of icplus.c seemed to also call "genphy_..." for port 4, but maybe it disabled that autonegotiation somehow.  You should also be able to get rid of it by turning the dmesg log level down, by setting some flag in /proc.

I would really only be concerned if the message was incorrect (if you plugged it into a host capable of 100/full, and it continued to print out "10/half")

@jirka:
The bug report has not been included in OpenWRT SVN yet, so that would explain why you ran into trouble. You need to apply it yourself:
https://dev.openwrt.org/attachment/tick … _phy.patch

Click to download in Original Format, and then apply it with "patch -p0 < ag71xx_phy.patch" from your kamikaze trunk.

You will also have to run:

TOPDIR=$PWD make -C target/linux clean

*after* applying the patches, in order to ensure that the extracted kernel tree is re-extracted. Just running "make" without cleaning will lead you to the same problem robrob had.

I will try to pester the openwrt channel and maybe send an email to the dev list. These patches are relatively simple so they should be included without much trouble.

@jirka: IP175C is conected to eth1
use: swconfig dev eth1 help

It is the same message.

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

I think eth0 is for RB450. Eth1 is for RB493.

Jirka

mtadeu wrote:

@jirka: IP175C is conected to eth1
use: swconfig dev eth1 help

jirka,

Without the patch phorn linked to above none of the switch ethernet ports will work. eth0 is the WAN port, eth1 is the switch. Apply the patch, run the above clean command, compile and it should work.