bc10-router/u-boot update

bc10 bc10-router

Updating u-boot

bc10-router uses the boot image for beagleboard of arago-project, and the version of its u-boot is u-boot-2012.04.01. The version of u-boot can be displayed as shown below.

PREFERRED_PROVIDER_virtual/bootloader = "u-boot"
UBOOT_MACHINE = "omap3_beagle_config"

This indicates that {HOME}/oe/arago/recipes/u-boot/u-boot_2012.04.01.bb is used for the build process. As {HOME}/oe/arago/recipes/u-boot/u-boot_2012.04.01.inc points out, the mainline of u-boot is downloaded form the master branch of repository, git://git.denx.de/u-boot.git, and several patches are applied for beagleboard. The patches, which are used here are listed below.

  • 0001-omap3_beagle-add-usbethaddr-setting-to-enable-networ.patch
  • 0001-OMAP3-Beagle-Set-BOOTDELAY-to-3.patch
  • 0002-am335x-am335x-am3517evm-beagleboard-am37x-Add-CONFIG_CMD_AS.patch
  • 0003-beagleboard-Load-uImage-from-VFAT-by-default.patch
  • 0004-beagleboard-Load-uImage-to-the-default-kernel-linux.patch
  • 0001-omap3_evm-Added-function-calls-to-set-volts-speed-on.patch
  • 0002-omap3evm-Make-the-board-start-at-800MHz.patch
  • 0003-beagleboard-Make-xM-rev-C-go-to-800MHz.patch

omap3_beagle_config is built by bitbake.
The patches shown above enable the mainline u-boot to have more functionalities then before. The patched one is capable of using tftpboot with USB-Ethernet adapter. However, the u-boot for ARM devices, which has recently been developed and available at http://git.denx.de/?p=u-boot/u-boot-arm.git, includes such functionalities, and this u-boot is now considered as the mainline.

Therefore, u-boot is going to be updated to u-boot-arm. This update of u-boot promises easier update of u-boot and kernel later on. To update u-boot, kernel is updated form 3.7, and the newer kernel can include DeviceTree that works with ARM architecture.

Caution) The repository of u-boot-arm has only two branches: master and next. Its Tag has not updated for 4 yeas, so it is very difficult to obtain a specific version of u-boot. To work wit a specific version of u-boot, select specific version of u-boot by Tag. The instruction of how to select a version of u-boot is shown later.

http://git.denx.de/u-boot.git/?p=u-boot.git;a=tags

How to update u-boot

This is how to update u-boot. The details are shown below.

Obtaining u-boot-arm from the repository

Obtain the source code of u-boot-arm from the repository.

$ git clone git://git.denx.de/u-boot-arm.git
$ cd u-boot-arm

Obtain u-boot from the respository

Obtain the 2012 version of u-boot from the repository.

$ git clone git://git.denx.de/u-boot.git
$ cd u-boot
$ git checkout refs/tags/v2012.10

After obtaining the source code, set up PATH to Cross Toolchain of ti-sdk-beagleboard-05.05.01.00. Then, execute config for beagleboard.

$ export PATH={HOME}/ti-sdk-beagleboard-05.05.01.00/linux-devkit/bin:$PATH
$ make CROSS_COMPILE=arm-arago-linux-gnueabi- mrproper
$ make CROSS_COMPILE=arm-arago-linux-gnueabi- omap3_beagle_config

Since the configuration for building beagleboard is completed, execute make to build.

$ make CROSS_COMPILE=arm-arago-linux-gnueabi-

Several files are built, yet only u-boot.img is used. Copy u-boot.img to FAT partition of a booting SD file. This is the end of updating process.

version

To apply the command below, the version of updated u-boot is checked.

# version

U-Boot 2012.10-12320-g39826f0 (Oct 22 2012 - 17:03:16)
arm-angstrom-linux-gnueabi-gcc (GCC) 4.5.4 20120305 (prerelease)
GNU ld (GNU Binutils) 2.20.1.20100303

u-boot commands

Updated the list of u-boot commands is shown below. This u-boot is capable of booting from tftpboot and nand of OMAP3.

# help
?       - 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
chpart  - change active partition
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dcache  - enable or disable data cache
dhcp    - boot image via network using DHCP/TFTP protocol
echo    - echo args to console
editenv - edit environment variable
env     - environment handling commands
exit    - exit script
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
false   - do nothing, unsuccessfully
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fdt     - flattened device tree utility commands
fsinfo  - print information about filesystems
fsload  - load binary file from a filesystem image
go      - start application at address 'addr'
gpio    - input/set/clear/toggle gpio pins
help    - print command description/usage
i2c     - I2C sub-system
icache  - enable or disable instruction cache
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
led     - led   - [0|1|green|all] [on|off|toggle]

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
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mtdparts- define flash/nand partitions
mtest   - simple RAM read/write test
mw      - memory write (fill)
nand    - NAND sub-system
nandecc - switch OMAP3 NAND ECC calculation algorithm
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
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
setexpr - set environment variable as the result of eval expression
showvar - print local hushshell variables
sleep   - delay execution for some time
source  - run script from memory
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
true    - do nothing, successfully
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version

The default environment variable of u-boot

The list of the pre-set environment variables for u-boot is shown below.
To use nEnv.txt, modify the configurations of environment variables.

# printenv
baudrate=115200
beaglerev=Cx
bootcmd=if mmc rescan ${mmcdev}; then if run userbutton; then setenv bootenv uEnv.txt;else setenv bootenv user.txt;fi;echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loaduimage; then run mmcboot;fi;fi;run nandboot;
bootdelay=3
bootenv=uEnv.txt
bootfile=uImage.beagle
buddy=none
camera=none
console=ttyO2,115200n8
defaultdisplay=dvi
dieid#=4ada00040000000004037b700d01401a
dvimode=640x480MR-16@60
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
loadaddr=0x80200000
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}
loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz
loaduimage=ext2load mmc ${mmcdev}:2 ${loadaddr} /boot/uImage
loaduimagefat=fatload mmc ${mmcdev} ${loadaddr} uImage
mmcargs=setenv bootargs console=${console} ${optargs} mpurate=${mpurate} buddy=${buddy} camera=${camera} vram=${vram} omapfb.mode=dvi:${dvimode} omapdss.def_disp=${defaultdisplay} root=${mmcroot} rootfstype=${mmcrootfstype}
mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr}
mmcdev=0
mmcroot=/dev/mmcblk0p2 rw
mmcrootfstype=ext3 rootwait
mpurate=auto
nandargs=setenv bootargs console=${console} ${optargs} mpurate=${mpurate} buddy=${buddy} camera=${camera} vram=${vram} omapfb.mode=dvi:${dvimode} omapdss.def_disp=${defaultdisplay} root=${nandroot} rootfstype=${nandrootfstype}
nandboot=echo Booting from nand ...; run nandargs; nand read ${loadaddr} 280000 400000; bootm ${loadaddr}
nandroot=ubi0:rootfs ubi.mtd=4
nandrootfstype=ubifs
ramargs=setenv bootargs console=${console} ${optargs} mpurate=${mpurate} buddy=${buddy} vram=${vram} omapfb.mode=dvi:${dvimode} omapdss.def_disp=${defaultdisplay} root=${ramroot} rootfstype=${ramrootfstype}
ramboot=echo Booting from ramdisk ...; run ramargs; bootm ${loadaddr}
ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=0x81000000,64M
ramrootfstype=ext2
rdaddr=0x81000000
usbtty=cdc_acm
userbutton=if gpio input 173; then run userbutton_xm; else run userbutton_nonxm; fi;
userbutton_nonxm=gpio input 7;
userbutton_xm=gpio input 4;
vram=12M

Environment size: 2283/131068 bytes

uEnv.txt

To set up uEnv.txt as shown below, bc10 will boot standardly as well as normally.

mmcroot=/dev/mmcblk0p2 rw
uenvcmd=run loaduimagefat; run mmcboot

As debugging Suspend/Resume and handing no_console_suspend to kernel as an option, uEnv is used as it is shown below.

console=ttyO2,115200n8
mpurate=auto
buddy=none
vram=12M
dvimode=640x480MR-16@60
defaultdisplay=dvi
loadaddr=0x80200000
mmcroot=/dev/mmcblk0p2 rw
mmcrootfstype=ext3 rootwait
mmcargs=setenv bootargs console=${console} ${optargs} mpurate=${mpurate} buddy=${buddy} camera=${camera} vram=${vram}  omapfb.mode=dvi:${dvimode} omapdss.def_disp=${defaultdisplay} root=${mmcroot} rootfstype=${mmcrootfstype} no_console_suspend
mmcboot=echo Booting from mmc (uEnv.txt configuration) ...; run mmcargs; bootm ${loadaddr}
loaduimagefat=fatload mmc ${mmcdev} ${loadaddr} uImage
uenvcmd=run loaduimagefat; run mmcboot

tftpboot

u-boot includes and handles OMAP EHC, which is done by linaro. This u-boot can deal with tftoboot, so it can handle a USB-Ethernet adapter.
Its details are written in the document, which is stored at the directory shown below.

u-boot-arm/doc/README.usb

The list of USB-Ethernet adapters, which work with tftpboot, is located at the directory of u-boot-arm/drivers/usb/eith/asx.c. Specifically, these USB-Ethernet adapters have to work with u-boot, which can handle tftpboot. The contents of the list suggest VernderID: ProductID.

static const struct asix_dongle const asix_dongles[] = {
        { 0x05ac, 0x1402, FLAG_TYPE_AX88772 },  /* Apple USB Ethernet Adapter */
        { 0x07d1, 0x3c05, FLAG_TYPE_AX88772 },  /* D-Link DUB-E100 H/W Ver B1 */
        /* Cables-to-Go USB Ethernet Adapter */
        { 0x0b95, 0x772a, FLAG_TYPE_AX88772 },
        { 0x0b95, 0x7720, FLAG_TYPE_AX88772 },  /* Trendnet TU2-ET100 V3.0R */
        { 0x0b95, 0x1720, FLAG_TYPE_AX88172 },  /* SMC */
        { 0x0db0, 0xa877, FLAG_TYPE_AX88772 },  /* MSI - ASIX 88772a */
        { 0x13b1, 0x0018, FLAG_TYPE_AX88172 },  /* Linksys 200M v2.1 */
        { 0x1557, 0x7720, FLAG_TYPE_AX88772 },  /* 0Q0 cable ethernet */
        /* DLink DUB-E100 H/W Ver B1 Alternate */
        { 0x2001, 0x3c05, FLAG_TYPE_AX88772 },
        /* ASIX 88772B */
        { 0x0b95, 0x772b, FLAG_TYPE_AX88772B | FLAG_EEPROM_MAC },
        { 0x0000, 0x0000, FLAG_NONE }   /* END - Do not remove */
};

As of January 2013, Buffalo LUA-U2-ATX is easily obtainable in Japan. This USB-Ethernet adapter works with tftpboot.
To check VenderID and ProductID, apply lsusb. Then, its output is displayed as it is shown below,

Bus 001 Device 004: ID 0b95:7720 ASIX Electronics Corp. AX88772

The details of how to build tftpboot is available at bc10-router/tftpboot.

Revision History

  • 2013-08-09 This article is initially published.

Front page   Edit Freeze Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   RSS of recent changes
Last-modified: 2013-08-09 (Fri) 11:22:43 (3913d)