U-boot environment
From AlwaysInnovating
Since 2010-09.a, u-boot environment variables are hard-coded in the u-boot binaries. There are not read any more from the NAND space. Therefore, the NAND space is entirely free and can be used for anything.
Default environment variables
The current hard-coded values are:
- bootargs: tbr=x quiet console=tty1 omapfb.mode=dvi:1024x600MR-16@60 omapfb.vrfb=1 omapfb.vram=0:8M,1:4M root=/dev/mmcblk0p2 rootdelay=1 rootfstype=ext3\0"
- bootcmd: mmc init; fatload mmc 0 0x82000000 uImage; bootm 0x82000000"
Note that u-boot replaces "tbr=x" by the proper value 2, 3 or 4:
- 2: Touch Book v1, board revision A1, B1
- 3: Touch Book v1, board revision C1
- 4: Touch Book v2 or Smart Book, board revision D4, D5, D6
This tbr is reads very early by the kernel to select the features corresponding to the right hardware.
Customized environment variables
If you want to have your own variables, you need to do at u-boot prompt:
nand erase setenv use_nand_env 1 setenv bootcmd "mmc init; fatload mmc 0 0x82000000 uImage; bootm 0x82000000" setenv bootargs "quiet console=tty1 omapfb.mode=dvi:1024x600MR-16@60 omapfb.vrfb=1 omapfb.vram=0:8M,1:4M root=/dev/mmcblk0p2 rootdelay=1 rootfstype=ext3"
The key aspect is to have use_nand_env so that u-boot knows it should use the variables on the nand.
You can also do it from AIOS:
flash_erase /dev/mtd2 fw_setenv use_nand_env 1 fw_setenv bootcmd "mmc init; fatload mmc 0 0x82000000 uImage; bootm 0x82000000" fw_setenv bootargs "quiet console=tty1 omapfb.mode=dvi:1024x600MR-16@60 omapfb.vrfb=1 omapfb.vram=0:8M,1:4M root=/dev/mmcblk0p2 rootdelay=1 rootfstype=ext3"
To initramfs or not to initramfs
If the power button is pressed during u-boot, the bootcmd is replaced "mmc init; fatload mmc 0 0x82000000 uImage2; bootm 0x82000000". This implies that uImage2 will be loaded instead of uImage. This bigger kernel (6MB instead of 2.7MB) has an embedded initramfs that will launches the multi-boot interface.
