(Progress before 6-12-2004 was not documented in detail).
(6-12-2004): I can build a (big-endian) kernel that looks like it should work, but I have not yet been able to bring it up on the router hardware - it crashes about 50 instructions in from the entry point, early in start_kernel: - it seems that Big-endian mode is not supported after all.
(7-12-2004): After changing to little endian mode, and rebuilding a little-endian kernel, it boots more:
Linux version 2.4.20-uc0 (hugo@waikare) (gcc version 3.3.4) #995 Tue Dec 7 09:37:23 NZDT 2004 Processor: Winbond W90N740 revision 1 Architecture: W90N740 On node 0 totalpages: 2048 zone(0): 0 pages. zone(1): 2048 pages. zone(2): 0 pages. Kernel command line: root=/dev/rom0 Calibrating delay loop... 39.83 BogoMIPS Memory: 4MB = 4MB total Memory: 2896KB available (838K code, 186K data, 40K init) Dentry cache hash table entries: 512 (order: 0, 4096 bytes) Inode cache hash table entries: 512 (order: 0, 4096 bytes) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 1024 (order: 0, 4096 bytes) POSIX conformance testing by UNIFIX Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket Starting kswapd Winbond W90N740 Serial driver version 0.9 (2001-12-27) with no serial options enabled ttyS00 at 0xfff80000 (irq = 6) is a W90N740 Unhandled fault: alignment exception (13) at 0x00000001 fault-common.c(97): start_code=0x7f000100, start_stack=0xa8) Internal error: Oops: 0 CPU: 0 pc : [<0000e97c>] lr : [<00074c54>] Not tainted sp : 00133f90 ip : ffffffff fp : 00133fc8 r10: 00000000 r9 : 0010d60c r8 : 00112160 r7 : 00133f9c r6 : 000e9994 r5 : 00000000 r4 : 000e9994 r3 : 00000000 r2 : 00000000 r1 : 00000001 r0 : 00700000 Flags: nZCv IRQs on FIQs on Mode SVC_32 Segment kernel Control: 0 Process swapper (pid: 1, stackpage=00133000) Stack: 00133f80: 00074c54 0000e97c 60000013 ffffffff 0000fec0 0000f1e4 00011a38 00011a90 00133fa0: 00011a3c 00011a90 000f0994 0001c200 00112160 000f0990 000f3b38 00133fe0 00133fc0: 00133fcc 000086b8 0000e848 000f946c 00112160 00133ffc 00133fe4 0001204c 00133fe0: 000086ac 000f946c 00112160 000f0994 00000000 00134000 000158ac 0001204c Backtrace: Function entered at [<0000e838>] from [<000086b8>] Function entered at [<0000869c>] from [<0001204c>] r5 = 00112160 r4 = 000F946C Function entered at [<0001203c>] from [<000158ac>] r6 = 000F0994 r5 = 00112160 r4 = 000F946C Code: e3e0000f e91baff0 (e5903008) e2031cff e1a01401 Kernel panic: Attempted to kill init!
The addresses refered to in the (quoted) kernel panic above are in linux-2.4.x/drivers/block/genhd.c, called from linux-2.4.x/arch/armnommu/kernel/setup.c when it tries to look at the ROMFS and run the init process. Hopefully, this is just because we don't yet have a ROMFS installed.
Addr2line results:
0xe838: drivers/block/genhd.c:252
0x869c: init/main:459
0x1203c: init/main:562
And the "Code:" it refers to disassembles to this:
0: e3e0000f mvn r0, #15 ; 0xf
4: e91baff0 ldmdb fp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, pc}
8: e5903008 ldr r3, [r0, #8]
c: e2031cff and r1, r3, #65280 ; 0xff00
10: e1a01401 mov r1, r1, lsl #8
(7-12-2004): Simple problem above: blkmem driver (linux-2.4.x/drivers/block/blkmem.c) didn't know where the flash was in the memory map, and was trying to access flash at 0x00000001, hence the alignment error. Fixed. Now we can boot right up until it tries to mount the root filesystem. Next thing to try is putting a ROMFS in flash.
Linux version 2.4.20-uc0 (hugo@waikare) (gcc version 3.3.4) #1031 Wed Dec 8 15:48:07 NZDT 2004
Processor: Winbond W90N740 revision 1
Architecture: W90N740
On node 0 totalpages: 1024
zone(0): 0 pages.
zone(1): 1024 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0
Calibrating delay loop... 39.83 BogoMIPS
Memory: 4MB = 4MB total
Memory: 3044KB available (758K code, 164K data, 40K init)
Dentry cache hash table entries: 512 (order: 0, 4096 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 1024 (order: 0, 4096 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Winbond W90N740 Serial driver version 0.9 (2001-12-27) with no serial options enabled
ttyS00 at 0xfff80000 (irq = 6) is a W90N740
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 7F090000-FB868FFF [VIRTUAL 7F090000-FB868FFF] (RO)
RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize
loop: loaded (max 8 devices)
The flash size:0x00100000
Boot Loader Configuration:
TFTP server port : MAC 0
Network phy chip : IC PLUS
MAC 0 Address : 7a:c6:22:6a:d7:77
IP 0 Address : 0.0.0.0
MAC 1 Address : 52:bb:78:d8:9b:3a
IP 1 Address : 0.0.0.0
DHCP Client : Enabled
CACHE : Disabled
01 eth0 initial ok!
which:0
01 eth1 initial ok!
which:1
AM29LV800BB Flash Detected
usb.c: registered new driver hub
add a static ohci host controller device
: USB OHCI at membase 0xfff05000, IRQ 9
hc_alloc_ohci
usb-ohci.c: AMD756 erratum 4 workaround
hc_reset
usb.c: new USB bus registered, assigned bus number 1
Product: USB OHCI Root Hub
SerialNumber: fff05000
hub.c: USB hub found
hub.c: 2 ports detected
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 1024)
Kernel panic: VFS: Unable to mount root fs on 1f:00
(9-12-2004): Stripped ROMFS down to the bare minimum (Busybox is the only binary; it is used for init as well), and it is 190kB or so. Fixed issue with ROMFS block memory driver; it now mounts, but I am having toolchain problems (can't build good bFLT-format binaries, hence the "BINFMT_FLAT: bad magic/rev (0x1010161, need 0x4)" error below. Also cleaned up a lot of debug messages and so on, and (hopefully) removed the dependency on the Winbond bootloader.
W90N740 Boot Loader [ Version 1.1 $Revision: 6 $ ] Rebuilt on Sep 26 2003
Running on a W90N740 Evaluation Board
Board Revision 1.0, W90N740 MCU
Memory Size is 0x400000 Bytes, Flash Size is 0x100000 Bytes
Board designed by Winbond
Hardware support provided at Winbond
Copyright (c) Winbond Limited 2001 - 2003. All rights reserved.
Boot Loader Configuration:
TFTP server port : MAC 0
Network phy chip : IC PLUS IP175A
MAC 0 Address : 7A:C6:22:6A:D7:77
IP 0 Address : 0.0.0.0
MAC 1 Address : 52:BB:78:D8:9B:3A
IP 1 Address : 0.0.0.0
DHCP Client : Enabled
CACHE : Disabled
BL buffer base : 0x00300000
BL buffer size : 0x00100000
Default baud rate : 115200
For help on the available commands type 'h'
Press ESC to enter debug mode ......
Cache disabed!
Processing image 1 ...
Processing image 2 ...
Processing image 3 ...
Processing image 4 ...
Processing image 5 ...
Processing image 6 ...
Processing image 7 ...
Unzip image 7 ...
Executing image 7 ...
Linux version 2.4.20-uc0 (hugo@waikare) (gcc version 3.3.4) #1056 Thu Dec 9 15:41:48 NZDT 2004
Processor: Winbond W90N740 revision 1
Architecture: W90N740
On node 0 totalpages: 1024
zone(0): 0 pages.
zone(1): 1024 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0
Calibrating delay loop... 39.83 BogoMIPS
Memory: 4MB = 4MB total
Memory: 3052KB available (748K code, 165K data, 40K init)
Dentry cache hash table entries: 512 (order: 0, 4096 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 1024 (order: 0, 4096 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Winbond W90N740 Serial driver version 0.9 (2001-12-27) with no serial options enabled
ttyS00 at 0xfff80000 (irq = 6) is a W90N740
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 7F090000-7F0C1BFF [VIRTUAL 7F090000-7F0C1BFF] (RO)
RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize
loop: loaded (max 8 devices)
w740mac.c: eth0 Initialization OK!
w740mac.c: eth1 Initialization OK!
usb.c: registered new driver hub
usb-ohci.c: USB OHCI at membase 0xfff05000, IRQ 9
usb-ohci.c: AMD756 erratum 4 workaround
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 1024)
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 40K
BINFMT_FLAT: bad magic/rev (0x1010161, need 0x4)
BINFMT_FLAT: bad magic/rev (0x1010161, need 0x4)
BINFMT_FLAT: bad magic/rev (0x1010161, need 0x4)
BINFMT_FLAT: bad magic/rev (0x1010161, need 0x4)
BINFMT_FLAT: bad magic/rev (0x1010161, need 0x4)
BINFMT_FLAT: bad magic/rev (0x1010161, need 0x4)
Kernel panic: No init found. Try passing init= option to kernel.
(10-12-2004): Fixed toolchain issues related to bFLT-format binaries, now have a booting system!! Some seemingly random errors at runtime though? --update: could be either some weird uClinux equivalent of a Segmentation Fault, or it could be a stack overflow.
W90N740 Boot Loader [ Version 1.1 $Revision: 6 $ ] Rebuilt on Sep 26 2003
Running on a W90N740 Evaluation Board
Board Revision 1.0, W90N740 MCU
Memory Size is 0x400000 Bytes, Flash Size is 0x100000 Bytes
Board designed by Winbond
Hardware support provided at Winbond
Copyright (c) Winbond Limited 2001 - 2003. All rights reserved.
Boot Loader Configuration:
TFTP server port : MAC 0
Network phy chip : IC PLUS IP175A
MAC 0 Address : 7A:C6:22:6A:D7:77
IP 0 Address : 0.0.0.0
MAC 1 Address : 52:BB:78:D8:9B:3A
IP 1 Address : 0.0.0.0
DHCP Client : Enabled
CACHE : Disabled
BL buffer base : 0x00300000
BL buffer size : 0x00100000
Default baud rate : 115200
For help on the available commands type 'h'
Press ESC to enter debug mode ......
Cache disabed!
Processing image 1 ...
Processing image 2 ...
Processing image 3 ...
Processing image 4 ...
Processing image 5 ...
Processing image 6 ...
Processing image 7 ...
Unzip image 7 ...
Executing image 7 ...
Linux version 2.4.20-uc0 (hugo@waikare) (gcc version 2.95.3 20010315 (release)) #1067 Fri Dec 10 08:46:59 NZDT 2004
Processor: Winbond W90N740 revision 1
Architecture: W90N740
On node 0 totalpages: 1024
zone(0): 0 pages.
zone(1): 1024 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0
Calibrating delay loop... 39.83 BogoMIPS
Memory: 4MB = 4MB total
Memory: 2988KB available (799K code, 174K data, 44K init)
Dentry cache hash table entries: 512 (order: 0, 4096 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 1024 (order: 0, 4096 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
Winbond W90N740 Serial driver version 0.9 (2001-12-27) with no serial options enabled
ttyS00 at 0xfff80000 (irq = 6) is a W90N740
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 7F090000-7F0C03FF [VIRTUAL 7F090000-7F0C03FF] (RO)
RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize
loop: loaded (max 8 devices)
w740mac.c: eth0 Initialization OK!
w740mac.c: eth1 Initialization OK!
usb.c: registered new driver hub
usb-ohci.c: USB OHCI at membase 0xfff05000, IRQ 9
usb-ohci.c: AMD756 erratum 4 workaround
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
VFS: Mounted root (romfs filesystem) readonly.
boot_options:1
Mounted devfs on /dev
Freeing init memory: 44K
init started: BusyBox v0.60.4 (2004.12.09-04:01+0000) multi-call binary
Welcome to
____ _ _
/ __| ||_|
_ _| | | | _ ____ _ _ _ _
| | | | | | || | _ \| | | |\ \/ /
| |_| | |__| || | | | | |_| |/ \
| ___\____|_||_|_| |_|\____|\_/\_/
| |
|_| on the DSE XH1151/Surecom EP4904 Router!
Unhandled fault: external abort on linefetch (F4) at 0x00000001
fault-common.c(97): start_code=0x380040, start_stack=0x3bff54)
BusyBox v0.60.4 (2004.12.09-04:28+0000) Built-in shell (lash)
Enter 'help' for a list of built-in commands.
~ # ls
bin dev etc home lib linuxr mnt
proc sbin swap tmp usr var
~ # help
Built-in commands:
-------------------
bg Resume a job in the background
cd Change working directory
exec Exec command, replacing this shell with the exec'd process
exit Exit from shell()
fg Bring job into the foreground
jobs Lists the active jobs
export Set environment variable
unset Unset environment variable
read Input environment variable
. Source-in and run commands in a file
pwd Print current directory
help List shell built-in commands
~ #
(16-12-2004): Basically everthing is working properly now. I fixed the network issue (interrupts somehow were not being turned on!!), but only eth1 seems to be working currently (that is the port labeled WAN on the case), eth0 (ports connected via the switch) is not working. Fixed the annoying '"external abort on linefetch"' problem (changed from lash to msh..., and fixed an issue in getcwd.c). Tested USB support with an FTDI USB-Serial Adapter - it works! Can now ping the board, send pings from the board, telnet from the board, telnet into the board, and so on. Very good progress!
W90N740 Boot Loader [ Version 1.1 $Revision: 6 $ ] Rebuilt on Sep 26 2003
Running on a W90N740 Evaluation Board
Board Revision 1.0, W90N740 MCU
Memory Size is 0x400000 Bytes, Flash Size is 0x100000 Bytes
Board designed by Winbond
Hardware support provided at Winbond
Copyright (c) Winbond Limited 2001 - 2003. All rights reserved.
Boot Loader Configuration:
TFTP server port : MAC 0
Network phy chip : IC PLUS IP175A
MAC 0 Address : 00:00:00:00:00:01
IP 0 Address : 0.0.0.0
MAC 1 Address : 00:00:00:00:00:02
IP 1 Address : 0.0.0.0
DHCP Client : Disabled
CACHE : Disabled
BL buffer base : 0x00300000
BL buffer size : 0x00100000
Default baud rate : 115200
For help on the available commands type 'h'
Press ESC to enter debug mode ......
Cache disabed!
Processing image 1 ...
Unzip image 1 ...
Executing image 1 ...
Linux version 2.4.20-uc0 (hugo@waikare) (gcc version 2.95.3 20010315 (release)(C
oldFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and sha
red lib patches from http://www.snapgear.com/)) #1126 Thu Dec 16 17:28:58 NZDT 2
004
Processor: Winbond W90N740 revision 1
Architecture: W90N740
On node 0 totalpages: 1024
zone(0): 0 pages.
zone(1): 1024 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0
Calibrating delay loop... 39.83 BogoMIPS
Memory: 4MB = 4MB total
Memory: 2896KB available (884K code, 180K data, 40K init)
Dentry cache hash table entries: 512 (order: 0, 4096 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 1024 (order: 0, 4096 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Winbond W90N740 Serial driver version 0.9 (2001-12-27) with no serial options en
abled
ttyS00 at 0xfff80000 (irq = 6) is a W90N740
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 7F090000-7F0DDBFF [VIRTUAL 7F090000-7F0DDBFF] (RO)
RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize
loop: loaded (max 8 devices)
w740mac.c: eth0 Initialization OK!
w740mac.c: eth1 Initialization OK!
usb.c: registered new driver hub
usb-ohci.c: USB OHCI at membase 0xfff05000, IRQ 9
usb-ohci.c: AMD756 erratum 4 workaround
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 40K
init started: BusyBox v0.60.4 (2004.12.16-04:25+0000) multi-call binary
Welcome to
____ _ _
/ __| ||_|
_ _| | | | _ ____ _ _ _ _
| | | | | | || | _ \| | | |\ \/ /
| |_| | |__| || | | | | |_| |/ \
| ___\____|_||_|_| |_|\____|\_/\_/
| |
|_| on the DSE XH1151/Surecom EP4904 Router!
BusyBox v0.60.4 (2004.12.16-04:25+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
#