OpenWrt Forum Archive

Topic: Support for Marvell 88F5xx81 based routers

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

I have a WRT350N v2 which is based on a Marvell 88F5181 SOC with an Atheros AR5008 for the wireless. GPL source is available, and the same chip is used in the D-Link DNS-323 which is a low-end NAS, and the Airport Extreme. A slightly different chip is used in some Buffalo Linkstations, and the community is working to clean up the released code (which is 2.6.12) for submission to the mainline kernel.

They ship hostapd, with a binary libwsc.so that's got something to do with 802.1x or EAP. They also ship what appear to be precompiled versions of ip_nat_ipsec, ip_conntrack_ipsec and mv88f5181, as well as binary atheros drivers and wsc_daemon.ko. The bootloader is U-Boot1.1.1 (Marvell version 1.7.3), which is shipped as a binary without any source. The toolchain is arm-linux-uclibc and is also shipped as binary without any source.

So, how can I help get OpenWRT ported to this architecture? I'm not afraid of bricking it as I have friends who've done JTAG reprogramming before.

Update 2009-08-31: Firstly, the thread title is wrong, should be 88Fxx81, and this thread is mostly about the WRT350N v2. Secondly, thanks to the work of mindbender, Kaloz, Davidkra, maddes.b, dirkNL, StrikerNL, relghuar, buytenh (apologies if I've missed anyone) there's now an image available for testing - see page 16 and on.

Update 2010-04-04: The Linksys WRT350N v2 is fully supported by Backfire 10.03, using the image in the orion directory. openwrt-wrt350nv2-squashfs-webupgrade.img can be used to flash from the original firmware, and openwrt-wrt350nv2-squashfs.img with sysupgrade. The Netgear WNR854T also works, except for the wireless card which does not have drivers yet. One option is to replace it with a card that does, see the thread for more details.

WRT350Nv2 wiki page

(Last edited by Watha on 26 May 2010, 10:03)

Ok, I've connected to the serial port (it's the same as the WRT300N's) and got a U-Boot console, next step is to try compiling the linkstationwiki 2.6.22 and netbooting it.

(Last edited by Watha on 15 Oct 2007, 07:15)

The "linkstation kernel" won't work.

88F5181 - Orion 1
88F5182 - Orion NAS
88F5281 - Orion 2

The "linkstation kernel" is for the 88F5182, and there are upstream patches for 88F5281. For the Orion 1, there is no other sources then the Linkys/Netgear ones.

you guys should watch this closely:
http://git.kernel.org/?p=linux/kernel/g … ;a=summary
http://news.gmane.org/gmane.linux.ports.arm.kernel

orion 1 example - dns323:
http://git.kernel.org/?p=linux/kernel/g … 10c9de6a68

OrionNas:
http://git.kernel.org/?p=linux/kernel/g … f6b1929dd0

Orion 2 devboard:
http://git.kernel.org/?p=linux/kernel/g … fcb9a2d7e5

tzachi perelstein, nicolas pitre and Lennert Buytenhek from Marvell are working on this.

actually this is also your chance to create some patches for direct support in the mainline kernel.
as you see there are already some working on getting support for some NAS-boxes directly into the kernel (byron bradley, herbert valerio, martin michlmayr)....there are quite many NAS-devices that use that architecture:
http://nas-central.org/ALL_COMMUNITIES/ … %20devices

i encourage you to do the same. i know openwrt.org has several kernel hacking guys....

i am not that familiar how many routers use that marvel design...

(Last edited by mindbender on 11 Dec 2007, 14:30)

i have problems to get the openwrt-ixp4xx-squashfs.img to working.
is there an easy way to convert it to u-boots uImage?
Would be kind if anyone can help me...

Some infos about this nice router:

WRT-300N v2 Serial Console
The serial console (JP5) is just above the flash chip on the same side as the antennas. Console speed is 115200, 8n1.
* () Vcc () RX () TX () GND
>picocom -b 115200 /dev/ttyUSB0
The console connector for the WRT350N v2 uses TTL voltage. Thus it cannot be directly connected to a PC via RS232 port. It requires level shifting.

        __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_ 
| | | |___|  _ \ / _ \ / _ \| __| 
| |_| |___| |_) | (_) | (_) | |_ 
 \___/    |____/ \___/ \___/ \__|  ** LOADER **
 ** MARVELL BOARD: RD-88F5181L-VOIP-GE LE 

U-Boot 1.1.1 (Dec 12 2006 - 16:12:22) Marvell version: 1.7.3

DRAM CS[0] base 0x00000000   size  32MB 
DRAM Total size  32MB 
Flash: mvFlashInit base 0xff800000 devW 1 busW 1
Flash: flashStructGet manu 0xec id 0xe0 
Flash: flashStructGet flash is supported.
FLASH: initFlashSecs TOP Sector Type 
Flash: flashSecsInit main sector loop 0 - 127 
[8192kB@ff800000] Flash:  8 MB
Addresses 20M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (20M - 16M): Done
*** Warning - bad CRC, using default environment

Soc: MV88F5181 Rev 9
CPU: ARM926 (Rev 0) running @ 500Mhz 
SysClock = 166Mhz , TClock = 166Mhz 

USB 0: host mode
PCI 0: PCI Express Root Complex Interface
PCI 1: Conventional PCI, speed = 33000000
Net:   mvEgigaLoad: egiga0 load ok
egiga0 [PRIME]

***************DRIVER INFO*****************

DRIVER BUILD DATA: Jan  9 2007 at 18:25:44
DRIVER VERSION 1.06

*******************************************
dbSign is:65:52:63:4f:6d:4d
mac address in flash is:XX
have eRcOmM 
Hit ENTER to stop autoboot:  0 
copy kernel from 0xff800000 to 0x400000 with size 0x200000
## Booting image at 00400000 ...
   Image Name:   Linux-2.6.12-arm1
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1511464 Bytes =  1.4 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux................................................................................................... done, booting the kernel.
Linux version 2.6.12-arm1 (Terry@9TerryLiu2) (gcc version 3.4.4 (release) (CodeSourcery ARM 2005q3-2)) #1 Sun Apr 8 20:47:27 CST 2007
CPU: ARM926EJ-Sid(wb) [41069260] revision 0 (ARMv5TEJ)
CPU0: D VIVT write-back cache
CPU0: I cache: 32768 bytes, associativity 1, 32 byte lines, 1024 sets
CPU0: D cache: 32768 bytes, associativity 1, 32 byte lines, 1024 sets
Machine: MV-88fxx81
Using UBoot passing parameters structure
Sys Clk = 166000000, Tclk = 166000000
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists
Kernel command line: console=ttyS0,115200 root=/dev/mtdblock1 rw
PID hash table entries: 256 (order: 8, 4096 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 32MB 0MB 0MB 0MB = 32MB total
Memory: 28928KB available (2497K code, 880K data, 100K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Flash bankwidth 1, base f4000000, size 800000

  Marvell Development Board (LSP Version 1.8.5)-- RD-88F5181L-VOIP-GE 

 Detected Tclk 166000000 and SysClk 166000000 
Marvell USB EHCI Host controller #0: c03fcb00
pexBarOverlapDetect: winNum 2 overlap current 0
mvPexInit:Warning :Bar 2 size is illigal
it will be disabled
please check Pex and CPU windows configuration
PCI: bus0: Fast back to back transfers enabled
PCI: bus1: Fast back to back transfers enabled
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
pci access ctrl reg 0x31e00's value = 0x00000a01
pci access ctrl size reg 0x31e08's value = 0x07fff000
SCSI subsystem initialized
Linux Kernel Card Services
  options:  [pci]
usbcore: registered new driver usbfs
usbcore: registered new driver hub
TWSI: twsiAddr7BitSet ERROR - Addr (7 Bit) int TimeOut.
TWSI: mvTwsiStopBitSet ERROR - Stop bit TimeOut .
TWSI: mvTwsiStartBitSet ERROR - Start Clear bit TimeOut .
TWSI: mvTwsiStopBitSet ERROR - Stop bit TimeOut .
TWSI: mvTwsiStartBitSet ERROR - Start Clear bit TimeOut .
TWSI: mvTwsiStopBitSet ERROR - Stop bit TimeOut .
TWSI: mvTwsiStartBitSet ERROR - Start Clear bit TimeOut .
TWSI: mvTwsiStopBitSet ERROR - Stop bit TimeOut .
TWSI: mvTwsiStartBitSet ERROR - Start Clear bit TimeOut .
TWSI: mvTwsiStopBitSet ERROR - Stop bit TimeOut .
TWSI: mvTwsiStartBitSet ERROR - Start Clear bit TimeOut .
TWSI: mvTwsiStopBitSet ERROR - status 8 after Stop Bit. 
TWSI: mvTwsiStartBitSet ERROR - Start Clear bit TimeOut .
TWSI: mvTwsiStopBitSet ERROR - Stop bit TimeOut .
use IDMA acceleration in copy to/from user buffers. used channels 2 and 3 
Done. 
Fast Floating Point Emulator V0.9 (c) Peter Teichmann.
squashfs: version 3.0 (2006/03/15) Phillip Lougher
JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
Initializing Cryptographic API
HDLC line discipline: version $Revision: 1.1.1.1 $, maxframe=4096
N_HDLC line discipline registered.
Serial: 8250/16550 driver $Revision: 1.1.1.1 $ 4 ports, IRQ sharing disabled
ttyS0 at MMIO 0x0 (irq = 3) is a 16550A
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
loop: loaded (max 8 devices)
Loading Marvell Gatway Driver:
multi queue enabled
prioritizing ToS 0xA0
eth0: 00:00:00:00:51:81, group-id 0x100, group-members are port-CPU port-1 port-2 port-3 port-4 
eth1: 00:00:00:00:51:82, group-id 0x200, group-members are port-CPU port-0 
init switch layer... gcosSetPortDefaultTc failed (port 8)
gcosSetPortDefaultTc failed (port 8)
gcosSetPortDefaultTc failed (port 8)
gcosSetPortDefaultTc failed (port 8)
gcosSetPortDefaultTc failed (port 8)
gcosSetPortDefaultTc failed (port 8)
gcosSetPortDefaultTc failed (port 8)
gcosSetPortDefaultTc failed (port 8)
done
init gigabit layer... done
loading network interfaces: eth0 eth1 
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
PPP BSD Compression module registered
NET: Registered protocol family 24
SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256).
STRIP: Version 1.3A-STUART.CHESHIRE (unlimited channels)
physmap flash device: 800000 at f4000000
phys_mapped_flash: Found 1 x16 devices at 0x0 in 8-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
phys_mapped_flash: Swapping erase regions for broken CFI table.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
Using physmap partition definition
Creating 5 MTD partitions on "phys_mapped_flash":
0x00000000-0x00760000 : "kernel" 
0x001a0000-0x00760000 : "rootfs" 
0x00760000-0x007a0000 : "lang" 
0x007a0000-0x007c0000 : "nvram" 
0x007c0000-0x00800000 : "u-boot" 
ehci_platform ehci_platform.4523: EHCI Host Controller
ehci_platform ehci_platform.4523: new USB bus registered, assigned bus number 1
ehci_platform ehci_platform.4523: irq 17, io mem 0x00000000
ehci_platform ehci_platform.4523: park 0
ehci_platform ehci_platform.4523: USB 0.0 initialized, EHCI 1.00, driver 10 Dec 2004
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
USB Universal Host Controller Interface driver v2.2
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
u32 classifier
    OLD policer on 
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
/proc/eth1_tm created
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
ip_conntrack version 2.1 (256 buckets, 2048 max) - 268 bytes per conntrack
ip_conntrack_rtsp v0.6.21 loading
ip_nat_rtsp v0.6.21 loading
ip_tables: (C) 2000-2002 Netfilter core team
netfilter PSD loaded - (c) astaro AG
ipt_random match loaded
ip_conntrack_pptp version 3.0 loaded
ip_nat_pptp version 3.0 loaded
NET: Registered protocol family 1
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>
VFS: Mounted root (squashfs filesystem) readonly.
Freeing init memory: 100K
init started:  BusyBox v1.1.0 (2007.04.08-13:18+0000) multi-call binary
init started:  BusyBox v1.1.0 (2007.04.08-13:18+0000) multi-call binary
Starting pid 203, console /dev/console: '/etc/rcS'
ipt_webstr: module license 'unspecified' taints kernel.
ufsd: driver loaded
UFSD version 5.28 (Nov  8 2006, 21:54:59)
NTFS read/write support included

ufsd: address 0xbf030538
mv_gateway: starting eth0
mv_gateway: starting eth1
V2.00.10
device eth0 entered promiscuous mode
ap_name=(null),action=start
rc_start: ap->name = lan
br0: port 1(eth0) entering learning state
br0: topology change detected, propagating
br0: port 1(eth0) entering forwarding state
rc_start: ap->name = printk
start printk...
rc_start: ap->name = wlan
start wifi
/sbin/brctl addif br0 ath0
ath0
Interface doesn't accept private ioctl...
maccmd (8BE0): Invalid argument
wlan up!!
rc_start: ap->name = syslogd
start syslog...
syslog_cmd=-R 192.168.1.100:514
rc_start: ap->name = httpd
start httpd...
tar: Short read
rc_start: ap->name = dhcpd
start dhcpd...
rc_start: ap->name = ntp
rc_start: ap->name = route
rc_start: ap->name = ripd
rc_start: ap->name = wscupnp
killall: wscupnpd: no process killed
rc_start: ap->name = ftpd
killall: bftpd: no process killed
open /proc/wps_button
mac = NOT NULL
mac = XXXXXXXXXX
mac = NOT NULL
mac = XXXXXXXXXX
ap_name=firewall,action=stop
rc_stop: ap->name = firewall
/usr/sbin/fw-scripts/firewall: .: 19: Can't open /tmp/firewall.conf
killall: reaim: no process killed
killall: IGMPProxy: no process killed
mac = NOT NULL
mac = XXXXXXXXXX
mac = NOT NULL
mac = XXXXXXXXXX
Configuration file: /tmp/madwifi.conf
RTNETLINK answers: No such file or directory
Configure bridge br0 for EAPOL traffic.
RTNETLINK answers: No such file or directory
madwifi_set_iface_flags: dev_up=0
Using interface ath0 with hwaddr 00:1a:70:a0:36:68 and ssid 'linksys'
Flushing old station entries
Deauthenticate all stations
l2_packet_receive - recv: Network is down
/etc/rcS: /etc/rcS: 83: cannot create /proc/sys/vm/pagetable_cache: Directory nonexistent
ap_name=wan_basic,action=stop
rc_stop: ap->name = wan_basic
kernel call WSC_STA_CALLBACK
[## WSCDEBUG ##] [FUNC]:wsc_staAssocCallback [LINE]:4047 MAC :radioIndex=6

        00 13 02 0B 98 0D 
[## WSCDEBUG ##] [FUNC]:createWsccb [LINE]:338
pWsccb->wscIe = 0
Wireless event: cmd=0x8c03 len=20
ath0: STA XX:XX:XX:XX:XX:XX IEEE 802.11: associated
  New STA
ath0: STA XX:XX:XX:XX:XX:XX WPA: event 1 notification
ap_name=mediaserver,action=start
rc_start: ap->name = mediaserver
ap_name=upnp,action=start
rc_start: ap->name = upnp
killall: upnpd: no process killed
route: SIOC[ADD|DEL]RT: File exists
UPnP Initialized
Intialized UPnP 
        with fullurl=http://192.168.1.1:49152/gateway.xml
                     ipaddress=192.168.1.1 port=49152
             web_dir_path=/usr/upnp/
             desc_doc_url=http://192.168.1.1:49152
Specifying the webserver root directory -- /usr/upnp/
Registering the RootDevice
RootDevice Registered
Initializing State Table
fullurl http://192.168.1.1:49152/gateway.xml 
Advertisements Sent
ap_name=wscupnp,action=start
rc_start: ap->name = wscupnp
mac = NOT NULL
mac = XXXXXXXXX
wsc_uuid=e7fe1b91-8cd5-0310-98dd-001a70a03668

Please press Enter to activate this console.

Flash information

Marvell>> flinfo

Bank # 1: SAMSUNG SAMSUNG_FID_K8D6316T (8 Mbit, top boot sector)
Size:  8 MB,Bus Width: 1, device Width: 1.
Flash base: 0xff800000,Number of Sectors: 135 Type: TOP.
  Sector Start Addresses:
    00000000      00010000      00020000      00030000      00040000     
    00050000      00060000      00070000      00080000      00090000     
    000a0000      000b0000      000c0000      000d0000      000e0000     
    000f0000      00100000      00110000      00120000      00130000     
    00140000      00150000      00160000      00170000      00180000     
    00190000      001a0000      001b0000      001c0000      001d0000     
    001e0000      001f0000      00200000      00210000      00220000     
    00230000      00240000      00250000      00260000      00270000     
    00280000      00290000      002a0000      002b0000      002c0000     
    002d0000      002e0000      002f0000      00300000      00310000     
    00320000      00330000      00340000      00350000      00360000     
    00370000      00380000      00390000      003a0000      003b0000     
    003c0000      003d0000      003e0000      003f0000      00400000     
    00410000      00420000      00430000      00440000      00450000     
    00460000      00470000      00480000      00490000      004a0000     
    004b0000      004c0000      004d0000      004e0000      004f0000     
    00500000      00510000      00520000      00530000      00540000     
    00550000      00560000      00570000      00580000      00590000     
    005a0000      005b0000      005c0000      005d0000      005e0000     
    005f0000      00600000      00610000      00620000      00630000     
    00640000      00650000      00660000      00670000      00680000     
    00690000      006a0000      006b0000      006c0000      006d0000     
    006e0000      006f0000      00700000      00710000      00720000     
    00730000      00740000      00750000      00760000      00770000     
    00780000      00790000      007a0000      007b0000      007c0000 (RO)
    007d0000 (RO) 007e0000 (RO) 007f0000 (RO) 007f2000 (RO) 007f4000 (RO)
    007f6000 (RO) 007f8000 (RO) 007fa000 (RO) 007fc000 (RO) 007fe000 (RO)

Bank # 2: missing or unknown FLASH type
Marvell>>

U-Boot User Environment variables

Marvell>> printenv
bootcmd=scload; bootm 0x400000
baudrate=115200
loads_echo=0
ipaddr=172.21.5.10
serverip=172.21.5.30
rootpath=/mnt/ARM_FS/
stdin=serial
stdout=serial
stderr=serial
cpuName=926
CASset=min
enaMonExt=no
enaFlashBuf=yes
enaCpuStream=no
MALLOC_len=4
ethprime=egiga0
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
bootdelay=3
disaMvPnp=no
ethaddr=00:00:00:00:51:81
overEthAddr=no
usb0Mode=host
ethact=egiga0

Environment size: 439/8188 bytes

the openwrt-ixp4xx-squashfs.img and the uboot uImages are 2 total different things. Generally a uImage is a kernel wrapped into the uboot format. an initrd or a filesystem on flash/hdd is needed as a kernel itself might load, but it cannot boot without a rootfs.

i personally do not know openwrt too much but squashfs is a flash filesystem. so most likely the kernel and the rootfs is stored inside this FS. i am sure you could mount it on a linux workstation (loop mount maybe) and look inside, but i think this might be rather useless for you.

ixp4xx is a different arm cpu than the arm926ej-s and i am quite sure most things are missing that are needed to get the kernel inside working with this orion-based-router.

actually i think the best approach to get things a little more pushed would be  if you tried to load the following uImage via tftp:
http://downloads.foonas.org/foonas-em/b … age_2.6.24

uboot is able to load uImages via tftp....actually ipaddr & serverip are allready set to some strange ips....

you could just use:
tftpboot [your_workstation_ip] uImage_2.6.24
if you serve the ip from your local workstation via tftp....you might have to change the ipaddr (this is the local ip of the router) in the uboot enviroment...
http://www.denx.de/wiki/view/DULG/UBoot … on_5.9.5.6.

why do i tell you that?
this uImage use a known to work rootfs inside....it uses foonas-em (which itself is compiled from openembedded) and is stored INSIDE the kernel as a initramfs.

when booted up your router will ironically search for a dhcp server (as foonas-em was designed for nas-systems) but it should fallback to 192.168.11.150 if there is none.

at least trying to boot via tftp might reveal some things that might be good to report to the marvell guys....
in case it works you should be able to ssh or telnet into the box...and even a webserver should be running.

good luck.

(Last edited by mindbender on 12 Dec 2007, 14:48)

Ok, I can download the kernel via tftp and boot it, but it hangs after

Marvell>> bootm 0x400000
## Booting image at 00400000 ...
   Image Name:   Linux-2.6.24-rc3
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    6240212 Bytes =  6 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux.........................

Do I need to specify the initramfs location or set it to use the serial console or something else? The serial console is running at 115200bps, does that image assume some other speed?

to be honest i don`t know. if i load the uImage via tftp on my LS Pro the same way it works.

all orion boards we encountered so far use the same baudrate (115200bps) as they all use the same special marvell uboot BSP (on many NAS boxes they used the marvell bsp 1.7.3)....i think it is more likely that the uImage that i pointed you to is too old...it might not have the needed things for orion 2 inside. it was compiled and uploaded on the 2nd december 07....which was before several changes were made in the git repo at http://git.kernel.org/?p=linux/kernel/g … ;a=summary

i am quite sure that a new foonas-em will be available soon (foonas-em beta 5)...you could try it then.

anyway, i think this still is a good place to start.

(Last edited by mindbender on 12 Dec 2007, 16:35)

Hah, I left it for a while and a login prompt appeared. What's the root password? Oh, and the WRT350N (which is what I have) is Orion 1:

Soc: MV88F5181 Rev 9
CPU: ARM926 (Rev 0) running @ 500Mhz 
SysClock = 166Mhz , TClock = 166Mhz

(Last edited by Watha on 12 Dec 2007, 17:43)

its: hydr0g3n

is the webserver serving something btw?

pingable?

(Last edited by mindbender on 12 Dec 2007, 17:46)

Thanks, that password works. It's got no network - ifconfig reports no eth0, just lo.

but still cool wink

post dmesg here

foonas-em$ dmesg
<5>Linux version 2.6.24-rc3 (ole@mediapc) (gcc version 4.2.1) #1 PREEMPT Sun Dec 2 16:26:45 GMT 2007
<4>CPU: Feroceon [41069260] revision 0 (ARMv5TEJ), cr=a0053177
<4>Machine: Buffalo/Revogear Kurobox Pro
<4>Ignoring unrecognised tag 0x41000403
<4>Memory policy: ECC disabled, Data cache writeback
<7>On node 0 totalpages: 8192
<7>  DMA zone: 64 pages used for memmap
<7>  DMA zone: 0 pages reserved
<7>  DMA zone: 8128 pages, LIFO batch:0
<7>  Normal zone: 0 pages used for memmap
<7>  Movable zone: 0 pages used for memmap
<4>CPU0: D VIVT write-back cache
<4>CPU0: I cache: 32768 bytes, associativity 1, 32 byte lines, 1024 sets
<4>CPU0: D cache: 32768 bytes, associativity 1, 32 byte lines, 1024 sets
<4>Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
<5>Kernel command line: 
<4>PID hash table entries: 128 (order: 7, 512 bytes)
<4>Console: colour dummy device 80x30
<6>console [tty0] enabled
<6>Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
<6>Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
<6>Memory: 32MB = 32MB total
<5>Memory: 24140KB available (3896K code, 248K data, 4156K init)
<7>Calibrating delay loop... 332.59 BogoMIPS (lpj=1662976)
<4>Mount-cache hash table entries: 512
<6>CPU: Testing write buffer coherency: ok
<6>net_namespace: 64 bytes
<6>NET: Registered protocol family 16
<6>Orion ID: MV88F5181-Rev-Unsupported. TCLK=166666667.
<7>PCI: Scanning bus 0000:00
<7>PCI: Fixups for bus 0000:00
<6>PCI: bus0: Fast back to back transfers enabled
<7>PCI: Bus scan for 0000:00 returning with max=00
<5>SCSI subsystem initialized
<6>usbcore: registered new interface driver usbfs
<6>usbcore: registered new interface driver hub
<6>usbcore: registered new device driver usb
<6>NET: Registered protocol family 2
<6>Time: orion_clocksource clocksource has been installed.
<7>Switched to high resolution mode on CPU 0
<6>IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
<6>TCP established hash table entries: 1024 (order: 1, 8192 bytes)
<6>TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
<6>TCP: Hash tables configured (established 1024 bind 1024)
<6>TCP reno registered
<6>JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
<6>SGI XFS with no debug enabled
<6>io scheduler noop registered
<6>io scheduler anticipatory registered
<6>io scheduler deadline registered
<6>io scheduler cfq registered (default)
<6>Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
<6>serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 3) is a 16550A
<6>serial8250.0: ttyS1 at MMIO 0xf1012100 (irq = 4) is a 16550A
<4>RAMDISK driver initialized: 3 RAM disks of 32768K size 1024 blocksize
<6>loop: module loaded
<5>MV-643xx 10/100/1000 Ethernet Driver
<6>$Id: ftl.c,v 1.59 2005/11/29 14:48:31 gleixner Exp $
<6>NFTL driver: nftlcore.c $Revision: 1.98 $, nftlmount.c $Revision: 1.41 $
<5>physmap platform flash device: 00040000 at f4000000
<6>physmap-flash.0: Found 1 x16 devices at 0x0 in 8-bit bank
<4>NOR chip too large to fit in mapping. Attempting to cope...
<4> Amd/Fujitsu Extended Query Table at 0x0040
<3>  Unknown Amd/Fujitsu Extended Query version 0.0.
<4>gen_probe: No supported Vendor Command Set found
<7>JEDEC: Found no physmap-flash.0 device at location zero
<3>physmap-flash physmap-flash.0: map_probe failed
<4>No NAND device found!!!
<6>orion-ehci orion-ehci.0: Marvell Orion EHCI
<6>orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
<6>orion-ehci orion-ehci.0: irq 17, io base 0xf1050000
<6>orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
<6>usb usb1: configuration #1 chosen from 1 choice
<6>hub 1-0:1.0: USB hub found
<6>hub 1-0:1.0: 1 port detected
<7>ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver
<6>USB Universal Host Controller Interface driver v3.0
<6>sl811: driver sl811-hcd, 19 May 2005
<6>usbcore: registered new interface driver usblp
<6>Initializing USB Mass Storage driver...
<6>usbcore: registered new interface driver usb-storage
<6>USB Mass Storage support registered.
<6>mice: PS/2 mouse device common for all mice
<7>i2c-core: driver [rtc-rs5c372] registered
<7>i2c-core: driver [rtc-s35390a] registered
<6>i2c /dev entries driver
<7>i2c-core: driver [dev_driver] registered
<7>i2c-adapter i2c-0: adapter [mv64xxx_i2c adapter] registered
<7>i2c-adapter i2c-0: client [rs5c372a] registered with bus id 0-0032
<7>i2c 0-0032: uevent
<7>rtc-rs5c372 0-0032: probe
<7>rtc-rs5c372 0-0032: rs5c372_probe
<7>i2c-adapter i2c-0: master_xfer[0] R, addr=0x32, len=17
<7><NULL>: can't read registers
<4>rtc-rs5c372: probe of 0-0032 failed with error -5
<7>i2c-dev: adapter [mv64xxx_i2c adapter] registered as minor 0
<6>TCP cubic registered
<6>NET: Registered protocol family 1
<6>NET: Registered protocol family 17
<6>RPC: Registered udp transport module.
<6>RPC: Registered tcp transport module.
<6>VFP support v0.3: not present
<4>drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
<6>Freeing init memory: 4156K

I wonder if Orion: common platform setup for Gigabit Ethernet port will enable the ethernet. In /sys there's devices/platform/mv643xx_eth.0 and mv643xx_eth_shared.

well, nice starting point now isn`t it?

maybe you get in direct contact with the marvell guys from the mailing list. i am sure they can tell you what to do....i mean...they ported the kernel to the board of the router in the first place for the GPL sources. if you show them that there is interest they might even code some additional patches.

you need to obtain some more information about the box....the kernel you just booted was compiled for a completely different device...thats why the flash map for example does not fit at all.

i think there is a command in uboot to get some more info about the flash map....wasn`t it fliinfo? just enter "help" in the uboot console to see the available commands.

I can't get to http://lists.arm.linux.org.uk/mailman/listinfo/ to subscribe to the mailing list (it just times out), I'll have to look into using gmane I think.

Marvell>> flinfo 

Bank # 1: SAMSUNG SAMSUNG_FID_K8D6316T (8 Mbit, top boot sector)
Size:  8 MB,Bus Width: 1, device Width: 1.
Flash base: 0xff800000,Number of Sectors: 135 Type: TOP.
  Sector Start Addresses:
    00000000      00010000      00020000      00030000      00040000     
    00050000      00060000      00070000      00080000      00090000     
    000a0000      000b0000      000c0000      000d0000      000e0000     
    000f0000      00100000      00110000      00120000      00130000     
    00140000      00150000      00160000      00170000      00180000     
    00190000      001a0000      001b0000      001c0000      001d0000     
    001e0000      001f0000      00200000      00210000      00220000     
    00230000      00240000      00250000      00260000      00270000     
    00280000      00290000      002a0000      002b0000      002c0000     
    002d0000      002e0000      002f0000      00300000      00310000     
    00320000      00330000      00340000      00350000      00360000     
    00370000      00380000      00390000      003a0000      003b0000     
    003c0000      003d0000      003e0000      003f0000      00400000     
    00410000      00420000      00430000      00440000      00450000     
    00460000      00470000      00480000      00490000      004a0000     
    004b0000      004c0000      004d0000      004e0000      004f0000     
    00500000      00510000      00520000      00530000      00540000     
    00550000      00560000      00570000      00580000      00590000     
    005a0000      005b0000      005c0000      005d0000      005e0000     
    005f0000      00600000      00610000      00620000      00630000     
    00640000      00650000      00660000      00670000      00680000     
    00690000      006a0000      006b0000      006c0000      006d0000     
    006e0000      006f0000      00700000      00710000      00720000     
    00730000      00740000      00750000      00760000      00770000     
    00780000      00790000      007a0000      007b0000      007c0000 (RO)
    007d0000 (RO) 007e0000 (RO) 007f0000 (RO) 007f2000 (RO) 007f4000 (RO)
    007f6000 (RO) 007f8000 (RO) 007fa000 (RO) 007fc000 (RO) 007fe000 (RO)

Bank # 2: missing or unknown FLASH type

(Last edited by Watha on 12 Dec 2007, 18:42)

look inside the GPL kernel sources and the uboot sources...there the flash map should be defined.

I'll have time to work on it next week / during the holidays.

To get this working properly (and ready to submit to mainline) you will need to create a new board setup file and register a new mach-type (http://www.arm.linux.org.uk/developer/machines/). The dmesg posted from the stock kernel shows the NOR flash setup so you can just copy that into your setup file.

Creating 5 MTD partitions on "phys_mapped_flash":
0x00000000-0x00760000 : "kernel" 
0x001a0000-0x00760000 : "rootfs" 
0x00760000-0x007a0000 : "lang" 
0x007a0000-0x007c0000 : "nvram" 
0x007c0000-0x00800000 : "u-boot"

The MV88F5182 has just one gigabit MAC with an external PHY, I've managed to find a photo of the top of the WRT350Nv2 but it wasn't very high quality, I can see that it has an 88E6131 (8-Port GE Switch w/ Integrated GE PHYs). The stock dmesg shows two network adapters so you'll need to find out if those are both in the SoC or if there is an external device on the board (try lspci but remember that it won't work on stock kernels and won't work on the new kernel unless PCI is properly initialised). A problem we have had with some NAS devices is the MAC address not being set properly and this will stop networking from working. You can see eth[01] being set to 00:00:00:00:51:8[12] and then presumably changed later in the boot process.

You will have to work out the correct assignment of the multiplexing pins on the router. Without documentation from Linksys the easiest way to find these is probably to recompile the stock kernel and get it to dump the MPP values. These multiplexing pins allow you to switch certain pins between being GPIOs, SATA, UART, NAND, etc. Things such as the PCI slot offset and the PCI IRQs will probably also have to be changed as well.

I've managed to build a kernel using foonas/openembedded/bitbake, so I can now test patches.  The SoC rev on my WRT350N v2 is also 88F5181L A1 aka RD-88F5181L-VOIP-GE , so it has the crypto engine. arch/arm/mach-mv88fxx81/mv88f5181/mvSysHwConfig.h has a bunch of config stuff, like

/* PCI0: IO and memory space */
#define PCI0_MEM_BASE  0xe8000000
#define PCI0_MEM_SIZE  _128M

#define PCI0_IO_BASE    0xf2100000
#define PCI0_IO_SIZE    _1M

/* IRQ numbers */
#ifndef ETH_PORT0_IRQ_NUM
# define ETH_PORT0_IRQ_NUM  21
#endif

/* MAC */
#ifndef CONFIG_ETH_0_MACADDR
# define CONFIG_ETH_0_MACADDR    "000000000050"
#endif
#ifndef CONFIG_ETH_1_MACADDR
# define CONFIG_ETH_1_MACADDR    "000000000051"
#endif
#ifndef CONFIG_ETH_2_MACADDR
# define CONFIG_ETH_2_MACADDR    "000000000052"
#endif

and Board/boardEnv/DB_88FXX81/mvBoardEnvSpec.h has

#define RD_88F5181L_VOIP_GE_INFO    {                                           \
                                                                                \
    "RD-88F5181L-VOIP-GE",                  /* boardName[MAX_BOARD_NAME_LEN] */ \
                                                                                \
    {RD_88F5181L_VOIP_GE_MPP0_7,            /* mpp0_7 */                        \
    RD_88F5181L_VOIP_GE_MPP8_15,            /* mpp8_15 */                       \
    RD_88F5181L_VOIP_GE_MPP16_23,           /* mpp16_23 */                      \
    RD_88F5181L_VOIP_GE_MPP_DEV},           /* mppDev */                        \
                                                                                \
    ((1<<4)|(1 << 5)|(1<<8)),               /* intsGppMask */                   \
                                                                                \
    /*{params, devType, devWidth}*/         /* devCsInfo[MV_BOARD_MAX_DEV] */   \
                                                                                \
    {{ N_A, N_A, N_A},                      /* devCs0 */                        \
     { N_A, N_A, N_A},                          /* devCs1 */                    \
     { N_A, N_A, N_A},                          /* devCs2/flashCs */            \
     { 0x8fcfffff, BOARD_DEV_NOR_FLASH, 8}},    /* bootCs */                    \
                                                                                \
    /*pciBoardIf[MV_BOARD_MAX_PCI_IF];*/                                        \
                                                                                \
    {{0x7,                                  /* firstSlotDevNum */               \
    1,                                      /* pciSlotsNum */                   \
                                                                                \
    /*pciSlot[MV_BOARD_MAX_PCI_SLOTS]*/                                         \
    /* {{intAGppPin, intBGppPin, intCGppPin, intDGppPin}} */                    \
                                                                                \
    {{ {4, 10, N_A, N_A}},              /* pciSlot0 */                          \
     { {N_A, N_A, N_A, N_A}},           /* pciSlot1 */                          \
     { {N_A, N_A, N_A, N_A}}}}},        /* pciSlot2 */                          \
                                                                                \
    0x68,                                   /* rtcTwsiAddr */                   \
    ADDR7_BIT,                              /* rtcTwsiAddrType */               \
    N_A,                                    /* pexPciBridgeTwsiAddr */          \
    N_A,                                    /* pexPciBridgeTwsiAddrType */      \
                                                                                \
    {0x0},                                  /* ethPhyAddr[MV_BOARD_MAX_PORTS] */\
                                                                                \
    5,                                      /* rtcIntPin */                     \
    N_A,                                    /* switchIntPin */                  \
    {N_A,N_A},                      /* vbusUsbGppPin[MV_BOARD_MAX_USB_IF] */    \
                                                                                \
    3,                                      /* activeLedsNumber */              \
                                                                                \
    {1,                                     /* led0GppPin */                    \
    2,                                      /* led1GppPin */                    \
    3,                                      /* led2GppPin */                    \
    N_A,                                    /* led3GppPin */                    \
    N_A,                                    /* led4GppPin */                    \
    N_A,                                    /* led5GppPin */                    \
    N_A,                                    /* led6GppPin */                    \
    N_A},                                   /* led7GppPin */                    \
    0,                                      /* ledsPolarity */                  \
    N_A                                     /* refClkGppPin */                  \
}

Stock kernel /proc/interrupts:

~ # cat /proc/interrupts 
           CPU0
  0:       3047   Mv Timer Tick
  3:        315   serial
 17:          0   ehci_hcd:usb1
 21:         35   mv_gateway
 36:        814   wifi0

/proc/bus/pci only reports 168c0023, which is the AR5416 802.11a/b/g/n Wireless PCI Adapter, so both ethernet interfaces are onboard. Looking at the traces, all the external ethernet ports go to the switch (which has a heatsink on it), and I can tftp with any of them.

(Last edited by Watha on 17 Dec 2007, 10:13)

any updates?

I posted most of the above to linux-arm, but no response.

actually these guys from the mailing list won`t create the patches themselves. but they surely will review submitted patches.

as i know that there are at least some orion based routers (most likely they are storage enabled over usb), i recommend to get the GPL source for this routers and then you should read the orion guide which i linked in the post above again.

i am quite sure that 99 % is already done and that:

1) the mach types need to be registered
2) extract the info about the flash map (already done in this thread for one router) and the GPIO stuff
3) start a new setup file....outlined here: http://nas-central.org/index.php/Orion_ … oard_Setup
(use the flash map already posted here in this thread and implement the GPIO stuff....you will also get the info from the GPL sources)

the main problem is that we from http://nas-central.org do not own an orion-based router so we cannot test ourselves (hey we hack NAS-devices already, you guys should hack the router part big_smile ), so i encourage you to give it a look. as you guys already had a kernel booting you are already very far....finish it.

(Last edited by mindbender on 11 Jan 2008, 22:24)