View source for U-Boot commands
From Openmoko
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Templates used on this page:
Return to U-Boot commands.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Templates used on this page:
Return to U-Boot commands.
![]() |
Languages: |
English • العربية • Български • Česky • Dansk • Deutsch • Esperanto • Eesti • Español • فارسی • Suomi • Français • עברית • Magyar • Italiano • 한국어 • Nederlands • Norsk (bokmål) • Polski • Português • Română • Русский • Svenska • Slovenčina • Українська • 中文(中国大陆) • 中文(台灣) • Euskara • Català |
Various tasks are performed with bootloader commands. On the U-Boot console, you can list the available commands with "help", and get more information about each command with "help command".
Auto-boot executes the command[s] specified in the bootcmd environment variable. The default configuration is:
GTA01Bv3 # printenv bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000
This basically tells us that it will load the content of the NAND partition kernel to memory address 0x32000000 and then try to boot it.
u-boot is configured to manage a non-volatile environment that is stored in the NAND flash partition named "u-boot_env". u-boot itself gets the location from OOB. You have commands to display, alter, and store the environment.
This displays all definitions in the current environment:
GTA01Bv2 # printenv baudrate=115200 bootargs=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416 usbtty=cdc_acm bootdelay=10 stdout=serial stderr=serial stdin=serial mtdparts=mtdparts=neo1973-nand:0x00030000(u-boot),0x0000c000(u-boot_env),0x00200000(kernel),0x00130000(splash),0x03c94000(rootfs) mtdids=nand0=neo1973-nand bootargs_base=rootfstype=jffs2 root=/dev/mtdblock4 console=ttySAC0,115200 console=tty0 loglevel=8 dyntick=enable lpj=252416 bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000 pcf50606_int1=0x40 filesize=160C000 partition=nand0,0 mtddevnum=0 mtddevname=u-boot Environment size: 670/16380 bytes GTA01Bv2 #
The following example shows how to manipulate an individual definition, and store the updated environment in flash:
GTA01Bv3 # setenv bootdelay 10 GTA01Bv3 # printenv bootdelay bootdelay=10 GTA01Bv3 # saveenv Saving Environment to NAND... Erasing Nand...Writing to Nand... done GTA01Bv3 #
You should escape ';', '$' by '\' and replace first occurence of '=' with ' ' on each line.
setenv bootcmd setenv bootargs \${bootargs} \${mtdparts}\; nand read.e 0x32000000 kernel 0x300000\; bootm 0x32000000
in order to initialize a MMC/SD card, you have to use the ``mmcinit command.
GTA01Bv3 # mmcinit trying to detect SD Card... MMC found. Card desciption is: Manufacturer ID = 58d564 HW/FW Revision = 3 8 Product Name = 21DN!@X� Serial Number = 445303 Month = 5 Year = 2000 READ_BL_LEN=15, C_SIZE_MULT=7, C_SIZE=3197 size = 4208984064 GTA01Bv3 #
afterwards, you can read ext2 filesystems like:
GTA01Bv3 # ext2ls mmc 0 <DIR> 1024 . <DIR> 1024 .. <DIR> 12288 lost+found 1544788 uImage
GTA01Bv3 # help nand nand info - show available NAND devices nand device [dev] - show or set current device nand read[.jffs2] - addr off size nand write[.jffs2] - addr off size - read/write `size' bytes starting at offset `off' to/from memory address `addr' nand erase [clean] [off size] - erase `size' bytes from offset `off' (entire device if not specified) nand bad - show bad blocks nand dump[.oob] off - dump page nand scrub - really clean NAND erasing bad blocks (UNSAFE) nand markbad off - mark bad block at offset (UNSAFE) nand biterr off - make a bit error at offset (UNSAFE)
GTA01Bv3 # nand read 0x32000000 kernel NAND read: device 0 offset 212992, size 2097152 ... 2097152 bytes read: OK GTA01Bv3 # bootm 0x32000000 ## Booting image at 32000000 ... Image Name: Openmoko Kernel Image Neo1973 Created: 2007-02-15 23:54:18 UTC Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 1546258 Bytes = 1.5 MB Load Address: 30008000 Entry Point: 30008000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK Starting kernel ...
The following set of commands loads the file u-boot.bin from ext2/mmc and flashes it into the bootloader flash partition:
GTA01Bv3 # ext2load mmc 0 0x32000000 u-boot.bin GTA01Bv3 # nand erase u-boot GTA01Bv3 # nand write.e 0x32000000 u-boot ${filesize}
The following set of commands loads the file uImage from ext2/mmc and flashes it into the kernel flash partition:
GTA01Bv3 # ext2load mmc 0 0x32000000 uImage GTA01Bv3 # nand erase kernel GTA01Bv3 # nand write.e 0x32000000 kernel ${filesize}
The following set of commands loads the file rootfs.jffs2 from ext2/mmc and flashes it into the rootfs flash partition:
GTA01Bv3 # ext2load mmc 0 0x32000000 rootfs.jffs2 GTA01Bv3 # nand erase rootfs GTA01Bv3 # nand write.e 0x32000000 rootfs ${filesize}
Please note that this will only work with root file system sizes that are smaller than the amount of memory above 0x32000000, which in the case of 64MB SDRAM is something like 32MB. Warning: you risk bricking your phone if you attempt to read in too large a file as extload appears to write the overflow into dangerous parts of memory address space.
Our version of u-boot supports a couple of Neo1973 specific commands:
GTA01Bv4 # help neo1973 neo1973 neo1973 info - display phone information neo1973 power-off - switch off the phone neo1973 charger status - display charger status neo1973 charger autofast - enable automatic fast (500mA) charging neo1973 charger !autofast - disable automatic fast (500mA) charging neo1973 charger fast - enable fast (500mA) charging neo1973 charger off - disable charging neo1973 backlight (on|off) - switch backlight on or off neo1973 led num (on|off) - switch LED number 'num' on or off neo1973 vibrator (on|off) - switch vibrator on or off neo1973 gsm (on|off|version) - switch GSM Modem on/off or print firmware version neo1973 gps (on|off) - switch GPS system on or off neo1973 udc pullup (on|off) - switch USB device controller pull-up on or off
Using GTA01Bv4 # neo1973 info FIC Neo1973 Hardware Revision 0x0240 GTA01Bv4 #
you can display hardware reference and revision
Using neo1973 power-off
you can switch the device off from the bootloader prompt.
For a detailed description of the charger basics, see Neo1973 Battery Charger.
You can get the current charger status by issuing neo1973 charger status
The following modes are possible:
You can disable battery charging (until the next reboot) by issuing neo1973 charger off
Using neo1973 charger fast you can force the PMU to try to do a fast (500mA) charge of the battery. It will abort if the battery is in over temperature or some other error condition occurs.
The following commands will add a boot menu entry that switches to fast charging and turns off the backlight:
setenv menu_6 Fast-Charge and Backlight Off: neo1973 charger fast\; neo1973 backlight off saveenv
While in this state, your Neo1973 can be charged with a generic USB charger. You also need to set
setenv boot_menu_timeout 65000 saveenv
to keep it from powering down, though.
Autofast is a feature of the PCF50606 PMU. It means that the fast_cccv mode will be automatically selected if a charger with suitable voltage is plugged in, and the battery not in over temperature condition.
WARNING: This is potentially dangerous. Only enable autofast if you ARE SURE that you can draw 500mA from the USB connector. This is the case with a wall outlet charger, or if you are attached to a self-powered hub or a desktop PC root hub. Bus powered hubs and some laptops only provide 100mA on their USB ports and can thus not support fast charging |
You can enable or disable autofast by
neo1973 charger autofast
and
neo1973 charger !autofast
respectively.
You can switch the backlight on and off by using neo1973 backlight on and neo1973 backlight off respectively.
You can switch the vibrator on and off by using neo1973 vibrator on and neo1973 vibrator off respectively.
Starting with Openmoko patchset SVN revision 2885, u-boot contains support for powering the GSM modem, and even accessing the modem from the console.
You can switch the GSM modem on and off by using neo1973 gsm on and neo1973 gsm off respectively.
You can access the GSM modem using openmoko's built-in terminal emulator in u-boot.
The following example demonstrates how:
GTA01Bv4 # neo1973 gsm on GTA01Bv4 # terminal serial switching s3ser0 from console into GSM mode Entering terminal mode for port serial Use '~.' to leave the terminal and get back to u-boot ATE1 OK AT+CGMI? ERROR AT+CGMI FIC OK AT+CGMR GTA01Bv4 OK ~[u-boot]~. switched s3ser0 from GSM mode back into console mode GTA01Bv4 # neo1973 gsm off GTA01Bv4 #
NOTE: If you're using the cu terminal emulator on your host PC to access u-boot, you have
to press '~' twice in order to escape it and make sure it actually gets sent to the Neo! |
GTA01Bv2 # help s3c2410 s3c2410 speed get - display current PLL speed config s3c2410 speed list - display supporte PLL speed configs s3c2410 speed set - set PLL speed GTA01Bv2 # s3c2410 speed list 50 MHz 101 MHz 202 MHz 266 MHz GTA01Bv2 # s3c2410 speed get FCLK = 202 MHz, HCLK = 101 MHz, PCLK = 50 MHz GTA01Bv2 # s3c2410 speed set 101 GTA01Bv2 # s3c2410 speed get FCLK = 101 MHz, HCLK = 50 MHz, PCLK = 50 MHz
You can re-configure the S3C2410 PLL to generate a 266 MHz core cpu clock (rather than the 200MHz default) by using GTA01Bv2 # s3c2410 speed set 266 and GTA01Bv2 # s3c2410 speed set 202 respectively.
WARNING: The old hardware (Phase 0 - GTA01Bv3) only runs stable at 266MHz if you do not attach anything (esp. the FPC / Debug Board to the Debug Port |
NOTE: New U-Boot (at least the svn3817 I use at now) use a new command 'S3C24xx', I assume for consistency when using GTA02 |
The QT2410 cs8900a Ethernet can be used to download images via network.
First, you have to make sure that ipaddr, serverip, ethaddr and netmask are set correctly in the environment:
QT2410 # printenv ethaddr=00:01:02:03:04:05 netmask=255.255.255.0 ipaddr=192.168.100.100 serverip=192.168.100.1
QT2410 # tftpboot 0x32000000 *** Warning: no boot file name; using 'C0A86464.img' TFTP from server 192.168.100.1; our IP address is 192.168.100.100 Filename 'C0A86464.img'. Load address: 0x32000000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ########################################## done Bytes transferred = 1544788 (179254 hex)
you can then commence booting via
QT2410# bootm 0x32000000