十一、 系统引导指令
boot 和bootd 都是运行ENV”bootcmd”中指定的指令。
bootm 指令是专门用于启动在SDRAM中的用U-boot的mkimage工具处理过的内核映像。 格式:bootm [addr [arg ...]] addr 是内核映像所在的SDRAM中的地址 当启动的是Linux内核时,'arg' 可以使 initrd 的地址。
[u-boot@MINI2440]# setenv bootcmd tftp\;bootm [u-boot@MINI2440]# saveenv Saving Environment to NAND... Erasing Nand... Erasing at 0x6000000000002 -- 0% complete. Writing to Nand... done [u-boot@MINI2440]# boot dm9000 i/o: 0x20000300, id: 0x90000a46 DM9000: running in 16 bit mode MAC: 08:08:11:18:12:27 operating at 100M full duplex mode Using dm9000 device TFTP from server 192.168.1.100; our IP address is 192.168.1.101 Filename 'zImage.img'. Load address: 0x30008000 Loading: T ################################################################# ################################################################# ########################## done Bytes transferred = 2277540 (22c0a4 hex) ## Booting kernel from Legacy Image at 30008000 ... Image Name: tekkaman Created: 2010-03-29 12:59:51 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 2277476 Bytes = 2.2 MB Load Address: 30008000 Entry Point: 30008040 Verifying Checksum ... OK XIP Kernel Image ... OK OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel. Linux version 2.6.33.1 (tekkaman@MAGI-Linux) (gcc version 4.3.2(crosstool-NG-1.6.1-tekkaman) ) #5 Mon Mar 29 20:58:50 CST 2010 CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177 CPU: VIVT data cache, VIVT instruction cache Machine: MINI2440 (略)
U-Boot 2009.11 ( 4月 04 2010 - 12:09:25)
modified by tekkamanninja (tekkamanninja@163.com) Love Linux
I2C: ready DRAM: 64 MB Flash: 2 MB NAND: 128 MiB Video: 240x320x16 20kHz 62Hz In: serial Out: serial Err: serial Net: dm9000 U-Boot 2009.11 ( 4月 04 2010 - 12:09:25) modified by tekkamanninja (tekkamanninja@163.com) Love Linux Hit any key to stop autoboot: 0 [u-boot@MINI2440]# bootd dm9000 i/o: 0x20000300, id: 0x90000a46 DM9000: running in 16 bit mode MAC: 08:08:11:18:12:27 operating at 100M full duplex mode Using dm9000 device TFTP from server 192.168.1.100; our IP address is 192.168.1.101 Filename 'zImage.img'. Load address: 0x30008000 Loading: T ################################################################# ################################################################# ########################## done Bytes transferred = 2277540 (22c0a4 hex) ## Booting kernel from Legacy Image at 30008000 ... Image Name: tekkaman Created: 2010-03-29 12:59:51 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 2277476 Bytes = 2.2 MB Load Address: 30008000 Entry Point: 30008040 Verifying Checksum ... OK XIP Kernel Image ... OK OK
Starting kernel ... (略)
|
12)EEPROM 读写指令eeprom - I2C 接口的EEPROM 读写指令 格式: eeprom read addr off cnt eeprom write addr off cnt 第一个参数addr 是要写入或读出的数据在SDRAM中的存放地址; 第二个参数off 是在EEPROM中的偏移; 第三个参数cnt 是读写的数据字节数。 使用范例:
[u-boot@MINI2440]# md.b 0x30008000 2 30008000: aa aa .. [u-boot@MINI2440]# eeprom read 0x30008000 10 2
EEPROM @0x50 read: addr 30008000 off 0010 count 2 ... done [u-boot@MINI2440]# md.b 0x30008000 2 30008000: ff ff .. [u-boot@MINI2440]# mm.b 0x30008000 30008000: ff ? aa 30008001: ff ? 55 30008002: aa ? q [u-boot@MINI2440]# md.b 0x30008000 2 30008000: aa 55 .U [u-boot@MINI2440]# eeprom write 0x30008000 10 2
EEPROM @0x50 write: addr 30008000 off 0010 count 2 ... done [u-boot@MINI2440]# eeprom read 0x30008010 10 2
EEPROM @0x50 read: addr 30008010 off 0010 count 2 ... done [u-boot@MINI2440]# md.b 0x30008010 2 30008010: aa 55 .U
|
(13)设置和读取RTC指令
date - 设置和读取RTC 格式: date [MMDDhhmm[[CC]YY][.ss]] MM:月份 DD:日期 hh:小时 mm 分钟 CC:年份的前两个数字 YY:年份的后两个数字 ss:秒数 使用范例:
[u-boot@MINI2440]# date Date: 1980-00-06 (Thursday) Time: 20:30:25 [u-boot@MINI2440]# date 041100582010.20 Date: 2010-04-11 (Sunday) Time: 0:58:20 |
十四、脚本运行指令 run var [...] var :ENV中的脚本名 使用范例:
[u-boot@MINI2440]# setenv a_run_test echo $bootfile \; version [u-boot@MINI2440]# run a_run_test zImage.img
U-Boot 2009.11 ( 4月 04 2010 - 12:09:25) |
十五、系统重启指令 reset - 重启CPU
[u-boot@MINI2440]# reset resetting ...
U-Boot 2009.11 ( 4月 04 2010 - 12:09:25)
modified by tekkamanninja (tekkamanninja@163.com) Love Linux
I2C: ready DRAM: 64 MB Flash: 2 MB NAND: 128 MiB Video: 240x320x16 20kHz 62Hz In: serial Out: serial Err: serial Net: dm9000 U-Boot 2009.11 ( 4月 04 2010 - 12:09:25) modified by tekkamanninja (tekkamanninja@163.com) Love Linux Hit any key to stop autoboot: 0 [u-boot@MINI2440]#
|
|