Sunday, August 3, 2008

The DNS323 dmesg output

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.

NetBSD 4.99.70 (DNS323) #1: Mon Jul 28 17:05:56 UTC 2008
luasi@tbox:/usr/obj/sys/arch/evbarm/compile/DNS323
total memory = 65536 KB
avail memory = 60644 KB
timecounter: Timecounters tick every 10.000 msec
mainbus0 (root)
cpu0 at mainbus0: ARM926EJ-S rev 0 (ARM9EJ-S core)
cpu0: DC enabled IC enabled WB enabled EABT branch prediction enabled
cpu0: 32KB/32B 1-way Instruction cache
cpu0: 32KB/32B 1-way write-back-locking-C Data cache
orion0 at mainbus0: Marvell MV88F5182 SoC Rev. A0 Orion1
orion0: CPU Clock 500.000 MHz SysClock 166.666 MHz TClock 166.664 MHz
oriontmr0 at orion0 addr 0xf1020300-0xf10203ff: Marvell Orion Timer
timecounter: Timecounter "oriontmr" frequency 0 Hz quality 100
oriongpp0 at orion0 addr 0xf1010100-0xf10101ff: Marvell Orion General Purpose I/O Port Interface
oriongpp0: Data Out: 0x00000006
oriongpp0: Data Out Enable Control: 0x0000c6c1
oriongpp0: Data Blink Enable: 0x00000010
oriongpp0: Data In Polarity: 0x00000000
oriongpp0: Data In: 0x000006d7
oriongpp0: Data Interrupt Cause: 0x00000000
oriongpp0: Data Interrupt Mask: 0x00000000
oriongpp0: Data Interrupt Level Mask: 0x00000000
com0 at orion0 addr 0xf1012000-0xf101201f irq 3: ns16550a, working fifo
com0: console
mvsata0 at orion0 addr 0xf1080000-0xf1085fff irq 29: Marvell Serial-ATA Host Controller (SATAHC)
mvsata0: GenIIe, 1hc, 2port/hc
atabus0 at mvsata0 channel 0
atabus1 at mvsata0 channel 1
ehci0 at orion0 addr 0xf1050000-0xf1051fff irq 17: Marvell Orion USB 2.0 Interface
ehci0: EHCI version 1.0
usb0 at ehci0: USB revision 2.0
ehci1 at orion0 addr 0xf10a0000-0xf10a1fff irq 12: Marvell Orion USB 2.0 Interface
ehci1: EHCI version 1.0
usb1 at ehci1: USB revision 2.0
orionpex0 at orion0 addr 0xf1040000-0xf1041fff irq 11: Marvell Orion PCI Express Interface
pci0 at orionpex0
pci0: i/o space, memory space enabled
vendor 0x11ab product 0x5182 (miscellaneous memory, revision 0x02) at pci0 dev 0 function 0 not configured
oriongbe0 at orion0 addr 0xf1072000-0xf1073fff: Marvell Orion Gigabit Ethernet Controller
oriongbe0: Ethernet address 00:00:00:00:00:00
makphy0 at oriongbe0 phy 8: Marvell 88E1111 Gigabit PHY, rev. 2
makphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
oriontwsi0 at orion0 addr 0xf1011000-0xf101101f irq 5: Orion TWSI controller
iic0 at oriontwsi0: I2C bus
rs5c372rtc0 at iic0 addr 0x32: RICOH RS5C372[AB] Real-time Clock
oriontwsi_check_status: 18 != 20
rs5c372rtc0: rs5c372rtc_reg_write: failed to write reg15
oriontwsi_check_status: 18 != 20
rs5c372rtc0: rs5c372rtc_reg_write: failed to write reg14
m41t80rtc0 at iic0 addr 0x68: M41T80 Real-time Clock
todr_attach: TOD already configured
g760a0 at iic0 addr 0x3e: G760A Fan Controller
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
uhub0 at usb0: vendor 0x0000 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub0: 1 port with 1 removable, self powered
uhub1 at usb1: vendor 0x0000 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub1: 1 port with 1 removable, self powered
mvsata0 port 0: device present, speed: 3.0Gb/s
wd0 at atabus0 drive 0:
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 465 GB, 969021 cyl, 16 head, 63 sec, 512 bytes/sect x 976773168 sectors
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd0(mvsata0:0:0): using PIO mode 4
boot device:
root on wd0a dumps on wd0b
oriontwsi_check_status: 18 != 20
rs5c372rtc0: rs5c372rtc_clock_read: failed to read rtc
WARNING: preposterous TOD clock time
WARNING: using filesystem time
WARNING: CHECK AND RESET THE DATE!

Installing a NetBSD kernel on DNS 323

THIS WILL ERASE YOUR LINUX FIRMWARE AND BRICK YOUR DNS 323.

To install a NetBSD kernel permanently in flash, I create a Linux ramdisk with a load address and entry point identical to that of the linux kernel. Instead of a linux filesystem, this image contains a NetBSD kernel. Here is the mkimage command that I used on my box:

mkimage -A arm -O linux -T ramdisk -C none -a 0x00008000 -e 0x00008000 -n "NetBSD kernel" -d /usr/src/sys/arch/evbarm/compile/obj/DNS323/netbsd.bin dns323.img

The following u-boot command will replace the ramdisk with dns323.img permanently. If you brick your device it is your fault 100% of the time. THIS WILL ERASE YOUR LINUX FIRMWARE AND BRICK YOUR DNS 323.

Marvell>>
Marvell>>
Marvell>> loadb r

You will have to use kermit to upload the dns323.img at this point.

At boot time u-boot loads the linux kernel and then overwrites it with the NetBSD kernel. When u-boot jumps into the entry point, NetBSD is started. I have captured the boot process below.

** LOADER **
** MARVELL BOARD: RD-88F5182-NAS-2 LE

U-Boot 1.1.1 (Oct 12 2007 - 17:19:14) Marvell version: 1.7.3.001

DRAM CS[0] base 0x00000000 size 64MB
DRAM Total size 64MB
[8192kB@ff800000] Flash: 8 MB
Load Address: 00008000
Entry Point: 00008000

Addresses 20M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (20M - 16M): Done
*** Warning - bad CRC, using default environment


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


USB 0: host mode
USB 1: host mode
PCI 0: PCI Express Root Complex Interface
PCI 1: Conventional PCI, speed = 33000000
Hit any key to stop autoboot: 3 ^H^H^H 2 ^H^H^H 1 ^H^H^H 0
## Booting image at ff820000 ...
Image Name: Linux-2.6.12.6-arm1
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1426600 Bytes = 1.4 MB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
OK
## Loading Ramdisk Image at ff9a0000 ...
Image Name: NetBSD kernel
Image Type: ARM Linux RAMDisk Image (uncompressed) Data Size: 2690748 Bytes = 2.6 MB
Load Address: 00008000
Entry Point: 00008000

Verifying Checksum ... OK

Starting kernel ...