„Das U-Boot“ ist ein Bootloader auf dem NGW100, der nach einem Reset automatisch aufgerufen wird. Der Controller springt bei einem Reset an Adresse 0x00000000, ab der auch das Flash gemappt ist.
Mit U-Boot lassen sich neue Images in den Flash-Speicher des NGW100 übertragen. So kann zum Beispiel das Linux-Image gelöscht oder gepatcht werden. Die Dokumentation zu U-Boot beschreibt die unterstützten Befehle. Das U-Boot des NGW100 enthält allerdings noch zusätzliche Kommandos, so z. B. Funktionen zum Initialisieren der SD-Karte und zum Zugriff auf ext2-Dateisysteme. Daher ist es nützlich, nach dem U-Boot-Prompt „help“ einzugeben, um die Befehle der aktuellen Bootloader-Version kennen zu lernen.
Das Schöne ist, dass man durch drücken der Leertaste direkt Zugriff auf den Bootloader des Boards erhält. <!— Mit U-Boot hat man die Möglichkeit, den Flash-Bereich des Bootloaders und damit das U-Boot selbst zu löschen. Daher ist es wichtig, sich mit dem Speichermapping des Boards vertraut zu machen. Als Beispiel enthält das AVRFreaks Wiki eine Anleitung, wie man den Flash-Speicher mit U-Boot schreiben kann.—>
<!— Hier noch ein paar Informationen zum JFFS2 Journalling Flash File System, version 2. Die Flash-Bausteine werden als sogenannte Memory Technology Devices (MTD) vom Betriebssystem behandelt. Eine FAQ zum Troubleshooting und zur generellen Anwendung ist hier zu finden.—>
? - alias for 'help' askenv - get environment variables from stdin base - print or set address offset bdinfo - print Board Info structure boot - boot default, i.e., run 'bootcmd' bootd - boot default, i.e., run 'bootcmd' bootm - boot application image from memory bootp - boot image via network using BootP/TFTP protocol cmp - memory compare coninfo - print console devices and information cp - memory copy crc32 - checksum calculation dhcp - invoke DHCP client to obtain IP/boot params echo - echo args to console erase - erase FLASH memory ext2load- load binary file from a Ext2 filesystem ext2ls - list files in a directory (default /) flinfo - print FLASH memory information fsinfo - print information about filesystems fsload - load binary file from a filesystem image go - start application at address 'addr' help - print online help loadb - load binary file over serial line (kermit mode) loads - load S-Record file over serial line loop - infinite loop on address range ls - list files in a directory (default /) md - memory display mm - memory modify (auto-incrementing) mmcinit - init mmc card mtest - simple RAM test mw - memory write (fill) nm - memory modify (constant address) printenv- print environment variables protect - enable or disable FLASH write protection rarpboot- boot image via network using RARP/TFTP protocol reset - Perform RESET of the CPU run - run commands in an environment variable saveenv - save environment variables to persistent storage setenv - set environment variables sleep - delay execution for some time tftpboot- boot image via network using TFTP protocol version - print monitor version
Diese Parameter werden angezeigt wenn man in U-Boot den Befehl printenv ausführt
Uboot> printenv baudrate=115200 ethaddr=00:04:25:1C:53:6C bootdelay=1 ethact=macb0 serverip=192.168.0.106 tftpip=192.168.0.106 eth1addr=00:04:25:1C:53:6D bootargs=console=ttyS0 root=/dev/mtdblock1 rootfstype=jffs2 bootcmd=fsload;bootm stdin=serial stdout=serial stderr=serial
Diese Dateien und Verzeichnisse sollten zu sehen sein wenn man in U-Boot den Befehl ls ausführt
Uboot> ls Scanning JFFS2 FS: ....... done. drwxr-xr-x 0 Fri Dec 15 10:07:40 2006 bin drwxr-xr-x 0 Wed Dec 13 09:29:25 2006 config drwxr-xr-x 0 Thu Dec 14 10:54:05 2006 dev drwxr-xr-x 0 Wed Feb 21 12:53:02 2007 etc drwxr-xr-x 0 Wed Dec 13 09:29:25 2006 home drwxr-xr-x 0 Wed Dec 13 14:17:25 2006 lib lrwxrwxrwx 11 Wed Feb 21 12:30:01 2007 linuxrc -> bin/busybox drwxr-xr-x 0 Wed Dec 13 09:29:25 2006 media drwxr-xr-x 0 Wed Dec 13 09:29:25 2006 mnt drwxr-xr-x 0 Wed Dec 13 09:29:25 2006 proc drwxr-xr-x 0 Fri Jan 19 13:46:48 2007 sbin drwxr-xr-x 0 Wed Dec 13 09:29:25 2006 sys drwxrwxrwt 0 Wed Dec 13 09:29:25 2006 tmp -rw-r--r-- 905936 Wed Feb 21 13:51:55 2007 uImage drwxr-xr-x 0 Wed Feb 21 14:41:10 2007 usr drwxr-xr-x 0 Tue Jan 30 13:53:14 2007 var drwxr-xr-x 0 Tue Jan 30 09:34:59 2007 www Uboot>
Das NGW bringt bei einem fabrikneuen Board folgende Bootmelungen über die serielle Schnittstelle (WAN nicht angeschlossen, LAN an einem Router)
U-Boot 1.1.4-at0 (Jan 3 2007 - 10:30:09)
U-Boot code: 00000000 -> 000144f7 data: 24000000 -> 24002d80
SDRAM: 32 MB at address 0x10000000
Testing SDRAM...OK
malloc: Using memory from 0x11fc0000 to 0x12000000
Flash: 8 MB at address 0x00000000
DRAM Configuration:
Bank #0: 10000000 32 MB
In: serial
Out: serial
Err: serial
Net: macb0, macb1
Press SPACE to abort autoboot in 1 seconds
\- JFFS2 loading 'uImage' to 0x10200000
Scanning JFFS2 FS: ........ done.
\- JFFS2 load complete: 905936 bytes loaded to 0x10200000
\- Booting image at 10200000 ...
Image Name: Linux-2.6.18-at0
Image Type: AVR32 Linux Kernel Image (gzip compressed)
Data Size: 905872 Bytes = 884.6 kB
Load Address: 10000000
Entry Point: 90000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting kernel at 90000000 (params at 11fc0040)...
pdc pdc.0: Atmel Peripheral DMA Controller enabled
EIM: External Interrupt Module at 0xfff00000, IRQ 19
EIM: Handling 4 external IRQs, starting with IRQ 64
smc smc.0: Atmel Static Memory Controller at 0xfff03400
pio0: Atmel Port Multiplexer at 0xffe02800 (irq 13)
pio0: Handling 32 external IRQs, starting with IRQ 96
pio1: Atmel Port Multiplexer at 0xffe02c00 (irq 14)
pio1: Handling 32 external IRQs, starting with IRQ 128
pio2: Atmel Port Multiplexer at 0xffe03000 (irq 15)
pio2: Handling 32 external IRQs, starting with IRQ 160
pio3: Atmel Port Multiplexer at 0xffe03400 (irq 16)
pio3: Handling 32 external IRQs, starting with IRQ 192
pio4: Atmel Port Multiplexer at 0xffe03800 (irq 17)
pio4: Handling 32 external IRQs, starting with IRQ 224
dmac0: DesignWare DMA controller at 0xff200000 irq 2
NET: Registered protocol family 2
IP route cache hash table entries: 256 (order: -2, 1024 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler cfq registered (default)
Serial: Atmel USART3 driver
usart.1: ttyS0 at MMIO 0xffe01000 (irq = 7) is a USART3
loop: loaded (max 8 devices)
eth0: Atmel MACB at 0xfff01800 irq 25 (00:04:25:1c:53:6c)
eth1: Atmel MACB at 0xfff01c00 irq 26 (00:04:25:1c:53:6d)
physmap platform flash device: 00800000 at 00000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
Amd/Fujitsu Extended Query Table at 0x0041
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 3 MTD partitions on "physmap-flash.0":
0x00000000-0x00020000 : "u-boot"
0x00020000-0x007f0000 : "root"
0x007f0000-0x00800000 : "env"
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xffe00000 (irq 3)
mtd_dataflash spi0.0: AT45DB642x (8448 KBytes)
ip_conntrack version 2.4 (256 buckets, 2048 max) - 204 bytes per conntrack
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Time: avr32 clocksource has been installed.
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 56K (90000000 - 9000e000)
init started: BusyBox v1.2.2 (2006.12.13-14:13+0000) multi-call binary
* mounting virtual filesystems: /proc /sys /dev/pts /dev/shm /config /var/log /var/log/samba /var/log/ntpstats /tmp
* setting hostname ... 'ngw.example.net'
* network loopback ... [[|OK ]]
* starting syslogd ... [[|OK ]]
* log messages to syslog ... [[|OK ]]
* starting klogd ... [[|OK ]]
* set mdev hotplug ... [[|OK ]]
* mdev ... [[|OK ]]
* probing modules ... vfat loaded, mmc_block loaded, atmel-mci loaded, [[|OK ]]
* mounting filesystems: /usr
* setup eth0 ... [[|STATIC ]] (10.11.12.1)
* setup eth1 ... [[|OK ]]
* network ... [[|OK ]]
* starting telnetd ... [[|OK ]]
* enable ipv4 forwarding ... [[|OK ]]
* iptables postrouting ... [[|OK ]]
* iptables incoming trafic ... [[|OK ]]
* iptables outgoung trafic ... [[|OK ]]
* starting dnsmasq ... [[|OK ]]
* running ntpdate ... [[|FAILED ]]
* starting dropbear ... [[|OK ]]
* starting inted ... [[|OK ]]
* starting nmbd ... [[|OK ]]
* starting smbd ... [[|OK ]]
* starting winbindd ... [[|OK ]]
* starting httpd ... [[|OK ]]
* get board type for GPIO ... 'NGW'
* setup GPIO boot LED ... [[|OK ]]
* setup GPIO LED A ... [[|OK ]]
* setup GPIO LED B ... [[|OK ]]
Network Gateway ready
BusyBox v1.2.2 (2006.12.13-14:13+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
~ #
Diskussion
I have extacly what info I want. Check, please. Wait, it's free? Awesome!
Dude, right on there brteohr.
I really wish there were more aritcels like this on the web.