GuruPlug U-Boot¶
GuruPlug Server Plus U-Boot Notes
u-boot Sources¶
- Marvell u-boot custodian repository: http://git.denx.de/?p=u-boot/u-boot-marvell.git;a=summary
git clone git://git.denx.de/u-boot-marvell.git u-boot-marvell.git
And patches to include/configs/guruplug.h
.
Note: you can download a suitable u-boot image below.
Compile¶
cd u-boot-marvell.git git checkout -b testing origin/testing make mrproper patch -p0 < .... make guruplug_config make u-boot.kwb
Installation¶
- PlugWiki:Reflashing_images_on_the_GuruPlug
- PlugWiki:Setting_Up_OpenOCD_Under_Linux
u-boot.kwb
on tftp server on another machine, that has also a rarpd running (Debian packagestftpd
ortftpd-hpa
,rarpd
, file/srv/tftp/u-boot.kwb
, and/etc/ethers
with the MAC and IP addresses of the plug)
Testing¶
hello_world¶
Test of the u-boot standalone example program:
rarp 0x0c100000 hello_world.bin go 0x0c100000 hello hello, good morning, good evening :-)
u-boot¶
You can load the u-boot image into RAM and run it using OpenOCD (you might need to rename the image file and put it in the correct place, see the guruplog_load_uboot
function in board/guruplug.cfg
):
./openocd -f ./board/guruplug.cfg -c init -c guruplug_load_uboot -c exit
Production¶
Now load the image using rarp/tftp and write the u-boot into the flash and reset the plug (see also doc/README.nand
):
rarp 0x6400000 u-boot.kwb nand erase 0x00000000 0x0100000 nand write 0x6400000 0x0000000 0x80000 reset
Alternatively you can use openocd to flash the image. I’d recommend to do that if you have a JTAG interface.
Downloads¶
And the binaries:
- guruplug-u-boot-flipflip-20101111.tar.gz (1.1MB) – u-boot for the GuruPlug with more features (includes my patch, and the image in various formats).
- this version can load stuff from ext2 partitions on a SD card in the plug’s internal SD card slot (see PlugForum:1642.30)!
Demo¶
Boot Screen¶
U-Boot 2010.09-02612-g27fb783-dirty (Nov 11 2010 - 22:51:37) Marvell-GuruPlug (-: flipflip's version 20101111 :-) SoC: Kirkwood 88F6281_A1 DRAM: 58 MiB NAND: 512 MiB In: serial Out: serial Err: serial Net: egiga0, egiga1 88E1121 Initialized on egiga0 88E1121 Initialized on egiga1 Hit any key to stop autoboot: 0
Commands¶
GuruPlug>> help ? - alias for 'help' 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 chpart - change active partition cmp - memory compare coninfo - print console devices and information cp - memory copy crc32 - checksum calculation dhcp - boot image via network using DHCP/TFTP protocol diskboot- boot from IDE device echo - echo args to console editenv - edit environment variable env - environment handling commands ext2load- load binary file from a Ext2 filesystem ext2ls - list files in a directory (default /) fatinfo - print information about filesystem fatload - load binary file from a dos filesystem fatls - list files in a directory (default /) fsinfo - print information about filesystems fsload - load binary file from a filesystem image go - start application at address 'addr' help - print command description/usage ide - IDE sub-system iminfo - print header information for application image imxtract- extract a part of a multi-image itest - return true/false on integer compare loadb - load binary file over serial line (kermit mode) loads - load S-Record file over serial line loady - load binary file over serial line (ymodem mode) loop - infinite loop on address range ls - list files in a directory (default /) md - memory display mii - MII utility commands mm - memory modify (auto-incrementing address) mtdparts- define flash/nand partitions mtest - simple RAM read/write test mw - memory write (fill) nand - NAND sub-system nboot - boot from NAND device nfs - boot image via network using NFS protocol nm - memory modify (constant address) ping - send ICMP ECHO_REQUEST to network host printenv- print environment variables 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 source - run script from memory tftpboot- boot image via network using TFTP protocol ubi - ubi commands ubifsload- load file from an UBIFS filesystem ubifsls - list files in a directory ubifsmount- mount UBIFS volume usb - USB sub-system usbboot - boot from USB device version - print monitor version
Load stuff from ext2 partitions¶
GuruPlug>> usb start (Re)start USB... USB: Register 10011 NbrPorts 1 USB EHCI 1.00 scanning bus for devices... 3 USB Device(s) found scanning bus for storage devices... Device NOT ready Request Sense returned 02 3A 00 2 Storage Device(s) found GuruPlug>> usb tree Device Tree: 1 Hub (480 Mb/s, 0mA) | u-boot EHCI Host Controller | +-2 Hub (480 Mb/s, 100mA) | USB2.0 Hub | +-3 Mass Storage (480 Mb/s, 500mA) USB Storage 000000009909 GuruPlug>> usb storage Device 0: Vendor: Generic Rev: 9909 Prod: STORAGE DEVICE Type: Removable Hard Disk Capacity: not available Device 1: Vendor: Generic Rev: 9909 Prod: STORAGE DEVICE Type: Removable Hard Disk Capacity: 7604.0 MB = 7.4 GB (15572992 x 512) GuruPlug>> usb part 1 Partition Map for USB device 1 -- Partition Type: DOS Partition Start Sector Num Sectors Type 1 22 525866 82 2 525888 2099328 83 3 2625216 2099328 83 4 4724544 10847232 83 GuruPlug>> ext2ls usb 1:4 /boot <DIR> 4096 . <DIR> 4096 .. 2041048 initrd.img-2.6.33.3flipflip.bak 991804 System.map-2.6.33.3flipflip 56727 config-2.6.33.3flipflip 2413524 initrd.img-2.6.33.3flipflip 1431196 vmlinuz-2.6.32-3-kirkwood 2561880 vmlinuz-2.6.33.3flipflip 84904 config-2.6.32-3-kirkwood 999932 System.map-2.6.32-3-kirkwood 84196 config-2.6.32-5-kirkwood 5420987 initrd.img-2.6.32-3-kirkwood 1432308 vmlinuz-2.6.32-5-kirkwood 1003079 System.map-2.6.32-5-kirkwood 5820997 initrd.img-2.6.32-5-kirkwood GuruPlug>> ext2load usb 1:4 0x01100000 /boot/initrd.img-2.6.33.3flipflip Loading file "/boot/initrd.img-2.6.33.3flipflip" from usb device 1:4 (usbdb4) 2413524 bytes read GuruPlug>> ext2load usb 1:4 0x00800000 /boot/vmlinuz-2.6.33.3flipflip Loading file "/boot/vmlinuz-2.6.33.3flipflip" from usb device 1:4 (usbdb4) 2561880 bytes read GuruPlug>> bootm 0x00800000 0x01100000
Note, the last command does not work because the initrd.img
and vmlinuz
must be converted to u-boot images using mkimage
so that one can actually boot them.