Mini2440 NetBSD Howto
Kernel Output
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 5.99.64 (MINI2440) #22: Mon Feb 6 21:29:36 CET 2012 pf@pf-desktop:/usr/local/src/netbsd-current/obj/sys/arch/evbarm/compile/MINI2440 total memory = 65536 KB avail memory = 60176 KB mainbus0 (root) cpu0 at mainbus0: ARM920T rev 0 (ARM9TDMI core) cpu0: DC enabled IC enabled WB enabled EABT cpu0: 16KB/32B 64-way Instruction cache cpu0: 16KB/32B 64-way write-back-locking-A Data cache ssio0 at mainbus0: fclk 405 MHz hclk 101 MHz pclk 50 MHz ohci0 at ssio0 intr 26 ohci0: OHCI version 1.0 usb0 at ohci0: USB revision 1.0 sscom0 at ssisscom0: console (major=104) ssextio0 at ssio0 dme0 at ssextio0 addr 0x20000300 intr 7 lcd0 at ssio0 wsdisplay0 at lcd0 lcd0: Allocating LCD frame buffer of size 153600 sssdi0 at ssio0 sdmmc0 at sssdi0 ssiis0 at ssio0 udassio0 at ssiis0 audio0 at udassio0: half duplex, playback, capture sstouch0 at ssio0 wsmouse0 at sstouch0 mux 0 ssrtc0 at ssio0: RTC clock: hz=100 stathz = 64 PCLK=50625000 prescaler=2 tc=24719 uhub0 at usb0: Samsung OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 ld0 at sdmmc0: < > ld0: 1962 MB, 996 cyl, 64 head, 63 sec, 512 bytes/sect x 4019200 sectors ld0: 4-bit width, bus clock 25.000 MHz boot device: ld0 root on ld0a dumps on ld0b root file system type: ffs
Network Install to SD-card
In order to install the NetBSD MINI2440 on an SD-card follow the steps below. These instructions assume that DHCP is used to configure IPv4 addresses, and that a TFTP server is running at 10.0.0.1. All binary files needed can either be build directly from the CVS repository or obtained from the daily snapshot directory at nyftp.netbsd.org (use newest with evbarm in pub/NetBSD-daily/HEAD).
- The dhcp-server must be configured with a proper “next-server” option, as in the following example /etc/dhcpd.conf:
host mini2440 {
hardware ethernet 08:08:11:18:12:27;
fixed-address 10.0.0.20;
next-server 10.0.0.1;
} - TFTP must be setup, such that the bootmini2440-bootloader and netbsd-MINI2440_INSTALL kernel are downloadable:
- a. Start TFTP service by uncommenting “'#tftp" line in /etc/inetd.conf, and restart inetd invoking '/etc/rc.d/inetd restart'
- b. Populate the TFTP-directory (usually /tftpboot) with two files:
1. bootmini2440 found at evbarm/installation/ directory of ISO image.
Make sure to have READ permission for files, or TFTP daemon will not be able to serve them to the MINI2440-board.
2. netbsd-MINI2440_INSTALL found at evbarm/installation/instkernel/ directory as netbsd-MINI2440_INSTALL.gz. gunzip it and copy it to the TFTp-directory as netbsd-MINI2440_INSTALL.
- From the U-Boot prompt, request an address via DHCP with autoloading disabled:
MINI2440 # setenv autoload n
‘printenv’ can be used to see the settings obtained from the DHCP request:
U-Boot> dhcp
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 10.0.0.20autoload=n
gatewayip=10.0.0.1
netmask=255.255.255.0
rootpath=/export/mini2440
ipaddr=10.0.0.20
serverip=10.0.0.1
dnsip=10.0.0.1 - Load "bootmini2440" at address 0x30a00000 over tftp by utilizing U-Boots tftp capabilities:
U-Boot> tftp 30a00000 bootmini2440
- Launch the bootmini2440-bootloader and ask it to fetch the install image over the network:
U-Boot> go 30a00000 tftp:netbsd-MINI2440_INSTALL
- The installer should now launch.
- When the distribution-selection screen shows, select "d: Custom installation". Select "e: Kernel (MINI2440)" and continue installation.
- Setup the disk-partitioning as desired and continue installation.
Please note, that SD-cards do not behave as regular harddrive. In order to get the best performance, care should be taken that partitions start on 8192-byte boundaries and end at them. Also, it is adviced that the block size of UFS is set to 8192 (other values might be more optimal). For more details see [1].
In order to avoid loading bootmini2440 over the network, or store it in NAND, it might be a good idea to have a FAT-partition on the SD-card which can be accessed by U-Boot. - Choose "HTTP" as installation source, configuring the dme0 manually if needed.
- A local server can be used as source,or the releng server can be used:
Host: nyftp.netbsd.org
Base directory: pub/NetBSD-daily/HEAD/201202011750Z/ - Once installation completes, bootmini2440 is again loaded over the network:
U-Boot> nfs 30a00000 tftp:bootmini2440
- The NetBSD system is then booted from the SD-card:
U-Boot> go 30a00000 ld0a:netbsd
Setup as Diskless Node
It is possible to run MINI2440 as an NFS diskless node. In that case a root-directory for the MINI2440 is create on a server, and exported via NFS.In this example /export/mini2440 is exported, and will be mounted as root file system by the MINI2440.
- First, /export/mini2440 needs to be exported, this is done by having the following line in /etc/exports:
/export/mini2440 -maproot=0
- Restart the NFS-server:
# /etc/rc.d/mountd restart
- Two files, base.tgz and etc.tgz, are to be inflated at the NFS exported directory. These files are found at evbarm/binary/sets/ directory of ISO image.
- Run MAKEDEV script to populate dev/ directory:
# cd /export/mini2440/dev
# sh ./MAKEDEV all - Gunzip netbsd-MINI2440.gz, found in evbarm/binary/kernel/, and copy it as "netbsd" to the NFS exported directory.
- From the U-Boot prompt, request an address via DHCP with autoloading disabled:
U-Boot> setenv autoload n
U-Boot> dhcp - Run TFTP to load bootmini2440 and starts NetBSD kernel
U-Boot> tftp 30a00000 bootmini2440
bootmini2440 loads NetBSD kernel with NFS protocol.
dm9000 i/o: 0x20000300, id: 0x90000a46
DM9000: running in 16 bit mode
MAC: 08:08:11:18:12:27
TFTP from server 192.168.24.24; our IP address is 192.168.24.69
Filename 'bootmini2440'.
Load address: 0x30a00000
Loading: T #########
done<
Bytes transferred = 117628 (1cb7c hex)
U-Boot> go 30a00000 nfs:netbsd
MINI2440 runs as NFS diskless node.
Enable second and third UARTs
The Mini2440 has three UARTs. By default only UART0 is used. UART 1 and 2 are supported, and can be used as consoles by performing the following procedures:
- Add two lines in /etc/ttys
sscom1 "/usr/libexec/getty std.115200" unknown on secure
sscom2 "/usr/libexec/getty std.115200" unknown on secure - Create two character devices
# /sbin/mknod /dev/sscom1 c 104 1
# /sbin/mknod /dev/sscom2 c 104 2 - Invoke getty(8) for them by running:
# kill -1 1
Run U-Boot without flashing it to NAND
U-Boot can be run from RAM, without flashing it into the boards NAND-memory. In order to do that power on the MINI2440 in NOR switch position (toward board edge).
Once the Mini2440 BIOS shows a prompt follow the following instructions:
[q] Goto shell of vivi [i] Version: 0945-2K
Enter your selection: q
Supervivi> load ram 0x31000000 242360 u
USB host is connected.
Waiting a download.
The decimal 242360 is the 'u-boot-256MB.bin' file size, which will be transfered via the USB cable by Windows DNW tool.
The u-boot image is ZIP'ed in u-boot_20100701.zip which can be found at http://www.friendlyarm.net/downloads. u-boot-256MB.bin is known ok for 1GB model as well as 128M model.
Now, U-Boot can be started:
Supervivi> go 0x31000000
Flashing U-Boot to NAND
Power on the MINI2440 in NOR switch position (toward board edge), and wait for prompt.As when running U-Boot from memory, the DNW-Windows tool is used to transfer the 'u-boot-256MB.bin'-file via USB to the MINI2440-board. This time no file size needs to be specified, and the file is written directly to NAND-flash:
[q] Goto shell of vivi [i] Version: 0945-2K
Enter your selection: q
Supervivi> load flash vivi u
USB host is connected.
Waiting a download.
Change the slide-switch to NAND position, and reset the board. A U-boot prompt is now displayed.
Modified: Mon 13-Feb-12 13:55:32 PST