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.

This weekend we did some more work on the WRT350N. Sadly not much progress...

First of all, to make things clear, We used the eabi toolchain from codesourcery to build the kernels this time. Because I read about it in this thread.
What have we tried this time:

-Vanilla sources 2.6.25.1, with the imported setup.c file from Davidkra's git repository.
---- Result:  Kernel decompresses and nothing more after that

-Davidkra's repository (29-3-2008) clone.
---- Result: Can't build the kernel because of 1600 conflicts in the repository, could build an earlier version of the repos

-Davidkra's uploaded uImage in his git repository
---- Result: Again the same, just the decompress nothing more

-The 2.6.25 version of this: http://downloads.foonas.org/foonas-em/0 … e_2.6.25.1 kernel
---- Result: Kernel decompresses and when done booting the system asks for login (the hydrog3n password)

So no luck this time, we wanted the .config file from the foonas image but we can't seem to find it (is it anywhere to be found?).
If we could use that config as base, we think we may be getting somewhere.

(Last edited by dirkNL on 5 May 2008, 13:49)

no problem i think. everythings available via the svn viewer or if you checkout the svn repository directly.

the defconfig + patches can be seen here (scroll down until you read "linux orion"):
http://svn.foonas.org/listing.php?repna … nux-orion_

defconfig:
http://svn.foonas.org/filedetails.php?r … g-2.6.25.1

what is the actually console log? i think we had this problem before ...i think this could be related to the wrong mach-id that is used in your uboot bootloader (yes you read right smile, marvell is to blame for that)....can you please post the console output?

(Last edited by mindbender on 10 May 2008, 16:58)

Here are my WRT350N v2.1 logs:

Boot part:

         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ 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:00:1d:7e:ad:cc:08
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:    1509616 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 (root@localhost.localdomain) (gcc version 3.4.4 (release) (CodeSourcery ARM 2005q3-2)) #1 Fri Sep 28 12:56:43 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 (2496K code, 877K 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: c03fbb00
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 - status 0 after Stop Bit.
TWSI: mvTwsiStartBitSet ERROR - start bit didn't went down
TWSI: mvTwsiStopBitSet ERROR - status 0 after Stop Bit.
TWSI: mvTwsiStartBitSet ERROR - start bit didn't went down
TWSI: mvTwsiStopBitSet ERROR - status 0 after Stop Bit.
TWSI: mvTwsiStartBitSet ERROR - start bit didn't went down
TWSI: mvTwsiStopBitSet ERROR - status 0 after Stop Bit.
TWSI: mvTwsiStartBitSet ERROR - start bit didn't went down
TWSI: mvTwsiStopBitSet ERROR - status 0 after Stop Bit.
TWSI: mvTwsiStartBitSet ERROR - start bit didn't went down
TWSI: mvTwsiStopBitSet ERROR - status 0 after Stop Bit.
TWSI: mvTwsiStartBitSet ERROR - start bit didn't went down
TWSI: mvTwsiStopBitSet ERROR - status 0 after Stop Bit.
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.09.28-05:12+0000) multi-call binary
init started:  BusyBox v1.1.0 (2007.09.28-05:12+0000) multi-call binary
Starting pid 202, 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.17
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 = ftpd
killall: bftpd: no process killed
open /proc/wps_button
mac = NOT NULL
mac = 001d7eadcc08
mac = NOT NULL
mac = 001d7eadcc08
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
mac = NOT NULL
mac = 001d7eadcc08

        00 1D 7E AD CC 08
mac = NOT NULL
mac = 001d7eadcc08
killall: IGMPProxy: no process killed
Configuration file: /tmp/madwifi.conf
Configure bridge br0 for EAPOL traffic.
madwifi_set_iface_flags: dev_up=0
Using interface ath0 with hwaddr 00:1d:7e:ad:cc:08 and ssid 'zaphod'
madwifi_set_ieee8021x: enabled=1
madwifi_configure_wpa: group key cipher=1
madwifi_configure_wpa: pairwise key ciphers=0x2
madwifi_configure_wpa: key management algorithms=0x2
madwifi_configure_wpa: rsn capabilities=0x0
madwifi_configure_wpa: enable WPA= 0x1
madwifi_set_iface_flags: dev_up=1
madwifi_set_privacy: enabled=1
wpa_write_wpa_ie 203 wsc_enable = 1
wpa_write_wpa_ie 204 hapd->conf->wpa_key_mgmt = 2
WPA: group state machine entering state GTK_INIT
GMK - hexdump(len=32): 93 cf 07 ad 8d 0f 64 f0 1b a2 37 24 fa c8 fb 5d d0 3c 2a 0c 9f e3 f9 8c 81 e3 ea f6 01 21 2c 33
GTK - hexdump(len=32): 59 d8 c1 47 f2 27 8a c2 36 41 f9 bf cf 9f 69 ab 4d c7 ca 3a 36 2b 7d c5 cd 29 2f 89 a6 2d f5 0b
WPA: group state machine entering state SETKEYSDONE
madwifi_set_key: alg=TKIP addr=00:00:00:00:00:00 key_idx=1
Flushing old station entries
Deauthenticate all stations
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
ap_name=dhcpd,action=create
rc_create: ap->name = dhcpd
ap_name=(null),action=restart
rc_stop: ap->name = wan_basic
rc_stop: ap->name = firewall
ap_name=ripd,action=restart
/usr/sbin/fw-scripts/firewall: .: 19: Can't open /tmp/firewall.conf
rc_stop: ap->name = ripd
killall: reaim: no process killed
killall: routed: no process killed
rc_start: ap->name = ripd
killall: IGMPProxy: no process killed
/etc/rcS: /etc/rcS: 83: cannot create /proc/sys/vm/pagetable_cache: Directory nonexistent
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
rc_start: ap->name = wan_basic
rc_start: ap->name = firewall
rmmod: ip_nat_ftp.ko: No such file or directory
rmmod: ip_conntrack_ftp.ko: No such file or directory
Starting firewalliptables: No chain/target/match by that name
iptables: No chain/target/match by that name
ap_name=mediaserver,action=start
rc_start: ap->name = mediaserver
proxy:1
rc_start: ap->name = static_route
rc_start: ap->name = ddns
ap_name=wscupnp,action=start
rc_start: ap->name = wscupnp
[cmd_agent1]iptables -I FORWARD -i eth1 -d 224.0.1.60 -j ACCEPT
The interface br0 exist !
The interface ath0 exist !
mac = NOT NULL
mac = 001d7eadcc08
wsc_uuid=e7fe1b91-8cd5-0310-98dd-001d7eadcc08
ap_name=upnp,action=start
rc_start: ap->name = upnp
killall: upnpd: no process killed
route: SIOC[ADD|DEL]RT: File exists

Please press Enter to activate this console. UPnP Initialized
Intialized UPnP
        with fullurl=http://192.168.0.1:49153/gateway.xml
                     ipaddress=192.168.0.1 port=49153
             web_dir_path=/usr/upnp/
             desc_doc_url=http://192.168.0.1:49153
Specifying the webserver root directory -- /usr/upnp/
Registering the RootDevice
RootDevice Registered
Initializing State Table
fullurl http://192.168.0.1:49153/gateway.xml
Advertisements Sent

/proc etc part:

~ # cat /proc/version
Linux version 2.6.12-arm1 (root@localhost.localdomain) (gcc version 3.4.4 (release) (CodeSourcery ARM 2005q3-2)) #1 Fri Sep 28 12:56:43 CST 2007
~ # cat /proc/cpuinfo
c/iomem
ifconfig
dmesgProcessor  : ARM926EJ-Sid(wb) rev 0 (v5l)
BogoMIPS        : 331.77
Features        : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant     : 0x0
CPU part        : 0x926
CPU revision    : 0
Cache type      : write-back
Cache clean     : cp15 c7 ops
Cache lockdown  : format C
Cache format    : Harvard
I size          : 32768
I assoc         : 1
I line length   : 32
I sets          : 1024
D size          : 32768
D assoc         : 1
D line length   : 32
D sets          : 1024

Hardware        : MV-88fxx81
Revision        : 0000
Serial          : 0000000000000000
~ # cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00760000 00010000 "kernel"
mtd1: 005c0000 00010000 "rootfs"
mtd2: 00040000 00010000 "lang"
mtd3: 00020000 00010000 "nvram"
mtd4: 00040000 00010000 "u-boot"
~ # cat /proc/modules
ip_nat_ftp 2912 0 - Live 0xbf107000
ip_conntrack_ftp 71968 1 ip_nat_ftp, Live 0xbf0f4000
wsc_daemon 2208 0 - Live 0xbf0f2000
wlan_tkip 12160 2 - Live 0xbf0ee000
wlan_xauth 1120 0 - Live 0xbf0ec000
ath_pci 138064 0 - Live 0xbf0c9000
ath_dfs 25772 1 ath_pci, Live 0xbf0c1000
ath_rate_atheros 28612 1 ath_pci, Live 0xbf0b9000
wlan 207016 5 wlan_tkip,wlan_xauth,ath_pci,ath_rate_atheros, Live 0xbf085000
ath_hal 183152 3 ath_pci,ath_rate_atheros, Live 0xbf057000
kwsc_mod 24456 2 wsc_daemon,wlan, Live 0xbf050000
ufsd 292976 0 - Live 0xbf007000
ipt_webstr 3712 0 - Live 0xbf005000
pb 3876 2 - Live 0xbf003000
led 5044 0 - Live 0xbf000000
~ # cat /proc/devices
Character devices:
  1 mem
  2 pty
  3 ttyp
  4 /dev/vc/0
  4 tty
  4 ttyS
  5 /dev/tty
  5 /dev/console
  5 /dev/ptmx
  7 vcs
 10 misc
 13 input
 90 mtd
108 ppp
128 ptm
136 pts
180 usb
254 pcmcia

Block devices:
  7 loop
  8 sd
 31 mtdblock
 65 sd
 66 sd
 67 sd
 68 sd
 69 sd
 70 sd
 71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
~ # cat /proc/meminfo
MemTotal:        29036 kB
MemFree:          9200 kB
Buffers:          1540 kB
Cached:           8284 kB
SwapCached:          0 kB
Active:           5148 kB
Inactive:         6484 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:        29036 kB
LowFree:          9200 kB
SwapTotal:           0 kB
SwapFree:            0 kB
Dirty:               0 kB
Writeback:           0 kB
Mapped:           3064 kB
Slab:             5328 kB
CommitLimit:     14516 kB
Committed_AS:     4512 kB
PageTables:        316 kB
VmallocTotal:   483328 kB
VmallocUsed:      8692 kB
VmallocChunk:   474568 kB
~ # cat /proc/iomem
00000000-01ffffff : System RAM
  00021000-002911ef : Kernel text
  00292000-0036d41b : Kernel data
e0000000-e7ffffff : PCI Memory Primary
e8000000-efffffff : PCI Memory Primary
  e8000000-e800ffff : 0000:01:07.0
    e8000000-e800ffff : ath
f4000000-f47fffff : flashMap
~ # ifconfig
ath0      Link encap:Ethernet  HWaddr 00:1D:7E:AD:CC:08
          UP BROADCAST RUNNING MULTICAST  MTU:2290  Metric:1
          RX packets:1156 errors:0 dropped:0 overruns:0 frame:0
          TX packets:269 errors:0 dropped:75 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:31365 (30.6 KiB)  TX bytes:58800 (57.4 KiB)

br0       Link encap:Ethernet  HWaddr 00:1D:7E:AD:CC:08
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:1537 errors:0 dropped:0 overruns:0 frame:0
          TX packets:343 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:76100 (74.3 KiB)  TX bytes:100018 (97.6 KiB)

eth0      Link encap:Ethernet  HWaddr 00:1D:7E:AD:CC:08
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:386 errors:0 dropped:0 overruns:0 frame:0
          TX packets:302 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:70453 (68.8 KiB)  TX bytes:70204 (68.5 KiB)
          Interrupt:21

eth1      Link encap:Ethernet  HWaddr 00:1D:7E:AD:CC:09
          inet addr:145.99.241.243  Bcast:145.99.255.255  Mask:255.255.255.248
          UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:208 errors:0 dropped:0 overruns:0 frame:0
          TX packets:231 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:512
          RX bytes:54911 (53.6 KiB)  TX bytes:45697 (44.6 KiB)
          Interrupt:21

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:70 errors:0 dropped:0 overruns:0 frame:0
          TX packets:70 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:17676 (17.2 KiB)  TX bytes:17676 (17.2 KiB)

wifi0     Link encap:Ethernet  HWaddr 00:1D:7E:AD:CC:08
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1163 errors:0 dropped:0 overruns:0 frame:0
          TX packets:276 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:52510 (51.2 KiB)  TX bytes:71099 (69.4 KiB)
          Interrupt:36 Memory:c2860000-c2870000

~ # dmesg
ufsd: address 0xbf030538
mv_gateway: starting eth0
mv_gateway: starting eth1
device eth0 entered promiscuous mode
br0: port 1(eth0) entering learning state
br0: topology change detected, propagating
br0: port 1(eth0) entering forwarding state
lock init
create wsc_cfb entry
create wsc_cfb entry
create wsc_iechange entry
create wsc_userset entry
ath_hal: 0.9.14.25 (AR5416, DEBUG)
wlan: 0.8.4.2 (Atheros/multi-bss)
ath_rate_atheros: Version 2.0.1
Copyright (c) 2001-2004 Atheros Communications, Inc, All Rights Reserved
ath_dfs: Version 2.0.0
Copyright (c) 2005-2006 Atheros Communications, Inc. All Rights Reserved
ath_pci: 0.9.4.5 (Atheros/multi-bss)
Chan  Freq  RegPwr  HT   CTL CTL_U CTL_L DFS
   1  2412n     27  HT20  1    0    1     N
   1  2412n     20  HT40  1    0    1     N
   2  2417n     20  HT40  1    0    1     N
   3  2422n     20  HT40  1    1    1     N
   4  2427n     20  HT40  1    1    1     N
   5  2432n     20  HT40  1    1    1     N
   6  2437n     20  HT40  1    1    1     N
   7  2442n     20  HT40  1    1    1     N
   8  2447n     20  HT40  1    1    1     N
   9  2452n     20  HT40  1    1    1     N
  10  2457n     20  HT40  1    1    1     N
  11  2462n     20  HT40  1    1    1     N
  12  2467n     20  HT40  1    1    0     N
  13  2472n     20  HT40  1    1    0     N
register_simple_config_callback called
wifi0: 11ng rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: 11ng MCS:  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
wifi0: mac 13.2 phy 8.1 radio 13.0
wifi0: Use hw queue 1 for WME_AC_BE traffic
wifi0: Use hw queue 0 for WME_AC_BK traffic
wifi0: Use hw queue 2 for WME_AC_VI traffic
wifi0: Use hw queue 3 for WME_AC_VO traffic
wifi0: Use hw queue 8 for CAB traffic
wifi0: Use hw queue 9 for beacons
wifi0: Atheros 5416 PCI: mem=0xe8000000, irq=36 hw_base=0xc2860000
ar5416SetPowerPerRateTable() syn 2412 ctl 2412 ext 2412 is40 0
  6mb OFDM  15.0 dBm |  9mb OFDM  15.0 dBm | 12mb OFDM  15.0 dBm | 18mb OFDM  15.0 dBm
 24mb OFDM  15.0 dBm | 36mb OFDM  15.0 dBm | 48mb OFDM  15.0 dBm | 54mb OFDM  15.0 dBm
 1L   CCK   17.0 dBm | 2L   CCK   17.0 dBm | 2S   CCK   17.0 dBm | 5.5L CCK   17.0 dBm
 5.5S CCK   17.0 dBm | 11L  CCK   17.0 dBm | 11S  CCK   17.0 dBm | XR         15.0 dBm
 HT20mcs 0  14.0 dBm | HT20mcs 1  14.0 dBm | HT20mcs 2  14.0 dBm | HT20mcs 3  14.0 dBm
 HT20mcs 4  14.0 dBm | HT20mcs 5  14.0 dBm | HT20mcs 6  13.0 dBm | HT20mcs 7  11.0 dBm
 HT40mcs 0   0.0 dBm | HT40mcs 1   0.0 dBm | HT40mcs 2   0.0 dBm | HT40mcs 3   0.0 dBm
 HT40mcs 4   0.0 dBm | HT40mcs 5   0.0 dBm | HT40mcs 6   0.0 dBm | HT40mcs 7   0.0 dBm
 Dup CCK     0.0 dBm | Dup OFDM    0.0 dBm | Ext CCK     0.0 dBm | Ext OFDM    0.0 dBm
2xAntennaReduction: 6, 2xMaxRegulatory: 54, 2xPowerLimit: 60
2xMaxPowerLevel: 28 (HT20)
TPC Enabled 1 1 0
ar5416SetPowerPerRateTable() syn 2412 ctl 2412 ext 2412 is40 0
  6mb OFDM  15.0 dBm |  9mb OFDM  15.0 dBm | 12mb OFDM  15.0 dBm | 18mb OFDM  15.0 dBm
 24mb OFDM  15.0 dBm | 36mb OFDM  15.0 dBm | 48mb OFDM  15.0 dBm | 54mb OFDM  15.0 dBm
 1L   CCK   17.0 dBm | 2L   CCK   17.0 dBm | 2S   CCK   17.0 dBm | 5.5L CCK   17.0 dBm
 5.5S CCK   17.0 dBm | 11L  CCK   17.0 dBm | 11S  CCK   17.0 dBm | XR         15.0 dBm
 HT20mcs 0  14.0 dBm | HT20mcs 1  14.0 dBm | HT20mcs 2  14.0 dBm | HT20mcs 3  14.0 dBm
 HT20mcs 4  14.0 dBm | HT20mcs 5  14.0 dBm | HT20mcs 6  13.0 dBm | HT20mcs 7  11.0 dBm
 HT40mcs 0   0.0 dBm | HT40mcs 1   0.0 dBm | HT40mcs 2   0.0 dBm | HT40mcs 3   0.0 dBm
 HT40mcs 4   0.0 dBm | HT40mcs 5   0.0 dBm | HT40mcs 6   0.0 dBm | HT40mcs 7   0.0 dBm
 Dup CCK     0.0 dBm | Dup OFDM    0.0 dBm | Ext CCK     0.0 dBm | Ext OFDM    0.0 dBm
2xAntennaReduction: 6, 2xMaxRegulatory: 54, 2xPowerLimit: 60
2xMaxPowerLevel: 30 (LEG)
device ath0 entered promiscuous mode
 wsc_daemon_init
create wsc_pushbutton entry
lock_write_proc: count = 260 sizeof(wsc_cfb)=260
 wsc_enable=1
 wsc_context=1
 wsc_version=0x10
 wsc_devcfstat=1
 wsc_admin.role=0
 wsc_admin.pwdMode=1
 wsc_admin.wsc_pin=00000000
 wsc_admin.seesionTimeout=120
 wsc_admin.retransmitTimeout=15
 wsc_admin.retryLimit=300
 wsc_admin.messageTimeout=0
 wsc_admin.configured=0
 wsc_admin.pbcIsRunning=0
 wsc_admin.selectedReg=0
 wsc_admin.selectedRegTime=0
 wsc_admin.selectRegConfigMethod=0
 wsc_admin.selectRegDevPwdId=0
 wsc_admin.selfPbcPressed=0
 wsc_admin.selfPbcPressedTime=0
 wsc_mac=00:1d:7e:ad:cc:08
 wsc_manfa=LINKSYS
 wsc_ssid=zaphod
 wsc_modelname=WRT350Nv2
 wsc_modelnumber=WSC0001
 wsc_serialnumber=0001000004E044
 wsc_devicename=LINKSYS-WRT350Nv2
 wsc_encrytype=4
lock_write_proc: count = 28 sizeof(wsc_cfb)=28
 role=0
 pwdMode=0
 wsc_context=1
 wsc_iechanged=0
 configured=1
 selectedReg=0
 selectRegConfigMethod=0x00
 selectRegDevPwdId=0x00
 wsc_admin.wsc_pin=00000000
ar5416SetPowerPerRateTable() syn 2412 ctl 2412 ext 2412 is40 0
  6mb OFDM  15.0 dBm |  9mb OFDM  15.0 dBm | 12mb OFDM  15.0 dBm | 18mb OFDM  15.0 dBm
 24mb OFDM  15.0 dBm | 36mb OFDM  15.0 dBm | 48mb OFDM  15.0 dBm | 54mb OFDM  15.0 dBm
 1L   CCK   17.0 dBm | 2L   CCK   17.0 dBm | 2S   CCK   17.0 dBm | 5.5L CCK   17.0 dBm
 5.5S CCK   17.0 dBm | 11L  CCK   17.0 dBm | 11S  CCK   17.0 dBm | XR         15.0 dBm
 HT20mcs 0  14.0 dBm | HT20mcs 1  14.0 dBm | HT20mcs 2  14.0 dBm | HT20mcs 3  14.0 dBm
 HT20mcs 4  14.0 dBm | HT20mcs 5  14.0 dBm | HT20mcs 6  13.0 dBm | HT20mcs 7  11.0 dBm
 HT40mcs 0   0.0 dBm | HT40mcs 1   0.0 dBm | HT40mcs 2   0.0 dBm | HT40mcs 3   0.0 dBm
 HT40mcs 4   0.0 dBm | HT40mcs 5   0.0 dBm | HT40mcs 6   0.0 dBm | HT40mcs 7   0.0 dBm
 Dup CCK     0.0 dBm | Dup OFDM    0.0 dBm | Ext CCK     0.0 dBm | Ext OFDM    0.0 dBm
2xAntennaReduction: 6, 2xMaxRegulatory: 54, 2xPowerLimit: 60
2xMaxPowerLevel: 28 (HT20)
TPC Enabled 1 1 0
Force rf_pwd_icsyndiv to 1 on 2412 (1 2)
ath_newstate: Resetting VAP dfswait_run
ath_newstate: Resetting VAP dfswait_run
ar5416SetPowerPerRateTable() syn 2437 ctl 2427 ext 2447 is40 1
  6mb OFDM  17.0 dBm |  9mb OFDM  17.0 dBm | 12mb OFDM  17.0 dBm | 18mb OFDM  17.0 dBm
 24mb OFDM  17.0 dBm | 36mb OFDM  17.0 dBm | 48mb OFDM  16.0 dBm | 54mb OFDM  15.0 dBm
 1L   CCK   19.0 dBm | 2L   CCK   19.0 dBm | 2S   CCK   19.0 dBm | 5.5L CCK   19.0 dBm
 5.5S CCK   19.0 dBm | 11L  CCK   19.0 dBm | 11S  CCK   19.0 dBm | XR         17.0 dBm
 HT20mcs 0  18.0 dBm | HT20mcs 1  18.0 dBm | HT20mcs 2  18.0 dBm | HT20mcs 3  18.0 dBm
 HT20mcs 4  18.0 dBm | HT20mcs 5  17.0 dBm | HT20mcs 6  13.0 dBm | HT20mcs 7  11.0 dBm
 HT40mcs 0  12.5 dBm | HT40mcs 1  12.5 dBm | HT40mcs 2  12.5 dBm | HT40mcs 3  12.5 dBm
 HT40mcs 4  12.5 dBm | HT40mcs 5  12.5 dBm | HT40mcs 6  12.5 dBm | HT40mcs 7  11.0 dBm
 Dup CCK    12.5 dBm | Dup OFDM   12.5 dBm | Ext CCK    19.0 dBm | Ext OFDM   17.0 dBm
2xAntennaReduction: 0, 2xMaxRegulatory: 40, 2xPowerLimit: 60
2xMaxPowerLevel: 25 (HT40)
TPC Enabled 1 1 0
Force rf_pwd_icsyndiv to 2 on 2437 (1 2)
ath_chan_set: Changing to channel 2427, Flags 30080, PF 0
br0: topology change detected, propagating
br0: port 2(ath0) entering forwarding state
download uses obsolete (PF_INET,SOCK_PACKET)
device eth1 entered promiscuous mode
device br0 entered promiscuous mode
~ #

(Last edited by dirkNL on 6 May 2008, 19:40)

i mean the console log with a non working kernel.

As I stated in my post with test results, the kernel boots but hangs after decompression, no error or whatsoever just the dots showing the decompress progress

erm. no wonder that foonas-em kernel gives you a prompt.

actually foonas-em by design has its own initramfs inside. it was designed to be a recovery kernel so it is possible to access the hdd when the hdd-distro does not boot anymore. telnet is enabled...

the vanilla kernel probably has problems to boot to the rootfs which sits in flash. you are sure it boots to the right device?

That just might be it.

When I have time to test on the device itself I will post again.

(Last edited by dirkNL on 7 May 2008, 19:54)

any update?

Nope, I haven't got enough time to continue working on it. Exams and such stuff...

That's some good news, my progress however isn't...

I've been trying to boot a "vanillla" kernel with wrt350n patches from david's repository with three different toolchains now.
Codesourcery's EABI
Codesourcery's uclinux
and the Stock toolchain from Linksys

With both the EABI and the Stock toolchain the kernel uncompresses, and stalls after telling me it's booting the kernel.
The uclinux toolchain shows even less.

I've tried a lot of different configs but haven't been able to get one going. As I said before I also can't boot the precompiled kernel from david.

I think I'm missing something very stupid, but I don't seem to get my head around it.

Just a thought; could it be I need to alter some offset values in the wrt350_setup.c file? And if so, where would I be able to trace back which values to use? Maybe david can help me out with that.

(Last edited by dirkNL on 26 May 2008, 22:17)

Thanks alot for the quick response. I think I tried the mach patch at some point, but now I'm not even sure how or when and on which sources.

I'll try these tonight and will post back asap.


** update **

Finally some results!!, I think the patch did the trick, silly me smile
But still, to make sure it doesn't depend on anything else I'll keep using this toolchain and mkimage for my future adventures...

The kernel boots but shows me some errors about the flash memory and inevitably panics with no root filesystem message. I'm now going to get started (finally) with the real work.

Keep you posted!


** update 2 **

I've been using the setup.c file from david as my starting point, but somehow none of the images built with it were able to boot. I switched to the setup.c file from the kurobox_pro which is in the stock kernel sources, this boots properly. I'm not going to dig for a solution for this problem just yet as I now just copied the values from david's file into the kurobox file and that "works".

When I say "works", this is what I get:

Linux version 2.6.25.4 (root@skvalpe) (gcc version 3.4.4 (release) (CodeSourcery ARM 2005q3-2)) #25 Mon May 26 05:28:07 CEST 2008
CPU: Feroceon [41069260] revision 0 (ARMv5TEJ), cr=a0053177
Machine: WRT350N - EXPERIMENTAL
Clearing invalid memory bank 0KB@0xffffffff
Clearing invalid memory bank 0KB@0xffffffff
Clearing invalid memory bank 0KB@0xffffffff
Ignoring unrecognised tag 0x00000000
Ignoring unrecognised tag 0x00000000
Ignoring unrecognised tag 0x00000000
Ignoring unrecognised tag 0x41000403
Memory policy: ECC disabled, Data cache writeback
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
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: console=ttyS0,115200 root=/dev/mtdblock1 rw
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 28656KB available (3160K code, 510K data, 116K init)
SLUB: Genslabs=12, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 540 bytes
NET: Registered protocol family 16
Orion ID: MV88F5181-Rev-Unsupported. TCLK=166666667.
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
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
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
HDLC line discipline: version $Revision: 4.8 $, maxframe=4096
N_HDLC line discipline registered.
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 3) is a 16550A
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO 0xf1012100 (irq = 4) is a 16550A
loop: module loaded
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).
console [netcon0] enabled
netconsole: network logging started
Driver 'sd' needs updating - please use bus_type methods
physmap platform flash device: 00800000 at f4000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 8-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
  Unknown Amd/Fujitsu Extended Query version 0.0.
gen_probe: No supported Vendor Command Set found
physmap-flash physmap-flash.0: map_probe failed
sysfs: duplicate filename 'physmap-flash.0' can not be created
------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:424 sysfs_add_one+0xbc/0xe0()
Modules linked in:
[<c0029dac>] (dump_stack+0x0/0x14) from [<c0037748>] (warn_on_slowpath+0x4c/0x60)
[<c00376fc>] (warn_on_slowpath+0x0/0x60) from [<c00c38a4>] (sysfs_add_one+0xbc/0xe0)
 r7:c034f5a8 r6:c1ced1e0 r4:c1c100f0
[<c00c37e8>] (sysfs_add_one+0x0/0xe0) from [<c00c39ac>] (create_dir+0x60/0xb8)
 r6:c1c19e38 r5:c1ced1e0 r4:c1c100f0
[<c00c394c>] (create_dir+0x0/0xb8) from [<c00c3a5c>] (sysfs_create_dir+0x38/0x64)
 r8:00000000 r7:c034e458 r6:c034e458 r5:00000000 r4:c034f5a8
[<c00c3a24>] (sysfs_create_dir+0x0/0x64) from [<c0123810>] (kobject_add_internal+0x78/0x1b4)
 r4:c034f5a8
[<c0123798>] (kobject_add_internal+0x0/0x1b4) from [<c0123998>] (kobject_add_varg+0x4c/0x54)
 r7:c034f5cc r6:c034e458 r5:00000000 r4:c034f5a8
[<c012394c>] (kobject_add_varg+0x0/0x54) from [<c0123a1c>] (kobject_add+0x40/0x64)
 r6:c034f538 r5:00000001 r4:c034f540
[<c01239dc>] (kobject_add+0x0/0x64) from [<c015ad50>] (device_add+0x84/0x49c)
 r3:c034f5cc r2:c0310e00
[<c015accc>] (device_add+0x0/0x49c) from [<c015f7b8>] (platform_device_add+0x148/0x18c)
[<c015f670>] (platform_device_add+0x0/0x18c) from [<c015f820>] (platform_device_register+0x24/0x28)
 r7:c0020684 r6:00000000 r5:c034f538 r4:00000000
[<c015f7fc>] (platform_device_register+0x0/0x28) from [<c001942c>] (physmap_init+0x34/0x44)
 r5:00000000
[<c00193f8>] (physmap_init+0x0/0x44) from [<c0008a94>] (kernel_init+0x94/0x2ac)
 r4:00000000
[<c0008a00>] (kernel_init+0x0/0x2ac) from [<c003a05c>] (do_exit+0x0/0x688)
---[ end trace afebe5dee4559e24 ]---
kobject_add_internal failed for physmap-flash.0 with -EEXIST, don't try to register things with the same name in the same directory.
[<c0029dac>] (dump_stack+0x0/0x14) from [<c0123924>] (kobject_add_internal+0x18c/0x1b4)
[<c0123798>] (kobject_add_internal+0x0/0x1b4) from [<c0123998>] (kobject_add_varg+0x4c/0x54)
 r7:c034f5cc r6:c034e458 r5:00000000 r4:c034f5a8
[<c012394c>] (kobject_add_varg+0x0/0x54) from [<c0123a1c>] (kobject_add+0x40/0x64)
 r6:c034f538 r5:00000001 r4:c034f540
[<c01239dc>] (kobject_add+0x0/0x64) from [<c015ad50>] (device_add+0x84/0x49c)
 r3:c034f5cc r2:c0310e00
[<c015accc>] (device_add+0x0/0x49c) from [<c015f7b8>] (platform_device_add+0x148/0x18c)
[<c015f670>] (platform_device_add+0x0/0x18c) from [<c015f820>] (platform_device_register+0x24/0x28)
 r7:c0020684 r6:00000000 r5:c034f538 r4:00000000
[<c015f7fc>] (platform_device_register+0x0/0x28) from [<c001942c>] (physmap_init+0x34/0x44)
 r5:00000000
[<c00193f8>] (physmap_init+0x0/0x44) from [<c0008a94>] (kernel_init+0x94/0x2ac)
 r4:00000000
[<c0008a00>] (kernel_init+0x0/0x2ac) from [<c003a05c>] (do_exit+0x0/0x688)
orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
orion-ehci orion-ehci.0: irq 17, io mem 0xf1050000
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
USB Universal Host Controller Interface driver v3.0
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "mtdblock1" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

As you can see it's failing to map it's NOR flash to create the root filesystem.
My setup.c is located here so you can see which values are used for all mappings.

I'm a little worried for getting this message "Unknown Amd/Fujitsu Extended Query version 0.0." which you can see in the log above. I've read in this thread whatta got the same message when booting another kernel from foonas. Is it really just some mapping which is missing, or is it something like a not yet supported feature?

The messages at the beginning of the log just confirm my guess it's just some mapping problem I think

Clearing invalid memory bank 0KB@0xffffffff
Clearing invalid memory bank 0KB@0xffffffff
Clearing invalid memory bank 0KB@0xffffffff
Ignoring unrecognised tag 0x00000000
Ignoring unrecognised tag 0x00000000
Ignoring unrecognised tag 0x00000000
Ignoring unrecognised tag 0x41000403

Any suggestion is welcome smile

(Last edited by dirkNL on 26 May 2008, 03:38)

That's quite possible.

lennert buytenhek told me that he will look at helping you a little from upstream guys.

(Last edited by mindbender on 28 May 2008, 02:46)

That's good to know, any help is welcome

StrikerNL (also member of this forum and a friend of mine) had a very good tip today:

use the file cfi_cmdset_0002.c from the WRT sources to get support for the flashchip/mtd. Now we're making progress, because now even the root filesystem can be mounted. That is however, if you have squashfs support in the kernel...

I took the squashfs patch for my vanilla kernel from a gentoo bug tracker: http://bugs.gentoo.org/show_bug.cgi?id=218169
It doesn't work out of the box, but I was able to solve the rejects. All very small ones actually.

Another important change; I changed the physmap id from 0 to 1 in my modified setup.c file. I think the 0 is created elsewhere in the orion sources, but I haven't bothered to look for this yet.

Here's my new log output; this is it for today. I will be back once I have some spare time again.

Linux version 2.6.25.4 (root@skvalpe) (gcc version 3.4.4 (release) (CodeSourcery ARM 2005q3-2)) #28 Thu May 29 05:13:33 CEST 2008
CPU: Feroceon [41069260] revision 0 (ARMv5TEJ), cr=a0053177
Machine: WRT350N - EXPERIMENTAL
Clearing invalid memory bank 0KB@0xffffffff
Clearing invalid memory bank 0KB@0xffffffff
Clearing invalid memory bank 0KB@0xffffffff
Ignoring unrecognised tag 0x00000000
Ignoring unrecognised tag 0x00000000
Ignoring unrecognised tag 0x00000000
Ignoring unrecognised tag 0x41000403
Memory policy: ECC disabled, Data cache writeback
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
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: console=ttyS0,115200 root=/dev/mtdblock1 rw
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 28616KB available (3204K code, 511K data, 116K init)
SLUB: Genslabs=12, HWalign=32, Order=0-1, MinObjects=4, CPUs=1, Nodes=1
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 540 bytes
NET: Registered protocol family 16
Orion ID: MV88F5181-Rev-Unsupported. TCLK=166666667.
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
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
squashfs: version 3.3 (2007/10/31) Phillip Lougher
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
HDLC line discipline: version $Revision: 4.8 $, maxframe=4096
N_HDLC line discipline registered.
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 3) is a 16550A
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO 0xf1012100 (irq = 4) is a 16550A
loop: module loaded
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).
console [netcon0] enabled
netconsole: network logging started
Driver 'sd' needs updating - please use bus_type methods
physmap platform flash device: 00800000 at f4000000
physmap-flash.1: Found 1 x16 devices at 0x0 in 8-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
physmap-flash.1: Swapping erase regions for broken CFI table.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
RedBoot partition parsing not available
Using physmap partition information
Creating 5 MTD partitions on "physmap-flash.1":
0x00000000-0x00760000 : "kernel"
0x001a0000-0x00760000 : "rootfs"
0x00760000-0x007a0000 : "lang"
0x007a0000-0x007c0000 : "nvram"
0x007c0000-0x00800000 : "u-boot"
physmap platform flash device: 01000000 at f0000000
physmap-flash physmap-flash.0: map_probe failed
orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
orion-ehci orion-ehci.0: irq 17, io mem 0xf1050000
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
USB Universal Host Controller Interface driver v3.0
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
VFS: Mounted root (squashfs filesystem) readonly.
Freeing init memory: 116K
SQUASHFS error: zlib_inflate returned unexpected result 0xfffffffd, srclength 65536, avail_in 903, avail_out 65536
SQUASHFS error: sb_bread failed reading block 0x1b
SQUASHFS error: Unable to read page, block 77, size 6ed3
SQUASHFS error: zlib_inflate returned unexpected result 0xfffffffd, srclength 65536, avail_in 903, avail_out 65536
SQUASHFS error: sb_bread failed reading block 0x1b
SQUASHFS error: Unable to read page, block 77, size 6ed3
SQUASHFS error: zlib_inflate returned unexpected result 0xfffffffd, srclength 65536, avail_in 903, avail_out 65536
SQUASHFS error: sb_bread failed reading block 0x1b
SQUASHFS error: Unable to read page, block 77, size 6ed3
SQUASHFS error: zlib_inflate returned unexpected result 0xfffffffd, srclength 65536, avail_in 903, avail_out 65536
SQUASHFS error: sb_bread failed reading block 0x1b
SQUASHFS error: Unable to read page, block 77, size 6ed3
SQUASHFS error: zlib_inflate returned unexpected result 0xfffffffd, srclength 65536, avail_in 903, avail_out 65536
SQUASHFS error: sb_bread failed reading block 0x1b
SQUASHFS error: Unable to read page, block 77, size 6ed3
SQUASHFS error: zlib_inflate returned unexpected result 0xfffffffd, srclength 65536, avail_in 903, avail_out 65536
SQUASHFS error: sb_bread failed reading block 0x1b
SQUASHFS error: Unable to read page, block 77, size 6ed3
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.

** update **

Just found out the default WRT kernel uses LZMA compression for squashfs, the patch I used doesn't...
going to have a look here http://www.squashfs-lzma.org/ now, I'll let you know if something happens.

(Last edited by dirkNL on 29 May 2008, 02:43)

dirkNL wrote:

use the file cfi_cmdset_0002.c from the WRT sources to get support for the flashchip/mtd.

Not entirely true; I took the cfi_cmdset_0002.c from the vanilla kernel sources and made a small change. It's only one line. [s]I'd paste it but I'm at work so I don't have it handy[/s] I forgot I can use SSH. What it comes down to, a check was added in the vanilla kernel sources for the major/minor version of the AMD/Fujitsu chipset. This check was not present in the linksys sources. This check only seems to allow versions from 1.0 to 1.4 (I believe). Any other version raises kernel panic. The WRT350N reports 0.0, so I added a rule to allow that version as well. It's a hack but since there was no check at all in the past I figured it may just work. It should probably just allow 0.0, not 0.0 through 0.4 as well. However that would still be a hack.

Here's the change:

if (extp->MajorVersion != '1' ||
   (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {

->

/* WRT350N is MajorVersion 0 */
if ((extp->MajorVersion != '1' && extp->MajorVersion != '0') ||
    (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {

(Last edited by StrikerNL on 29 May 2008, 08:38)

Hmm... you did more than I... I'll clean up my repo and give you write access to it. Maybe I'll host it on another server.

Alright, good news, and also, a lot of it.

First off, I would like to extend a lot of thanks to Lennert Buytenhek. He worked with me and Dirk for hours to get the WRT350n working. What marvellous support from Marvell! wink

With a lot of help from Lennert, we have been able to get, well, everything working on the WRT350n. I currently have 2.6.26-rc4 running on it. We think it's ready to run openwrt, as soon as we figure out how create an image that can be flashed via the standard interface.

According to Lennert, the work he did to create a working wrt350n_setup.c, will be included in the next major mainline kernel, probably 2.6.27. Until then, you will need to get the kernel from the marvell GIT repository. This is of course very good news, because for a large part the wrt350n will work out of the box with a generic kernel in the not too distant future!

What works: Almost everything, it seems. LAN, WiFi, USB, writing new rootfs/kernel to flash, booting from Squash-LZMA filesystem in flash. Also Lennert has mapped the GPIO's (leds and buttons) for future use.
What doesn't: n-mode for WiFi, booting the SquashFS-LZMA rootfs that normally comes with the wrt350n, because SquashFS 3.3 seems to be backwards incompatible with 3.0, which is what was used to create the stock rootfs. Since the rootfs can easily be overwritten, this doesn't really matter.

First I'll just sum up the steps that were taken to get everything work, then I'll elaborate on the important ones more in-depth.

1. Get the latest GIT checkout from the marvell GIT repository
2. Download patch for cfi_cmdset_0002.c and apply it to the kernel
3. Patch 2.6.26-rc4 to have SquashFS-LZMA (needs patching to make it 2.6.26 compatible)
4. Build the kernel
5. Get the latest madwifi, point it to the new kernel and build it (needs a few patches as well)
6. Patch the zImage with the correct machine type id and build the uImage
7. Boot the uImage through the Marvell bootloader.
8. Load the madwifi modules

Now for the more detailed explanations:

The cfi_cmdset_0002.c patch
Somewhere along the line between 2.6.12 (linksys sources) and now, a check was added for the version of the CFI chip. This check enforces that the version can only be between 1.0 and 1.4. This presents a problem, because the WRT350N reports version 0.0. This patch modifies the check to allow 0.0 as well as 1.0 to 1.4. With this patch applied, the flash can be mapped just fine.

Patching 2.6.26-rc4 with SquashFS-LZMA
Patching a kernel newer than 2.6.24.3 presents a problem, because there are only patches up to this version as of the time of writing. 2.6.25 and later need you to manually patch the kernel. I will outline this process here. When SquashFS-LZMA gets ported to the newer kernel by the author, this section will be obsoleted.

Following the instructions at http://www.squashfs-lzma.org/, get all the files in the menu on the left (except for the kernel, obviously). Note: I didn't apply the 'cvsfix' patches.

Then follow the guide here: http://www.squashfs-lzma.org/dl/sqlzma.txt.
Note: use the 2.6.24 patch to patch the kernel
Note 2: you don't need to do the Makefile stuff or actually run make

Now do the following things:
1. From where you unpacked sqlzmaXXX-XXX.tar.bz2, copy sqlzma.h to <kernelsrc>/fs/squashfs
2. From where you unpacked sqlzmaXXX-XXX.tar.bz2, copy sqmagic.h to <kernelsrc>/fs/squashfs
3. From where you unpacked lzmaXXX.tar.bz2, copy C/Compress/LZMA/uncomp.c to <kernelsrc>/fs/squashfs
4. From where you unpacked lzmaXXX.tar.bz2, copy C/Compress/LZMA/LzmaDecode.c to <kernelsrc>/fs/squashfs
5. From where you unpacked lzmaXXX.tar.bz2, copy C/Compress/LZMA/LzmaDecode.h to <kernelsrc>/fs/squashfs
6. From where you unpacked lzmaXXX.tar.bz2, copy C/Compress/LZMA/LzmaTypes.h to <kernelsrc>/fs/squashfs
7. From where you unpacked lzmaXXX.tar.bz2, copy C/Compress/LZMA/kmod/module.c to <kernelsrc>/fs/squashfs
8. Apply this patch to <kernelsrc>/fs/squashfs/inode.c
9. Apply this patch to <kernelsrc>/fs/squashfs/Makefile
10. Edit <kernelsrc>/fs/squashfs/module.c, change "#include "../LzmaDecode.c" to "#include "LzmaDecode.c"

Now enable SquashFS in the kernel (file systems, miscellaneous, squashfs, builtin). Now the kernel has SquashFS-LZMA support.

Compiling madwifi modules
Get the latest madwifi SVN version from http://svn.madwifi.org/madwifi/trunk. To build madwifi, I had to apply some hacks to the source. Your mileage may vary. Anyway, this is what I did. Since this is SVN, there's probably not a lot of use in creating patches for it, so I'll just walk through it step by step.

NOTE! For compiling this, I used this toolchain. I used a newer one for the kernel but that one completely failed to compile madwifi.

1. From where you checked out madwifi, edit hal/public/armv4-le-elf.inc. All the way at the bottom, where it says "COPTS+= -march=armv4 -mlittle-endian \", change this to "COPTS+= -march=armv5te -mlittle-endian \"
2. Try to compile madwifi, it may just work. If you get errors about functions iowrite32be/ioread32be like I did, continue.
3. From where you checked out madwifi, edit ath_hal/ah_os.h.
4. Find the comment about "The register accesses are done using target-specific" (for me, line 195).
5. Go down a bit to where it says the following:

#define _OS_REG_WRITE(_ah, _reg, _val) do {                     \
         is_reg_le(_reg) ?                                      \
         iowrite32((_val), (_ah)->ah_sh + (_reg)) :             \
         iowrite32be((_val), (_ah)->ah_sh + (_reg));            \
        } while (0)

6. Change this to/replace this with:

#define _OS_REG_WRITE(_ah, _reg, _val) do {                     \
         iowrite32((_val), (_ah)->ah_sh + (_reg));              \
        } while (0)

7. Right below that, there should be this:

#define _OS_REG_READ(_ah, _reg)                                 \
        (is_reg_le(_reg) ?                                      \
         ioread32((_ah)->ah_sh + (_reg)) :                      \
         ioread32be((_ah)->ah_sh + (_reg)))

8. Change this to/replace this with:

#define _OS_REG_READ(_ah, _reg)                                 \
        ioread32((_ah)->ah_sh + (_reg))

9. Now compile madwifi. It should now work.
10. Install the modules somewhere where your WRT350N will be able to access them (in your rootfs, /lib/modules somewhere).

Patching the zImage with the correct machine type id
You can either do this manually every time you build a kernel or have it be done for you. I'm going to assume you prefer the latter.

Apply this patch to your kernel. This changes the arch/arm/boot/Makefile so it puts the machine id in the zImage before it creates the uImage. Many thanks to mindbender and Lennert for this one.

These are, I think, all the steps needed to create an image with the very latest kernel that will boot on wrt350n. You will have support for everything. Just for the sake of completeness, I will include here the config that was used build a working kernel after these steps.

What's left to do?
The next thing will be to figure out how to create an image which can be used to flash a new firmware to the wrt350n without needing the serial console.

(Last edited by StrikerNL on 31 May 2008, 17:08)

I'll look into this tomorrow and get it working in openwrt with some luck... Do we have support for the switch, or we end up with an AP only for now? (eg do we have wan and lan?)

Unfortunately no switch yet, no. All traffic goes through eth0, of the WAN port and all 4 LAN ports. Lennert may try to get this working in the next couple of weeks, if his time allows him to.

Great you managed to get it working. So well, do you need an repo?

Transmitting file data ........................
Committed revision 11352.

wink

@Davidkra. No thanks as almost everything will be in the mainline git-repos very soon it won't be necessary, thanks anyway.

@Kaloz. Superb, we'll try it as soon as possible

(Last edited by dirkNL on 4 Jun 2008, 15:45)

Just posting some updates.

- We have created a working image/firmware builder that can and will be used to make images that can be flashed from the stock wrt350n firmware (so you don't need to use the serial console to flash, which is good, as you need a special cable for that)
- We have gotten an SVN checkout and tried to build a working openwrt rootfs. No success there, yet. Due to lack of time, we haven't been able to do a lot of tests. We'll get there though.

(Last edited by StrikerNL on 11 Jun 2008, 11:38)