注:以下的阅读笔记的源程序版本为:u-boot-1.1.6
#
#(C) Copyright 2000 - 2005
#Wolfgang Denk, DENX Software Engineering, [email protected].
#
#See file CREDITS for list of people who contributed to this
#project.
#
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License as
#published by the Free Software Foundation; either version 2 of
#the License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston,
#MA 02111-1307 USA
#
Summary:摘要
========
Thisdirectory contains the source code for U-Boot, a boot loader for
Embeddedboards based on PowerPC, ARM, MIPS and several other
processors,which can be installed in a boot ROM and used to
initializeand test the hardware or to download and run application
code.
这个目录包含了U-Boot的源码,U-Boot是一个基于PowerPC, ARM, MIPS
和若干其他嵌入式处理板的boot引导,它能够下载到一个boot ROM中并
用于初始化和测试硬件或者下载和运行应用程序。
Thedevelopment of U-Boot is closely related to Linux: some parts of
thesource code originate in the Linux source tree, we have some
headerfiles in common, and special provision has been made to
supportbooting of Linux images.
U-boot的开发非常接近Linux,它的某部分源码来自于Linux代码目录树,
在common里面,我们有着相同的头文件,以及特别规定其必须支持引
导Linux镜像。
Someattention has been paid to make this software easily
configurableand extendable. For instance, all monitor commands are
implementedwith the same call interface, so that it's very easy to
addnew commands. Also, instead of permanently adding rarely used
code(for instance hardware test utilities) to the monitor, you can
loadand run it dynamically.
某部分已经用于使软件易于配置和扩展。例如,所有监控命令被应用于
相同调用接口,所以它非常容易去添加新命令。而且,这永远代替了使
用添加一些代码到监控器(例如,硬件测试工具),以动态地加载和运
行它。
Status:情形
=======
Ingeneral, all boards for which a configuration option exists in the
Makefilehave been tested to some extent and can be considered
"working".In fact, many of them are used in production systems.
Incase of problems see the CHANGELOG and CREDITS files to find out
whocontributed the specific port.
通常,在Makefile中存在配置选项的所有板已经被一定程度的测试,可
以认为是可行的。事实上,它们中有许多已经应用于生产系统中了。假
使有问题,请参考CHANGELOG 和 CREDITS文件,找出是谁贡献的
指定部分。
Whereto get help:在哪里找到帮助
==================
Incase you have questions about, problems with or contributions for
U-Bootyou should send a message to the U-Boot mailing list at
previoustraffic on the mailing list - please search the archive
beforeasking FAQ's. Please see
http://lists.sourceforge.net/lists/listinfo/u-boot-users/
Wherewe come from:我们从哪里来
===================
-start from 8xxrom sources
-create PPCBoot project (http://sourceforge.net/projects/ppcboot)
-clean up code
-make it easier to add custom boards
-make it possible to add other [PowerPC] CPUs
-extend functions, especially:
* Provide extended interface to Linux bootloader
* S-Record download
* network boot
* PCMCIA / CompactFLash / ATA disk / SCSI ...boot
-create ARMBoot project (http://sourceforge.net/projects/armboot)
-add other CPU families (starting with ARM)
-create U-Boot project (http://sourceforge.net/projects/u-boot)
Namesand Spelling:名称和拼写
===================
The"official" name of this project is "Das U-Boot". Thespelling
"U-Boot"shall be used in all written text (documentation, comments
insource files etc.). Example:
This is the README file for the U-Bootproject.
Filenames etc. shall be based on the string "u-boot". Examples:
include/asm-ppc/u-boot.h
#include
Variablenames, preprocessor constants etc. shall be either based on
thestring "u_boot" or on "U_BOOT". Example:
U_BOOT_VERSION u_boot_logo
IH_OS_U_BOOT u_boot_hush_start
Versioning:版本管理
===========
U-Bootuses a 3 level version number containing a version, a
sub-version,and a patchlevel: "U-Boot-2.34.5" means version "2",
sub-version"34", and patchlevel "4".
Thepatchlevel is used to indicate certain stages of development
betweenreleased versions, i. e. officially released versions of
U-Bootwill always have a patchlevel of "0".
DirectoryHierarchy:目录层次
====================
-board Board dependent files板子依赖文件
-common Misc architecture independentfunctions多体系结构独立函数
-cpu CPU specific filesCPU相关文件
- 74xx_7xx Filesspecific to Freescale MPC74xx and 7xx CPUs
- arm720t Filesspecific to ARM 720 CPUs
- arm920t Filesspecific to ARM 920 CPUs
- at91rm9200 Files specific to AtmelAT91RM9200 CPU
- imx Filesspecific to Freescale MC9328 i.MX CPUs
- s3c24x0 Filesspecific to Samsung S3C24X0 CPUs
- arm925t Filesspecific to ARM 925 CPUs
- arm926ejs Filesspecific to ARM 926 CPUs
- arm1136 Filesspecific to ARM 1136 CPUs
- at32ap Filesspecific to Atmel AVR32 AP CPUs
- i386 Filesspecific to i386 CPUs
- ixp Filesspecific to Intel XScale IXP CPUs
- mcf52x2 Filesspecific to Freescale ColdFire MCF52x2 CPUs
- mips Filesspecific to MIPS CPUs
- mpc5xx Filesspecific to Freescale MPC5xx CPUs
- mpc5xxx Filesspecific to Freescale MPC5xxx CPUs
- mpc8xx Filesspecific to Freescale MPC8xx CPUs
- mpc8220 Filesspecific to Freescale MPC8220 CPUs
- mpc824x Filesspecific to Freescale MPC824x CPUs
- mpc8260 Filesspecific to Freescale MPC8260 CPUs
- mpc85xx Filesspecific to Freescale MPC85xx CPUs
- nios Filesspecific to Altera NIOS CPUs
- nios2 Filesspecific to Altera Nios-II CPUs
- ppc4xx Filesspecific to AMCC PowerPC 4xx CPUs
- pxa Filesspecific to Intel XScale PXA CPUs
- s3c44b0 Filesspecific to Samsung S3C44B0 CPUs
- sa1100 Filesspecific to Intel StrongARM SA1100 CPUs
-disk Code for disk drivepartition handling磁盘驱动及分区处理代码
-doc Documentation (don'texpect too much) 文档
-drivers Commonly used device drivers通用设备驱动
-dtt Digital Thermometer andThermostat drivers数字温度器和调温装置驱动
-examples Example code for standaloneapplications, etc.独立应用程序的示例代码
-include Header Files头文件
-lib_arm Files generic to ARM architectureARM体系结构通用文件
-lib_avr32 Files generic to AVR32 architecture
-lib_generic Files generic to all architectures
-lib_i386 Files generic to i386 architecture
-lib_m68k Files generic to m68k architecture
-lib_mips Files generic to MIPS architecture
-lib_nios Files generic to NIOS architecture
-lib_ppc Files generic to PowerPCarchitecture
-net Networking code网络代码
-post Power On Self Test上电自检
-rtc Real Time Clock drivers实时时钟驱动
-tools Tools to build S-Record orU-Boot images, etc. 例如编译S-Record和U-Boot镜像工具
SoftwareConfiguration:软件配置
=======================
Configurationis usually done using C preprocessor defines; the
rationalebehind that is to avoid dead code whenever possible.
配置通常使用C预定义;在这背后的基本原理是尽可能避免死代码。
Thereare two classes of configuration variables:
有两种级别的配置变量
*Configuration _OPTIONS_:
These are selectable by the user and havenames beginning with
"CONFIG_".
*Configuration _SETTINGS_:
These depend on the hardware etc. and shouldnot be meddled with if
you don't know what you're doing; they havenames beginning with
"CFG_".
Laterwe will add a configuration tool - probably similar to or even
identicalto what's used for the Linux kernel. Right now, we have to
dothe configuration by hand, which means creating some symbolic
linksand editing some configuration files. We use the TQM8xxL boards
asan example here.
Selectionof Processor Architecture and Board Type:
---------------------------------------------------
Forall supported boards there are ready-to-use default
configurationsavailable; just type "make
Example:For a TQM823L module type:
cd u-boot
make TQM823L_config
Forthe Cogent platform, you need to specify the cpu type as well;
e.g."make cogent_mpc8xx_config". And also configure the cogent
directoryaccording to the instructions in cogent/README.
ConfigurationOptions:配置选项
----------------------
Configurationdepends on the combination of board and CPU type; all
suchinformation is kept in a configuration file
"include/configs/
配置依靠结合板和CPU类型;在配置文件中所有信息是活跃的。
Example:For a TQM823L module, all configuration settings are in
"include/configs/TQM823L.h".
Manyof the options are named exactly as the corresponding Linux
kernelconfiguration options. The intention is to make it easier to
builda config tool - later.
Thefollowing options need to be configured:
接下来的选项需要配置
-CPU Type: Define exactly one of CPU类型
PowerPC based CPUs:
-------------------
CONFIG_MPC823, CONFIG_MPC850, CONFIG_MPC855, CONFIG_MPC860
or CONFIG_MPC5xx
or CONFIG_MPC8220
or CONFIG_MPC824X,CONFIG_MPC8260
or CONFIG_MPC85xx
or CONFIG_IOP480
or CONFIG_405GP
or CONFIG_405EP
or CONFIG_440
or CONFIG_MPC74xx
or CONFIG_750FX
ARM based CPUs:
---------------
CONFIG_SA1110
CONFIG_ARM7
CONFIG_PXA250
CONFIG_CPU_MONAHANS
MicroBlaze based CPUs:
----------------------
CONFIG_MICROBLAZE
Nios-2 based CPUs:
----------------------
CONFIG_NIOS2
AVR32 based CPUs:
----------------------
CONFIG_AT32AP
-Board Type: Define exactly one of板类型
PowerPC based boards:
---------------------
CONFIG_ADCIOP CONFIG_FPS860L CONFIG_OXC
CONFIG_ADS860 CONFIG_GEN860T CONFIG_PCI405
CONFIG_AMX860 CONFIG_GENIETV CONFIG_PCIPPC2
CONFIG_AP1000 CONFIG_GTH CONFIG_PCIPPC6
CONFIG_AR405 CONFIG_gw8260 CONFIG_pcu_e
CONFIG_BAB7xx CONFIG_hermes CONFIG_PIP405
CONFIG_BC3450 CONFIG_hymod CONFIG_PM826
CONFIG_c2mon CONFIG_IAD210 CONFIG_ppmc8260
CONFIG_CANBT CONFIG_ICU862 CONFIG_QS823
CONFIG_CCM CONFIG_IP860 CONFIG_QS850
CONFIG_CMI CONFIG_IPHASE4539 CONFIG_QS860T
CONFIG_cogent_mpc8260 CONFIG_IVML24 CONFIG_RBC823
CONFIG_cogent_mpc8xx CONFIG_IVML24_128 CONFIG_RPXClassic
CONFIG_CPCI405 CONFIG_IVML24_256 CONFIG_RPXlite
CONFIG_CPCI4052 CONFIG_IVMS8 CONFIG_RPXsuper
CONFIG_CPCIISER4 CONFIG_IVMS8_128 CONFIG_rsdproto
CONFIG_CPU86 CONFIG_IVMS8_256 CONFIG_sacsng
CONFIG_CRAYL1 CONFIG_JSE CONFIG_Sandpoint8240
CONFIG_CSB272 CONFIG_LANTEC CONFIG_Sandpoint8245
CONFIG_CU824 CONFIG_LITE5200B CONFIG_sbc8260
CONFIG_DASA_SIM CONFIG_lwmon CONFIG_sbc8560
CONFIG_DB64360 CONFIG_MBX CONFIG_SM850
CONFIG_DB64460 CONFIG_MBX860T CONFIG_SPD823TS
CONFIG_DU405 CONFIG_MHPC CONFIG_STXGP3
CONFIG_DUET_ADS CONFIG_MIP405 CONFIG_SXNI855T
CONFIG_EBONY CONFIG_MOUSSE CONFIG_TQM823L
CONFIG_ELPPC CONFIG_MPC8260ADS CONFIG_TQM8260
CONFIG_ELPT860 CONFIG_MPC8540ADS CONFIG_TQM850L
CONFIG_ep8260 CONFIG_MPC8540EVAL CONFIG_TQM855L
CONFIG_ERIC CONFIG_MPC8560ADS CONFIG_TQM860L
CONFIG_ESTEEM192E CONFIG_MUSENKI CONFIG_TTTech
CONFIG_ETX094 CONFIG_MVS1 CONFIG_UTX8245
CONFIG_EVB64260 CONFIG_NETPHONE CONFIG_V37
CONFIG_FADS823 CONFIG_NETTA CONFIG_W7OLMC
CONFIG_FADS850SAR CONFIG_NETVIA CONFIG_W7OLMG
CONFIG_FADS860T CONFIG_NX823 CONFIG_WALNUT
CONFIG_FLAGADM CONFIG_OCRTC CONFIG_ZPC1900
CONFIG_FPS850L CONFIG_ORSG CONFIG_ZUMA
ARM based boards:
-----------------
CONFIG_ARMADILLO, CONFIG_AT91RM9200DK, CONFIG_CERF250,
CONFIG_CSB637, CONFIG_DELTA, CONFIG_DNP1110,
CONFIG_EP7312, CONFIG_H2_OMAP1610, CONFIG_HHP_CRADLE,
CONFIG_IMPA7, CONFIG_INNOVATOROMAP1510, CONFIG_INNOVATOROMAP1610,
CONFIG_KB9202, CONFIG_LART, CONFIG_LPD7A400,
CONFIG_LUBBOCK, CONFIG_OSK_OMAP5912, CONFIG_OMAP2420H4,
CONFIG_PLEB2, CONFIG_SHANNON, CONFIG_P2_OMAP730,
CONFIG_SMDK2400, CONFIG_SMDK2410, CONFIG_TRAB,
CONFIG_VCMA9
MicroBlaze based boards:
------------------------
CONFIG_SUZAKU
Nios-2 based boards:
------------------------
CONFIG_PCI5441 CONFIG_PK1C20
CONFIG_EP1C20 CONFIG_EP1S10CONFIG_EP1S40
AVR32 based boards:
-------------------
CONFIG_ATSTK1000
-CPU Daughterboard Type: (if CONFIG_ATSTK1000 is defined) CPU子类型
Define exactly one of
CONFIG_ATSTK1002
-CPU Module Type: (if CONFIG_COGENT is defined)CPU模块类型
Define exactly one of
CONFIG_CMA286_60_OLD
---FIXME --- not tested yet:FIXME
CONFIG_CMA286_60,CONFIG_CMA286_21, CONFIG_CMA286_60P,
CONFIG_CMA287_23, CONFIG_CMA287_50
-Motherboard Type: (if CONFIG_COGENT is defined)母板类型
Define exactly one of
CONFIG_CMA101, CONFIG_CMA102
-Motherboard I/O Modules: (if CONFIG_COGENT is defined)母板IO模块
Define one or more of
CONFIG_CMA302
-Motherboard Options: (if CONFIG_CMA101 or CONFIG_CMA102 are defined)母板选项
Define one or more of
CONFIG_LCD_HEARTBEAT - update a character position on
the lcd display every second with
a "rotator" |\-/|\-/
-Board flavour: (if CONFIG_MPC8260ADS is defined)板flavour
CONFIG_ADSTYPE
Possible values are:
CFG_8260ADS - original MPC8260ADS
CFG_8266ADS - MPC8266ADS
CFG_PQ2FADS - PQ2FADS-ZU or PQ2FADS-VR
CFG_8272ADS - MPC8272ADS
-MPC824X Family Member (if CONFIG_MPC824X is defined) MPC824X家族内存
Define exactly one of
CONFIG_MPC8240, CONFIG_MPC8245
-8xx CPU Options: (if using an MPC8xx cpu) 8xx CPU选项
CONFIG_8xx_GCLK_FREQ - deprecated: CPU clock if
get_gclk_freq() cannot work
e.g. if there is no 32KHz
reference PIT/RTC clock
CONFIG_8xx_OSCLK - PLL input clock (either EXTCLK
or XTAL/EXTAL)
-859/866/885 CPU options: (if using a MPC859 or MPC866 or MPC885 CPU): 859/866/885 CPU选项
CFG_8xx_CPUCLK_MIN
CFG_8xx_CPUCLK_MAX
CONFIG_8xx_CPUCLK_DEFAULT
See doc/README.MPC866
CFG_MEASURE_CPUCLK
Define this to measure the actualCPU clock instead
of relying on the correctness ofthe configured
values. Mostly useful for boardbringup to make sure
the PLL is locked at the intendedfrequency. Note
that this requires a (stable)reference clock (32 kHz
RTC clock or CFG_8XX_XIN)
-Intel Monahans options:英特尔系列选项
CFG_MONAHANS_RUN_MODE_OSC_RATIO
Defines the Monahans run mode tooscillator
ratio. Valid values are 8, 16, 24,31. The core
frequency is this value multipliedby 13 MHz.
CFG_MONAHANS_TURBO_RUN_MODE_RATIO
Defines the Monahans turbo mode tooscillator
ratio. Valid values are 1 (defaultif undefined) and
2. The core frequency ascalculated above is multiplied
by this value.
-Linux Kernel Interface:Linux内核接口
CONFIG_CLOCKS_IN_MHZ
U-Boot stores all clockinformation in Hz
internally. For binarycompatibility with older Linux
kernels (which expect the clockspassed in the
bd_info data to be in MHz) theenvironment variable
"clocks_in_mhz" can bedefined so that U-Boot
converts clock data to MHZ beforepassing it to the
Linux kernel.
When CONFIG_CLOCKS_IN_MHZ isdefined, a definition of
"clocks_in_mhz=1"is automatically included in the
default environment.
CONFIG_MEMSIZE_IN_BYTES [relevant for MIPS only]
When transfering memsize parameterto linux, some versions
expect it to be in bytes, othersin MB.
Define CONFIG_MEMSIZE_IN_BYTES tomake it in bytes.
CONFIG_OF_FLAT_TREE
New kernel versions are expectingfirmware settings to be
passed using flat open firmwaretrees.
The environment variable"disable_of", when set, disables this
functionality.
CONFIG_OF_FLAT_TREE_MAX_SIZE
The maximum size of theconstructed OF tree.
OF_CPU - The proper name of thecpus node.
OF_SOC - The proper name of thesoc node.
OF_TBCLK - The timebase frequency.
OF_STDOUT_PATH - The path to theconsole device
CONFIG_OF_HAS_BD_T
The resulting flat device treewill have a copy of the bd_t.
Space should be pre-allocated inthe dts for the bd_t.
CONFIG_OF_HAS_UBOOT_ENV
The resulting flat device treewill have a copy of u-boot's
environment variables
CONFIG_OF_BOARD_SETUP
Board code has additionmodification that it wants to make
to the flat device tree beforehanding it off to the kernel
CONFIG_OF_BOOT_CPU
This define fills in the correctboot cpu in the boot
param header, the default value iszero if undefined.
-Serial Ports:串口
CFG_PL010_SERIAL
Define this if you want supportfor Amba PrimeCell PL010 UARTs.
CFG_PL011_SERIAL
Define this if you want supportfor Amba PrimeCell PL011 UARTs.
CONFIG_PL011_CLOCK
If you have Amba PrimeCell PL011UARTs, set this variable to
the clock speed of the UARTs.
CONFIG_PL01x_PORTS
If you have Amba PrimeCell PL010or PL011 UARTs on your board,
define this to a list of baseaddresses for each (supported)
port. See e.g.include/configs/versatile.h
-Console Interface:控制台接口
Depending on board, define exactlyone serial port
(like CONFIG_8xx_CONS_SMC1,CONFIG_8xx_CONS_SMC2,
CONFIG_8xx_CONS_SCC1, ...), orswitch off the serial
console by definingCONFIG_8xx_CONS_NONE
Note: if CONFIG_8xx_CONS_NONE isdefined, the serial
port routines must be definedelsewhere
(i.e. serial_init(),serial_getc(), ...)
CONFIG_CFB_CONSOLE
Enables console device for a colorframebuffer. Needs following
defines (cf. smiLynxEM, i8042,board/eltec/bab7xx)
VIDEO_FB_LITTLE_ENDIAN graphic memory organisation
(defaultbig endian)
VIDEO_HW_RECTFILL graphic chip supports
rectanglefill
(cf.smiLynxEM)
VIDEO_HW_BITBLT graphic chip supports
bit-blit(cf. smiLynxEM)
VIDEO_VISIBLE_COLS visible pixel columns
(cols=pitch)
VIDEO_VISIBLE_ROWS visible pixel rows
VIDEO_PIXEL_SIZE bytes per pixel
VIDEO_DATA_FORMAT graphic data format
(0-5,cf. cfb_console.c)
VIDEO_FB_ADRS framebuffer address
VIDEO_KBD_INIT_FCT keyboard int fct
(i.e. i8042_kbd_init())
VIDEO_TSTC_FCT test char fct
(i.e.i8042_tstc)
VIDEO_GETC_FCT get char fct
(i.e.i8042_getc)
CONFIG_CONSOLE_CURSOR cursor drawing on/off
(requiresblink timer
cf.i8042.c)
CFG_CONSOLE_BLINK_COUNTblink interval (cf. i8042.c)
CONFIG_CONSOLE_TIME display time/date info in
upperright corner
(requiresCFG_CMD_DATE)
CONFIG_VIDEO_LOGO display Linux logo in
upperleft corner
CONFIG_VIDEO_BMP_LOGO use bmp_logo.h instead of
linux_logo.hfor logo.
RequiresCONFIG_VIDEO_LOGO
CONFIG_CONSOLE_EXTRA_INFO
addionalboard info beside
thelogo
When CONFIG_CFB_CONSOLE isdefined, video console is
default i/o. Serial console can beforced with
environment 'console=serial'.
When CONFIG_SILENT_CONSOLE isdefined, all console
messages (by U-Boot and Linux!)can be silenced with
the "silent" environmentvariable. See
doc/README.silent for moreinformation.
-Console Baudrate:控制台波特率
CONFIG_BAUDRATE - in bps
Select one of the baudrates listedin
CFG_BAUDRATE_TABLE, see below.
CFG_BRGCLK_PRESCALE, baudrateprescale
-Interrupt driven serial port input:中断驱动串口输入
CONFIG_SERIAL_SOFTWARE_FIFO
PPC405GP only.
Use an interrupt handler forreceiving data on the
serial port. It also enables usinghardware handshake
(RTS/CTS) and UART's built-inFIFO. Set the number of
bytes the interrupt driven inputbuffer should have.
Leave undefined to disable thisfeature, including
disable the buffer and hardwarehandshake.
-Console UART Number:控制台串口数量
CONFIG_UART1_CONSOLE
AMCC PPC4xx only.
If defined internal UART1 (and notUART0) is used
as default U-Boot console.
-Boot Delay: CONFIG_BOOTDELAY - in secondsBoot延时
Delay before automatically bootingthe default image;
set to -1 to disable autoboot.
See doc/README.autoboot for theseoptions that
work with CONFIG_BOOTDELAY. Noneare required.
CONFIG_BOOT_RETRY_TIME
CONFIG_BOOT_RETRY_MIN
CONFIG_AUTOBOOT_KEYED
CONFIG_AUTOBOOT_PROMPT
CONFIG_AUTOBOOT_DELAY_STR
CONFIG_AUTOBOOT_STOP_STR
CONFIG_AUTOBOOT_DELAY_STR2
CONFIG_AUTOBOOT_STOP_STR2
CONFIG_ZERO_BOOTDELAY_CHECK
CONFIG_RESET_TO_RETRY
-Autoboot Command:自动boot命令
CONFIG_BOOTCOMMAND
Only needed when CONFIG_BOOTDELAYis enabled;
define a command string that isautomatically executed
when no character is read on theconsole interface
within "Boot Delay"after reset.
CONFIG_BOOTARGS
This can be used to pass argumentsto the bootm
command. The value ofCONFIG_BOOTARGS goes into the
environment value"bootargs".
CONFIG_RAMBOOT and CONFIG_NFSBOOT
The value of these goes into theenvironment as
"ramboot" and"nfsboot" respectively, and can be used
as a convenience, when switchingbetween booting from
ram and nfs.
-Pre-Boot Commands: Pre-Boot命令
CONFIG_PREBOOT
When this option is #defined, theexistence of the
environment variable"preboot" will be checked
immediately before starting theCONFIG_BOOTDELAY
countdown and/or running theauto-boot command resp.
entering interactive mode.
This feature is especially usefulwhen "preboot" is
automatically generated ormodified. For an example
see the LWMON board specific code:here "preboot" is
modified when the user holds downa certain
combination of keys on the(special) keyboard when
booting the systems
-Serial Download Echo Mode:串口下载Echo模式
CONFIG_LOADS_ECHO
If defined to 1, all charactersreceived during a
serial download (using the"loads" command) are
echoed back. This might be neededby some terminal
emulations (like "cu"),but may as well just take
time on others. This setting#define's the initial
value of the"loads_echo" environment variable.
-Kgdb Serial Baudrate: (if CFG_CMD_KGDB is defined) Kgdb串口波特率
CONFIG_KGDB_BAUDRATE
Select one of the baudrates listedin
CFG_BAUDRATE_TABLE, see below.
-Monitor Functions:监控功能
CONFIG_COMMANDS
Most monitor functions can beselected (or
de-selected) by adjusting thedefinition of
CONFIG_COMMANDS; to selectindividual functions,
#define CONFIG_COMMANDS by"OR"ing any of the
following values:
#define enables commands:
-------------------------
CFG_CMD_ASKENV * ask for env variable
CFG_CMD_AUTOSCRIPT AutoscriptSupport
CFG_CMD_BDI bdinfo
CFG_CMD_BEDBUG * Include BedBug Debugger
CFG_CMD_BMP * BMP support
CFG_CMD_BSP * Board specific commands
CFG_CMD_BOOTD bootd
CFG_CMD_CACHE * icache, dcache
CFG_CMD_CONSOLE coninfo
CFG_CMD_DATE * support for RTC, date/time...
CFG_CMD_DHCP * DHCP support
CFG_CMD_DIAG * Diagnostics
CFG_CMD_DOC * Disk-On-Chip Support
CFG_CMD_DTT * Digital Therm and Thermostat
CFG_CMD_ECHO echoarguments
CFG_CMD_EEPROM * EEPROM read/write support
CFG_CMD_ELF * bootelf, bootvx
CFG_CMD_ENV saveenv
CFG_CMD_FDC * Floppy Disk Support
CFG_CMD_FAT * FAT partition support
CFG_CMD_FDOS * Dos diskette Support
CFG_CMD_FLASH flinfo,erase, protect
CFG_CMD_FPGA FPGAdevice initialization support
CFG_CMD_HWFLOW * RTS/CTS hw flow control
CFG_CMD_I2C * I2C serial bus support
CFG_CMD_IDE * IDE harddisk support
CFG_CMD_IMI iminfo
CFG_CMD_IMLS Listall found images
CFG_CMD_IMMAP * IMMR dump support
CFG_CMD_IRQ * irqinfo
CFG_CMD_ITEST Integer/string test of 2 values
CFG_CMD_JFFS2 * JFFS2 Support
CFG_CMD_KGDB * kgdb
CFG_CMD_LOADB loadb
CFG_CMD_LOADS loads
CFG_CMD_MEMORY md,mm, nm, mw, cp, cmp, crc, base,
loop, loopw, mtest
CFG_CMD_MISC Miscfunctions like sleep etc
CFG_CMD_MMC * MMC memory mapped support
CFG_CMD_MII * MII utility commands
CFG_CMD_NAND * NAND support
CFG_CMD_NET bootp, tftpboot, rarpboot
CFG_CMD_PCI * pciinfo
CFG_CMD_PCMCIA * PCMCIA support
CFG_CMD_PING * send ICMP ECHO_REQUEST to network host
CFG_CMD_PORTIO * Port I/O
CFG_CMD_REGINFO * Register dump
CFG_CMD_RUN run command in envvariable
CFG_CMD_SAVES * save S record dump
CFG_CMD_SCSI * SCSI Support
CFG_CMD_SDRAM * print SDRAM configuration information
(requires CFG_CMD_I2C)
CFG_CMD_SETGETDCR Support for DCRRegister access (4xx only)
CFG_CMD_SPI * SPI serial bus support
CFG_CMD_USB * USB support
CFG_CMD_VFD * VFD support (TRAB)
CFG_CMD_BSP * Board SPecific functions
CFG_CMD_CDP * Cisco Discover Protocol support
-----------------------------------------------
CFG_CMD_ALL all
CONFIG_CMD_DFL Default configuration; at the moment
this is includes allcommands, except
the ones marked with"*" in the list
above.
If you don't defineCONFIG_COMMANDS it defaults to
CONFIG_CMD_DFL ininclude/cmd_confdefs.h. A board can
override the default settings inthe respective
include file.
EXAMPLE: If you want all functionsexcept of network
support you can write:
#define CONFIG_COMMANDS(CFG_CMD_ALL & ~CFG_CMD_NET)
Note: Don'tenable the "icache" and "dcache" commands
(configuration optionCFG_CMD_CACHE) unless you know
what you (and your U-Boot users)are doing. Data
cache cannot be enabled on systemslike the 8xx or
8260 (where accesses to the IMMRregion must be
uncached), and it cannot bedisabled on all other
systems where we (mis-) use thedata cache to hold an
initial stack and some data.
XXX - this list needs to getupdated!
-Watchdog:看门狗
CONFIG_WATCHDOG
If this variable is defined, itenables watchdog
support. There must be support inthe platform specific
code for a watchdog. For the 8xxand 8260 CPUs, the
SIU Watchdog feature is enabled inthe SYPCR
register.
-U-Boot Version:U-boot版本
CONFIG_VERSION_VARIABLE
If this variable is defined, anenvironment variable
named "ver" is createdby U-Boot showing the U-Boot
version as printed by the"version" command.
This variable is readonly.
-Real-Time Clock:实时时钟
When CFG_CMD_DATE is selected, thetype of the RTC
has to be selected, too. Defineexactly one of the
following options:
CONFIG_RTC_MPC8xx - use internal RTC of MPC8xx
CONFIG_RTC_PCF8563 - use Philips PCF8563 RTC
CONFIG_RTC_MC146818 - use MC146818 RTC
CONFIG_RTC_DS1307 - use Maxim, Inc. DS1307 RTC
CONFIG_RTC_DS1337 - use Maxim, Inc. DS1337 RTC
CONFIG_RTC_DS1338 - use Maxim, Inc. DS1338 RTC
CONFIG_RTC_DS164x - use Dallas DS164x RTC
CONFIG_RTC_MAX6900 - use Maxim, Inc. MAX6900 RTC
Note that if the RTC uses I2C,then the I2C interface
must also be configured. See I2CSupport, below.
-Timestamp Support:时间戳支持
When CONFIG_TIMESTAMP is selected,the timestamp
(date and time) of an image isprinted by image
commands like bootm or iminfo.This option is
automatically enabled when youselect CFG_CMD_DATE .
-Partition Support:分区支持
CONFIG_MAC_PARTITION and/orCONFIG_DOS_PARTITION
and/or CONFIG_ISO_PARTITION
If IDE or SCSI support is enabled (CFG_CMD_IDE or
CFG_CMD_SCSI) you must configuresupport for at least
one partition type as well.
-IDE Reset method:IDE复位方法
CONFIG_IDE_RESET_ROUTINE - this isdefined in several
board configurations files butused nowhere!
CONFIG_IDE_RESET - is this isdefined, IDE Reset will
be performed by calling thefunction
ide_set_reset(int reset)
which has to be defined in a boardspecific file
-ATAPI Support:ATAPI支持
CONFIG_ATAPI
Set this to enable ATAPI support.
-LBA48 Support LBA48支持
CONFIG_LBA48
Set this to enable support fordisks larger than 137GB
Also look at CFG_64BIT_LBA,CFG_64BIT_VSPRINTF and CFG_64BIT_STRTOUL CFG_64BIT_STRTOUL
Whithout these , LBA48 supportuses 32bit variables and will 'only'
support disks up to 2.1TB.
CFG_64BIT_LBA:
When enabled, makes the IDEsubsystem use 64bit sector addresses.地址
Default is 32bit.
-SCSI Support:SCSI支持
At the moment only there is onlysupport for the
SYM53C8XX SCSI controller; define
CONFIG_SCSI_SYM53C8XX to enableit.
CFG_SCSI_MAX_LUN [8],CFG_SCSI_MAX_SCSI_ID [7] and
CFG_SCSI_MAX_DEVICE[CFG_SCSI_MAX_SCSI_ID *
CFG_SCSI_MAX_LUN] can be adjustedto define the
maximum numbers of LUNs, SCSI ID'sand target
devices.
CFG_SCSI_SYM53C8XX_CCF to fixclock timing (80Mhz)
-NETWORK Support (PCI):网络支持
CONFIG_E1000
Support for Intel 8254x gigabitchips.
CONFIG_EEPRO100
Support for Intel82557/82559/82559ER chips.
OptionalCONFIG_EEPRO100_SROM_WRITE enables eeprom
write routine for first timeinitialisation.
CONFIG_TULIP
Support for Digital 2114x chips.
Optional CONFIG_TULIP_SELECT_MEDIAfor board specific
modem chip initialisation(KS8761/QS6611).
CONFIG_NATSEMI
Support for National dp83815chips.
CONFIG_NS8382X
Support for National dp8382[01]gigabit chips.
-NETWORK Support (other):网络支持
CONFIG_DRIVER_LAN91C96
Support for SMSC's LAN91C96 chips.
CONFIG_LAN91C96_BASE
Define this to hold thephysical address
of the LAN91C96's I/O space
CONFIG_LAN91C96_USE_32_BIT
Define this to enable 32bit addressing
CONFIG_DRIVER_SMC91111
Support for SMSC's LAN91C111 chip
CONFIG_SMC91111_BASE
Define this to hold thephysical address
of the device (I/O space)
CONFIG_SMC_USE_32_BIT
Define this if data bus is32 bits
CONFIG_SMC_USE_IOFUNCS
Define this to use i/ofunctions instead of macros
(some hardware wont workwith macros)
-USB Support:USB支持
At the moment only the UHCI hostcontroller is
supported (PIP405, MIP405,MPC5200); define
CONFIG_USB_UHCI to enable it.
define CONFIG_USB_KEYBOARD toenable the USB Keyboard
and define CONFIG_USB_STORAGE toenable the USB
storage devices.
Note:
Supported are USB Keyboards andUSB Floppy drives
(TEAC FD-05PUB).
MPC5200 USB requires additionaldefines:
CONFIG_USB_CLOCK
for 528 MHz Clock:0x0001bbbb
CONFIG_USB_CONFIG
for differentialdrivers: 0x00001000
for single endeddrivers: 0x00005000
-MMC Support:MMU支持
The MMC controller on the IntelPXA is supported. To
enable this define CONFIG_MMC. TheMMC can be
accessed from the boot prompt bymapping the device
to physical memory similar toflash. Command line is
enabled with CFG_CMD_MMC. The MMCdriver also works with
the FAT fs. This is enabled withCFG_CMD_FAT.
-Journaling Flash filesystem support:日志FLASH文件系统支持
CONFIG_JFFS2_NAND,CONFIG_JFFS2_NAND_OFF, CONFIG_JFFS2_NAND_SIZE,
CONFIG_JFFS2_NAND_DEV
Define these for a defaultpartition on a NAND device
CFG_JFFS2_FIRST_SECTOR,
CFG_JFFS2_FIRST_BANK,CFG_JFFS2_NUM_BANKS
Define these for a defaultpartition on a NOR device
CFG_JFFS_CUSTOM_PART
Define this to create an ownpartition. You have to provide a
function struct part_info*jffs2_part_info(int part_num)
If you define only one JFFS2partition you may also want to
#define CFG_JFFS_SINGLE_PART 1
to disable the command chpart.This is the default when you
have not defined a custompartition
-Keyboard Support:键盘支持
CONFIG_ISA_KEYBOARD
Define this to enable standard(PC-Style) keyboard
support
CONFIG_I8042_KBD
Standard PC keyboard driver withUS (is default) and
GERMAN key layout (switch viaenvironment 'keymap=de') support.
Export function i8042_kbd_init,i8042_tstc and i8042_getc
for cfb_console. Supports cursorblinking.
-Video support:音频支持
CONFIG_VIDEO
Define this to enable videosupport (for output to
video).
CONFIG_VIDEO_CT69000
Enable Chips & Technologies69000 Video chip
CONFIG_VIDEO_SMI_LYNXEM
Enable Silicon Motion SMI712/710/810 Video chip. The
video output is selected viaenvironment 'videoout'
(1 = LCD and 2 = CRT). If videooutis undefined, CRT is
assumed.
For the CT69000 and SMI_LYNXEMdrivers, videomode is
selected via environment'videomode'. Two diferent ways
are possible:
- "videomode=num" 'num' is a standard LiLo mode numbers.
Following standard modes aresupported (* is default):
Colors 640x480800x600 1024x768 1152x864 1280x1024
-------------+---------------------------------------------
8 bits | 0x301* 0x303 0x305 0x161 0x307
15 bits | 0x310 0x313 0x316 0x162 0x319
16 bits | 0x311 0x314 0x317 0x163 0x31A
24 bits | 0x312 0x315 0x318 ? 0x31B
-------------+---------------------------------------------
(i.e. setenv videomode 317;saveenv; reset;)
- "videomode=bootargs"all the video parameters are parsed
from the bootargs. (Seedrivers/videomodes.c)
CONFIG_VIDEO_SED13806
Enable Epson SED13806 driver. Thisdriver supports 8bpp
and 16bpp modes defined byCONFIG_VIDEO_SED13806_8BPP
or CONFIG_VIDEO_SED13806_16BPP
-Keyboard Support:键盘支持
CONFIG_KEYBOARD
Define this to enable a customkeyboard support.
This simply callsdrv_keyboard_init() which must be
defined in your board-specificfiles.
The only board using this so faris RBC823.
-LCD Support: CONFIG_LCDLCD支持
Define this to enable LCD support(for output to LCD
display); also select one of thesupported displays
by defining one of these:
CONFIG_NEC_NL6448AC33:
NEC NL6448AC33-18. Active,color, single scan.
CONFIG_NEC_NL6448BC20
NEC NL6448BC20-08.6.5", 640x480.
Active, color, single scan.
CONFIG_NEC_NL6448BC33_54
NEC NL6448BC33-54.10.4", 640x480.
Active, color, single scan.
CONFIG_SHARP_16x9
Sharp 320x240. Active,color, single scan.
It isn't 16x9, and I am notsure what it is.
CONFIG_SHARP_LQ64D341
Sharp LQ64D341 display,640x480.
Active, color, single scan.
CONFIG_HLD1045
HLD1045 display, 640x480.
Active, color, single scan.
CONFIG_OPTREX_BW
Optrex CBL50840-2 NF-FW 99 22 M5
or
Hitachi LMG6912RPFC-00T
or
Hitachi SP14Q002
320x240. Black & white.
Normally display is black on whitebackground; define
CFG_WHITE_ON_BLACK to get itinverted.
-Splash Screen Support: CONFIG_SPLASH_SCREEN Splash屏支持
If this option is set, theenvironment is checked for
a variable"splashimage". If found, the usual display
of logo, copyright and systeminformation on the LCD
is suppressed and the BMP image atthe address
specified in"splashimage" is loaded instead. The
console is redirected to the"nulldev", too. This
allows for a "silent"boot where a splash screen is
loaded very quickly afterpower-on.
-Gzip compressed BMP image support: CONFIG_VIDEO_BMP_GZIP Gzip压缩BMS图片支持
If this option is set,additionally to standard BMP
images, gzipped BMP images can bedisplayed via the
splashscreen support or the bmpcommand.
-Compression support:压缩支持
CONFIG_BZIP2
If this option is set, support forbzip2 compressed
images is included. If not, onlyuncompressed and gzip
compressed images are supported.
NOTE: the bzip2 algorithm requiresa lot of RAM, so
the malloc area (as defined byCFG_MALLOC_LEN) should
be at least 4MB.
-MII/PHY support:MII/PHY支持
CONFIG_PHY_ADDR
The address of PHY on MII bus.
CONFIG_PHY_CLOCK_FREQ (ppc4xx)
The clock frequency of the MII bus
CONFIG_PHY_GIGE
If this option is set, support forspeed/duplex
detection of Gigabit PHY isincluded.
CONFIG_PHY_RESET_DELAY
Some PHY like Intel LXT971A needextra delay after
reset before any MII registeraccess is possible.
For such PHY, set this option tothe usec delay
required. (minimum 300usec forLXT971A)
CONFIG_PHY_CMD_DELAY (ppc4xx)
Some PHY like Intel LXT971A needextra delay after
command issued before MII statusregister can be read
-Ethernet address:以太网地址
CONFIG_ETHADDR
CONFIG_ETH2ADDR
CONFIG_ETH3ADDR
Define a default value forethernet address to use
for the respective ethernetinterface, in case this
is not determined automatically.
-IP address:IP地址
CONFIG_IPADDR
Define a default value for the IPaddress to use for
the default ethernet interface, incase this is not
determined through e.g. bootp.
-Server IP address:服务器IP地址
CONFIG_SERVERIP
Defines a default value for theIPaddress of a TFTP
server to contact when using the"tftboot" command.
-BOOTP Recovery Mode:BOOTP recovery模式
CONFIG_BOOTP_RANDOM_DELAY
If you have many targets in anetwork that try to
boot using BOOTP, you may want toavoid that all
systems send out BOOTP requests atprecisely the same
moment (which would happen forinstance at recovery
from a power failure, when allsystems will try to
boot, thus flooding the BOOTPserver. Defining
CONFIG_BOOTP_RANDOM_DELAY causes arandom delay to be
inserted before sending out BOOTPrequests. The
following delays are instertedthen:
1st BOOTP request: delay 0 ... 1 sec
2nd BOOTP request: delay 0 ... 2 sec
3rd BOOTP request: delay 0 ... 4 sec
4th and following
BOOTP requests: delay 0 ... 8 sec
-DHCP Advanced Options:DHCP高级选项
CONFIG_BOOTP_MASK
You can fine tune the DHCPfunctionality by adding
these flags to theCONFIG_BOOTP_MASK define:
CONFIG_BOOTP_DNS2 - If a DHCPclient requests the DNS
serverip from a DHCP server, it ispossible that more
than one DNS serverip is offeredto the client.
If CONFIG_BOOTP_DNS2 is enabled,the secondary DNS
serverip will be stored in theadditional environment
variable "dnsip2". Thefirst DNS serverip is always
stored in the variable"dnsip", when CONFIG_BOOTP_DNS
is added to the CONFIG_BOOTP_MASK.
CONFIG_BOOTP_SEND_HOSTNAME - SomeDHCP servers are capable
to do a dynamic update of a DNSserver. To do this, they
need the hostname of the DHCP requester.
If CONFIG_BOOP_SEND_HOSTNAME isadded to the
CONFIG_BOOTP_MASK, the content ofthe "hostname"
environment variable is passed asoption 12 to
the DHCP server.
- CDP Options:CDP选项
CONFIG_CDP_DEVICE_ID
The device id used in CDP triggerframes.
CONFIG_CDP_DEVICE_ID_PREFIX
A two character string which isprefixed to the MAC address
of the device.
CONFIG_CDP_PORT_ID
A printf format string whichcontains the ascii name of
the port. Normally is set to"eth%d" which sets
eth0 for the first ethernet, eth1for the second etc.
CONFIG_CDP_CAPABILITIES
A 32bit integer which indicatesthe device capabilities;
0x00000010 for a normal host whichdoes not forwards.
CONFIG_CDP_VERSION
An ascii string containing theversion of the software.
CONFIG_CDP_PLATFORM
An ascii string containing thename of the platform.
CONFIG_CDP_TRIGGER
A 32bit integer sent on thetrigger.
CONFIG_CDP_POWER_CONSUMPTION
A 16bit integer containing thepower consumption of the
device in .1 of milliwatts.
CONFIG_CDP_APPLIANCE_VLAN_TYPE
A byte containing the id of theVLAN.
-Status LED: CONFIG_STATUS_LED状态LED
Several configurations allow todisplay the current
status using a LED. For instance,the LED will blink
fast while running U-Boot code,stop blinking as
soon as a reply to a BOOTP requestwas received, and
start blinking slow once the Linuxkernel is running
(supported by a status LED driverin the Linux
kernel). DefiningCONFIG_STATUS_LED enables this
feature in U-Boot.
-CAN Support: CONFIG_CAN_DRIVERCAN支持
Defining CONFIG_CAN_DRIVER enablesCAN driver support
on those systems that support this(optional)
feature, like the TQM8xxL modules.
-I2C Support: CONFIG_HARD_I2C |CONFIG_SOFT_I2C I2C支持
These enable I2C serial buscommands. Defining either of
(but not both of) CONFIG_HARD_I2Cor CONFIG_SOFT_I2C will
include the appropriate I2C driverfor the selected cpu.
This will allow you to use i2ccommands at the u-boot
command line (as long as you setCFG_CMD_I2C in
CONFIG_COMMANDS) and communicatewith i2c based realtime
clock chips. See common/cmd_i2c.cfor a description of the
command line interface.
CONFIG_HARD_I2C selects the CPMhardware driver for I2C.
CONFIG_SOFT_I2C configures u-bootto use a software (aka
bit-banging) driver instead of CPMor similar hardware
support for I2C.
There are several other quantitiesthat must also be
defined when you defineCONFIG_HARD_I2C or CONFIG_SOFT_I2C.
In both cases you will need todefine CFG_I2C_SPEED
to be the frequency (in Hz) atwhich you wish your i2c bus
to run and CFG_I2C_SLAVE to be theaddress of this node (ie
the cpu's i2c node address).
Now, the u-boot i2c code for thempc8xx (cpu/mpc8xx/i2c.c)
sets the cpu up as a master nodeand so its address should
therefore be cleared to 0 (See,eg, MPC823e User's Manual
p.16-473). So, set CFG_I2C_SLAVEto 0.
That's all that's required forCONFIG_HARD_I2C.
If you use the software i2cinterface (CONFIG_SOFT_I2C)
then the following macros need tobe defined (examples are
from include/configs/lwmon.h):
I2C_INIT
(Optional). Any commands necessaryto enable the I2C
controller or configure ports.
eg: #define I2C_INIT(immr->im_cpm.cp_pbdir |= PB_SCL)
I2C_PORT
(Only for MPC8260 CPU). The I/Oport to use (the code
assumes both bits are on the sameport). Valid values
are 0..3 for ports A..D.
I2C_ACTIVE
The code necessary to make the I2Cdata line active
(driven). If the data line is open collector, this
define can be null.
eg: #define I2C_ACTIVE(immr->im_cpm.cp_pbdir |= PB_SDA)
I2C_TRISTATE
The code necessary to make the I2Cdata line tri-stated
(inactive). If the data line is open collector, this
define can be null.
eg: #define I2C_TRISTATE(immr->im_cpm.cp_pbdir &= ~PB_SDA)
I2C_READ
Code that returns TRUE if the I2Cdata line is high,
FALSE if it is low.
eg: #define I2C_READ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
I2C_SDA(bit)
If
is FALSE, it clears it (low).
eg: #define I2C_SDA(bit) \
if(bit)immr->im_cpm.cp_pbdat |= PB_SDA; \
else immr->im_cpm.cp_pbdat &= ~PB_SDA
I2C_SCL(bit)
If
is FALSE, it clears it (low).
eg: #define I2C_SCL(bit) \
if(bit)immr->im_cpm.cp_pbdat |= PB_SCL; \
else immr->im_cpm.cp_pbdat &= ~PB_SCL
I2C_DELAY
This delay is invoked four timesper clock cycle so this
controls the rate of datatransfer. The data rate thus
is 1 / (I2C_DELAY * 4). Oftendefined to be something
like:
#define I2C_DELAY udelay(2)
CFG_I2C_INIT_BOARD
When a board is reset during ani2c bus transfer
chips might think that the currenttransfer is still
in progress. On some boards it ispossible to access
the i2c SCLK line directly, eitherby using the
processor pin as a GPIO or byhaving a second pin
connected to the bus. If thisoption is defined a
custom i2c_init_board() routine inboards/xxx/board.c
is run early in the boot sequence.
CONFIG_I2CFAST (PPC405GP|PPC405EPonly)
This option enables configurationof bi_iic_fast[] flags
in u-boot bd_info structure basedon u-boot environment
variable "i2cfast". (seealso i2cfast)
-SPI Support: CONFIG_SPI SPI支持
Enables SPI driver (so far onlytested with
SPI EEPROM, also an instance workswith Crystal A/D and
D/As on the SACSng board)
CONFIG_SPI_X
Enables extended (16-bit) SPIEEPROM addressing.
(symmetrical to CONFIG_I2C_X)
CONFIG_SOFT_SPI
Enables a software (bit-bang) SPIdriver rather than
using hardware support. This is ageneral purpose
driver that only requires threegeneral I/O port pins
(two outputs, one input) tofunction. If this is
defined, the board configurationmust define several
SPI configuration items (port pinsto use, etc). For
an example, seeinclude/configs/sacsng.h.
-FPGA Support: CONFIG_FPGA_COUNT FPGA支持
Specify the number of FPGA devicesto support.
CONFIG_FPGA
Used to specify the types of FPGAdevices. For example,
#define CONFIG_FPGA CFG_XILINX_VIRTEX2
CFG_FPGA_PROG_FEEDBACK
Enable printing of hash marksduring FPGA configuration.
CFG_FPGA_CHECK_BUSY
Enable checks on FPGAconfiguration interface busy
status by the configurationfunction. This option
will require a board or devicespecific function to
be written.
CONFIG_FPGA_DELAY
If defined, a function that providesdelays in the FPGA
configuration driver.
CFG_FPGA_CHECK_CTRLC
Allow Control-C to interrupt FPGAconfiguration
CFG_FPGA_CHECK_ERROR
Check for configuration errorsduring FPGA bitfile
loading. For example, abort duringVirtex II
configuration if the INIT_B linegoes low (which
indicated a CRC error).
CFG_FPGA_WAIT_INIT
Maximum time to wait for theINIT_B line to deassert
after PROB_B has been deassertedduring a Virtex II
FPGA configuration sequence. Thedefault time is 500
mS.
CFG_FPGA_WAIT_BUSY
Maximum time to wait for BUSY todeassert during
Virtex II FPGA configuration. Thedefault is 5 mS.
CFG_FPGA_WAIT_CONFIG
Time to wait after FPGAconfiguration. The default is
200 mS.
-Configuration Management:配置管理
CONFIG_IDENT_STRING
If defined, this string will beadded to the U-Boot
version information(U_BOOT_VERSION)
-Vendor Parameter Protection: Vendor参数保护
U-Boot considers the values of theenvironment
variables "serial#"(Board Serial Number) and
"ethaddr" (EthernetAddress) to be parameters that
are set once by the board vendor /manufacturer, and
protects these variables fromcasual modification by
the user. Once set, thesevariables are read-only,
and write or delete attempts arerejected. You can
change this behviour:
If CONFIG_ENV_OVERWRITE is#defined in your config
file, the write protection forvendor parameters is
completely disabled. Anybody canchange or delete
these parameters.
Alternatively, if you #define _both_CONFIG_ETHADDR
_and_CONFIG_OVERWRITE_ETHADDR_ONCE, a default
ethernet address is installed inthe environment,
which can be changed exactly ONCEby the user. [The
serial# is unaffected by this, i.e. it remains
read-only.]
-Protected RAM:保护RAM
CONFIG_PRAM
Define this variable to enable thereservation of
"protected RAM", i. e.RAM which is not overwritten
by U-Boot. Define CONFIG_PRAM tohold the number of
kB you want to reserve for pRAM.You can overwrite
this default value by defining anenvironment
variable "pram" to thenumber of kB you want to
reserve. Note that the board infostructure will
still show the full amount of RAM.If pRAM is
reserved, a new environmentvariable "mem" will
automatically be defined to holdthe amount of
remaining RAM in a form that canbe passed as boot
argument to Linux, for instancelike that:
setenv bootargs ...mem=\${mem}
saveenv
This way you can tell Linux not touse this memory,
either, which results in a memoryregion that will
not be affected by reboots.
*WARNING* If your boardconfiguration uses automatic
detection of the RAM size, youmust make sure that
this memory test isnon-destructive. So far, the
following board configurations areknown to be
"pRAM-clean":
ETX094, IVMS8, IVML24,SPD8xx, TQM8xxL,
HERMES, IP860, RPXlite,LWMON, LANTEC,
PCU_E, FLAGADM, TQM8260
-Error Recovery:错误恢复
CONFIG_PANIC_HANG
Define this variable to stop thesystem in case of a
fatal error, so that you have toreset it manually.
This is probably NOT a good ideafor an embedded
system where you want to system toreboot
automatically as fast as possible,but it may be
useful during development sinceyou can try to debug
the conditions that lead to thesituation.
CONFIG_NET_RETRY_COUNT
This variable defines the numberof retries for
network operations like ARP, RARP,TFTP, or BOOTP
before giving up the operation. Ifnot defined, a
default value of 5 is used.
-Command Interpreter:命令注释器
CONFIG_AUTO_COMPLETE
Enable auto completion of commandsusing TAB.
Note that this feature has NOTbeen implemented yet
for the "hush" shell.
CFG_HUSH_PARSER
Define this variable to enable the"hush" shell (from
Busybox) as command lineinterpreter, thus enabling
powerful command line syntax like
if...then...else...fi conditionalsor `&&' and '||'
constructs ("shellscripts").
If undefined, you get the old,much simpler behaviour
with a somewhat smaller memoryfootprint.
CFG_PROMPT_HUSH_PS2
This defines the secondary promptstring, which is
printed when the commandinterpreter needs more input
to complete a command. Usually"> ".
Note:笔记
In the current implementation, thelocal variables
space and global environmentvariables space are
separated. Local variables arethose you define by
simply typing `name=value'. Toaccess a local
variable later on, you have write`$name' or
`${name}'; to execute the contentsof a variable
directly type `$name' at thecommand prompt.
Global environment variables arethose you use
setenv/printenv to work with. Torun a command stored
in such a variable, you need touse the run command,
and you must not use the '$' signto access them.
To store commands and specialcharacters in a
variable, please use doublequotation marks
surrounding the whole text of thevariable, instead
of the backslashes beforesemicolons and special
symbols.
-Commandline Editing and History:命令编辑和历史
CONFIG_CMDLINE_EDITING
Enable editiong and Historyfunctions for interactive
commandline input operations
-Default Environment:默认环境
CONFIG_EXTRA_ENV_SETTINGS
Define this to contain any numberof null terminated
strings (variable = value pairs)that will be part of
the default environment compiledinto the boot image.
For example, place something likethis in your
board's config file:
#define CONFIG_EXTRA_ENV_SETTINGS\
"myvar1=value1\0"\
"myvar2=value2\0"
Warning: This method is based onknowledge about the
internal format how theenvironment is stored by the
U-Boot code. This is NOT anofficial, exported
interface! Although it is unlikelythat this format
will change soon, there is noguarantee either.
You better know what you are doinghere.
Note: overly (ab)use of thedefault environment is
discouraged. Make sure to checkother ways to preset
the environment like theautoscript function or the
boot command first.
-DataFlash Support:DataFlash支持
CONFIG_HAS_DATAFLASH
Defining this option enablesDataFlash features and
allows to read/write in Dataflashvia the standard
commands cp, md...
-SystemACE Support: SystemACE支持
CONFIG_SYSTEMACE
Adding this option adds supportfor Xilinx SystemACE
chips attached via some sort oflocal bus. The address
of the chip must alsh be definedin the
CFG_SYSTEMACE_BASE macro. Forexample:
#define CONFIG_SYSTEMACE
#define CFG_SYSTEMACE_BASE0xf0000000
When SystemACE support is added,the "ace" device type
becomes available to the fatcommands, i.e. fatls.
-TFTP Fixed UDP Port:TFTP UDP端口
CONFIG_TFTP_PORT
If this is defined, theenvironment variable tftpsrcp
is used to supply the TFTP UDPsource port value.
If tftpsrcp isn't defined, thenormal pseudo-random port
number generator is used.
Also, the environment variabletftpdstp is used to supply
the TFTP UDP destination portvalue. If tftpdstp isn't
defined, the normal port 69 isused.
The purpose for tftpsrcp is toallow a TFTP server to
blindly start the TFTP transferusing the pre-configured
target IP address and UDP port.This has the effect of
"punching through" the(Windows XP) firewall, allowing
the remainder of the TFTP transferto proceed normally.
A better solution is to properlyconfigure the firewall,
but sometimes that is not allowed.
-Show boot progress:显示boot进展
CONFIG_SHOW_BOOT_PROGRESS
Defining this option allows to addsome board-
specific code (calling auser-provided function
"show_boot_progress(int)")that enables you to show
the system's boot progress on somedisplay (for
example, some LED's) on yourboard. At the moment,
the following checkpoints areimplemented:
Arg Where When
1 common/cmd_bootm.c before attempting to boot an image
-1 common/cmd_bootm.c Image header has bad magic number
2 common/cmd_bootm.c Image header has correct magic number
-2 common/cmd_bootm.c Image header has bad checksum
3 common/cmd_bootm.c Image header has correct checksum
-3 common/cmd_bootm.c Image data has bad checksum
4 common/cmd_bootm.c Image data has correct checksum
-4 common/cmd_bootm.c Image is for unsupported architecture
5 common/cmd_bootm.c Architecture check OK
-5 common/cmd_bootm.c Wrong Image Type (not kernel, multi,standalone)
6 common/cmd_bootm.c Image Type check OK
-6 common/cmd_bootm.c gunzip uncompression error
-7 common/cmd_bootm.c Unimplemented compression type
7 common/cmd_bootm.c Uncompression OK
-8 common/cmd_bootm.c Wrong Image Type (not kernel, multi,standalone)
8 common/cmd_bootm.c Image Type check OK
-9 common/cmd_bootm.c Unsupported OS (not Linux, BSD, VxWorks,QNX)
9 common/cmd_bootm.c Start initial ramdisk verification
-10 common/cmd_bootm.c Ramdisk header has bad magic number
-11 common/cmd_bootm.c Ramdisk header has bad checksum
10 common/cmd_bootm.c Ramdisk header is OK
-12 common/cmd_bootm.c Ramdisk data has bad checksum
11 common/cmd_bootm.c Ramdisk data has correct checksum
12 common/cmd_bootm.c Ramdisk verification complete, startloading
-13 common/cmd_bootm.c Wrong Image Type (not PPC Linux Ramdisk)
13 common/cmd_bootm.c Start multifile image verification
14 common/cmd_bootm.c No initial ramdisk, no multifile,continue.
15 common/cmd_bootm.c All preparation done, transferring controlto OS
-30 lib_ppc/board.c Fatal error, hang the system
-31 post/post.c POST test failed, detected bypost_output_backlog()
-32 post/post.c POST test failed, detected bypost_run_single()
-1 common/cmd_doc.c Bad usage of "doc" command
-1 common/cmd_doc.c No boot device
-1 common/cmd_doc.c Unknown Chip ID on boot device
-1 common/cmd_doc.c Read Error on boot device
-1 common/cmd_doc.c Image header has bad magic number
-1 common/cmd_ide.c Bad usage of "ide" command
-1 common/cmd_ide.c No boot device
-1 common/cmd_ide.c Unknown boot device
-1 common/cmd_ide.c Unknown partition table
-1 common/cmd_ide.c Invalid partition type
-1 common/cmd_ide.c Read Error on boot device
-1 common/cmd_ide.c Image header has bad magic number
-1 common/cmd_nand.c Bad usage of "nand" command
-1 common/cmd_nand.c No boot device
-1 common/cmd_nand.c Unknown Chip ID on boot device
-1 common/cmd_nand.c Read Error on boot device
-1 common/cmd_nand.c Image header has bad magic number
-1 common/env_common.c Environment has a bad CRC, using default
ModemSupport:Modem支持
--------------
[sofar only for SMDK2400 and TRAB boards]
-Modem support endable:
CONFIG_MODEM_SUPPORT
-RTS/CTS Flow control enable:
CONFIG_HWFLOW
-Modem debug support:
CONFIG_MODEM_SUPPORT_DEBUG
Enables debugging stuff (charscreen[1024], dbg())
for modem support. Useful onlywith BDI2000.
-Interrupt support (PPC):中断支持
There are common interrupt_init()and timer_interrupt()
for all PPC archs.interrupt_init() calls interrupt_init_cpu()
for cpu specific initialization.interrupt_init_cpu()
should set decrementer_count toappropriate value. If
cpu resets decrementerautomatically after interrupt
(ppc4xx) it should setdecrementer_count to zero.
timer_interrupt() callstimer_interrupt_cpu() for cpu
specific handling. If board haswatchdog / status_led
/ other_activity_monitor it worksautomatically from
general timer_interrupt().
-General:通用
In the target system modem supportis enabled when a
specific key (key combination) ispressed during
power-on. Otherwise U-Boot willboot normally
(autoboot). The key_pressed()fuction is called from
board_init(). Currentlykey_pressed() is a dummy
function, returning 1 and thusenabling modem
initialization.
If there are no modem init stringsin the
environment, U-Boot proceed toautoboot; the
previous output (banner, infoprintfs) will be
supressed, though.
See also: doc/README.Modem
ConfigurationSettings:配置设置
-----------------------
-CFG_LONGHELP: Defined when you want long help messages included;
undefine this when you're short ofmemory.
-CFG_PROMPT: This is what U-Boot printson the console to
prompt for user input.
-CFG_CBSIZE: Buffer size for input fromthe Console
-CFG_PBSIZE: Buffer size for Consoleoutput
-CFG_MAXARGS: max. Number of argumentsaccepted for monitor commands
-CFG_BARGSIZE: Buffer size for Boot Arguments which are passed to
the application (usually a Linuxkernel) when it is
booted
-CFG_BAUDRATE_TABLE:
List of legal baudrate settingsfor this board.
-CFG_CONSOLE_INFO_QUIET
Suppress display of consoleinformation at boot.
-CFG_CONSOLE_IS_IN_ENV
If the board specific function
extern intoverwrite_console (void);
returns 1, the stdin, stderr andstdout are switched to the
serial port, else the settings inthe environment are used.
-CFG_CONSOLE_OVERWRITE_ROUTINE
Enable the call tooverwrite_console().
-CFG_CONSOLE_ENV_OVERWRITE
Enable overwrite of previousconsole environment settings.
-CFG_MEMTEST_START, CFG_MEMTEST_END:
Begin and End addresses of thearea used by the
simple memory test.
-CFG_ALT_MEMTEST:
Enable an alternate, moreextensive memory test.
-CFG_MEMTEST_SCRATCH:
Scratch address used by thealternate memory test
You only need to set this ifaddress zero isn't writeable
-CFG_TFTP_LOADADDR:
Default load address for networkfile downloads
-CFG_LOADS_BAUD_CHANGE:
Enable temporary baudrate changewhile serial download
-CFG_SDRAM_BASE:
Physical start address of SDRAM._Must_ be 0 here.
-CFG_MBIO_BASE:
Physical start address ofMotherboard I/O (if using a
Cogent motherboard)
-CFG_FLASH_BASE:
Physical start address of Flashmemory.
-CFG_MONITOR_BASE:
Physical start address of bootmonitor code (set by
make config files to be same asthe text base address
(TEXT_BASE) used when linking) -same as
CFG_FLASH_BASE when booting fromflash.
-CFG_MONITOR_LEN:
Size of memory reserved formonitor code, used to
determine _at_compile_time_ (!) ifthe environment is
embedded within the U-Boot image,or in a separate
flash sector.
-CFG_MALLOC_LEN:
Size of DRAM reserved for malloc()use.
-CFG_BOOTM_LEN:
Normally compressed uImages arelimited to an
uncompressed size of 8 MBytes. Ifthis is not enough,
you can define CFG_BOOTM_LEN inyour board config file
to adjust this setting to yourneeds.
-CFG_BOOTMAPSZ:
Maximum size of memory mapped bythe startup code of
the Linux kernel; all data thatmust be processed by
the Linux kernel (bd_info, bootarguments, eventually
initrd image) must be put belowthis limit.
-CFG_MAX_FLASH_BANKS:
Max number of Flash memory banks
-CFG_MAX_FLASH_SECT:
Max number of sectors on a Flashchip
-CFG_FLASH_ERASE_TOUT:
Timeout for Flash erase operations(in ms)
-CFG_FLASH_WRITE_TOUT:
Timeout for Flash write operations(in ms)
-CFG_FLASH_LOCK_TOUT
Timeout for Flash set sector lockbit operation (in ms)
-CFG_FLASH_UNLOCK_TOUT
Timeout for Flash clear lock bitsoperation (in ms)
-CFG_FLASH_PROTECTION
If defined, hardware flash sectorsprotection is used
instead of U-Boot softwareprotection.
-CFG_DIRECT_FLASH_TFTP:
Enable TFTP transfers directly toflash memory;
without this option such adownload has to be
performed in two steps: (1)download to RAM, and (2)
copy from RAM to flash.
The two-step approach is usuallymore reliable, since
you can check if the downloadworked before you erase
the flash, but in some situations(when sytem RAM is
too limited to allow for a temporycopy of the
downloaded image) this option maybe very useful.
-CFG_FLASH_CFI:
Define if the flash driver usesextra elements in the
common flash structure for storingflash geometry.
-CFG_FLASH_CFI_DRIVER
This option also enables thebuilding of the cfi_flash driver
in the drivers directory
-CFG_FLASH_QUIET_TEST
If this option is defined, thecommon CFI flash doesn't
print it's warning upon notrecognized FLASH banks. This
is useful, if some of theconfigured banks are only
optionally available.
-CFG_RX_ETH_BUFFER:
Defines the number of ethernetreceive buffers. On some
ethernet controllers it isrecommended to set this value
to 8 or even higher (EEPRO100 or405 EMAC), since all
buffers can be full shortly afterenabling the interface
on high ethernet traffic.
Defaults to 4 if not defined.
Thefollowing definitions that deal with the placement and management
ofenvironment data (variable area); in general, we support the
followingconfigurations:
-CFG_ENV_IS_IN_FLASH:
Define this if the environment is inflash memory.
a) The environment occupies one wholeflash sector, which is
"embedded" in the text segment with the U-Boot code. This
happens usually with "bottom boot sector" or "top boot
sector" type flash chips, which have several smaller
sectors at the start or the end. For instance, such a
layout can have sector sizes of 8, 2x4, 16, Nx32 kB. In
such a case you would place the environment in one of the
4 kB sectors - with U-Boot code before and after it. With
"top boot sector" type flash chips, you would put the
environment in one of the last sectors, leaving a gap
between U-Boot and the environment.
- CFG_ENV_OFFSET:
Offset of environment data (variable area) to the
beginning of flash memory; for instance, with bottom boot
type flash chips the second sector can be used: the offset
for this sector is given here.
CFG_ENV_OFFSET is used relative to CFG_FLASH_BASE.
- CFG_ENV_ADDR:
This is just another way to specify the start address of
the flash sector containing the environment (instead of
CFG_ENV_OFFSET).
- CFG_ENV_SECT_SIZE:
Size of the sector containing the environment.
b) Sometimes flash chips have few, equalsized, BIG sectors.
In such a case you don't want to spend a whole sector for
the environment.
- CFG_ENV_SIZE:
If you use this in combination with CFG_ENV_IS_IN_FLASH
and CFG_ENV_SECT_SIZE, you can specify to use only a part
of this flash sector for the environment. This saves
memory for the RAM copy of the environment.
It may also save flash memory if you decide to use this
when your environment is "embedded" within U-Boot code,
since then the remainder of the flash sector could be used
for U-Boot code. It should be pointed out that this is
STRONGLY DISCOURAGED from a robustness point of view:
updating the environment in flash makes it always
necessary to erase the WHOLE sector. If something goes
wrong before the contents has been restored from a copy in
RAM, your target system will be dead.
- CFG_ENV_ADDR_REDUND
CFG_ENV_SIZE_REDUND
These settings describe a second storage area used to hold
a redundand copy of the environment data, so that there is
a valid backup copy in case there is a power failure during
a "saveenv" operation.
BECAREFUL! Any changes to the flash layout, and some changes to the
sourcecode will make it necessary to adapt
accordingly!
-CFG_ENV_IS_IN_NVRAM:
Define this if you have some non-volatilememory device
(NVRAM, battery buffered SRAM) which youwant to use for the
environment.
- CFG_ENV_ADDR:
- CFG_ENV_SIZE:
These two #defines are used to determin the memory area you
want to use for environment. It is assumed that this memory
can just be read and written to, without any special
provision.
BECAREFUL! The first access to the environment happens quite early
inU-Boot initalization (when we try to get the setting of for the
consolebaudrate). You *MUST* have mappend your NVRAM area then, or
U-Bootwill hang.
Pleasenote that even with NVRAM we still use a copy of the
environmentin RAM: we could work on NVRAM directly, but we want to
keepsettings there always unmodified except somebody uses "saveenv"
tosave the current settings.
-CFG_ENV_IS_IN_EEPROM:
Use this if you have an EEPROM or similarserial access
device and a driver for it.
- CFG_ENV_OFFSET:
- CFG_ENV_SIZE:
These two #defines specify the offset and size of the
environment area within the total memory of your EEPROM.
- CFG_I2C_EEPROM_ADDR:
If defined, specified the chip address of the EEPROM device.
The default address is zero.
- CFG_EEPROM_PAGE_WRITE_BITS:
If defined, the number of bits used to address bytes in a
single page in the EEPROM device. A 64 byte page, for example
would require six bits.
- CFG_EEPROM_PAGE_WRITE_DELAY_MS:
If defined, the number of milliseconds to delay between
page writes. The default iszero milliseconds.
- CFG_I2C_EEPROM_ADDR_LEN:
The length in bytes of the EEPROM memory array address. Note
that this is NOT the chip address length!
- CFG_I2C_EEPROM_ADDR_OVERFLOW:
EEPROM chips that implement "address overflow" are ones
like Catalyst 24WC04/08/16 which has 9/10/11 bits of
address and the extra bits end up in the "chip address" bit
slots. This makes a 24WC08 (1Kbyte) chip look like four 256
byte chips.
Note that we consider the length of the address field to
still be one byte because the extra address bits are hidden
in the chip address.
- CFG_EEPROM_SIZE:
The size in bytes of the EEPROM device.
-CFG_ENV_IS_IN_DATAFLASH:
Define this if you have a DataFlashmemory device which you
want to use for the environment.
- CFG_ENV_OFFSET:
- CFG_ENV_ADDR:
- CFG_ENV_SIZE:
These three #defines specify the offset and size of the
environment area within the total memory of your DataFlash placed
at the specified address.
-CFG_ENV_IS_IN_NAND:
Define this if you have a NAND devicewhich you want to use
for the environment.
- CFG_ENV_OFFSET:
- CFG_ENV_SIZE:
These two #defines specify the offset and size of the environment
area within the first NAND device.
- CFG_ENV_OFFSET_REDUND
This setting describes a second storage area of CFG_ENV_SIZE
size used to hold a redundant copy of the environment data,
so that there is a valid backup copy in case there is a
power failure during a "saveenv" operation.
Note: CFG_ENV_OFFSET andCFG_ENV_OFFSET_REDUND must be aligned
to a block boundary, and CFG_ENV_SIZEmust be a multiple of
the NAND devices block size.
-CFG_SPI_INIT_OFFSET
Defines offset to the initial SPI bufferarea in DPRAM. The
area is used at an early stage (ROM part)if the environment
is configured to reside in the SPIEEPROM: We need a 520 byte
scratch DPRAM area. It is used betweenthe two initialization
calls (spi_init_f() and spi_init_r()). Avalue of 0xB00 seems
to be a good choice since it makes it farenough from the
start of the data area as well as fromthe stack pointer.
Pleasenote that the environment is read-only as long as the monitor
hasbeen relocated to RAM and a RAM copy of the environment has been
created;also, when using EEPROM you will have to use getenv_r()
untilthen to read environment variables.
Theenvironment is protected by a CRC32 checksum. Before the monitor
isrelocated into RAM, as a result of a bad CRC you will be working
withthe compiled-in default environment - *silently*!!! [This is
necessary,because the first environment variable we need is the
"baudrate"setting for the console - if we have a bad CRC, we don't
haveany device yet where we could complain.]
Note:once the monitor has been relocated, then it will complain if
thedefault environment is used; a new CRC is computed as soon as you
usethe "saveenv" command to store a valid environment.
-CFG_FAULT_ECHO_LINK_DOWN:
Echo the inverted Ethernet linkstate to the fault LED.
Note: If this option is active,then CFG_FAULT_MII_ADDR
also needs to be defined.
-CFG_FAULT_MII_ADDR:
MII address of the PHY to checkfor the Ethernet link state.
-CFG_64BIT_VSPRINTF:
Makes vsprintf (and all *printffunctions) support printing
of 64bit values by using the Lquantifier
-CFG_64BIT_STRTOUL:
Adds simple_strtoull that returnsa 64bit value
LowLevel (hardware related) configuration options:
---------------------------------------------------
-CFG_CACHELINE_SIZE:
Cache Line Size of the CPU.
-CFG_DEFAULT_IMMR:
Default address of the IMMR aftersystem reset.
Needed on some 8260 systems(MPC8260ADS, PQ2FADS-ZU,
and RPXsuper) to be able to adjustthe position of
the IMMR register after a reset.
-Floppy Disk Support:
CFG_FDC_DRIVE_NUMBER
the default drive number (defaultvalue 0)
CFG_ISA_IO_STRIDE
defines the spacing between fdcchipset registers
(default value 1)
CFG_ISA_IO_OFFSET
defines the offset of registerfrom address. It
depends on which part of the databus is connected to
the fdc chipset. (default value 0)
If CFG_ISA_IO_STRIDECFG_ISA_IO_OFFSET and
CFG_FDC_DRIVE_NUMBER areundefined, they take their
default value.
if CFG_FDC_HW_INIT is defined,then the function
fdc_hw_init() is called at thebeginning of the FDC
setup. fdc_hw_init() must beprovided by the board
source code. It is used to makehardware dependant
initializations.
-CFG_IMMR: Physical address of the InternalMemory.
DO NOT CHANGE unless you knowexactly what you're
doing! (11-4) [MPC8xx/82xx systemsonly]
-CFG_INIT_RAM_ADDR:
Start address of memory area thatcan be used for
initial data and stack; pleasenote that this must be
writable memory that is workingWITHOUT special
initialization,i. e. you CANNOT use normal RAM which
will become available only afterprogramming the
memory controller and runningcertain initialization
sequences.
U-Boot uses the following memorytypes:
- MPC8xx and MPC8260: IMMR(internal memory of the CPU)
- MPC824X: data cache
- PPC4xx: data cache
-CFG_GBL_DATA_OFFSET:
Offset of the initial datastructure in the memory
area defined by CFG_INIT_RAM_ADDR.Usually
CFG_GBL_DATA_OFFSET is chosen suchthat the initial
data is located at the end of theavailable space
(sometimes written as(CFG_INIT_RAM_END -
CFG_INIT_DATA_SIZE), and theinitial stack is just
below that area (growing from(CFG_INIT_RAM_ADDR +
CFG_GBL_DATA_OFFSET) downward.
Note:
On the MPC824X (or other systemsthat use the data
cache for initial memory) theaddress chosen for
CFG_INIT_RAM_ADDR is basicallyarbitrary - it must
point to an otherwise UNUSEDaddress space between
the top of RAM and the start ofthe PCI space.
-CFG_SIUMCR: SIU Module Configuration(11-6)
-CFG_SYPCR: System Protection Control(11-9)
-CFG_TBSCR: Time Base Status andControl (11-26)
-CFG_PISCR: Periodic Interrupt Statusand Control (11-31)
-CFG_PLPRCR: PLL, Low-Power, and ResetControl Register (15-30)
-CFG_SCCR: System Clock and reset ControlRegister (15-27)
-CFG_OR_TIMING_SDRAM:
SDRAM timing
-CFG_MAMR_PTA:
periodic timer for refresh
-CFG_DER: Debug Event Register (37-47)
-FLASH_BASE0_PRELIM, FLASH_BASE1_PRELIM, CFG_REMAP_OR_AM,
CFG_PRELIM_OR_AM, CFG_OR_TIMING_FLASH,CFG_OR0_REMAP,
CFG_OR0_PRELIM, CFG_BR0_PRELIM,CFG_OR1_REMAP, CFG_OR1_PRELIM,
CFG_BR1_PRELIM:
Memory Controller Definitions:BR0/1 and OR0/1 (FLASH)
-SDRAM_BASE2_PRELIM, SDRAM_BASE3_PRELIM, SDRAM_MAX_SIZE,
CFG_OR_TIMING_SDRAM, CFG_OR2_PRELIM,CFG_BR2_PRELIM,
CFG_OR3_PRELIM, CFG_BR3_PRELIM:
Memory Controller Definitions:BR2/3 and OR2/3 (SDRAM)
-CFG_MAMR_PTA, CFG_MPTPR_2BK_4K, CFG_MPTPR_1BK_4K, CFG_MPTPR_2BK_8K,
CFG_MPTPR_1BK_8K, CFG_MAMR_8COL,CFG_MAMR_9COL:
Machine Mode Register and MemoryPeriodic Timer
Prescaler definitions (SDRAMtiming)
-CFG_I2C_UCODE_PATCH, CFG_I2C_DPMEM_OFFSET [0x1FC0]:
enable I2C microcode relocationpatch (MPC8xx);
define relocation offset in DPRAM[DSP2]
-CFG_SPI_UCODE_PATCH, CFG_SPI_DPMEM_OFFSET [0x1FC0]:
enable SPI microcode relocationpatch (MPC8xx);
define relocation offset in DPRAM[SCC4]
-CFG_USE_OSCCLK:
Use OSCM clock mode on MBX8xxboard. Be careful,
wrong setting might damage yourboard. Read
doc/README.MBX before setting thisvariable!
-CFG_CPM_POST_WORD_ADDR: (MPC8xx, MPC8260 only)
Offset of the bootmode word inDPRAM used by post
(Power On Self Tests). Thisdefinition overrides
#define'd default value incommproc.h resp.
cpm_8260.h.
-CFG_PCI_SLV_MEM_LOCAL, CFG_PCI_SLV_MEM_BUS, CFG_PICMR0_MASK_ATTRIB,
CFG_PCI_MSTR0_LOCAL, CFG_PCIMSK0_MASK,CFG_PCI_MSTR1_LOCAL,
CFG_PCIMSK1_MASK, CFG_PCI_MSTR_MEM_LOCAL,CFG_PCI_MSTR_MEM_BUS,
CFG_CPU_PCI_MEM_START, CFG_PCI_MSTR_MEM_SIZE,CFG_POCMR0_MASK_ATTRIB,
CFG_PCI_MSTR_MEMIO_LOCAL,CFG_PCI_MSTR_MEMIO_BUS, CPU_PCI_MEMIO_START,
CFG_PCI_MSTR_MEMIO_SIZE,CFG_POCMR1_MASK_ATTRIB, CFG_PCI_MSTR_IO_LOCAL,
CFG_PCI_MSTR_IO_BUS, CFG_CPU_PCI_IO_START,CFG_PCI_MSTR_IO_SIZE,
CFG_POCMR2_MASK_ATTRIB: (MPC826x only)
Overrides the default PCI memorymap in cpu/mpc8260/pci.c if set.
-CONFIG_ETHER_ON_FEC[12]
Define to enable FEC[12] on a 8xxseries processor.
-CONFIG_FEC[12]_PHY
Define to the hardcoded PHYaddress which corresponds
to the given FEC; i. e.
#defineCONFIG_FEC1_PHY 4
means that the PHY with address 4is connected to FEC1
When set to -1, means to probe forfirst available.
-CONFIG_FEC[12]_PHY_NORXERR
The PHY does not have a RXERR line(RMII only).
(so program the FEC to ignore it).
-CONFIG_RMII
Enable RMII mode for all FECs.
Note that this is a global option,we can't
have one FEC in standard MII modeand another in RMII mode.
-CONFIG_CRC32_VERIFY
Add a verify option to the crc32command.
The syntax is:
=> crc32 -v
Where address/count indicate amemory area
and crc32 is the correct crc32which the
area should have.
-CONFIG_LOOPW
Add the "loopw" memorycommand. This only takes effect if
the memory commands are activatedglobally (CFG_CMD_MEM).
-CONFIG_MX_CYCLIC
Add the "mdc" and"mwc" memory commands. These are cyclic
"md/mw" commands.
Examples:
=> mdc.b 10 4 500
This command will print 4 bytes(10,11,12,13) each 500 ms.
=> mwc.l 100 12345678 10
This command will write 12345678to address 100 all 10 ms.
This only takes effect if thememory commands are activated
globally (CFG_CMD_MEM).
-CONFIG_SKIP_LOWLEVEL_INIT
-CONFIG_SKIP_RELOCATE_UBOOT
[ARM only] If these variables aredefined, then
certain low level initializations(like setting up
the memory controller) are omittedand/or U-Boot does
not relocate itself into RAM.
Normally these variables MUST NOTbe defined. The
only exception is when U-Boot isloaded (to RAM) by
some other boot loader or by adebugger which
performs these intializationsitself.
Buildingthe Software:编译软件
======================
BuildingU-Boot has been tested in native PPC environments (on a
PowerBookG3 running LinuxPPC 2000) and in cross environments
(runningRedHat 6.x and 7.x Linux on x86, Solaris 2.6 on a SPARC, and
NetBSD1.5 on x86).
编译U-Boot已经在PPC环境和交叉环境中被测试过。
Ifyou are not using a native PPC environment, it is assumed that you
havethe GNU cross compiling tools available in your path and named
witha prefix of "powerpc-linux-". If this is not the case, (e.g. if
youare using Monta Vista's Hard Hat Linux CDK 1.2) you must change
thedefinition of CROSS_COMPILE in Makefile. For HHL on a 4xx CPU,
changeit to:
如果你没使用过一个PPC环境,假设你有可行的GUN交叉编译工具在你
路径里,并且命令为以” powerpc-linux-”为前缀。如果它不是这种情况(
例如你是使用Monta Vista的Hard Hat Linux CDK 1.2)。你必须要改变
Makefile中的编译交叉工具链的定义。以在4xx CPU上面的HHL并改变它:
CROSS_COMPILE = ppc_4xx-
U-Bootis intended to be simple to build. After installing the
sources you mustconfigure U-Boot for one specific board type. This
isdone by typing:
U-Boot意在易于编译。完成下载后你首先必须配置U-Boot为一个特定的
板类型,尝试这个操作:
make NAME_config
where"NAME_config" is the name of one of the existing
configurations;the following names are supported:
ADCIOP_config FPS860L_config omap730p2_config
ADS860_config GEN860T_config pcu_e_config
Alaska8220_config
AR405_config GENIETV_config PIP405_config
at91rm9200dk_config GTH_config QS823_config
CANBT_config hermes_config QS850_config
cmi_mpc5xx_config hymod_config QS860T_config
cogent_common_config IP860_config RPXlite_config
cogent_mpc8260_config IVML24_config RPXlite_DW_config
cogent_mpc8xx_config IVMS8_config RPXsuper_config
CPCI405_config JSE_config rsdproto_config
CPCIISER4_config LANTEC_config Sandpoint8240_config
csb272_config lwmon_config sbc8260_config
CU824_config MBX860T_config sbc8560_33_config
DUET_ADS_config MBX_config sbc8560_66_config
EBONY_config MPC8260ADS_config SM850_config
ELPT860_config MPC8540ADS_config SPD823TS_config
ESTEEM192E_config MPC8540EVAL_config stxgp3_config
ETX094_config MPC8560ADS_config SXNI855T_config
FADS823_config NETVIA_config TQM823L_config
FADS850SAR_config omap1510inn_config TQM850L_config
FADS860T_config omap1610h2_config TQM855L_config
FPS850L_config omap1610inn_config TQM860L_config
omap5912osk_config walnut_config
omap2420h4_config Yukon8220_config
ZPC1900_config
Note:for some board special configuration names may exist; check if
additional information is available fromthe board vendor; for
instance, the TQM823L systems areavailable without (standard)
or with LCD support. You can select suchadditional "features"
when chosing the configuration, i. e.
注:对于一些特定板指定配置名字也许已存在;从板供应商那检查是
否附加信息是可行的。例如,TQM823L系统在没有标准或有LCD支持
时是可行的。当你选择配置时,你可以选择类似特征条件。例如:
make TQM823L_config
- will configure for a plain TQM823L, i.e. no LCD support
make TQM823L_LCD_config
- will configure for a TQM823L with U-Bootconsole on LCD
etc.
Finally,type "make all", and you should get some working U-Boot
imagesready for download to / installation on your system:
最后,输入make all,你将获得一些可行的uboot镜像,该镜像准备
下载到你的系统中。
-"u-boot.bin" is a raw binary image
-"u-boot" is an image in ELF binary format
-"u-boot.srec" is in Motorola S-Record format
Bydefault the build is performed locally and the objects are saved
inthe source directory. One of the two methods can be used to change
thisbehavior and build U-Boot to some external directory:
默认编译是在源目录下局部执行并保存目标对象。两种方法中的一种是
去改变这个行为和编译U-Boot到一些外部目录:
1.Add O= to the make command line invocations:
make O=/tmp/build distclean
make O=/tmp/build NAME_config
make O=/tmp/build all
2.Set environment variable BUILD_DIR to point to the desired location:
export BUILD_DIR=/tmp/build
make distclean
make NAME_config
make all
Notethat the command line "O=" setting overrides the BUILD_DIRenvironment
variable.
注意命令行”O”的设置会覆盖了BUILD_DIR环境变量。
Pleasebe aware that the Makefiles assume you are using GNU make, so
forinstance on NetBSD you might need to use "gmake" instead of
native"make".
Ifthe system board that you have is not listed, then you will need
toport U-Boot to your hardware platform. To do this, follow these
steps:
如果列表中没有你的系统板,那么你需要去转uboot到你的硬件平台。
按以下的步骤来做:
1. Add a new configuration option for your boardto the toplevel
"Makefile" and to the"MAKEALL" script, using the existing
entries as examples. Note that here and atmany other places
boards and other names are listed inalphabetical sort order. Please
keep this order.
在你的板子添加一个新配置选项在项层目录的Makefile和MAKEALL
脚本,使用已存在的词目和例子。注意这里和在许多其他板子,是
按字母顺序列的其他名字。
2. Create a new directory to hold your boardspecific code. Add any
files you need. In your board directory,you will need at least
the "Makefile", a "
创建一个新目录去支持你的板子的指定代码。添加一些你需要的文
件。在你的板目录下,你必须至少有Makefile和
和u-boot.lds文件。
3. Create a new configuration file"include/configs/
your board
为你的板子创建一个新的配置文件include/configs/
3. If you're porting U-Boot to a new CPU, thenalso create a new
directory to hold your CPU specific code. Add any files youneed.
如果你追加一个新CPU到U-Boot中,那么也要创建一个新目录以
支持你的CPU指定代码。根据需要增加一些文件。
4. Run "make
使用你的新名字运行make
5. Type "make", and you should get aworking "u-boot.srec" file
to be installed on your target system.
输入make,你将获得一个可用的u-boot.srec文件,该文件用于
下去到你的目标系统板。
6. Debug and solve any problems that mightarise.
[Of course, this last step is much harderthan it sounds.]
调试和解决可以出现的所有问题。
Testingof U-Boot Modifications, Ports to New Hardware, etc.:
==============================================================
测试U-Boot变更,增加新硬件,例如:
Ifyou have modified U-Boot sources (for instance added a new board
or support for new devices, a new CPU, etc.) you are expected to
providefeedback to the other developers. The feedback normally takes
theform of a "patch", i. e. a context diff against a certain (latest
officialor latest in CVS) version of U-Boot sources.
如果你有修改U-Boot源代码(例如增加一个新板或者支持一个新
设备,一个新CPU),期待你为其它开发者提供一个回馈。该回馈
通常以patch的格式。例如:一个环境差异对某个(最新官方或最
新CVS)版本的U-Boot源码。
Butbefore you submit such a patch, please verify that your modifi-
cation did not break existing code. At least makesure that *ALL* of
thesupported boards compile WITHOUT ANY compiler warnings. To do so,
justrun the "MAKEALL" script, which will configure and build U-Boot
forALL supported system. Be warned, this will take a while. You can
select which (cross) compiler to use by passing a `CROSS_COMPILE'
environmentvariable to the script, i. e. to use the cross tools from
MontaVista'sHard Hat Linux you can type
然而,在你提交类似补丁之前,请确保你的修改没有破坏已有代码。
至少确认所有支持的板编译没有任何的警告。这样做,运行MAKEALL
脚本,该脚本配置和编译所有支持系统的U-Boot。需要注意,这将
需要一定时间。你可以修改CROSS_COMPILE环境变量到脚本以选择
交叉工具链。
CROSS_COMPILE=ppc_8xx- MAKEALL
orto build on a native PowerPC system you can type
CROSS_COMPILE=' ' MAKEALL
Whenusing the MAKEALL script, the default behaviour is to build U-Boot
inthe source directory. This location can be changed by setting the
BUILD_DIRenvironment variable. Also, for each target built, the MAKEALL
scriptsaves two log files (
settingthe MAKEALL_LOGDIR environment variable. For example:
export BUILD_DIR=/tmp/build
export MAKEALL_LOGDIR=/tmp/log
CROSS_COMPILE=ppc_8xx- MAKEALL
Withthe above settings build objects are saved in the /tmp/build, log
filesare saved in the /tmp/log and the source tree remains clean during
thewhole build process.
Seealso "U-Boot Porting Guide" below.
MonitorCommands - Overview:监控命令综述
============================
go - start application at address 'addr'
从'addr'地址中启动应用程序
run - run commands in an environment variable
运行环境变量中的命令
bootm - boot application image from memory
从内存中引导应用程序镜像
bootp - boot image via network using BootP/TFTPprotocol
通过网络使用BootP/TFTP协议启动镜像
tftpboot-boot image via network using TFTP protocol
and env variables "ipaddr" and "serverip"
(and eventually "gatewayip")
通过网络使用TFTP协议和环境变量中的IP地址和
服务器地址启动镜像
rarpboot-boot image via network using RARP/TFTP protocol
通过网络使用RARP/TFTP协议启动镜像
diskboot-boot from IDE devicebootd - bootdefault, i.e., run 'bootcmd'
从IDE设备bootd中启动镜像
loads - load S-Record file over serial line
通过串口线加载S-Record
loadb - load binary file over serial line(kermit mode)
通过串口线加载二进制文件(kermit模式)
md - memory display
显示内存
mm - memory modify (auto-incrementing)
修改内存(自动增加)
nm - memory modify (constant address)
修改内存(固定地址)
mw - memory write (fill)
写内存
cp - memory copy
拷贝内存
cmp - memory compare
比较内存
crc32 - checksum calculation
计算校验码
imd - i2c memory display
I2C内存显示
imm - i2c memory modify (auto-incrementing)
I2C内存修改(自动增加)
inm - i2c memory modify (constant address)
I2C内存修改(固定地址)
imw - i2c memory write (fill)
写I2C内存
icrc32 - i2c checksum calculation
I2C计算校验码
iprobe - probe to discover valid I2C chip addresses
探测并发现合法的I2C芯片地址
iloop - infinite loop on address range
在地址范围内无限循环
isdram - print SDRAM configuration information
打印SDRAM配置信息
sspi - SPI utility commands
SPI实用命令
base - print or set address offset
打印或设置地址偏移
printenv-print environment variables
打印环境变量
setenv - set environment variables
设置环境变量
saveenv- save environment variables to persistent storage
保存环境变量到不易变的存储器中
protect- enable or disable FLASH write protection
使能或禁止FLASH写保护
erase - erase FLASH memory
擦除FLASH内存
flinfo - print FLASH memory information
打印FLASH内存信息
bdinfo - print Board Info structure
打印板信息结构
iminfo - print header information for applicationimage
打印应用程序镜像的头信息
coninfo- print console devices and informations
打印控制台设备和信息
ide - IDE sub-system
IDE sub系统
loop - infinite loop on address range
在地址范围内无限循环
loopw - infinite write loop on address range
在地址范围内无限循环写
mtest - simple RAM test
简单RAM测试
icache - enable or disable instruction cache
使能或禁止指令高速缓存
dcache - enable or disable data cache
使能或禁止数据高速缓存
reset - Perform RESET of the CPU
执行复位CPU
echo - echo args to console
打印参数到控制台
version- print monitor version
打印控制版本
help - print online help
打印在线帮助
? - alias for 'help'
Help的别名
MonitorCommands - Detailed Description:
========================================
监控命令-详细描述
TODO.
Fornow: just type "help
EnvironmentVariables:环境变量
======================
U-Bootsupports user configuration using Environment Variables which
canbe made persistent by saving to Flash memory.
U-Boot支持用户使用环境变量来配置,该环境变量可保存在FLASH存储中
EnvironmentVariables are set using "setenv", printed using
"printenv",and saved to Flash using "saveenv". Using "setenv"
withouta value can be used to delete a variable from the
environment.As long as you don't save the environment you are
workingwith an in-memory copy. In case the Flash area containing the
environmentis erased by accident, a default environment is provided.
环境变量可以使用setenv来设置,使用printenv来打印,使用saveenv来
保存到FLASH。使用没有设定值的setenv可以用于从环境变量中删除一个
变量。只要你不保存环境变量,你的工作都是在内存中的。防止FLASH中
包含环境变量的范围被意外擦除,它提供了一个默认的环境变量。
Someconfiguration options can be set using Environment Variables:
某些配置选项可通过环境变量设置:
baudrate -see CONFIG_BAUDRATE
bootdelay -see CONFIG_BOOTDELAY
bootcmd -see CONFIG_BOOTCOMMAND
bootargs -Boot arguments when booting an RTOS image
bootfile -Name of the image to load with TFTP
autoload -if set to "no" (any string beginning with 'n'),
"bootp" will just load perform a lookup of the
configuration from the BOOTP server, but not try to
load any image using TFTP
autostart -if set to "yes", an image loaded using the "bootp",
"rarpboot", "tftpboot" or "diskboot"commands will
beautomatically started (by internally calling
"bootm")
If set to "no", a standalone image passed to the
"bootm" command will be copied to the load address
(and eventually uncompressed), but NOT be started.
This can be used to load and uncompress arbitrary
data.
i2cfast -(PPC405GP|PPC405EP only)
if set to 'y' configures Linux I2C driver for fast
mode (400kHZ). This environment variable is used in
initialization code. So, for changes to be effective
it must be saved and board must be reset.
initrd_high -restrict positioning of initrd images:
If this variable is not set, initrd images will be
copied to the highest possible address in RAM; this
is usually what you want since it allows for
maximum initrd size. If for some reason you want to
make sure that the initrd image is loaded below the
CFG_BOOTMAPSZ limit, you can set this environment
variable to a value of "no" or "off" or"0".
Alternatively, you can set it to a maximum upper
address to use (U-Boot will still check that it
does not overwrite the U-Boot stack and data).
For instance, when you have a system with 16 MB
RAM, and want to reserve 4 MB from use by Linux,
you can do this by adding "mem=12M" to the value of
the "bootargs" variable. However, now you must make
sure that the initrd image is placed in the first
12 MB as well - this can be done with
setenv initrd_high 00c00000
If you set initrd_high to 0xFFFFFFFF, this is an
indication to U-Boot that all addresses are legal
for the Linux kernel, including addresses in flash
memory. In this case U-Boot will NOT COPY the
ramdisk at all. This may be useful to reduce the
boot time on your system, but requires that this
feature is supported by your Linux kernel.
ipaddr -IP address; needed for tftpboot command
loadaddr -Default load address for commands like "bootp",
"rarpboot", "tftpboot", "loadb" or"diskboot"
loads_echo -see CONFIG_LOADS_ECHO
serverip -TFTP server IP address; needed for tftpboot command
bootretry -see CONFIG_BOOT_RETRY_TIME
bootdelaykey -see CONFIG_AUTOBOOT_DELAY_STR
bootstopkey -see CONFIG_AUTOBOOT_STOP_STR
ethprime -When CONFIG_NET_MULTI is enabled controls which
interface is used first.
ethact -When CONFIG_NET_MULTI is enabled controls which
interface is currently active. For example you
can do the following
=> setenv ethact FEC ETHERNET
=> ping 192.168.0.1 # traffic sent on FEC ETHERNET
=> setenv ethact SCC ETHERNET
=> ping 10.0.0.1 # traffic sent on SCC ETHERNET
netretry -When set to "no" each network operation will
either succeed or fail without retrying.
When set to "once" the network operation will
fail when all the available network interfaces
are tried once without success.
Useful on scripts which control the retry operation
themselves.
tftpsrcport -If this is set, the value is used for TFTP's
UDP source port.
tftpdstport -If this is set, the value is used for TFTP's UDP
destination port instead of the Well Know Port 69.
vlan -When set to a value < 4095 the traffic over
ethernet is encapsulated/received over 802.1q
VLAN tagged frames.
Thefollowing environment variables may be used and automatically
updatedby the network boot commands ("bootp" and "rarpboot"),
dependingthe information provided by your boot server:
以下环境变量能够被使用并且通过网络引导命令自动更新,这依赖于
你的引导服务器提供的信息。
bootfile -see above
dnsip -IP address of your Domain Name Server
dnsip2 -IP address of your secondary Domain Name Server
gatewayip -IP address of the Gateway (Router) to use
hostname -Target hostname
ipaddr -see above
netmask -Subnet Mask
rootpath -Pathname of the root filesystem on the NFS server
serverip -see above
Thereare two special Environment Variables:
有两个特别的环境变量
serial# -contains hardware identification information such
as type string and/or serial number
ethaddr -Ethernet address
Thesevariables can be set only once (usually during manufacturing of
theboard). U-Boot refuses to delete or overwrite these variables
oncethey have been set once.
这些变量只能被设置一次。U-Boot拒绝删除和重写这些变量,因为它们
已经被设置过了。
Furtherspecial Environment Variables:
更特别环境变量
ver -Contains the U-Boot version string as printed
with the "version" command. This variable is
readonly (see CONFIG_VERSION_VARIABLE).
Pleasenote that changes to some configuration parameters may take
onlyeffect after the next boot (yes, that's just like Windoze :-).
请注意,改变某些配置参数可能只影响到下次引导的情景。
CommandLine Parsing:命令行讲法分析
=====================
Thereare two different command line parsers available with U-Boot:
theold "simple" one, and the much more powerful "hush" shell:
有两种不同的命令行语法变量,U-Boot:是旧的,shell:比较强大
Old,simple command line parser:旧的,简单的命令行语法
--------------------------------
-supports environment variables (through setenv / saveenv commands)
-several commands on one line, separated by ';'
-variable substitution using "... ${name} ..." syntax
-special characters ('$', ';') can be escaped by prefixing with '\',
for example:
setenv bootcmd bootm \${address}
-You can also escape text by enclosing in single apostrophes, for example:
setenv addip 'setenv bootargs $bootargsip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname::off'
Hushshell: Hush shell
-----------
-similar to Bourne shell, with control structures like
if...then...else...fi, for...do...done;while...do...done,
until...do...done, ...
-supports environment ("global") variables (through setenv / saveenv
commands) and local shell variables (throughstandard shell syntax
"name=value"); only environmentvariables can be used with "run"
command
Generalrules:常用规则
--------------
(1)If a command line (or an environment variable executed by a "run"
command) contains several commandsseparated by semicolon, and
one of these commands fails, then theremaining commands will be
executed anyway.
如果一个命令行中包含若干个用分号隔开的命令,它们其中一个命令
失败,那么接下来的命令无论如何接着执行。
(2)If you execute several variables with one call to run (i. e.
calling run with a list af variables asarguments), any failing
command will cause "run" toterminate, i. e. the remaining
variables are not executed.
如果你通过一条运行命令执行若干变量,任何失败的命令会导致运行
中止,例如剩下变量不被执行。
Notefor Redundant Ethernet Interfaces:以太网接口冗余信息笔记
=======================================
Someboards come with redundant ethernet interfaces; U-Boot supports
suchconfigurations and is capable of automatic selection of a
"working"interface when needed. MAC assignment works as follows:
Networkinterfaces are numbered eth0, eth1, eth2, ... Corresponding
MACaddresses can be stored in the environment as "ethaddr" (=>eth0),
"eth1addr"(=>eth1), "eth2addr", ...
Ifthe network interface stores some valid MAC address (for instance
inSROM), this is used as default address if there is NO correspon-
dingsetting in the environment; if the corresponding environment
variableis set, this overrides the settings in the card; that means:
oIf the SROM has a valid MAC address, and there is no address in the
environment, the SROM's address is used.
oIf there is no valid address in the SROM, and a definition in the
environment exists, then the value from theenvironment variable is
used.
oIf both the SROM and the environment contain a MAC address, and
both addresses are the same, this MAC addressis used.
oIf both the SROM and the environment contain a MAC address, and the
addresses differ, the value from theenvironment is used and a
warning is printed.
oIf neither SROM nor the environment contain a MAC address, an error
is raised.
ImageFormats:镜像格式
==============
The"boot" commands of this monitor operate on "image" fileswhich
canbe basicly anything, preceeded by a special header; see the
definitionsin include/image.h for details; basicly, the header
definesthe following image properties:
*Target Operating System (Provisions for OpenBSD, NetBSD, FreeBSD,
4.4BSD, Linux, SVR4, Esix, Solaris, Irix,SCO, Dell, NCR, VxWorks,
LynxOS, pSOS, QNX, RTEMS, ARTOS;目标操作系统
Currently supported: Linux, NetBSD, VxWorks,QNX, RTEMS, ARTOS, LynxOS).
*Target CPU Architecture (Provisions for Alpha, ARM, AVR32, Intel x86,
IA64, MIPS, NIOS, PowerPC, IBM S390, SuperH,Sparc, Sparc 64 Bit;
Currently supported: ARM, AVR32, Intel x86,MIPS, NIOS, PowerPC).目标CPU架构
*Compression Type (uncompressed, gzip, bzip2)压缩类型
*Load Address加载地址
*Entry Point入口点
*Image Name镜像名字
*Image Timestamp镜像时间戳
Theheader is marked by a special Magic Number, and both the header
andthe data portions of the image are secured against corruption by
CRC32checksums.
LinuxSupport:Linux支持
==============
AlthoughU-Boot should support any OS or standalone application
easily,the main focus has always been on Linux during the design of
U-Boot.
虽然U-boot更容易支持任何OS或独立应用程序,但是U-BOOT的设
计主要聚焦于Linux。
U-Bootincludes many features that so far have been part of some
special"boot loader" code within the Linux kernel. Also, any
"initrd"images to be used are no longer part of one big Linux image;
instead,kernel and "initrd" are separate images. This implementation
servesseveral purposes:
-the same features can be used for other OS or standalone
applications (for instance: using compressedimages to reduce the
Flash memory footprint)
-it becomes much easier to port new Linux kernel versions because
lots of low-level, hardware dependent stuffare done by U-Boot
-the same Linux kernel image can now be used with different "initrd"
images; of course this also means thatdifferent kernel images can
be run with the same "initrd". Thismakes testing easier (you don't
have to build a new "zImage.initrd"Linux image when you just
change a file in your "initrd").Also, a field-upgrade of the
software is easier now.
LinuxHOWTO:Linux基本知识
============
PortingLinux to U-Boot based systems:基于U-boot平台移植Linux
---------------------------------------
U-Bootcannot save you from doing all the necessary modifications to
configurethe Linux device drivers for use with your target hardware
(no,we don't intend to provide a full virtual machine interface to
Linux:-).
U-boot不会为你做所有必要的修改来配置linux设备驱动,而这些驱动
用在你的目标硬件上。(现在,我们不想要提供一个全虚拟机器接口到
linux)
Butnow you can ignore ALL boot loader code (in arch/ppc/mbxboot).
但现在你可以忽略所有boot加载代码
Justmake sure your machine specific header file (for instance
include/asm-ppc/tqm8xx.h)includes the same definition of the Board
Informationstructure as we define in include/u-boot.h, and make
surethat your definition of IMAP_ADDR uses the same value as your
U-Bootconfiguration in CFG_IMMR.
Configuringthe Linux kernel:配置LINUX内核
-----------------------------
Nospecific requirements for U-Boot. Make sure you have some root
device(initial ramdisk, NFS) for your target system.
Buildinga Linux Image:连接一个LINUX镜像
-----------------------
WithU-Boot, "normal" build targets like "zImage" or"bzImage" are
notused. If you use recent kernel source, a new build target
"uImage"will exist which automatically builds an image usable by
U-Boot.Most older kernels also have support for a "pImage" target,
whichwas introduced for our predecessor project PPCBoot and uses a
100%compatible format.
对于U-Boot来讲,正常编译目标为zImage或bzImage已经不使用了。
如果你使用最新的内核源码,一个新编译目标uImage将存在。Uboot
自动地编译成可用的镜像uImage
Example:
make TQM850L_config
make oldconfig
make dep
make uImage
The"uImage" build target uses a special tool (in 'tools/mkimage') to
encapsulatea compressed Linux kernel image with header information,
CRC32checksum etc. for use with U-Boot. This is what we are doing:
*build a standard "vmlinux" kernel image (in ELF binary format):
编译一个标准的vmlinux内核镜像
*convert the kernel into a raw binary image:转换内核到一个raw二进制镜像
${CROSS_COMPILE}-objcopy -O binary \
-R .note -R .comment \
-S vmlinux linux.bin
*compress the binary image:压缩二进制镜像
gzip -9 linux.bin
*package compressed binary image for U-Boot:用uboot打包压缩的二进制镜像
mkimage -A ppc -O linux -T kernel -C gzip\
-a 0 -e 0 -n "Linux KernelImage" \
-d linux.bin.gz uImage
The"mkimage" tool can also be used to create ramdisk images for use
withU-Boot, either separated from the Linux kernel image, or
combinedinto one file. "mkimage" encapsulates the images with a 64
byteheader containing information about target architecture,
operatingsystem, image type, compression method, entry points, time
stamp,CRC32 checksums, etc.
"mkimage"can be called in two ways: to verify existing images and
printthe header information, or to build new images.
Mkimage工具有两种调用情况:用于校验已存在的镜像和打印头信息,
或用于编译新镜像。
Inthe first form (with "-l" option) mkimage lists the information
containedin the header of an existing U-Boot image; this includes
checksumverification:
tools/mkimage -l image
-l ==> list image header information
Thesecond form (with "-d" option) is used to build a U-Boot image
froma "data file" which is used as image payload:
tools/mkimage -A arch -O os -T type -Ccomp -a addr -e ep \
-n name -d data_file image
-A ==> set architecture to 'arch'设置架构类型
-O ==> set operating system to 'os'设置操作系统
-T ==> set image type to 'type'设置镜像类型
-C ==> set compression type 'comp'设置压缩类型
-a ==> set load address to 'addr' (hex)设置加载地址
-e ==> set entry point to 'ep' (hex)设置入口点
-n ==> set image name to 'name'设置镜像名字
-d ==> use image data from 'datafile'设置镜像数据格式
Rightnow, all Linux kernels for PowerPC systems use the same load
address(0x00000000), but the entry point address depends on the
kernelversion:
-2.2.x kernels have the entry point at 0x0000000C,
-2.3.x and later kernels have the entry point at 0x00000000.
Soa typical call to build a U-Boot image would read:
-> tools/mkimage -n '2.4.4 kernel forTQM850L' \
> -A ppc -O linux -T kernel -C gzip -a0 -e 0 \
> -d /opt/elsk/ppc_8xx/usr/src/linux-2.4.4/arch/ppc/coffboot/vmlinux.gz\
> examples/uImage.TQM850L
Image Name: 2.4.4 kernel for TQM850L
Created: Wed Jul 19 02:34:59 2000
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 335725 Bytes = 327.86 kB = 0.32 MB
Load Address: 0x00000000
Entry Point: 0x00000000
Toverify the contents of the image (or check for corruption):
-> tools/mkimage -lexamples/uImage.TQM850L
Image Name: 2.4.4 kernel for TQM850L
Created: Wed Jul 19 02:34:59 2000
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 335725 Bytes = 327.86 kB = 0.32 MB
Load Address: 0x00000000
Entry Point: 0x00000000
NOTE:for embedded systems where boot time is critical you can trade
speedfor memory and install an UNCOMPRESSED image instead: this
needsmore space in Flash, but boots much faster since it does not
needto be uncompressed:
-> gunzip/opt/elsk/ppc_8xx/usr/src/linux-2.4.4/arch/ppc/coffboot/vmlinux.gz
-> tools/mkimage -n '2.4.4 kernel forTQM850L' \
> -A ppc -O linux -T kernel -C none -a0 -e 0 \
> -d/opt/elsk/ppc_8xx/usr/src/linux-2.4.4/arch/ppc/coffboot/vmlinux \
> examples/uImage.TQM850L-uncompressed
Image Name: 2.4.4 kernel for TQM850L
Created: Wed Jul 19 02:34:59 2000
Image Type: PowerPC Linux Kernel Image (uncompressed)
Data Size: 792160 Bytes = 773.59 kB = 0.76 MB
Load Address: 0x00000000
Entry Point: 0x00000000
Similaryou can build U-Boot images from a 'ramdisk.image.gz' file
whenyour kernel is intended to use an initial ramdisk:
-> tools/mkimage -n 'Simple RamdiskImage' \
> -A ppc -O linux -T ramdisk -C gzip \
> -d/LinuxPPC/images/SIMPLE-ramdisk.image.gz examples/simple-initrd
Image Name: Simple Ramdisk Image
Created: Wed Jan 12 14:01:50 2000
Image Type: PowerPC Linux RAMDisk Image (gzipcompressed)
Data Size: 566530 Bytes = 553.25 kB = 0.54 MB
Load Address: 0x00000000
Entry Point: 0x00000000
Installinga Linux Image:下载一个LINUX镜像
-------------------------
Todownloading a U-Boot image over the serial (console) interface,
youmust convert the image to S-Record format:
objcopy -I binary -O srec examples/imageexamples/image.srec
The'objcopy' does not understand the information in the U-Boot
imageheader, so the resulting S-Record file will be relative to
address0x00000000. To load it to a given address, you need to
specifythe target address as 'offset' parameter with the 'loads'
command.
Example:install the image to address 0x40100000 (which on the
TQM8xxLis in the first Flash bank):
=> erase 40100000 401FFFFF
.......... done
Erased 8 sectors
=> loads 40100000
## Ready for S-Record download ...
~>examples/image.srec
1 2 3 4 5 6 7 8 9 10 11 12 13 ...
...
15989 15990 15991 15992
[file transfer complete]
[connected]
## Start Addr = 0x00000000
Youcan check the success of the download using the 'iminfo' command;
thisincludes a checksum verification so you can be sure no data
corruptionhappened:
=> imi 40100000
## Checking Image at 40100000 ...
Image Name: 2.2.13 for initrd onTQM850L
Image Type: PowerPC Linux KernelImage (gzip compressed)
Data Size: 335725 Bytes =327 kB = 0 MB
Load Address: 00000000
Entry Point: 0000000c
Verifying Checksum ... OK
BootLinux:启动LINUX
-----------
The"bootm" command is used to boot an application that is stored in
memory(RAM or Flash). In case of a Linux kernel image, the contents
ofthe "bootargs" environment variable is passed to the kernel as
parameters.You can check and modify this variable using the
"printenv"and "setenv" commands:
=> printenv bootargs
bootargs=root=/dev/ram
=> setenv bootargs root=/dev/nfs rwnfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2
=> printenv bootargs
bootargs=root=/dev/nfs rwnfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2
=> bootm 40020000
## Booting Linux kernel at 40020000 ...
Image Name: 2.2.13 for NFS onTQM850L
Image Type: PowerPC Linux KernelImage (gzip compressed)
Data Size: 381681 Bytes =372 kB = 0 MB
Load Address: 00000000
Entry Point: 0000000c
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Linux version 2.2.13 ([email protected])(gcc version 2.95.2 19991024 (release)) #1 Wed Jul 19 02:35:17 MEST 2000
Boot arguments: root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPCnfsaddrs=10.0.0.99:10.0.0.2
time_init: decrementer frequency =187500000/60
Calibrating delay loop... 49.77 BogoMIPS
Memory: 15208k available (700k kernelcode, 444k data, 32k init) [c0000000,c1000000]
...
Ifyou want to boot a Linux kernel with initial ram disk, you pass
thememory addresses of both the kernel and the initrd image (PPBCOOT
format!)to the "bootm" command:
=> imi 40100000 40200000
## Checking Image at 40100000 ...
Image Name: 2.2.13 for initrd onTQM850L
Image Type: PowerPC Linux KernelImage (gzip compressed)
Data Size: 335725 Bytes =327 kB = 0 MB
Load Address: 00000000
Entry Point: 0000000c
Verifying Checksum ... OK
## Checking Image at 40200000 ...
Image Name: Simple Ramdisk Image
Image Type: PowerPC LinuxRAMDisk Image (gzip compressed)
Data Size: 566530 Bytes =553 kB = 0 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
=> bootm 40100000 40200000
## Booting Linux kernel at 40100000 ...
Image Name: 2.2.13 for initrd onTQM850L
Image Type: PowerPC Linux KernelImage (gzip compressed)
Data Size: 335725 Bytes =327 kB = 0 MB
Load Address: 00000000
Entry Point: 0000000c
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at 40200000 ...
Image Name: Simple Ramdisk Image
Image Type: PowerPC LinuxRAMDisk Image (gzip compressed)
Data Size: 566530 Bytes =553 kB = 0 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Loading Ramdisk ... OK
Linux version 2.2.13 ([email protected])(gcc version 2.95.2 19991024 (release)) #1 Wed Jul 19 02:32:08 MEST 2000
Boot arguments: root=/dev/ram
time_init: decrementer frequency =187500000/60
Calibrating delay loop... 49.77 BogoMIPS
...
RAMDISK: Compressed image found at block0
VFS: Mounted root (ext2 filesystem).
bash#
BootLinux and pass a flat device tree:
-----------
First,U-Boot must be compiled with the appropriate defines. See the section
titled"Linux Kernel Interface" above for a more in depth explanation. The
followingis an example of how to start a kernel and pass an updated
flatdevice tree:
=>print oftaddr
oftaddr=0x300000
=>print oft
oft=oftrees/mpc8540ads.dtb
=>tftp $oftaddr $oft
Speed:1000, full duplex
UsingTSEC0 device
TFTPfrom server 192.168.1.1; our IP address is 192.168.1.101
Filename'oftrees/mpc8540ads.dtb'.
Loadaddress: 0x300000
Loading:#
done
Bytestransferred = 4106 (100a hex)
=>tftp $loadaddr $bootfile
Speed:1000, full duplex
UsingTSEC0 device
TFTPfrom server 192.168.1.1; our IP address is 192.168.1.2
Filename'uImage'.
Loadaddress: 0x200000
Loading:############
done
Bytestransferred = 1029407 (fb51f hex)
=>print loadaddr
loadaddr=200000
=>print oftaddr
oftaddr=0x300000
=>bootm $loadaddr - $oftaddr
##Booting image at 00200000 ...
Image Name: Linux-2.6.17-dirty
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 1029343 Bytes = 1005.2 kB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Bootingusing flat device tree at 0x300000
UsingMPC85xx ADS machine description
MemoryCAM mapping: CAM0=256Mb, CAM1=256Mb, CAM2=0Mb residual: 0Mb
[snip]
MoreAbout U-Boot Image Types:
------------------------------
U-Bootsupports the following image types:
"Standalone Programs" are directlyrunnable in the environment
provided by U-Boot; it is expected that(if they behave
well) you can continue to work in U-Bootafter return from
the Standalone Program.
"OS Kernel Images" are usuallyimages of some Embedded OS which
will take over control completely.Usually these programs
will install their own set of exceptionhandlers, device
drivers, set up the MMU, etc. - thismeans, that you cannot
expect to re-enter U-Boot except byresetting the CPU.
"RAMDisk Images" are more or lessjust data blocks, and their
parameters (address, size) are passed toan OS kernel that is
being started.
"Multi-File Images" containseveral images, typically an OS
(Linux) kernel image and one or more dataimages like
RAMDisks. This construct is useful forinstance when you want
to boot over the network using BOOTPetc., where the boot
server provides just a single image file,but you want to get
for instance an OS kernel and a RAMDiskimage.
"Multi-File Images" start witha list of image sizes, each
image size (in bytes) specified by an"uint32_t" in network
byte order. This list is terminated by an"(uint32_t)0".
Immediately after the terminating 0follow the images, one by
one, all aligned on "uint32_t"boundaries (size rounded up to
a multiple of 4 bytes).
"Firmware Images" are binaryimages containing firmware (like
U-Boot or FPGA images) which usually willbe programmed to
flash memory.
"Script files" are commandsequences that will be executed by
U-Boot's command interpreter; thisfeature is especially
useful when you configure U-Boot to use areal shell (hush)
as command interpreter.
StandaloneHOWTO:
=================
Oneof the features of U-Boot is that you can dynamically load and
run"standalone" applications, which can use some resources of
U-Bootlike console I/O functions or interrupt services.
Twosimple examples are included with the sources:
"HelloWorld" Demo:
-------------------
'examples/hello_world.c'contains a small "Hello World" Demo
application;it is automatically compiled when you build U-Boot.
It'sconfigured to run at address 0x00040004, so you can play with it
likethat:
=> loads
## Ready for S-Record download ...
~>examples/hello_world.srec
1 2 3 4 5 6 7 8 9 10 11 ...
[file transfer complete]
[connected]
## Start Addr = 0x00040004
=> go 40004 Hello World! This is atest.
## Starting application at 0x00040004 ...
Hello World
argc = 7
argv[0] = "40004"
argv[1] = "Hello"
argv[2] = "World!"
argv[3] = "This"
argv[4] = "is"
argv[5] = "a"
argv[6] = "test."
argv[7] = "
Hit any key to exit ...
## Application terminated, rc = 0x0
Anotherexample, which demonstrates how to register a CPM interrupt
handlerwith the U-Boot code, can be found in 'examples/timer.c'.
Here,a CPM timer is set up to generate an interrupt every second.
Theinterrupt service routine is trivial, just printing a '.'
character,but this is just a demo program. The application can be
controlledby the following keys:
? - print current values og the CPM Timerregisters
b - enable interrupts and start timer
e - stop timer and disable interrupts
q - quit application
=> loads
## Ready for S-Record download ...
~>examples/timer.srec
1 2 3 4 5 6 7 8 9 10 11 ...
[file transfer complete]
[connected]
## Start Addr = 0x00040004
=> go 40004
## Starting application at 0x00040004 ...
TIMERS=0xfff00980
Using timer 1
tgcr @ 0xfff00980, tmr @ 0xfff00990, trr @ 0xfff00994, tcr @ 0xfff00998,tcn @ 0xfff0099c, ter @ 0xfff009b0
Hit'b':
[q, b, e, ?] Set interval 1000000 us
Enabling timer
Hit'?':
[q, b, e, ?] ........
tgcr=0x1, tmr=0xff1c, trr=0x3d09,tcr=0x0, tcn=0xef6, ter=0x0
Hit'?':
[q, b, e, ?] .
tgcr=0x1, tmr=0xff1c, trr=0x3d09,tcr=0x0, tcn=0x2ad4, ter=0x0
Hit'?':
[q, b, e, ?] .
tgcr=0x1, tmr=0xff1c, trr=0x3d09,tcr=0x0, tcn=0x1efc, ter=0x0
Hit'?':
[q, b, e, ?] .
tgcr=0x1, tmr=0xff1c, trr=0x3d09,tcr=0x0, tcn=0x169d, ter=0x0
Hit'e':
[q, b, e, ?] ...Stopping timer
Hit'q':
[q, b, e, ?] ## Application terminated,rc = 0x0
Minicomwarning:
================
Overtime, many people have reported problems when trying to use the
"minicom"terminal emulation program for serial download. I (wd)
considerminicom to be broken, and recommend not to use it. Under
Unix,I recommend to use C-Kermit for general purpose use (and
especiallyfor kermit binary protocol download ("loadb" command), and
use"cu" for S-Record download ("loads" command).
Nevertheless,if you absolutely want to use it try adding this
configurationto your "File transfer protocols" section:
Name Program NameU/D FullScr IO-Red. Multi
X kermit /usr/bin/kermit -i -l %l-s Y U Y N N
Y kermit /usr/bin/kermit -i -l %l-r N D Y N N
NetBSDNotes:
=============
Startingat version 0.9.2, U-Boot supports NetBSD both as host
(buildU-Boot) and target system (boots NetBSD/mpc8xx).
Buildingrequires a cross environment; it is known to work on
NetBSD/i386with the cross-powerpc-netbsd-1.3 package (you will also
needgmake since the Makefiles are not compatible with BSD make).
Notethat the cross-powerpc package does not install include files;
attemptingto build U-Boot will fail because
missing. This file has to be installed and patchedmanually:
# cd/usr/pkg/cross/powerpc-netbsd/include
# mkdir powerpc
# ln -s powerpc machine
# cp/usr/src/sys/arch/powerpc/include/ansi.h powerpc/ansi.h
# ${EDIT} powerpc/ansi.h ## must remove __va_list, _BSD_VA_LIST
Nativebuilds *don't* work due to incompatibilities between native
andU-Boot include files.
Bootingassumes that (the first part of) the image booted is a
stage-2loader which in turn loads and then invokes the kernel
proper.Loader sources will eventually appear in the NetBSD source
tree(probably in sys/arc/mpc8xx/stand/u-boot_stage2/); in the
meantime,see ftp://ftp.denx.de/pub/u-boot/ppcboot_stage2.tar.gz
ImplementationInternals:
=========================
Thefollowing is not intended to be a complete description of every
implementationdetail. However, it should help to understand the
innerworkings of U-Boot and make it easier to port it to custom
hardware.
InitialStack, Global Data:
---------------------------
Theimplementation of U-Boot is complicated by the fact that U-Boot
startsrunning out of ROM (flash memory), usually without access to
systemRAM (because the memory controller is not initialized yet).
Thismeans that we don't have writable Data or BSS segments, and BSS
isnot initialized as zero. To be able to get a C environment working
atall, we have to allocate at least a minimal stack. Implementation
optionsfor this are defined and restricted by the CPU used: Some CPU
modelsprovide on-chip memory (like the IMMR area on MPC8xx and
MPC826xprocessors), on others (parts of) the data cache can be
lockedas (mis-) used as memory, etc.
Chris Hallinan posted a good summary of these issues to the
u-boot-users mailing list:
Subject: RE: [U-Boot-Users] RE: More OnMemory Bank x (nothingness)?
From: "Chris Hallinan"
Date: Mon, 10 Feb 2003 16:43:46 -0500(22:43 MET)
...
Correct me if I'm wrong, folks, but theway I understand it
is this: Using DCACHE as initial RAM forStack, etc, does not
require any physical RAM backing up thecache. The cleverness
is that the cache is being used as atemporary supply of
necessary storage before the SDRAMcontroller is setup. It's
beyond the scope of this list to expainthe details, but you
can see how this works by studying thecache architecture and
operation in the architecture andprocessor-specific manuals.
OCM is On Chip Memory, which I believethe 405GP has 4K. It
is another option for the system designerto use as an
initial stack/ram area prior to SDRAMbeing available. Either
option should work for you. Using CS 4should be fine if your
board designers haven't used it forsomething that would
cause you grief during the initial boot!It is frequently not
used.
CFG_INIT_RAM_ADDR should be somewherethat won't interfere
with your processor/board/system design.The default value
you will find in any recent u-bootdistribution in
walnut.h should work for you. I'd set itto a value larger
than your SDRAM module. If you have a64MB SDRAM module, set
it above 400_0000. Just make sure yourboard has no resources
that are supposed to respond to thataddress! That code in
start.S has been around a while andshould work as is when
you get the config right.
-Chris Hallinan
DS4.COM, Inc.
Itis essential to remember this, since it has some impact on the C
codefor the initialization procedures:
记住这些是有必要的:因为它在C格式初始化程序中有一些影响:
*Initialized global data (data segment) is read-only. Do not attempt
to write it.
*Do not use any unitialized global data (or implicitely initialized
as zero data - BSS segment) at all - this isundefined, initiali-
zation is performed later (when relocating toRAM).
*Stack space is very limited. Avoid big data buffers or things like
that.
Havingonly the stack as writable memory limits means we cannot use
normalglobal data to share information beween the code. But it
turnedout that the implementation of U-Boot can be greatly
simplifiedby making a global data structure (gd_t) available to all
functions.We could pass a pointer to this data as argument to _all_
functions,but this would bloat the code. Instead we use a feature of
theGCC compiler (Global Register Variables) to share the data: we
placea pointer (gd) to the global data into a register which we
reservefor this purpose.
Whenchoosing a register for such a purpose we are restricted by the
relevant (E)ABI specifications for the current architecture, and by
GCC'simplementation.
ForPowerPC, the following registers have specific use:
R1: stackpointer
R2: TOCpointer
R3-R4: parameterpassing and return values
R5-R10: parameter passing
R13: smalldata area pointer
R30: GOTpointer
R31: framepointer
(U-Boot also uses R14 as internal GOTpointer.)
==> U-Boot will use R29 to hold apointer to the global data
Note: on PPC, we could use a staticinitializer (since the
address of the global data structure isknown at compile time),
but it turned out that reserving a registerresults in somewhat
smaller code - although the code savingsare not that big (on
average for all boards 752 bytes for thewhole U-Boot image,
624 text + 127 data).
OnARM, the following registers are used:对于ARM,以下寄存器用于:
R0: functionargument word/integer result
R1-R3: functionargument word
R9: GOTpointer
R10: stacklimit (used only if stack checking if enabled)
R11: argument(frame) pointer
R12: temporaryworkspace
R13: stackpointer
R14: linkregister
R15: programcounter
==> U-Boot will use R8 to hold a pointerto the global data
NOTE:DECLARE_GLOBAL_DATA_PTR must be used with file-global scope,
orcurrent versions of GCC may "optimize" the code too much.
MemoryManagement:
------------------
U-Bootruns in system state and uses physical addresses, i.e. the
MMUis not used either for address mapping nor for memory protection.
Theavailable memory is mapped to fixed addresses using the memory
controller.In this process, a contiguous block is formed for each
memorytype (Flash, SDRAM, SRAM), even when it consists of several
physicalmemory banks.
U-Bootis installed in the first 128 kB of the first Flash bank (on
TQM8xxLmodules this is the range 0x40000000 ... 0x4001FFFF). After
bootingand sizing and initializing DRAM, the code relocates itself
tothe upper end of DRAM. Immediately below the U-Boot code some
memoryis reserved for use by malloc() [see CFG_MALLOC_LEN
configurationsetting]. Below that, a structure with global Board
Infodata is placed, followed by the stack (growing downward).
Additionally,some exception handler code is copied to the low 8 kB
ofDRAM (0x00000000 ... 0x00001FFF).
Soa typical memory configuration with 16 MB of DRAM could look like
this:
0x0000 0000 Exception Vector code
:
0x0000 1FFF
0x0000 2000 Free for Application Use
:
:
:
:
0x00FB FF20 Monitor Stack (Growing downward)
0x00FB FFAC Board Info Data and permanent copy of global data
0x00FC 0000 Malloc Arena
:
0x00FD FFFF
0x00FE 0000 RAM Copy of Monitor Code
... eventually:LCD or video framebuffer
... eventually:pRAM (Protected RAM - unchanged by reset)
0x00FF FFFF [End of RAM]
SystemInitialization:
----------------------
Inthe reset configuration, U-Boot starts at the reset entry point
(onmost PowerPC systens at address 0x00000100). Because of the reset
configurationfor CS0# this is a mirror of the onboard Flash memory.
Tobe able to re-map memory U-Boot then jumps to its link address.
Tobe able to implement the initialization code in C, a (small!)
initialstack is set up in the internal Dual Ported RAM (in case CPUs
whichprovide such a feature like MPC8xx or MPC8260), or in a locked
partof the data cache. After that, U-Boot initializes the CPU core,
thecaches and the SIU.
Next,all (potentially) available memory banks are mapped using a
preliminarymapping. For example, we put them on 512 MB boundaries
(multiplesof 0x20000000: SDRAM on 0x00000000 and 0x20000000, Flash
on0x40000000 and 0x60000000, SRAM on 0x80000000). Then UPM A is
programmedfor SDRAM access. Using the temporary configuration, a
simplememory test is run that determines the size of the SDRAM
banks.
Whenthere is more than one SDRAM bank, and the banks are of
differentsize, the largest is mapped first. For equal size, the first
bank(CS2#) is mapped first. The first mapping is always for address
0x00000000,with any additional banks following immediately to create
contiguousmemory starting from 0.
Then,the monitor installs itself at the upper end of the SDRAM area
andallocates memory for use by malloc() and for the global Board
Infodata; also, the exception vector code is copied to the low RAM
pages,and the final stack is set up.
Onlyafter this relocation will you have a "normal" C environment;
untilthat you are restricted in several ways, mostly because you are
runningfrom ROM, and because the code will have to be relocated to a
newaddress in RAM.
U-BootPorting Guide:
----------------------
[Basedon messages by Jerry Van Baren in the U-Boot-Users mailing
list,October 2002]
intmain (int argc, char *argv[])
{
sighandler_t no_more_time;
signal (SIGALRM, no_more_time);
alarm (PROJECT_DEADLINE - toSec (3 *WEEK));
if (available_money >available_manpower) {
pay consultant to port U-Boot;
return 0;
}
Download latest U-Boot source;
Subscribe to u-boot-users mailing list;
if (clueless) {
email ("Hi, I am new toU-Boot, how do I get started?");
}
while (learning) {
Read the README file in the toplevel directory;
Readhttp://www.denx.de/twiki/bin/view/DULG/Manual ;
Read the source, Luke;
}
if (available_money > toLocalCurrency($2500)) {
Buy a BDI2000;
} else {
Add a lot of aggravation and time;
}
Create your own board supportsubdirectory;
Create your own board config file;
while (!running) {
do {
Add / modify source code;
} until (compiles);
Debug;
if (clueless)
email ("Hi, I amhaving problems...");
}
Send patch file to Wolfgang;
return 0;
}
voidno_more_time (int sig)
{
hire_a_guru();
}
CodingStandards:
-----------------
Allcontributions to U-Boot should conform to the Linux kernel
codingstyle; see the file "Documentation/CodingStyle" and the script
"scripts/Lindent"in your Linux kernel source directory. In sources
originatingfrom U-Boot a style corresponding to "Lindent -pcs" (adding
spacesbefore parameters to function calls) is actually used.
Sourcefiles originating from a different project (for example the
MTDsubsystem) are generally exempt from these guidelines and are not
reformatedto ease subsequent migration to newer versions of those
sources.
Pleasenote that U-Boot is implemented in C (and to some small parts in
Assembler);no C++ is used, so please do not use C++ style comments (//)
inyour code.
Pleasealso stick to the following formatting rules:
-remove any trailing white space
-use TAB characters for indentation, not spaces
-make sure NOT to use DOS '\r\n' line feeds
-do not add more than 2 empty lines to source files
-do not add trailing empty lines to source files
Submissionswhich do not conform to the standards may be returned
witha request to reformat the changes.
SubmittingPatches:
-------------------
Sincethe number of patches for U-Boot is growing, we need to
establishsome rules. Submissions which do not conform to these rules
maybe rejected, even when they contain important and valuable stuff.
Patchesshall be sent to the u-boot-users mailing list.
Whenyou send a patch, please include the following information with
it:
*For bug fixes: a description of the bug and how your patch fixes
this bug. Please try to include a way ofdemonstrating that the
patch actually fixes something.
*For new features: a description of the feature and your
implementation.
*A CHANGELOG entry as plaintext (separate from the patch)
*For major contributions, your entry to the CREDITS file
*When you add support for a new board, don't forget to add this
board to the MAKEALL script, too.
*If your patch adds new configuration options, don't forget to
document these in the README file.
*The patch itself. If you are accessing the CVS repository use "cvs
update; cvs diff -puRN"; else, use"diff -purN OLD NEW". If your
version of diff does not support theseoptions, then get the latest
version of GNU diff.
The current directory when running thiscommand shall be the top
level directory of the U-Boot source tree, orit's parent directory
(i. e. please make sure that your patchincludes sufficient
directory information for the affectedfiles).
We accept patches as plain text, MIMEattachments or as uuencoded
gzipped text.
*If one logical set of modifications affects or creates several
files, all these changes shall be submittedin a SINGLE patch file.
*Changesets that contain different, unrelated modifications shall be
submitted as SEPARATE patches, one patch perchangeset.
Notes:
*Before sending the patch, run the MAKEALL script on your patched
source tree and make sure that no errors orwarnings are reported
for any of the boards.
*Keep your modifications to the necessary minimum: A patch
containing several unrelated changes orarbitrary reformats will be
returned with a request to re-formatting /split it.
*If you modify existing code, make sure that your new code does not
add to the memory footprint of the code ;-)Small is beautiful!
When adding new features, these shouldcompile conditionally only
(using #ifdef), and the resulting code withthe new feature
disabled must not need more memory than theold code without your
modification.
*Remember that there is a size limit of 40 kB per message on the
u-boot-users mailing list. Compression mayhelp.