README 91 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653
  1. # SPDX-License-Identifier: GPL-2.0+
  2. #
  3. # (C) Copyright 2000 - 2013
  4. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. Summary:
  6. ========
  7. This directory contains the source code for U-Boot, a boot loader for
  8. Embedded boards based on PowerPC, ARM, MIPS and several other
  9. processors, which can be installed in a boot ROM and used to
  10. initialize and test the hardware or to download and run application
  11. code.
  12. The development of U-Boot is closely related to Linux: some parts of
  13. the source code originate in the Linux source tree, we have some
  14. header files in common, and special provision has been made to
  15. support booting of Linux images.
  16. Some attention has been paid to make this software easily
  17. configurable and extendable. For instance, all monitor commands are
  18. implemented with the same call interface, so that it's very easy to
  19. add new commands. Also, instead of permanently adding rarely used
  20. code (for instance hardware test utilities) to the monitor, you can
  21. load and run it dynamically.
  22. Status:
  23. =======
  24. In general, all boards for which a default configuration file exists in the
  25. configs/ directory have been tested to some extent and can be considered
  26. "working". In fact, many of them are used in production systems.
  27. In case of problems you can use
  28. scripts/get_maintainer.pl <path>
  29. to identify the people or companies responsible for various boards and
  30. subsystems. Or have a look at the git log.
  31. Where to get help:
  32. ==================
  33. In case you have questions about, problems with or contributions for
  34. U-Boot, you should send a message to the U-Boot mailing list at
  35. <u-boot@lists.denx.de>. There is also an archive of previous traffic
  36. on the mailing list - please search the archive before asking FAQ's.
  37. Please see https://lists.denx.de/pipermail/u-boot and
  38. https://marc.info/?l=u-boot
  39. Where to get source code:
  40. =========================
  41. The U-Boot source code is maintained in the Git repository at
  42. https://source.denx.de/u-boot/u-boot.git ; you can browse it online at
  43. https://source.denx.de/u-boot/u-boot
  44. The "Tags" links on this page allow you to download tarballs of
  45. any version you might be interested in. Official releases are also
  46. available from the DENX file server through HTTPS or FTP.
  47. https://ftp.denx.de/pub/u-boot/
  48. ftp://ftp.denx.de/pub/u-boot/
  49. Where we come from:
  50. ===================
  51. - start from 8xxrom sources
  52. - create PPCBoot project (https://sourceforge.net/projects/ppcboot)
  53. - clean up code
  54. - make it easier to add custom boards
  55. - make it possible to add other [PowerPC] CPUs
  56. - extend functions, especially:
  57. * Provide extended interface to Linux boot loader
  58. * S-Record download
  59. * network boot
  60. * ATA disk / SCSI ... boot
  61. - create ARMBoot project (https://sourceforge.net/projects/armboot)
  62. - add other CPU families (starting with ARM)
  63. - create U-Boot project (https://sourceforge.net/projects/u-boot)
  64. - current project page: see https://www.denx.de/wiki/U-Boot
  65. Names and Spelling:
  66. ===================
  67. The "official" name of this project is "Das U-Boot". The spelling
  68. "U-Boot" shall be used in all written text (documentation, comments
  69. in source files etc.). Example:
  70. This is the README file for the U-Boot project.
  71. File names etc. shall be based on the string "u-boot". Examples:
  72. include/asm-ppc/u-boot.h
  73. #include <asm/u-boot.h>
  74. Variable names, preprocessor constants etc. shall be either based on
  75. the string "u_boot" or on "U_BOOT". Example:
  76. U_BOOT_VERSION u_boot_logo
  77. IH_OS_U_BOOT u_boot_hush_start
  78. Software Configuration:
  79. =======================
  80. Selection of Processor Architecture and Board Type:
  81. ---------------------------------------------------
  82. For all supported boards there are ready-to-use default
  83. configurations available; just type "make <board_name>_defconfig".
  84. Example: For a TQM823L module type:
  85. cd u-boot
  86. make TQM823L_defconfig
  87. Note: If you're looking for the default configuration file for a board
  88. you're sure used to be there but is now missing, check the file
  89. doc/README.scrapyard for a list of no longer supported boards.
  90. Sandbox Environment:
  91. --------------------
  92. U-Boot can be built natively to run on a Linux host using the 'sandbox'
  93. board. This allows feature development which is not board- or architecture-
  94. specific to be undertaken on a native platform. The sandbox is also used to
  95. run some of U-Boot's tests.
  96. See doc/arch/sandbox/sandbox.rst for more details.
  97. Board Initialisation Flow:
  98. --------------------------
  99. This is the intended start-up flow for boards. This should apply for both
  100. SPL and U-Boot proper (i.e. they both follow the same rules).
  101. Note: "SPL" stands for "Secondary Program Loader," which is explained in
  102. more detail later in this file.
  103. At present, SPL mostly uses a separate code path, but the function names
  104. and roles of each function are the same. Some boards or architectures
  105. may not conform to this. At least most ARM boards which use
  106. CONFIG_SPL_FRAMEWORK conform to this.
  107. Execution typically starts with an architecture-specific (and possibly
  108. CPU-specific) start.S file, such as:
  109. - arch/arm/cpu/armv7/start.S
  110. - arch/powerpc/cpu/mpc83xx/start.S
  111. - arch/mips/cpu/start.S
  112. and so on. From there, three functions are called; the purpose and
  113. limitations of each of these functions are described below.
  114. lowlevel_init():
  115. - purpose: essential init to permit execution to reach board_init_f()
  116. - no global_data or BSS
  117. - there is no stack (ARMv7 may have one but it will soon be removed)
  118. - must not set up SDRAM or use console
  119. - must only do the bare minimum to allow execution to continue to
  120. board_init_f()
  121. - this is almost never needed
  122. - return normally from this function
  123. board_init_f():
  124. - purpose: set up the machine ready for running board_init_r():
  125. i.e. SDRAM and serial UART
  126. - global_data is available
  127. - stack is in SRAM
  128. - BSS is not available, so you cannot use global/static variables,
  129. only stack variables and global_data
  130. Non-SPL-specific notes:
  131. - dram_init() is called to set up DRAM. If already done in SPL this
  132. can do nothing
  133. SPL-specific notes:
  134. - you can override the entire board_init_f() function with your own
  135. version as needed.
  136. - preloader_console_init() can be called here in extremis
  137. - should set up SDRAM, and anything needed to make the UART work
  138. - there is no need to clear BSS, it will be done by crt0.S
  139. - for specific scenarios on certain architectures an early BSS *can*
  140. be made available (via CONFIG_SPL_EARLY_BSS by moving the clearing
  141. of BSS prior to entering board_init_f()) but doing so is discouraged.
  142. Instead it is strongly recommended to architect any code changes
  143. or additions such to not depend on the availability of BSS during
  144. board_init_f() as indicated in other sections of this README to
  145. maintain compatibility and consistency across the entire code base.
  146. - must return normally from this function (don't call board_init_r()
  147. directly)
  148. Here the BSS is cleared. For SPL, if CONFIG_SPL_STACK_R is defined, then at
  149. this point the stack and global_data are relocated to below
  150. CONFIG_SPL_STACK_R_ADDR. For non-SPL, U-Boot is relocated to run at the top of
  151. memory.
  152. board_init_r():
  153. - purpose: main execution, common code
  154. - global_data is available
  155. - SDRAM is available
  156. - BSS is available, all static/global variables can be used
  157. - execution eventually continues to main_loop()
  158. Non-SPL-specific notes:
  159. - U-Boot is relocated to the top of memory and is now running from
  160. there.
  161. SPL-specific notes:
  162. - stack is optionally in SDRAM, if CONFIG_SPL_STACK_R is defined and
  163. CONFIG_SYS_FSL_HAS_CCI400
  164. Defined For SoC that has cache coherent interconnect
  165. CCN-400
  166. CONFIG_SYS_FSL_HAS_CCN504
  167. Defined for SoC that has cache coherent interconnect CCN-504
  168. The following options need to be configured:
  169. - CPU Type: Define exactly one, e.g. CONFIG_MPC85XX.
  170. - Board Type: Define exactly one, e.g. CONFIG_MPC8540ADS.
  171. - 85xx CPU Options:
  172. CONFIG_SYS_PPC64
  173. Specifies that the core is a 64-bit PowerPC implementation (implements
  174. the "64" category of the Power ISA). This is necessary for ePAPR
  175. compliance, among other possible reasons.
  176. CONFIG_SYS_FSL_ERRATUM_A004510
  177. Enables a workaround for erratum A004510. If set,
  178. then CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV and
  179. CFG_SYS_FSL_CORENET_SNOOPVEC_COREONLY must be set.
  180. CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV
  181. CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV2 (optional)
  182. Defines one or two SoC revisions (low 8 bits of SVR)
  183. for which the A004510 workaround should be applied.
  184. The rest of SVR is either not relevant to the decision
  185. of whether the erratum is present (e.g. p2040 versus
  186. p2041) or is implied by the build target, which controls
  187. whether CONFIG_SYS_FSL_ERRATUM_A004510 is set.
  188. See Freescale App Note 4493 for more information about
  189. this erratum.
  190. CFG_SYS_FSL_CORENET_SNOOPVEC_COREONLY
  191. This is the value to write into CCSR offset 0x18600
  192. according to the A004510 workaround.
  193. CONFIG_SYS_FSL_SINGLE_SOURCE_CLK
  194. Single Source Clock is clocking mode present in some of FSL SoC's.
  195. In this mode, a single differential clock is used to supply
  196. clocks to the sysclock, ddrclock and usbclock.
  197. - Generic CPU options:
  198. CONFIG_SYS_FSL_DDR
  199. Freescale DDR driver in use. This type of DDR controller is
  200. found in mpc83xx, mpc85xx as well as some ARM core SoCs.
  201. CFG_SYS_FSL_DDR_ADDR
  202. Freescale DDR memory-mapped register base.
  203. CONFIG_SYS_FSL_IFC_CLK_DIV
  204. Defines divider of platform clock(clock input to IFC controller).
  205. CONFIG_SYS_FSL_LBC_CLK_DIV
  206. Defines divider of platform clock(clock input to eLBC controller).
  207. CFG_SYS_FSL_DDR_SDRAM_BASE_PHY
  208. Physical address from the view of DDR controllers. It is the
  209. same as CFG_SYS_DDR_SDRAM_BASE for all Power SoCs. But
  210. it could be different for ARM SoCs.
  211. - ARM options:
  212. CFG_SYS_EXCEPTION_VECTORS_HIGH
  213. Select high exception vectors of the ARM core, e.g., do not
  214. clear the V bit of the c1 register of CP15.
  215. COUNTER_FREQUENCY
  216. Generic timer clock source frequency.
  217. COUNTER_FREQUENCY_REAL
  218. Generic timer clock source frequency if the real clock is
  219. different from COUNTER_FREQUENCY, and can only be determined
  220. at run time.
  221. - Linux Kernel Interface:
  222. CONFIG_OF_LIBFDT
  223. New kernel versions are expecting firmware settings to be
  224. passed using flattened device trees (based on open firmware
  225. concepts).
  226. CONFIG_OF_LIBFDT
  227. * New libfdt-based support
  228. * Adds the "fdt" command
  229. * The bootm command automatically updates the fdt
  230. OF_TBCLK - The timebase frequency.
  231. boards with QUICC Engines require OF_QE to set UCC MAC
  232. addresses
  233. CONFIG_OF_IDE_FIXUP
  234. U-Boot can detect if an IDE device is present or not.
  235. If not, and this new config option is activated, U-Boot
  236. removes the ATA node from the DTS before booting Linux,
  237. so the Linux IDE driver does not probe the device and
  238. crash. This is needed for buggy hardware (uc101) where
  239. no pull down resistor is connected to the signal IDE5V_DD7.
  240. - vxWorks boot parameters:
  241. bootvx constructs a valid bootline using the following
  242. environments variables: bootdev, bootfile, ipaddr, netmask,
  243. serverip, gatewayip, hostname, othbootargs.
  244. It loads the vxWorks image pointed bootfile.
  245. Note: If a "bootargs" environment is defined, it will override
  246. the defaults discussed just above.
  247. - Cache Configuration for ARM:
  248. CFG_SYS_PL310_BASE - Physical base address of PL310
  249. controller register space
  250. - Serial Ports:
  251. CFG_PL011_CLOCK
  252. If you have Amba PrimeCell PL011 UARTs, set this variable to
  253. the clock speed of the UARTs.
  254. CFG_PL01x_PORTS
  255. If you have Amba PrimeCell PL010 or PL011 UARTs on your board,
  256. define this to a list of base addresses for each (supported)
  257. port. See e.g. include/configs/versatile.h
  258. CONFIG_SERIAL_HW_FLOW_CONTROL
  259. Define this variable to enable hw flow control in serial driver.
  260. Current user of this option is drivers/serial/nsl16550.c driver
  261. - Removal of commands
  262. If no commands are needed to boot, you can disable
  263. CONFIG_CMDLINE to remove them. In this case, the command line
  264. will not be available, and when U-Boot wants to execute the
  265. boot command (on start-up) it will call board_run_command()
  266. instead. This can reduce image size significantly for very
  267. simple boot procedures.
  268. - Regular expression support:
  269. CONFIG_REGEX
  270. If this variable is defined, U-Boot is linked against
  271. the SLRE (Super Light Regular Expression) library,
  272. which adds regex support to some commands, as for
  273. example "env grep" and "setexpr".
  274. - Watchdog:
  275. CFG_SYS_WATCHDOG_FREQ
  276. Some platforms automatically call WATCHDOG_RESET()
  277. from the timer interrupt handler every
  278. CFG_SYS_WATCHDOG_FREQ interrupts. If not set by the
  279. board configuration file, a default of CONFIG_SYS_HZ/2
  280. (i.e. 500) is used. Setting CFG_SYS_WATCHDOG_FREQ
  281. to 0 disables calling WATCHDOG_RESET() from the timer
  282. interrupt.
  283. - GPIO Support:
  284. The CFG_SYS_I2C_PCA953X_WIDTH option specifies a list of
  285. chip-ngpio pairs that tell the PCA953X driver the number of
  286. pins supported by a particular chip.
  287. Note that if the GPIO device uses I2C, then the I2C interface
  288. must also be configured. See I2C Support, below.
  289. - I/O tracing:
  290. When CONFIG_IO_TRACE is selected, U-Boot intercepts all I/O
  291. accesses and can checksum them or write a list of them out
  292. to memory. See the 'iotrace' command for details. This is
  293. useful for testing device drivers since it can confirm that
  294. the driver behaves the same way before and after a code
  295. change. Currently this is supported on sandbox and arm. To
  296. add support for your architecture, add '#include <iotrace.h>'
  297. to the bottom of arch/<arch>/include/asm/io.h and test.
  298. Example output from the 'iotrace stats' command is below.
  299. Note that if the trace buffer is exhausted, the checksum will
  300. still continue to operate.
  301. iotrace is enabled
  302. Start: 10000000 (buffer start address)
  303. Size: 00010000 (buffer size)
  304. Offset: 00000120 (current buffer offset)
  305. Output: 10000120 (start + offset)
  306. Count: 00000018 (number of trace records)
  307. CRC32: 9526fb66 (CRC32 of all trace records)
  308. - Timestamp Support:
  309. When CONFIG_TIMESTAMP is selected, the timestamp
  310. (date and time) of an image is printed by image
  311. commands like bootm or iminfo. This option is
  312. automatically enabled when you select CONFIG_CMD_DATE .
  313. - Partition Labels (disklabels) Supported:
  314. Zero or more of the following:
  315. CONFIG_MAC_PARTITION Apple's MacOS partition table.
  316. CONFIG_ISO_PARTITION ISO partition table, used on CDROM etc.
  317. CONFIG_EFI_PARTITION GPT partition table, common when EFI is the
  318. bootloader. Note 2TB partition limit; see
  319. disk/part_efi.c
  320. CONFIG_SCSI) you must configure support for at
  321. least one non-MTD partition type as well.
  322. - NETWORK Support (PCI):
  323. CONFIG_E1000_SPI
  324. Utility code for direct access to the SPI bus on Intel 8257x.
  325. This does not do anything useful unless you set at least one
  326. of CONFIG_CMD_E1000 or CONFIG_E1000_SPI_GENERIC.
  327. CONFIG_NATSEMI
  328. Support for National dp83815 chips.
  329. CONFIG_NS8382X
  330. Support for National dp8382[01] gigabit chips.
  331. - NETWORK Support (other):
  332. CONFIG_CALXEDA_XGMAC
  333. Support for the Calxeda XGMAC device
  334. CONFIG_LAN91C96
  335. Support for SMSC's LAN91C96 chips.
  336. CONFIG_LAN91C96_USE_32_BIT
  337. Define this to enable 32 bit addressing
  338. CFG_SYS_DAVINCI_EMAC_PHY_COUNT
  339. Define this if you have more then 3 PHYs.
  340. CONFIG_FTGMAC100
  341. Support for Faraday's FTGMAC100 Gigabit SoC Ethernet
  342. CONFIG_FTGMAC100_EGIGA
  343. Define this to use GE link update with gigabit PHY.
  344. Define this if FTGMAC100 is connected to gigabit PHY.
  345. If your system has 10/100 PHY only, it might not occur
  346. wrong behavior. Because PHY usually return timeout or
  347. useless data when polling gigabit status and gigabit
  348. control registers. This behavior won't affect the
  349. correctnessof 10/100 link speed update.
  350. CONFIG_SH_ETHER
  351. Support for Renesas on-chip Ethernet controller
  352. CFG_SH_ETHER_USE_PORT
  353. Define the number of ports to be used
  354. CFG_SH_ETHER_PHY_ADDR
  355. Define the ETH PHY's address
  356. CFG_SH_ETHER_CACHE_WRITEBACK
  357. If this option is set, the driver enables cache flush.
  358. - TPM Support:
  359. CONFIG_TPM
  360. Support TPM devices.
  361. CONFIG_TPM_TIS_INFINEON
  362. Support for Infineon i2c bus TPM devices. Only one device
  363. per system is supported at this time.
  364. CONFIG_TPM_TIS_I2C_BURST_LIMITATION
  365. Define the burst count bytes upper limit
  366. CONFIG_TPM_ST33ZP24
  367. Support for STMicroelectronics TPM devices. Requires DM_TPM support.
  368. CONFIG_TPM_ST33ZP24_I2C
  369. Support for STMicroelectronics ST33ZP24 I2C devices.
  370. Requires TPM_ST33ZP24 and I2C.
  371. CONFIG_TPM_ST33ZP24_SPI
  372. Support for STMicroelectronics ST33ZP24 SPI devices.
  373. Requires TPM_ST33ZP24 and SPI.
  374. CONFIG_TPM_ATMEL_TWI
  375. Support for Atmel TWI TPM device. Requires I2C support.
  376. CONFIG_TPM_TIS_LPC
  377. Support for generic parallel port TPM devices. Only one device
  378. per system is supported at this time.
  379. CONFIG_TPM
  380. Define this to enable the TPM support library which provides
  381. functional interfaces to some TPM commands.
  382. Requires support for a TPM device.
  383. CONFIG_TPM_AUTH_SESSIONS
  384. Define this to enable authorized functions in the TPM library.
  385. Requires CONFIG_TPM and CONFIG_SHA1.
  386. - USB Support:
  387. At the moment only the UHCI host controller is
  388. supported (PIP405, MIP405); define
  389. CONFIG_USB_UHCI to enable it.
  390. define CONFIG_USB_KEYBOARD to enable the USB Keyboard
  391. and define CONFIG_USB_STORAGE to enable the USB
  392. storage devices.
  393. Note:
  394. Supported are USB Keyboards and USB Floppy drives
  395. (TEAC FD-05PUB).
  396. CONFIG_USB_DWC2_REG_ADDR the physical CPU address of the DWC2
  397. HW module registers.
  398. - USB Device:
  399. Define the below if you wish to use the USB console.
  400. Once firmware is rebuilt from a serial console issue the
  401. command "setenv stdin usbtty; setenv stdout usbtty" and
  402. attach your USB cable. The Unix command "dmesg" should print
  403. it has found a new device. The environment variable usbtty
  404. can be set to gserial or cdc_acm to enable your device to
  405. appear to a USB host as a Linux gserial device or a
  406. Common Device Class Abstract Control Model serial device.
  407. If you select usbtty = gserial you should be able to enumerate
  408. a Linux host by
  409. # modprobe usbserial vendor=0xVendorID product=0xProductID
  410. else if using cdc_acm, simply setting the environment
  411. variable usbtty to be cdc_acm should suffice. The following
  412. might be defined in YourBoardName.h
  413. If you have a USB-IF assigned VendorID then you may wish to
  414. define your own vendor specific values either in BoardName.h
  415. or directly in usbd_vendor_info.h. If you don't define
  416. CONFIG_USBD_MANUFACTURER, CONFIG_USBD_PRODUCT_NAME,
  417. CONFIG_USBD_VENDORID and CONFIG_USBD_PRODUCTID, then U-Boot
  418. should pretend to be a Linux device to it's target host.
  419. CONFIG_USBD_MANUFACTURER
  420. Define this string as the name of your company for
  421. - CONFIG_USBD_MANUFACTURER "my company"
  422. CONFIG_USBD_PRODUCT_NAME
  423. Define this string as the name of your product
  424. - CONFIG_USBD_PRODUCT_NAME "acme usb device"
  425. CONFIG_USBD_VENDORID
  426. Define this as your assigned Vendor ID from the USB
  427. Implementors Forum. This *must* be a genuine Vendor ID
  428. to avoid polluting the USB namespace.
  429. - CONFIG_USBD_VENDORID 0xFFFF
  430. CONFIG_USBD_PRODUCTID
  431. Define this as the unique Product ID
  432. for your device
  433. - CONFIG_USBD_PRODUCTID 0xFFFF
  434. - ULPI Layer Support:
  435. The ULPI (UTMI Low Pin (count) Interface) PHYs are supported via
  436. the generic ULPI layer. The generic layer accesses the ULPI PHY
  437. via the platform viewport, so you need both the genric layer and
  438. the viewport enabled. Currently only Chipidea/ARC based
  439. viewport is supported.
  440. To enable the ULPI layer support, define CONFIG_USB_ULPI and
  441. CONFIG_USB_ULPI_VIEWPORT in your board configuration file.
  442. If your ULPI phy needs a different reference clock than the
  443. standard 24 MHz then you have to define CFG_ULPI_REF_CLK to
  444. the appropriate value in Hz.
  445. - MMC Support:
  446. CONFIG_SH_MMCIF
  447. Support for Renesas on-chip MMCIF controller
  448. CONFIG_SH_MMCIF_ADDR
  449. Define the base address of MMCIF registers
  450. CONFIG_SH_MMCIF_CLK
  451. Define the clock frequency for MMCIF
  452. - USB Device Firmware Update (DFU) class support:
  453. CONFIG_DFU_OVER_USB
  454. This enables the USB portion of the DFU USB class
  455. CONFIG_DFU_NAND
  456. This enables support for exposing NAND devices via DFU.
  457. CONFIG_DFU_RAM
  458. This enables support for exposing RAM via DFU.
  459. Note: DFU spec refer to non-volatile memory usage, but
  460. allow usages beyond the scope of spec - here RAM usage,
  461. one that would help mostly the developer.
  462. CONFIG_SYS_DFU_DATA_BUF_SIZE
  463. Dfu transfer uses a buffer before writing data to the
  464. raw storage device. Make the size (in bytes) of this buffer
  465. configurable. The size of this buffer is also configurable
  466. through the "dfu_bufsiz" environment variable.
  467. CONFIG_SYS_DFU_MAX_FILE_SIZE
  468. When updating files rather than the raw storage device,
  469. we use a static buffer to copy the file into and then write
  470. the buffer once we've been given the whole file. Define
  471. this to the maximum filesize (in bytes) for the buffer.
  472. Default is 4 MiB if undefined.
  473. DFU_DEFAULT_POLL_TIMEOUT
  474. Poll timeout [ms], is the timeout a device can send to the
  475. host. The host must wait for this timeout before sending
  476. a subsequent DFU_GET_STATUS request to the device.
  477. DFU_MANIFEST_POLL_TIMEOUT
  478. Poll timeout [ms], which the device sends to the host when
  479. entering dfuMANIFEST state. Host waits this timeout, before
  480. sending again an USB request to the device.
  481. - Keyboard Support:
  482. See Kconfig help for available keyboard drivers.
  483. - MII/PHY support:
  484. CONFIG_PHY_CLOCK_FREQ (ppc4xx)
  485. The clock frequency of the MII bus
  486. CONFIG_PHY_CMD_DELAY (ppc4xx)
  487. Some PHY like Intel LXT971A need extra delay after
  488. command issued before MII status register can be read
  489. - BOOTP Recovery Mode:
  490. CONFIG_BOOTP_RANDOM_DELAY
  491. If you have many targets in a network that try to
  492. boot using BOOTP, you may want to avoid that all
  493. systems send out BOOTP requests at precisely the same
  494. moment (which would happen for instance at recovery
  495. from a power failure, when all systems will try to
  496. boot, thus flooding the BOOTP server. Defining
  497. CONFIG_BOOTP_RANDOM_DELAY causes a random delay to be
  498. inserted before sending out BOOTP requests. The
  499. following delays are inserted then:
  500. 1st BOOTP request: delay 0 ... 1 sec
  501. 2nd BOOTP request: delay 0 ... 2 sec
  502. 3rd BOOTP request: delay 0 ... 4 sec
  503. 4th and following
  504. BOOTP requests: delay 0 ... 8 sec
  505. CFG_BOOTP_ID_CACHE_SIZE
  506. BOOTP packets are uniquely identified using a 32-bit ID. The
  507. server will copy the ID from client requests to responses and
  508. U-Boot will use this to determine if it is the destination of
  509. an incoming response. Some servers will check that addresses
  510. aren't in use before handing them out (usually using an ARP
  511. ping) and therefore take up to a few hundred milliseconds to
  512. respond. Network congestion may also influence the time it
  513. takes for a response to make it back to the client. If that
  514. time is too long, U-Boot will retransmit requests. In order
  515. to allow earlier responses to still be accepted after these
  516. retransmissions, U-Boot's BOOTP client keeps a small cache of
  517. IDs. The CFG_BOOTP_ID_CACHE_SIZE controls the size of this
  518. cache. The default is to keep IDs for up to four outstanding
  519. requests. Increasing this will allow U-Boot to accept offers
  520. from a BOOTP client in networks with unusually high latency.
  521. - DHCP Advanced Options:
  522. - Link-local IP address negotiation:
  523. Negotiate with other link-local clients on the local network
  524. for an address that doesn't require explicit configuration.
  525. This is especially useful if a DHCP server cannot be guaranteed
  526. to exist in all environments that the device must operate.
  527. See doc/README.link-local for more information.
  528. - MAC address from environment variables
  529. FDT_SEQ_MACADDR_FROM_ENV
  530. Fix-up device tree with MAC addresses fetched sequentially from
  531. environment variables. This config work on assumption that
  532. non-usable ethernet node of device-tree are either not present
  533. or their status has been marked as "disabled".
  534. - CDP Options:
  535. CONFIG_CDP_DEVICE_ID
  536. The device id used in CDP trigger frames.
  537. CONFIG_CDP_DEVICE_ID_PREFIX
  538. A two character string which is prefixed to the MAC address
  539. of the device.
  540. CONFIG_CDP_PORT_ID
  541. A printf format string which contains the ascii name of
  542. the port. Normally is set to "eth%d" which sets
  543. eth0 for the first Ethernet, eth1 for the second etc.
  544. CONFIG_CDP_CAPABILITIES
  545. A 32bit integer which indicates the device capabilities;
  546. 0x00000010 for a normal host which does not forwards.
  547. CONFIG_CDP_VERSION
  548. An ascii string containing the version of the software.
  549. CONFIG_CDP_PLATFORM
  550. An ascii string containing the name of the platform.
  551. CONFIG_CDP_TRIGGER
  552. A 32bit integer sent on the trigger.
  553. CONFIG_CDP_POWER_CONSUMPTION
  554. A 16bit integer containing the power consumption of the
  555. device in .1 of milliwatts.
  556. CONFIG_CDP_APPLIANCE_VLAN_TYPE
  557. A byte containing the id of the VLAN.
  558. - Status LED: CONFIG_LED_STATUS
  559. Several configurations allow to display the current
  560. status using a LED. For instance, the LED will blink
  561. fast while running U-Boot code, stop blinking as
  562. soon as a reply to a BOOTP request was received, and
  563. start blinking slow once the Linux kernel is running
  564. (supported by a status LED driver in the Linux
  565. kernel). Defining CONFIG_LED_STATUS enables this
  566. feature in U-Boot.
  567. Additional options:
  568. CONFIG_LED_STATUS_GPIO
  569. The status LED can be connected to a GPIO pin.
  570. In such cases, the gpio_led driver can be used as a
  571. status LED backend implementation. Define CONFIG_LED_STATUS_GPIO
  572. to include the gpio_led driver in the U-Boot binary.
  573. CFG_GPIO_LED_INVERTED_TABLE
  574. Some GPIO connected LEDs may have inverted polarity in which
  575. case the GPIO high value corresponds to LED off state and
  576. GPIO low value corresponds to LED on state.
  577. In such cases CFG_GPIO_LED_INVERTED_TABLE may be defined
  578. with a list of GPIO LEDs that have inverted polarity.
  579. - I2C Support:
  580. CFG_SYS_NUM_I2C_BUSES
  581. Hold the number of i2c buses you want to use.
  582. CFG_SYS_I2C_DIRECT_BUS
  583. define this, if you don't use i2c muxes on your hardware.
  584. if CFG_SYS_I2C_MAX_HOPS is not defined or == 0 you can
  585. omit this define.
  586. CFG_SYS_I2C_MAX_HOPS
  587. define how many muxes are maximal consecutively connected
  588. on one i2c bus. If you not use i2c muxes, omit this
  589. define.
  590. CFG_SYS_I2C_BUSES
  591. hold a list of buses you want to use, only used if
  592. CFG_SYS_I2C_DIRECT_BUS is not defined, for example
  593. a board with CFG_SYS_I2C_MAX_HOPS = 1 and
  594. CFG_SYS_NUM_I2C_BUSES = 9:
  595. CFG_SYS_I2C_BUSES {{0, {I2C_NULL_HOP}}, \
  596. {0, {{I2C_MUX_PCA9547, 0x70, 1}}}, \
  597. {0, {{I2C_MUX_PCA9547, 0x70, 2}}}, \
  598. {0, {{I2C_MUX_PCA9547, 0x70, 3}}}, \
  599. {0, {{I2C_MUX_PCA9547, 0x70, 4}}}, \
  600. {0, {{I2C_MUX_PCA9547, 0x70, 5}}}, \
  601. {1, {I2C_NULL_HOP}}, \
  602. {1, {{I2C_MUX_PCA9544, 0x72, 1}}}, \
  603. {1, {{I2C_MUX_PCA9544, 0x72, 2}}}, \
  604. }
  605. which defines
  606. bus 0 on adapter 0 without a mux
  607. bus 1 on adapter 0 with a PCA9547 on address 0x70 port 1
  608. bus 2 on adapter 0 with a PCA9547 on address 0x70 port 2
  609. bus 3 on adapter 0 with a PCA9547 on address 0x70 port 3
  610. bus 4 on adapter 0 with a PCA9547 on address 0x70 port 4
  611. bus 5 on adapter 0 with a PCA9547 on address 0x70 port 5
  612. bus 6 on adapter 1 without a mux
  613. bus 7 on adapter 1 with a PCA9544 on address 0x72 port 1
  614. bus 8 on adapter 1 with a PCA9544 on address 0x72 port 2
  615. If you do not have i2c muxes on your board, omit this define.
  616. - Legacy I2C Support:
  617. If you use the software i2c interface (CONFIG_SYS_I2C_SOFT)
  618. then the following macros need to be defined (examples are
  619. from include/configs/lwmon.h):
  620. I2C_INIT
  621. (Optional). Any commands necessary to enable the I2C
  622. controller or configure ports.
  623. eg: #define I2C_INIT (immr->im_cpm.cp_pbdir |= PB_SCL)
  624. I2C_ACTIVE
  625. The code necessary to make the I2C data line active
  626. (driven). If the data line is open collector, this
  627. define can be null.
  628. eg: #define I2C_ACTIVE (immr->im_cpm.cp_pbdir |= PB_SDA)
  629. I2C_TRISTATE
  630. The code necessary to make the I2C data line tri-stated
  631. (inactive). If the data line is open collector, this
  632. define can be null.
  633. eg: #define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA)
  634. I2C_READ
  635. Code that returns true if the I2C data line is high,
  636. false if it is low.
  637. eg: #define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0)
  638. I2C_SDA(bit)
  639. If <bit> is true, sets the I2C data line high. If it
  640. is false, it clears it (low).
  641. eg: #define I2C_SDA(bit) \
  642. if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \
  643. else immr->im_cpm.cp_pbdat &= ~PB_SDA
  644. I2C_SCL(bit)
  645. If <bit> is true, sets the I2C clock line high. If it
  646. is false, it clears it (low).
  647. eg: #define I2C_SCL(bit) \
  648. if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \
  649. else immr->im_cpm.cp_pbdat &= ~PB_SCL
  650. I2C_DELAY
  651. This delay is invoked four times per clock cycle so this
  652. controls the rate of data transfer. The data rate thus
  653. is 1 / (I2C_DELAY * 4). Often defined to be something
  654. like:
  655. #define I2C_DELAY udelay(2)
  656. CONFIG_SOFT_I2C_GPIO_SCL / CONFIG_SOFT_I2C_GPIO_SDA
  657. If your arch supports the generic GPIO framework (asm/gpio.h),
  658. then you may alternatively define the two GPIOs that are to be
  659. used as SCL / SDA. Any of the previous I2C_xxx macros will
  660. have GPIO-based defaults assigned to them as appropriate.
  661. You should define these to the GPIO value as given directly to
  662. the generic GPIO functions.
  663. CFG_I2C_MULTI_BUS
  664. This option allows the use of multiple I2C buses, each of which
  665. must have a controller. At any point in time, only one bus is
  666. active. To switch to a different bus, use the 'i2c dev' command.
  667. Note that bus numbering is zero-based.
  668. CFG_SYS_I2C_NOPROBES
  669. This option specifies a list of I2C devices that will be skipped
  670. when the 'i2c probe' command is issued.
  671. e.g.
  672. #define CFG_SYS_I2C_NOPROBES {0x50,0x68}
  673. will skip addresses 0x50 and 0x68 on a board with one I2C bus
  674. CFG_SYS_RTC_BUS_NUM
  675. If defined, then this indicates the I2C bus number for the RTC.
  676. If not defined, then U-Boot assumes that RTC is on I2C bus 0.
  677. CONFIG_SOFT_I2C_READ_REPEATED_START
  678. defining this will force the i2c_read() function in
  679. the soft_i2c driver to perform an I2C repeated start
  680. between writing the address pointer and reading the
  681. data. If this define is omitted the default behaviour
  682. of doing a stop-start sequence will be used. Most I2C
  683. devices can use either method, but some require one or
  684. the other.
  685. - SPI Support: CONFIG_SPI
  686. Enables SPI driver (so far only tested with
  687. SPI EEPROM, also an instance works with Crystal A/D and
  688. D/As on the SACSng board)
  689. CFG_SYS_SPI_MXC_WAIT
  690. Timeout for waiting until spi transfer completed.
  691. default: (CONFIG_SYS_HZ/100) /* 10 ms */
  692. - FPGA Support: CONFIG_FPGA
  693. Enables FPGA subsystem.
  694. CONFIG_FPGA_<vendor>
  695. Enables support for specific chip vendors.
  696. (ALTERA, XILINX)
  697. CONFIG_FPGA_<family>
  698. Enables support for FPGA family.
  699. (SPARTAN2, SPARTAN3, VIRTEX2, CYCLONE2, ACEX1K, ACEX)
  700. CONFIG_SYS_FPGA_CHECK_BUSY
  701. Enable checks on FPGA configuration interface busy
  702. status by the configuration function. This option
  703. will require a board or device specific function to
  704. be written.
  705. CFG_FPGA_DELAY
  706. If defined, a function that provides delays in the FPGA
  707. configuration driver.
  708. CFG_SYS_FPGA_CHECK_ERROR
  709. Check for configuration errors during FPGA bitfile
  710. loading. For example, abort during Virtex II
  711. configuration if the INIT_B line goes low (which
  712. indicated a CRC error).
  713. CFG_SYS_FPGA_WAIT_INIT
  714. Maximum time to wait for the INIT_B line to de-assert
  715. after PROB_B has been de-asserted during a Virtex II
  716. FPGA configuration sequence. The default time is 500
  717. ms.
  718. CFG_SYS_FPGA_WAIT_BUSY
  719. Maximum time to wait for BUSY to de-assert during
  720. Virtex II FPGA configuration. The default is 5 ms.
  721. CFG_SYS_FPGA_WAIT_CONFIG
  722. Time to wait after FPGA configuration. The default is
  723. 200 ms.
  724. - Vendor Parameter Protection:
  725. U-Boot considers the values of the environment
  726. variables "serial#" (Board Serial Number) and
  727. "ethaddr" (Ethernet Address) to be parameters that
  728. are set once by the board vendor / manufacturer, and
  729. protects these variables from casual modification by
  730. the user. Once set, these variables are read-only,
  731. and write or delete attempts are rejected. You can
  732. change this behaviour:
  733. If CONFIG_ENV_OVERWRITE is #defined in your config
  734. file, the write protection for vendor parameters is
  735. completely disabled. Anybody can change or delete
  736. these parameters.
  737. The same can be accomplished in a more flexible way
  738. for any variable by configuring the type of access
  739. to allow for those variables in the ".flags" variable
  740. or define CFG_ENV_FLAGS_LIST_STATIC.
  741. - Protected RAM:
  742. CFG_PRAM
  743. Define this variable to enable the reservation of
  744. "protected RAM", i. e. RAM which is not overwritten
  745. by U-Boot. Define CFG_PRAM to hold the number of
  746. kB you want to reserve for pRAM. You can overwrite
  747. this default value by defining an environment
  748. variable "pram" to the number of kB you want to
  749. reserve. Note that the board info structure will
  750. still show the full amount of RAM. If pRAM is
  751. reserved, a new environment variable "mem" will
  752. automatically be defined to hold the amount of
  753. remaining RAM in a form that can be passed as boot
  754. argument to Linux, for instance like that:
  755. setenv bootargs ... mem=\${mem}
  756. saveenv
  757. This way you can tell Linux not to use this memory,
  758. either, which results in a memory region that will
  759. not be affected by reboots.
  760. *WARNING* If your board configuration uses automatic
  761. detection of the RAM size, you must make sure that
  762. this memory test is non-destructive. So far, the
  763. following board configurations are known to be
  764. "pRAM-clean":
  765. IVMS8, IVML24, SPD8xx,
  766. HERMES, IP860, RPXlite, LWMON,
  767. FLAGADM
  768. - Error Recovery:
  769. Note:
  770. In the current implementation, the local variables
  771. space and global environment variables space are
  772. separated. Local variables are those you define by
  773. simply typing `name=value'. To access a local
  774. variable later on, you have write `$name' or
  775. `${name}'; to execute the contents of a variable
  776. directly type `$name' at the command prompt.
  777. Global environment variables are those you use
  778. setenv/printenv to work with. To run a command stored
  779. in such a variable, you need to use the run command,
  780. and you must not use the '$' sign to access them.
  781. To store commands and special characters in a
  782. variable, please use double quotation marks
  783. surrounding the whole text of the variable, instead
  784. of the backslashes before semicolons and special
  785. symbols.
  786. - Default Environment:
  787. CFG_EXTRA_ENV_SETTINGS
  788. Define this to contain any number of null terminated
  789. strings (variable = value pairs) that will be part of
  790. the default environment compiled into the boot image.
  791. For example, place something like this in your
  792. board's config file:
  793. #define CFG_EXTRA_ENV_SETTINGS \
  794. "myvar1=value1\0" \
  795. "myvar2=value2\0"
  796. Warning: This method is based on knowledge about the
  797. internal format how the environment is stored by the
  798. U-Boot code. This is NOT an official, exported
  799. interface! Although it is unlikely that this format
  800. will change soon, there is no guarantee either.
  801. You better know what you are doing here.
  802. Note: overly (ab)use of the default environment is
  803. discouraged. Make sure to check other ways to preset
  804. the environment like the "source" command or the
  805. boot command first.
  806. CONFIG_DELAY_ENVIRONMENT
  807. Normally the environment is loaded when the board is
  808. initialised so that it is available to U-Boot. This inhibits
  809. that so that the environment is not available until
  810. explicitly loaded later by U-Boot code. With CONFIG_OF_CONTROL
  811. this is instead controlled by the value of
  812. /config/load-environment.
  813. - Automatic software updates via TFTP server
  814. CONFIG_UPDATE_TFTP
  815. CONFIG_UPDATE_TFTP_CNT_MAX
  816. CONFIG_UPDATE_TFTP_MSEC_MAX
  817. These options enable and control the auto-update feature;
  818. for a more detailed description refer to doc/README.update.
  819. - MTD Support (mtdparts command, UBI support)
  820. CONFIG_MTD_UBI_WL_THRESHOLD
  821. This parameter defines the maximum difference between the highest
  822. erase counter value and the lowest erase counter value of eraseblocks
  823. of UBI devices. When this threshold is exceeded, UBI starts performing
  824. wear leveling by means of moving data from eraseblock with low erase
  825. counter to eraseblocks with high erase counter.
  826. The default value should be OK for SLC NAND flashes, NOR flashes and
  827. other flashes which have eraseblock life-cycle 100000 or more.
  828. However, in case of MLC NAND flashes which typically have eraseblock
  829. life-cycle less than 10000, the threshold should be lessened (e.g.,
  830. to 128 or 256, although it does not have to be power of 2).
  831. default: 4096
  832. CONFIG_MTD_UBI_BEB_LIMIT
  833. This option specifies the maximum bad physical eraseblocks UBI
  834. expects on the MTD device (per 1024 eraseblocks). If the
  835. underlying flash does not admit of bad eraseblocks (e.g. NOR
  836. flash), this value is ignored.
  837. NAND datasheets often specify the minimum and maximum NVM
  838. (Number of Valid Blocks) for the flashes' endurance lifetime.
  839. The maximum expected bad eraseblocks per 1024 eraseblocks
  840. then can be calculated as "1024 * (1 - MinNVB / MaxNVB)",
  841. which gives 20 for most NANDs (MaxNVB is basically the total
  842. count of eraseblocks on the chip).
  843. To put it differently, if this value is 20, UBI will try to
  844. reserve about 1.9% of physical eraseblocks for bad blocks
  845. handling. And that will be 1.9% of eraseblocks on the entire
  846. NAND chip, not just the MTD partition UBI attaches. This means
  847. that if you have, say, a NAND flash chip admits maximum 40 bad
  848. eraseblocks, and it is split on two MTD partitions of the same
  849. size, UBI will reserve 40 eraseblocks when attaching a
  850. partition.
  851. default: 20
  852. CONFIG_MTD_UBI_FASTMAP
  853. Fastmap is a mechanism which allows attaching an UBI device
  854. in nearly constant time. Instead of scanning the whole MTD device it
  855. only has to locate a checkpoint (called fastmap) on the device.
  856. The on-flash fastmap contains all information needed to attach
  857. the device. Using fastmap makes only sense on large devices where
  858. attaching by scanning takes long. UBI will not automatically install
  859. a fastmap on old images, but you can set the UBI parameter
  860. CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT to 1 if you want so. Please note
  861. that fastmap-enabled images are still usable with UBI implementations
  862. without fastmap support. On typical flash devices the whole fastmap
  863. fits into one PEB. UBI will reserve PEBs to hold two fastmaps.
  864. CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT
  865. Set this parameter to enable fastmap automatically on images
  866. without a fastmap.
  867. default: 0
  868. CONFIG_MTD_UBI_FM_DEBUG
  869. Enable UBI fastmap debug
  870. default: 0
  871. - SPL framework
  872. CONFIG_SPL
  873. Enable building of SPL globally.
  874. CONFIG_SPL_PANIC_ON_RAW_IMAGE
  875. When defined, SPL will panic() if the image it has
  876. loaded does not have a signature.
  877. Defining this is useful when code which loads images
  878. in SPL cannot guarantee that absolutely all read errors
  879. will be caught.
  880. An example is the LPC32XX MLC NAND driver, which will
  881. consider that a completely unreadable NAND block is bad,
  882. and thus should be skipped silently.
  883. CONFIG_SPL_DISPLAY_PRINT
  884. For ARM, enable an optional function to print more information
  885. about the running system.
  886. CONFIG_SPL_MPC83XX_WAIT_FOR_NAND
  887. Set this for NAND SPL on PPC mpc83xx targets, so that
  888. start.S waits for the rest of the SPL to load before
  889. continuing (the hardware starts execution after just
  890. loading the first page rather than the full 4K).
  891. CONFIG_SPL_UBI
  892. Support for a lightweight UBI (fastmap) scanner and
  893. loader
  894. CONFIG_SYS_NAND_5_ADDR_CYCLE, CONFIG_SYS_NAND_PAGE_SIZE,
  895. CONFIG_SYS_NAND_OOBSIZE, CONFIG_SYS_NAND_BLOCK_SIZE,
  896. CONFIG_SYS_NAND_BAD_BLOCK_POS, CFG_SYS_NAND_ECCPOS,
  897. CFG_SYS_NAND_ECCSIZE, CFG_SYS_NAND_ECCBYTES
  898. Defines the size and behavior of the NAND that SPL uses
  899. to read U-Boot
  900. CFG_SYS_NAND_U_BOOT_DST
  901. Location in memory to load U-Boot to
  902. CFG_SYS_NAND_U_BOOT_SIZE
  903. Size of image to load
  904. CFG_SYS_NAND_U_BOOT_START
  905. Entry point in loaded image to jump to
  906. CONFIG_SPL_RAM_DEVICE
  907. Support for running image already present in ram, in SPL binary
  908. CONFIG_SPL_FIT_PRINT
  909. Printing information about a FIT image adds quite a bit of
  910. code to SPL. So this is normally disabled in SPL. Use this
  911. option to re-enable it. This will affect the output of the
  912. bootm command when booting a FIT image.
  913. - Interrupt support (PPC):
  914. There are common interrupt_init() and timer_interrupt()
  915. for all PPC archs. interrupt_init() calls interrupt_init_cpu()
  916. for CPU specific initialization. interrupt_init_cpu()
  917. should set decrementer_count to appropriate value. If
  918. CPU resets decrementer automatically after interrupt
  919. (ppc4xx) it should set decrementer_count to zero.
  920. timer_interrupt() calls timer_interrupt_cpu() for CPU
  921. specific handling. If board has watchdog / status_led
  922. / other_activity_monitor it works automatically from
  923. general timer_interrupt().
  924. Board initialization settings:
  925. ------------------------------
  926. During Initialization u-boot calls a number of board specific functions
  927. to allow the preparation of board specific prerequisites, e.g. pin setup
  928. before drivers are initialized. To enable these callbacks the
  929. following configuration macros have to be defined. Currently this is
  930. architecture specific, so please check arch/your_architecture/lib/board.c
  931. typically in board_init_f() and board_init_r().
  932. - CONFIG_BOARD_EARLY_INIT_F: Call board_early_init_f()
  933. - CONFIG_BOARD_EARLY_INIT_R: Call board_early_init_r()
  934. - CONFIG_BOARD_LATE_INIT: Call board_late_init()
  935. Configuration Settings:
  936. -----------------------
  937. - CONFIG_SYS_LONGHELP: Defined when you want long help messages included;
  938. undefine this when you're short of memory.
  939. - CFG_SYS_HELP_CMD_WIDTH: Defined when you want to override the default
  940. width of the commands listed in the 'help' command output.
  941. - CONFIG_SYS_PROMPT: This is what U-Boot prints on the console to
  942. prompt for user input.
  943. - CFG_SYS_BAUDRATE_TABLE:
  944. List of legal baudrate settings for this board.
  945. - CFG_SYS_MEM_RESERVE_SECURE
  946. Only implemented for ARMv8 for now.
  947. If defined, the size of CFG_SYS_MEM_RESERVE_SECURE memory
  948. is substracted from total RAM and won't be reported to OS.
  949. This memory can be used as secure memory. A variable
  950. gd->arch.secure_ram is used to track the location. In systems
  951. the RAM base is not zero, or RAM is divided into banks,
  952. this variable needs to be recalcuated to get the address.
  953. - CFG_SYS_SDRAM_BASE:
  954. Physical start address of SDRAM. _Must_ be 0 here.
  955. - CFG_SYS_FLASH_BASE:
  956. Physical start address of Flash memory.
  957. - CONFIG_SYS_MALLOC_LEN:
  958. Size of DRAM reserved for malloc() use.
  959. - CFG_SYS_BOOTMAPSZ:
  960. Maximum size of memory mapped by the startup code of
  961. the Linux kernel; all data that must be processed by
  962. the Linux kernel (bd_info, boot arguments, FDT blob if
  963. used) must be put below this limit, unless "bootm_low"
  964. environment variable is defined and non-zero. In such case
  965. all data for the Linux kernel must be between "bootm_low"
  966. and "bootm_low" + CFG_SYS_BOOTMAPSZ. The environment
  967. variable "bootm_mapsize" will override the value of
  968. CFG_SYS_BOOTMAPSZ. If CFG_SYS_BOOTMAPSZ is undefined,
  969. then the value in "bootm_size" will be used instead.
  970. - CONFIG_SYS_BOOT_GET_CMDLINE:
  971. Enables allocating and saving kernel cmdline in space between
  972. "bootm_low" and "bootm_low" + BOOTMAPSZ.
  973. - CONFIG_SYS_BOOT_GET_KBD:
  974. Enables allocating and saving a kernel copy of the bd_info in
  975. space between "bootm_low" and "bootm_low" + BOOTMAPSZ.
  976. - CONFIG_SYS_FLASH_PROTECTION
  977. If defined, hardware flash sectors protection is used
  978. instead of U-Boot software protection.
  979. - CONFIG_SYS_FLASH_CFI:
  980. Define if the flash driver uses extra elements in the
  981. common flash structure for storing flash geometry.
  982. - CONFIG_FLASH_CFI_DRIVER
  983. This option also enables the building of the cfi_flash driver
  984. in the drivers directory
  985. - CONFIG_FLASH_CFI_MTD
  986. This option enables the building of the cfi_mtd driver
  987. in the drivers directory. The driver exports CFI flash
  988. to the MTD layer.
  989. - CONFIG_SYS_FLASH_USE_BUFFER_WRITE
  990. Use buffered writes to flash.
  991. - CONFIG_ENV_FLAGS_LIST_DEFAULT
  992. - CFG_ENV_FLAGS_LIST_STATIC
  993. Enable validation of the values given to environment variables when
  994. calling env set. Variables can be restricted to only decimal,
  995. hexadecimal, or boolean. If CONFIG_CMD_NET is also defined,
  996. the variables can also be restricted to IP address or MAC address.
  997. The format of the list is:
  998. type_attribute = [s|d|x|b|i|m]
  999. access_attribute = [a|r|o|c]
  1000. attributes = type_attribute[access_attribute]
  1001. entry = variable_name[:attributes]
  1002. list = entry[,list]
  1003. The type attributes are:
  1004. s - String (default)
  1005. d - Decimal
  1006. x - Hexadecimal
  1007. b - Boolean ([1yYtT|0nNfF])
  1008. i - IP address
  1009. m - MAC address
  1010. The access attributes are:
  1011. a - Any (default)
  1012. r - Read-only
  1013. o - Write-once
  1014. c - Change-default
  1015. - CONFIG_ENV_FLAGS_LIST_DEFAULT
  1016. Define this to a list (string) to define the ".flags"
  1017. environment variable in the default or embedded environment.
  1018. - CFG_ENV_FLAGS_LIST_STATIC
  1019. Define this to a list (string) to define validation that
  1020. should be done if an entry is not found in the ".flags"
  1021. environment variable. To override a setting in the static
  1022. list, simply add an entry for the same variable name to the
  1023. ".flags" variable.
  1024. If CONFIG_REGEX is defined, the variable_name above is evaluated as a
  1025. regular expression. This allows multiple variables to define the same
  1026. flags without explicitly listing them for each variable.
  1027. The following definitions that deal with the placement and management
  1028. of environment data (variable area); in general, we support the
  1029. following configurations:
  1030. BE CAREFUL! The first access to the environment happens quite early
  1031. in U-Boot initialization (when we try to get the setting of for the
  1032. console baudrate). You *MUST* have mapped your NVRAM area then, or
  1033. U-Boot will hang.
  1034. Please note that even with NVRAM we still use a copy of the
  1035. environment in RAM: we could work on NVRAM directly, but we want to
  1036. keep settings there always unmodified except somebody uses "saveenv"
  1037. to save the current settings.
  1038. BE CAREFUL! For some special cases, the local device can not use
  1039. "saveenv" command. For example, the local device will get the
  1040. environment stored in a remote NOR flash by SRIO or PCIE link,
  1041. but it can not erase, write this NOR flash by SRIO or PCIE interface.
  1042. - CONFIG_NAND_ENV_DST
  1043. Defines address in RAM to which the nand_spl code should copy the
  1044. environment. If redundant environment is used, it will be copied to
  1045. CONFIG_NAND_ENV_DST + CONFIG_ENV_SIZE.
  1046. Please note that the environment is read-only until the monitor
  1047. has been relocated to RAM and a RAM copy of the environment has been
  1048. created; also, when using EEPROM you will have to use env_get_f()
  1049. until then to read environment variables.
  1050. The environment is protected by a CRC32 checksum. Before the monitor
  1051. is relocated into RAM, as a result of a bad CRC you will be working
  1052. with the compiled-in default environment - *silently*!!! [This is
  1053. necessary, because the first environment variable we need is the
  1054. "baudrate" setting for the console - if we have a bad CRC, we don't
  1055. have any device yet where we could complain.]
  1056. Note: once the monitor has been relocated, then it will complain if
  1057. the default environment is used; a new CRC is computed as soon as you
  1058. use the "saveenv" command to store a valid environment.
  1059. - CONFIG_SYS_FAULT_MII_ADDR:
  1060. MII address of the PHY to check for the Ethernet link state.
  1061. - CONFIG_DISPLAY_BOARDINFO
  1062. Display information about the board that U-Boot is running on
  1063. when U-Boot starts up. The board function checkboard() is called
  1064. to do this.
  1065. - CONFIG_DISPLAY_BOARDINFO_LATE
  1066. Similar to the previous option, but display this information
  1067. later, once stdio is running and output goes to the LCD, if
  1068. present.
  1069. Low Level (hardware related) configuration options:
  1070. ---------------------------------------------------
  1071. - CONFIG_SYS_CACHELINE_SIZE:
  1072. Cache Line Size of the CPU.
  1073. - CONFIG_SYS_CCSRBAR_DEFAULT:
  1074. Default (power-on reset) physical address of CCSR on Freescale
  1075. PowerPC SOCs.
  1076. - CFG_SYS_CCSRBAR:
  1077. Virtual address of CCSR. On a 32-bit build, this is typically
  1078. the same value as CONFIG_SYS_CCSRBAR_DEFAULT.
  1079. - CFG_SYS_CCSRBAR_PHYS:
  1080. Physical address of CCSR. CCSR can be relocated to a new
  1081. physical address, if desired. In this case, this macro should
  1082. be set to that address. Otherwise, it should be set to the
  1083. same value as CONFIG_SYS_CCSRBAR_DEFAULT. For example, CCSR
  1084. is typically relocated on 36-bit builds. It is recommended
  1085. that this macro be defined via the _HIGH and _LOW macros:
  1086. #define CFG_SYS_CCSRBAR_PHYS ((CFG_SYS_CCSRBAR_PHYS_HIGH
  1087. * 1ull) << 32 | CFG_SYS_CCSRBAR_PHYS_LOW)
  1088. - CFG_SYS_CCSRBAR_PHYS_HIGH:
  1089. Bits 33-36 of CFG_SYS_CCSRBAR_PHYS. This value is typically
  1090. either 0 (32-bit build) or 0xF (36-bit build). This macro is
  1091. used in assembly code, so it must not contain typecasts or
  1092. integer size suffixes (e.g. "ULL").
  1093. - CFG_SYS_CCSRBAR_PHYS_LOW:
  1094. Lower 32-bits of CFG_SYS_CCSRBAR_PHYS. This macro is
  1095. used in assembly code, so it must not contain typecasts or
  1096. integer size suffixes (e.g. "ULL").
  1097. - CONFIG_SYS_IMMR: Physical address of the Internal Memory.
  1098. DO NOT CHANGE unless you know exactly what you're
  1099. doing! (11-4) [MPC8xx systems only]
  1100. - CFG_SYS_INIT_RAM_ADDR:
  1101. Start address of memory area that can be used for
  1102. initial data and stack; please note that this must be
  1103. writable memory that is working WITHOUT special
  1104. initialization, i. e. you CANNOT use normal RAM which
  1105. will become available only after programming the
  1106. memory controller and running certain initialization
  1107. sequences.
  1108. U-Boot uses the following memory types:
  1109. - MPC8xx: IMMR (internal memory of the CPU)
  1110. - CONFIG_SYS_SCCR: System Clock and reset Control Register (15-27)
  1111. - CONFIG_SYS_OR_TIMING_SDRAM:
  1112. SDRAM timing
  1113. - CONFIG_SYS_SRIOn_MEM_VIRT:
  1114. Virtual Address of SRIO port 'n' memory region
  1115. - CONFIG_SYS_SRIOn_MEM_PHYxS:
  1116. Physical Address of SRIO port 'n' memory region
  1117. - CONFIG_SYS_SRIOn_MEM_SIZE:
  1118. Size of SRIO port 'n' memory region
  1119. - CONFIG_SYS_NAND_BUSWIDTH_16BIT
  1120. Defined to tell the NAND controller that the NAND chip is using
  1121. a 16 bit bus.
  1122. Not all NAND drivers use this symbol.
  1123. Example of drivers that use it:
  1124. - drivers/mtd/nand/raw/ndfc.c
  1125. - drivers/mtd/nand/raw/mxc_nand.c
  1126. - CONFIG_SYS_NDFC_EBC0_CFG
  1127. Sets the EBC0_CFG register for the NDFC. If not defined
  1128. a default value will be used.
  1129. - CONFIG_SYS_SPD_BUS_NUM
  1130. If SPD EEPROM is on an I2C bus other than the first
  1131. one, specify here. Note that the value must resolve
  1132. to something your driver can deal with.
  1133. - CONFIG_FSL_DDR_INTERACTIVE
  1134. Enable interactive DDR debugging. See doc/README.fsl-ddr.
  1135. - CONFIG_FSL_DDR_SYNC_REFRESH
  1136. Enable sync of refresh for multiple controllers.
  1137. - CONFIG_FSL_DDR_BIST
  1138. Enable built-in memory test for Freescale DDR controllers.
  1139. - CONFIG_RMII
  1140. Enable RMII mode for all FECs.
  1141. Note that this is a global option, we can't
  1142. have one FEC in standard MII mode and another in RMII mode.
  1143. - CONFIG_CRC32_VERIFY
  1144. Add a verify option to the crc32 command.
  1145. The syntax is:
  1146. => crc32 -v <address> <count> <crc32>
  1147. Where address/count indicate a memory area
  1148. and crc32 is the correct crc32 which the
  1149. area should have.
  1150. - CONFIG_LOOPW
  1151. Add the "loopw" memory command. This only takes effect if
  1152. the memory commands are activated globally (CONFIG_CMD_MEMORY).
  1153. - CONFIG_CMD_MX_CYCLIC
  1154. Add the "mdc" and "mwc" memory commands. These are cyclic
  1155. "md/mw" commands.
  1156. Examples:
  1157. => mdc.b 10 4 500
  1158. This command will print 4 bytes (10,11,12,13) each 500 ms.
  1159. => mwc.l 100 12345678 10
  1160. This command will write 12345678 to address 100 all 10 ms.
  1161. This only takes effect if the memory commands are activated
  1162. globally (CONFIG_CMD_MEMORY).
  1163. - CONFIG_SPL_BUILD
  1164. Set when the currently running compilation is for an artifact
  1165. that will end up in one of the 'xPL' builds, i.e. SPL, TPL or
  1166. VPL. Code that needs phase-specific behaviour can check this,
  1167. or (where possible) use spl_phase() instead.
  1168. Note that CONFIG_SPL_BUILD *is* always defined when either
  1169. of CONFIG_TPL_BUILD / CONFIG_VPL_BUILD is defined. This can be
  1170. counter-intuitive and should perhaps be changed.
  1171. - CONFIG_TPL_BUILD
  1172. Set when the currently running compilation is for an artifact
  1173. that will end up in the TPL build (as opposed to SPL, VPL or
  1174. U-Boot proper). Code that needs phase-specific behaviour can
  1175. check this, or (where possible) use spl_phase() instead.
  1176. - CONFIG_VPL_BUILD
  1177. Set when the currently running compilation is for an artifact
  1178. that will end up in the VPL build (as opposed to the SPL, TPL
  1179. or U-Boot proper). Code that needs phase-specific behaviour can
  1180. check this, or (where possible) use spl_phase() instead.
  1181. - CONFIG_ARCH_MAP_SYSMEM
  1182. Generally U-Boot (and in particular the md command) uses
  1183. effective address. It is therefore not necessary to regard
  1184. U-Boot address as virtual addresses that need to be translated
  1185. to physical addresses. However, sandbox requires this, since
  1186. it maintains its own little RAM buffer which contains all
  1187. addressable memory. This option causes some memory accesses
  1188. to be mapped through map_sysmem() / unmap_sysmem().
  1189. - CONFIG_X86_RESET_VECTOR
  1190. If defined, the x86 reset vector code is included. This is not
  1191. needed when U-Boot is running from Coreboot.
  1192. Freescale QE/FMAN Firmware Support:
  1193. -----------------------------------
  1194. The Freescale QUICCEngine (QE) and Frame Manager (FMAN) both support the
  1195. loading of "firmware", which is encoded in the QE firmware binary format.
  1196. This firmware often needs to be loaded during U-Boot booting, so macros
  1197. are used to identify the storage device (NOR flash, SPI, etc) and the address
  1198. within that device.
  1199. - CONFIG_SYS_FMAN_FW_ADDR
  1200. The address in the storage device where the FMAN microcode is located. The
  1201. meaning of this address depends on which CONFIG_SYS_QE_FMAN_FW_IN_xxx macro
  1202. is also specified.
  1203. - CONFIG_SYS_QE_FW_ADDR
  1204. The address in the storage device where the QE microcode is located. The
  1205. meaning of this address depends on which CONFIG_SYS_QE_FMAN_FW_IN_xxx macro
  1206. is also specified.
  1207. - CONFIG_SYS_QE_FMAN_FW_LENGTH
  1208. The maximum possible size of the firmware. The firmware binary format
  1209. has a field that specifies the actual size of the firmware, but it
  1210. might not be possible to read any part of the firmware unless some
  1211. local storage is allocated to hold the entire firmware first.
  1212. - CONFIG_SYS_QE_FMAN_FW_IN_NOR
  1213. Specifies that QE/FMAN firmware is located in NOR flash, mapped as
  1214. normal addressable memory via the LBC. CONFIG_SYS_FMAN_FW_ADDR is the
  1215. virtual address in NOR flash.
  1216. - CONFIG_SYS_QE_FMAN_FW_IN_NAND
  1217. Specifies that QE/FMAN firmware is located in NAND flash.
  1218. CONFIG_SYS_FMAN_FW_ADDR is the offset within NAND flash.
  1219. - CONFIG_SYS_QE_FMAN_FW_IN_MMC
  1220. Specifies that QE/FMAN firmware is located on the primary SD/MMC
  1221. device. CONFIG_SYS_FMAN_FW_ADDR is the byte offset on that device.
  1222. - CONFIG_SYS_QE_FMAN_FW_IN_REMOTE
  1223. Specifies that QE/FMAN firmware is located in the remote (master)
  1224. memory space. CONFIG_SYS_FMAN_FW_ADDR is a virtual address which
  1225. can be mapped from slave TLB->slave LAW->slave SRIO or PCIE outbound
  1226. window->master inbound window->master LAW->the ucode address in
  1227. master's memory space.
  1228. Freescale Layerscape Management Complex Firmware Support:
  1229. ---------------------------------------------------------
  1230. The Freescale Layerscape Management Complex (MC) supports the loading of
  1231. "firmware".
  1232. This firmware often needs to be loaded during U-Boot booting, so macros
  1233. are used to identify the storage device (NOR flash, SPI, etc) and the address
  1234. within that device.
  1235. - CONFIG_FSL_MC_ENET
  1236. Enable the MC driver for Layerscape SoCs.
  1237. Freescale Layerscape Debug Server Support:
  1238. -------------------------------------------
  1239. The Freescale Layerscape Debug Server Support supports the loading of
  1240. "Debug Server firmware" and triggering SP boot-rom.
  1241. This firmware often needs to be loaded during U-Boot booting.
  1242. - CONFIG_SYS_MC_RSV_MEM_ALIGN
  1243. Define alignment of reserved memory MC requires
  1244. Building the Software:
  1245. ======================
  1246. Building U-Boot has been tested in several native build environments
  1247. and in many different cross environments. Of course we cannot support
  1248. all possibly existing versions of cross development tools in all
  1249. (potentially obsolete) versions. In case of tool chain problems we
  1250. recommend to use the ELDK (see https://www.denx.de/wiki/DULG/ELDK)
  1251. which is extensively used to build and test U-Boot.
  1252. If you are not using a native environment, it is assumed that you
  1253. have GNU cross compiling tools available in your path. In this case,
  1254. you must set the environment variable CROSS_COMPILE in your shell.
  1255. Note that no changes to the Makefile or any other source files are
  1256. necessary. For example using the ELDK on a 4xx CPU, please enter:
  1257. $ CROSS_COMPILE=ppc_4xx-
  1258. $ export CROSS_COMPILE
  1259. U-Boot is intended to be simple to build. After installing the
  1260. sources you must configure U-Boot for one specific board type. This
  1261. is done by typing:
  1262. make NAME_defconfig
  1263. where "NAME_defconfig" is the name of one of the existing configu-
  1264. rations; see configs/*_defconfig for supported names.
  1265. Note: for some boards special configuration names may exist; check if
  1266. additional information is available from the board vendor; for
  1267. instance, the TQM823L systems are available without (standard)
  1268. or with LCD support. You can select such additional "features"
  1269. when choosing the configuration, i. e.
  1270. make TQM823L_defconfig
  1271. - will configure for a plain TQM823L, i. e. no LCD support
  1272. make TQM823L_LCD_defconfig
  1273. - will configure for a TQM823L with U-Boot console on LCD
  1274. etc.
  1275. Finally, type "make all", and you should get some working U-Boot
  1276. images ready for download to / installation on your system:
  1277. - "u-boot.bin" is a raw binary image
  1278. - "u-boot" is an image in ELF binary format
  1279. - "u-boot.srec" is in Motorola S-Record format
  1280. By default the build is performed locally and the objects are saved
  1281. in the source directory. One of the two methods can be used to change
  1282. this behavior and build U-Boot to some external directory:
  1283. 1. Add O= to the make command line invocations:
  1284. make O=/tmp/build distclean
  1285. make O=/tmp/build NAME_defconfig
  1286. make O=/tmp/build all
  1287. 2. Set environment variable KBUILD_OUTPUT to point to the desired location:
  1288. export KBUILD_OUTPUT=/tmp/build
  1289. make distclean
  1290. make NAME_defconfig
  1291. make all
  1292. Note that the command line "O=" setting overrides the KBUILD_OUTPUT environment
  1293. variable.
  1294. User specific CPPFLAGS, AFLAGS and CFLAGS can be passed to the compiler by
  1295. setting the according environment variables KCPPFLAGS, KAFLAGS and KCFLAGS.
  1296. For example to treat all compiler warnings as errors:
  1297. make KCFLAGS=-Werror
  1298. Please be aware that the Makefiles assume you are using GNU make, so
  1299. for instance on NetBSD you might need to use "gmake" instead of
  1300. native "make".
  1301. If the system board that you have is not listed, then you will need
  1302. to port U-Boot to your hardware platform. To do this, follow these
  1303. steps:
  1304. 1. Create a new directory to hold your board specific code. Add any
  1305. files you need. In your board directory, you will need at least
  1306. the "Makefile" and a "<board>.c".
  1307. 2. Create a new configuration file "include/configs/<board>.h" for
  1308. your board.
  1309. 3. If you're porting U-Boot to a new CPU, then also create a new
  1310. directory to hold your CPU specific code. Add any files you need.
  1311. 4. Run "make <board>_defconfig" with your new name.
  1312. 5. Type "make", and you should get a working "u-boot.srec" file
  1313. to be installed on your target system.
  1314. 6. Debug and solve any problems that might arise.
  1315. [Of course, this last step is much harder than it sounds.]
  1316. Testing of U-Boot Modifications, Ports to New Hardware, etc.:
  1317. ==============================================================
  1318. If you have modified U-Boot sources (for instance added a new board
  1319. or support for new devices, a new CPU, etc.) you are expected to
  1320. provide feedback to the other developers. The feedback normally takes
  1321. the form of a "patch", i.e. a context diff against a certain (latest
  1322. official or latest in the git repository) version of U-Boot sources.
  1323. But before you submit such a patch, please verify that your modifi-
  1324. cation did not break existing code. At least make sure that *ALL* of
  1325. the supported boards compile WITHOUT ANY compiler warnings. To do so,
  1326. just run the buildman script (tools/buildman/buildman), which will
  1327. configure and build U-Boot for ALL supported system. Be warned, this
  1328. will take a while. Please see the buildman README, or run 'buildman -H'
  1329. for documentation.
  1330. See also "U-Boot Porting Guide" below.
  1331. Monitor Commands - Overview:
  1332. ============================
  1333. go - start application at address 'addr'
  1334. run - run commands in an environment variable
  1335. bootm - boot application image from memory
  1336. bootp - boot image via network using BootP/TFTP protocol
  1337. bootz - boot zImage from memory
  1338. tftpboot- boot image via network using TFTP protocol
  1339. and env variables "ipaddr" and "serverip"
  1340. (and eventually "gatewayip")
  1341. tftpput - upload a file via network using TFTP protocol
  1342. rarpboot- boot image via network using RARP/TFTP protocol
  1343. diskboot- boot from IDE devicebootd - boot default, i.e., run 'bootcmd'
  1344. loads - load S-Record file over serial line
  1345. loadb - load binary file over serial line (kermit mode)
  1346. loadm - load binary blob from source address to destination address
  1347. md - memory display
  1348. mm - memory modify (auto-incrementing)
  1349. nm - memory modify (constant address)
  1350. mw - memory write (fill)
  1351. ms - memory search
  1352. cp - memory copy
  1353. cmp - memory compare
  1354. crc32 - checksum calculation
  1355. i2c - I2C sub-system
  1356. sspi - SPI utility commands
  1357. base - print or set address offset
  1358. printenv- print environment variables
  1359. pwm - control pwm channels
  1360. seama - load SEAMA NAND image
  1361. setenv - set environment variables
  1362. saveenv - save environment variables to persistent storage
  1363. protect - enable or disable FLASH write protection
  1364. erase - erase FLASH memory
  1365. flinfo - print FLASH memory information
  1366. nand - NAND memory operations (see doc/README.nand)
  1367. bdinfo - print Board Info structure
  1368. iminfo - print header information for application image
  1369. coninfo - print console devices and informations
  1370. ide - IDE sub-system
  1371. loop - infinite loop on address range
  1372. loopw - infinite write loop on address range
  1373. mtest - simple RAM test
  1374. icache - enable or disable instruction cache
  1375. dcache - enable or disable data cache
  1376. reset - Perform RESET of the CPU
  1377. echo - echo args to console
  1378. version - print monitor version
  1379. help - print online help
  1380. ? - alias for 'help'
  1381. Monitor Commands - Detailed Description:
  1382. ========================================
  1383. TODO.
  1384. For now: just type "help <command>".
  1385. Note for Redundant Ethernet Interfaces:
  1386. =======================================
  1387. Some boards come with redundant Ethernet interfaces; U-Boot supports
  1388. such configurations and is capable of automatic selection of a
  1389. "working" interface when needed. MAC assignment works as follows:
  1390. Network interfaces are numbered eth0, eth1, eth2, ... Corresponding
  1391. MAC addresses can be stored in the environment as "ethaddr" (=>eth0),
  1392. "eth1addr" (=>eth1), "eth2addr", ...
  1393. If the network interface stores some valid MAC address (for instance
  1394. in SROM), this is used as default address if there is NO correspon-
  1395. ding setting in the environment; if the corresponding environment
  1396. variable is set, this overrides the settings in the card; that means:
  1397. o If the SROM has a valid MAC address, and there is no address in the
  1398. environment, the SROM's address is used.
  1399. o If there is no valid address in the SROM, and a definition in the
  1400. environment exists, then the value from the environment variable is
  1401. used.
  1402. o If both the SROM and the environment contain a MAC address, and
  1403. both addresses are the same, this MAC address is used.
  1404. o If both the SROM and the environment contain a MAC address, and the
  1405. addresses differ, the value from the environment is used and a
  1406. warning is printed.
  1407. o If neither SROM nor the environment contain a MAC address, an error
  1408. is raised. If CONFIG_NET_RANDOM_ETHADDR is defined, then in this case
  1409. a random, locally-assigned MAC is used.
  1410. If Ethernet drivers implement the 'write_hwaddr' function, valid MAC addresses
  1411. will be programmed into hardware as part of the initialization process. This
  1412. may be skipped by setting the appropriate 'ethmacskip' environment variable.
  1413. The naming convention is as follows:
  1414. "ethmacskip" (=>eth0), "eth1macskip" (=>eth1) etc.
  1415. Image Formats:
  1416. ==============
  1417. U-Boot is capable of booting (and performing other auxiliary operations on)
  1418. images in two formats:
  1419. New uImage format (FIT)
  1420. -----------------------
  1421. Flexible and powerful format based on Flattened Image Tree -- FIT (similar
  1422. to Flattened Device Tree). It allows the use of images with multiple
  1423. components (several kernels, ramdisks, etc.), with contents protected by
  1424. SHA1, MD5 or CRC32. More details are found in the doc/uImage.FIT directory.
  1425. Old uImage format
  1426. -----------------
  1427. Old image format is based on binary files which can be basically anything,
  1428. preceded by a special header; see the definitions in include/image.h for
  1429. details; basically, the header defines the following image properties:
  1430. * Target Operating System (Provisions for OpenBSD, NetBSD, FreeBSD,
  1431. 4.4BSD, Linux, SVR4, Esix, Solaris, Irix, SCO, Dell, NCR, VxWorks,
  1432. LynxOS, pSOS, QNX, RTEMS, INTEGRITY;
  1433. Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, INTEGRITY).
  1434. * Target CPU Architecture (Provisions for Alpha, ARM, Intel x86,
  1435. IA64, MIPS, Nios II, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
  1436. Currently supported: ARM, Intel x86, MIPS, Nios II, PowerPC).
  1437. * Compression Type (uncompressed, gzip, bzip2)
  1438. * Load Address
  1439. * Entry Point
  1440. * Image Name
  1441. * Image Timestamp
  1442. The header is marked by a special Magic Number, and both the header
  1443. and the data portions of the image are secured against corruption by
  1444. CRC32 checksums.
  1445. Linux Support:
  1446. ==============
  1447. Although U-Boot should support any OS or standalone application
  1448. easily, the main focus has always been on Linux during the design of
  1449. U-Boot.
  1450. U-Boot includes many features that so far have been part of some
  1451. special "boot loader" code within the Linux kernel. Also, any
  1452. "initrd" images to be used are no longer part of one big Linux image;
  1453. instead, kernel and "initrd" are separate images. This implementation
  1454. serves several purposes:
  1455. - the same features can be used for other OS or standalone
  1456. applications (for instance: using compressed images to reduce the
  1457. Flash memory footprint)
  1458. - it becomes much easier to port new Linux kernel versions because
  1459. lots of low-level, hardware dependent stuff are done by U-Boot
  1460. - the same Linux kernel image can now be used with different "initrd"
  1461. images; of course this also means that different kernel images can
  1462. be run with the same "initrd". This makes testing easier (you don't
  1463. have to build a new "zImage.initrd" Linux image when you just
  1464. change a file in your "initrd"). Also, a field-upgrade of the
  1465. software is easier now.
  1466. Linux HOWTO:
  1467. ============
  1468. Porting Linux to U-Boot based systems:
  1469. ---------------------------------------
  1470. U-Boot cannot save you from doing all the necessary modifications to
  1471. configure the Linux device drivers for use with your target hardware
  1472. (no, we don't intend to provide a full virtual machine interface to
  1473. Linux :-).
  1474. But now you can ignore ALL boot loader code (in arch/powerpc/mbxboot).
  1475. Just make sure your machine specific header file (for instance
  1476. include/asm-ppc/tqm8xx.h) includes the same definition of the Board
  1477. Information structure as we define in include/asm-<arch>/u-boot.h,
  1478. and make sure that your definition of IMAP_ADDR uses the same value
  1479. as your U-Boot configuration in CONFIG_SYS_IMMR.
  1480. Note that U-Boot now has a driver model, a unified model for drivers.
  1481. If you are adding a new driver, plumb it into driver model. If there
  1482. is no uclass available, you are encouraged to create one. See
  1483. doc/driver-model.
  1484. Configuring the Linux kernel:
  1485. -----------------------------
  1486. No specific requirements for U-Boot. Make sure you have some root
  1487. device (initial ramdisk, NFS) for your target system.
  1488. Building a Linux Image:
  1489. -----------------------
  1490. With U-Boot, "normal" build targets like "zImage" or "bzImage" are
  1491. not used. If you use recent kernel source, a new build target
  1492. "uImage" will exist which automatically builds an image usable by
  1493. U-Boot. Most older kernels also have support for a "pImage" target,
  1494. which was introduced for our predecessor project PPCBoot and uses a
  1495. 100% compatible format.
  1496. Example:
  1497. make TQM850L_defconfig
  1498. make oldconfig
  1499. make dep
  1500. make uImage
  1501. The "uImage" build target uses a special tool (in 'tools/mkimage') to
  1502. encapsulate a compressed Linux kernel image with header information,
  1503. CRC32 checksum etc. for use with U-Boot. This is what we are doing:
  1504. * build a standard "vmlinux" kernel image (in ELF binary format):
  1505. * convert the kernel into a raw binary image:
  1506. ${CROSS_COMPILE}-objcopy -O binary \
  1507. -R .note -R .comment \
  1508. -S vmlinux linux.bin
  1509. * compress the binary image:
  1510. gzip -9 linux.bin
  1511. * package compressed binary image for U-Boot:
  1512. mkimage -A ppc -O linux -T kernel -C gzip \
  1513. -a 0 -e 0 -n "Linux Kernel Image" \
  1514. -d linux.bin.gz uImage
  1515. The "mkimage" tool can also be used to create ramdisk images for use
  1516. with U-Boot, either separated from the Linux kernel image, or
  1517. combined into one file. "mkimage" encapsulates the images with a 64
  1518. byte header containing information about target architecture,
  1519. operating system, image type, compression method, entry points, time
  1520. stamp, CRC32 checksums, etc.
  1521. "mkimage" can be called in two ways: to verify existing images and
  1522. print the header information, or to build new images.
  1523. In the first form (with "-l" option) mkimage lists the information
  1524. contained in the header of an existing U-Boot image; this includes
  1525. checksum verification:
  1526. tools/mkimage -l image
  1527. -l ==> list image header information
  1528. The second form (with "-d" option) is used to build a U-Boot image
  1529. from a "data file" which is used as image payload:
  1530. tools/mkimage -A arch -O os -T type -C comp -a addr -e ep \
  1531. -n name -d data_file image
  1532. -A ==> set architecture to 'arch'
  1533. -O ==> set operating system to 'os'
  1534. -T ==> set image type to 'type'
  1535. -C ==> set compression type 'comp'
  1536. -a ==> set load address to 'addr' (hex)
  1537. -e ==> set entry point to 'ep' (hex)
  1538. -n ==> set image name to 'name'
  1539. -d ==> use image data from 'datafile'
  1540. Right now, all Linux kernels for PowerPC systems use the same load
  1541. address (0x00000000), but the entry point address depends on the
  1542. kernel version:
  1543. - 2.2.x kernels have the entry point at 0x0000000C,
  1544. - 2.3.x and later kernels have the entry point at 0x00000000.
  1545. So a typical call to build a U-Boot image would read:
  1546. -> tools/mkimage -n '2.4.4 kernel for TQM850L' \
  1547. > -A ppc -O linux -T kernel -C gzip -a 0 -e 0 \
  1548. > -d /opt/elsk/ppc_8xx/usr/src/linux-2.4.4/arch/powerpc/coffboot/vmlinux.gz \
  1549. > examples/uImage.TQM850L
  1550. Image Name: 2.4.4 kernel for TQM850L
  1551. Created: Wed Jul 19 02:34:59 2000
  1552. Image Type: PowerPC Linux Kernel Image (gzip compressed)
  1553. Data Size: 335725 Bytes = 327.86 kB = 0.32 MB
  1554. Load Address: 0x00000000
  1555. Entry Point: 0x00000000
  1556. To verify the contents of the image (or check for corruption):
  1557. -> tools/mkimage -l examples/uImage.TQM850L
  1558. Image Name: 2.4.4 kernel for TQM850L
  1559. Created: Wed Jul 19 02:34:59 2000
  1560. Image Type: PowerPC Linux Kernel Image (gzip compressed)
  1561. Data Size: 335725 Bytes = 327.86 kB = 0.32 MB
  1562. Load Address: 0x00000000
  1563. Entry Point: 0x00000000
  1564. NOTE: for embedded systems where boot time is critical you can trade
  1565. speed for memory and install an UNCOMPRESSED image instead: this
  1566. needs more space in Flash, but boots much faster since it does not
  1567. need to be uncompressed:
  1568. -> gunzip /opt/elsk/ppc_8xx/usr/src/linux-2.4.4/arch/powerpc/coffboot/vmlinux.gz
  1569. -> tools/mkimage -n '2.4.4 kernel for TQM850L' \
  1570. > -A ppc -O linux -T kernel -C none -a 0 -e 0 \
  1571. > -d /opt/elsk/ppc_8xx/usr/src/linux-2.4.4/arch/powerpc/coffboot/vmlinux \
  1572. > examples/uImage.TQM850L-uncompressed
  1573. Image Name: 2.4.4 kernel for TQM850L
  1574. Created: Wed Jul 19 02:34:59 2000
  1575. Image Type: PowerPC Linux Kernel Image (uncompressed)
  1576. Data Size: 792160 Bytes = 773.59 kB = 0.76 MB
  1577. Load Address: 0x00000000
  1578. Entry Point: 0x00000000
  1579. Similar you can build U-Boot images from a 'ramdisk.image.gz' file
  1580. when your kernel is intended to use an initial ramdisk:
  1581. -> tools/mkimage -n 'Simple Ramdisk Image' \
  1582. > -A ppc -O linux -T ramdisk -C gzip \
  1583. > -d /LinuxPPC/images/SIMPLE-ramdisk.image.gz examples/simple-initrd
  1584. Image Name: Simple Ramdisk Image
  1585. Created: Wed Jan 12 14:01:50 2000
  1586. Image Type: PowerPC Linux RAMDisk Image (gzip compressed)
  1587. Data Size: 566530 Bytes = 553.25 kB = 0.54 MB
  1588. Load Address: 0x00000000
  1589. Entry Point: 0x00000000
  1590. The "dumpimage" tool can be used to disassemble or list the contents of images
  1591. built by mkimage. See dumpimage's help output (-h) for details.
  1592. Installing a Linux Image:
  1593. -------------------------
  1594. To downloading a U-Boot image over the serial (console) interface,
  1595. you must convert the image to S-Record format:
  1596. objcopy -I binary -O srec examples/image examples/image.srec
  1597. The 'objcopy' does not understand the information in the U-Boot
  1598. image header, so the resulting S-Record file will be relative to
  1599. address 0x00000000. To load it to a given address, you need to
  1600. specify the target address as 'offset' parameter with the 'loads'
  1601. command.
  1602. Example: install the image to address 0x40100000 (which on the
  1603. TQM8xxL is in the first Flash bank):
  1604. => erase 40100000 401FFFFF
  1605. .......... done
  1606. Erased 8 sectors
  1607. => loads 40100000
  1608. ## Ready for S-Record download ...
  1609. ~>examples/image.srec
  1610. 1 2 3 4 5 6 7 8 9 10 11 12 13 ...
  1611. ...
  1612. 15989 15990 15991 15992
  1613. [file transfer complete]
  1614. [connected]
  1615. ## Start Addr = 0x00000000
  1616. You can check the success of the download using the 'iminfo' command;
  1617. this includes a checksum verification so you can be sure no data
  1618. corruption happened:
  1619. => imi 40100000
  1620. ## Checking Image at 40100000 ...
  1621. Image Name: 2.2.13 for initrd on TQM850L
  1622. Image Type: PowerPC Linux Kernel Image (gzip compressed)
  1623. Data Size: 335725 Bytes = 327 kB = 0 MB
  1624. Load Address: 00000000
  1625. Entry Point: 0000000c
  1626. Verifying Checksum ... OK
  1627. Boot Linux:
  1628. -----------
  1629. The "bootm" command is used to boot an application that is stored in
  1630. memory (RAM or Flash). In case of a Linux kernel image, the contents
  1631. of the "bootargs" environment variable is passed to the kernel as
  1632. parameters. You can check and modify this variable using the
  1633. "printenv" and "setenv" commands:
  1634. => printenv bootargs
  1635. bootargs=root=/dev/ram
  1636. => setenv bootargs root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2
  1637. => printenv bootargs
  1638. bootargs=root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2
  1639. => bootm 40020000
  1640. ## Booting Linux kernel at 40020000 ...
  1641. Image Name: 2.2.13 for NFS on TQM850L
  1642. Image Type: PowerPC Linux Kernel Image (gzip compressed)
  1643. Data Size: 381681 Bytes = 372 kB = 0 MB
  1644. Load Address: 00000000
  1645. Entry Point: 0000000c
  1646. Verifying Checksum ... OK
  1647. Uncompressing Kernel Image ... OK
  1648. Linux version 2.2.13 (wd@denx.local.net) (gcc version 2.95.2 19991024 (release)) #1 Wed Jul 19 02:35:17 MEST 2000
  1649. Boot arguments: root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2
  1650. time_init: decrementer frequency = 187500000/60
  1651. Calibrating delay loop... 49.77 BogoMIPS
  1652. Memory: 15208k available (700k kernel code, 444k data, 32k init) [c0000000,c1000000]
  1653. ...
  1654. If you want to boot a Linux kernel with initial RAM disk, you pass
  1655. the memory addresses of both the kernel and the initrd image (PPBCOOT
  1656. format!) to the "bootm" command:
  1657. => imi 40100000 40200000
  1658. ## Checking Image at 40100000 ...
  1659. Image Name: 2.2.13 for initrd on TQM850L
  1660. Image Type: PowerPC Linux Kernel Image (gzip compressed)
  1661. Data Size: 335725 Bytes = 327 kB = 0 MB
  1662. Load Address: 00000000
  1663. Entry Point: 0000000c
  1664. Verifying Checksum ... OK
  1665. ## Checking Image at 40200000 ...
  1666. Image Name: Simple Ramdisk Image
  1667. Image Type: PowerPC Linux RAMDisk Image (gzip compressed)
  1668. Data Size: 566530 Bytes = 553 kB = 0 MB
  1669. Load Address: 00000000
  1670. Entry Point: 00000000
  1671. Verifying Checksum ... OK
  1672. => bootm 40100000 40200000
  1673. ## Booting Linux kernel at 40100000 ...
  1674. Image Name: 2.2.13 for initrd on TQM850L
  1675. Image Type: PowerPC Linux Kernel Image (gzip compressed)
  1676. Data Size: 335725 Bytes = 327 kB = 0 MB
  1677. Load Address: 00000000
  1678. Entry Point: 0000000c
  1679. Verifying Checksum ... OK
  1680. Uncompressing Kernel Image ... OK
  1681. ## Loading RAMDisk Image at 40200000 ...
  1682. Image Name: Simple Ramdisk Image
  1683. Image Type: PowerPC Linux RAMDisk Image (gzip compressed)
  1684. Data Size: 566530 Bytes = 553 kB = 0 MB
  1685. Load Address: 00000000
  1686. Entry Point: 00000000
  1687. Verifying Checksum ... OK
  1688. Loading Ramdisk ... OK
  1689. Linux version 2.2.13 (wd@denx.local.net) (gcc version 2.95.2 19991024 (release)) #1 Wed Jul 19 02:32:08 MEST 2000
  1690. Boot arguments: root=/dev/ram
  1691. time_init: decrementer frequency = 187500000/60
  1692. Calibrating delay loop... 49.77 BogoMIPS
  1693. ...
  1694. RAMDISK: Compressed image found at block 0
  1695. VFS: Mounted root (ext2 filesystem).
  1696. bash#
  1697. Boot Linux and pass a flat device tree:
  1698. -----------
  1699. First, U-Boot must be compiled with the appropriate defines. See the section
  1700. titled "Linux Kernel Interface" above for a more in depth explanation. The
  1701. following is an example of how to start a kernel and pass an updated
  1702. flat device tree:
  1703. => print oftaddr
  1704. oftaddr=0x300000
  1705. => print oft
  1706. oft=oftrees/mpc8540ads.dtb
  1707. => tftp $oftaddr $oft
  1708. Speed: 1000, full duplex
  1709. Using TSEC0 device
  1710. TFTP from server 192.168.1.1; our IP address is 192.168.1.101
  1711. Filename 'oftrees/mpc8540ads.dtb'.
  1712. Load address: 0x300000
  1713. Loading: #
  1714. done
  1715. Bytes transferred = 4106 (100a hex)
  1716. => tftp $loadaddr $bootfile
  1717. Speed: 1000, full duplex
  1718. Using TSEC0 device
  1719. TFTP from server 192.168.1.1; our IP address is 192.168.1.2
  1720. Filename 'uImage'.
  1721. Load address: 0x200000
  1722. Loading:############
  1723. done
  1724. Bytes transferred = 1029407 (fb51f hex)
  1725. => print loadaddr
  1726. loadaddr=200000
  1727. => print oftaddr
  1728. oftaddr=0x300000
  1729. => bootm $loadaddr - $oftaddr
  1730. ## Booting image at 00200000 ...
  1731. Image Name: Linux-2.6.17-dirty
  1732. Image Type: PowerPC Linux Kernel Image (gzip compressed)
  1733. Data Size: 1029343 Bytes = 1005.2 kB
  1734. Load Address: 00000000
  1735. Entry Point: 00000000
  1736. Verifying Checksum ... OK
  1737. Uncompressing Kernel Image ... OK
  1738. Booting using flat device tree at 0x300000
  1739. Using MPC85xx ADS machine description
  1740. Memory CAM mapping: CAM0=256Mb, CAM1=256Mb, CAM2=0Mb residual: 0Mb
  1741. [snip]
  1742. More About U-Boot Image Types:
  1743. ------------------------------
  1744. U-Boot supports the following image types:
  1745. "Standalone Programs" are directly runnable in the environment
  1746. provided by U-Boot; it is expected that (if they behave
  1747. well) you can continue to work in U-Boot after return from
  1748. the Standalone Program.
  1749. "OS Kernel Images" are usually images of some Embedded OS which
  1750. will take over control completely. Usually these programs
  1751. will install their own set of exception handlers, device
  1752. drivers, set up the MMU, etc. - this means, that you cannot
  1753. expect to re-enter U-Boot except by resetting the CPU.
  1754. "RAMDisk Images" are more or less just data blocks, and their
  1755. parameters (address, size) are passed to an OS kernel that is
  1756. being started.
  1757. "Multi-File Images" contain several images, typically an OS
  1758. (Linux) kernel image and one or more data images like
  1759. RAMDisks. This construct is useful for instance when you want
  1760. to boot over the network using BOOTP etc., where the boot
  1761. server provides just a single image file, but you want to get
  1762. for instance an OS kernel and a RAMDisk image.
  1763. "Multi-File Images" start with a list of image sizes, each
  1764. image size (in bytes) specified by an "uint32_t" in network
  1765. byte order. This list is terminated by an "(uint32_t)0".
  1766. Immediately after the terminating 0 follow the images, one by
  1767. one, all aligned on "uint32_t" boundaries (size rounded up to
  1768. a multiple of 4 bytes).
  1769. "Firmware Images" are binary images containing firmware (like
  1770. U-Boot or FPGA images) which usually will be programmed to
  1771. flash memory.
  1772. "Script files" are command sequences that will be executed by
  1773. U-Boot's command interpreter; this feature is especially
  1774. useful when you configure U-Boot to use a real shell (hush)
  1775. as command interpreter.
  1776. Booting the Linux zImage:
  1777. -------------------------
  1778. On some platforms, it's possible to boot Linux zImage. This is done
  1779. using the "bootz" command. The syntax of "bootz" command is the same
  1780. as the syntax of "bootm" command.
  1781. Note, defining the CONFIG_SUPPORT_RAW_INITRD allows user to supply
  1782. kernel with raw initrd images. The syntax is slightly different, the
  1783. address of the initrd must be augmented by it's size, in the following
  1784. format: "<initrd addres>:<initrd size>".
  1785. Standalone HOWTO:
  1786. =================
  1787. One of the features of U-Boot is that you can dynamically load and
  1788. run "standalone" applications, which can use some resources of
  1789. U-Boot like console I/O functions or interrupt services.
  1790. Two simple examples are included with the sources:
  1791. "Hello World" Demo:
  1792. -------------------
  1793. 'examples/hello_world.c' contains a small "Hello World" Demo
  1794. application; it is automatically compiled when you build U-Boot.
  1795. It's configured to run at address 0x00040004, so you can play with it
  1796. like that:
  1797. => loads
  1798. ## Ready for S-Record download ...
  1799. ~>examples/hello_world.srec
  1800. 1 2 3 4 5 6 7 8 9 10 11 ...
  1801. [file transfer complete]
  1802. [connected]
  1803. ## Start Addr = 0x00040004
  1804. => go 40004 Hello World! This is a test.
  1805. ## Starting application at 0x00040004 ...
  1806. Hello World
  1807. argc = 7
  1808. argv[0] = "40004"
  1809. argv[1] = "Hello"
  1810. argv[2] = "World!"
  1811. argv[3] = "This"
  1812. argv[4] = "is"
  1813. argv[5] = "a"
  1814. argv[6] = "test."
  1815. argv[7] = "<NULL>"
  1816. Hit any key to exit ...
  1817. ## Application terminated, rc = 0x0
  1818. Another example, which demonstrates how to register a CPM interrupt
  1819. handler with the U-Boot code, can be found in 'examples/timer.c'.
  1820. Here, a CPM timer is set up to generate an interrupt every second.
  1821. The interrupt service routine is trivial, just printing a '.'
  1822. character, but this is just a demo program. The application can be
  1823. controlled by the following keys:
  1824. ? - print current values og the CPM Timer registers
  1825. b - enable interrupts and start timer
  1826. e - stop timer and disable interrupts
  1827. q - quit application
  1828. => loads
  1829. ## Ready for S-Record download ...
  1830. ~>examples/timer.srec
  1831. 1 2 3 4 5 6 7 8 9 10 11 ...
  1832. [file transfer complete]
  1833. [connected]
  1834. ## Start Addr = 0x00040004
  1835. => go 40004
  1836. ## Starting application at 0x00040004 ...
  1837. TIMERS=0xfff00980
  1838. Using timer 1
  1839. tgcr @ 0xfff00980, tmr @ 0xfff00990, trr @ 0xfff00994, tcr @ 0xfff00998, tcn @ 0xfff0099c, ter @ 0xfff009b0
  1840. Hit 'b':
  1841. [q, b, e, ?] Set interval 1000000 us
  1842. Enabling timer
  1843. Hit '?':
  1844. [q, b, e, ?] ........
  1845. tgcr=0x1, tmr=0xff1c, trr=0x3d09, tcr=0x0, tcn=0xef6, ter=0x0
  1846. Hit '?':
  1847. [q, b, e, ?] .
  1848. tgcr=0x1, tmr=0xff1c, trr=0x3d09, tcr=0x0, tcn=0x2ad4, ter=0x0
  1849. Hit '?':
  1850. [q, b, e, ?] .
  1851. tgcr=0x1, tmr=0xff1c, trr=0x3d09, tcr=0x0, tcn=0x1efc, ter=0x0
  1852. Hit '?':
  1853. [q, b, e, ?] .
  1854. tgcr=0x1, tmr=0xff1c, trr=0x3d09, tcr=0x0, tcn=0x169d, ter=0x0
  1855. Hit 'e':
  1856. [q, b, e, ?] ...Stopping timer
  1857. Hit 'q':
  1858. [q, b, e, ?] ## Application terminated, rc = 0x0
  1859. Implementation Internals:
  1860. =========================
  1861. The following is not intended to be a complete description of every
  1862. implementation detail. However, it should help to understand the
  1863. inner workings of U-Boot and make it easier to port it to custom
  1864. hardware.
  1865. Initial Stack, Global Data:
  1866. ---------------------------
  1867. The implementation of U-Boot is complicated by the fact that U-Boot
  1868. starts running out of ROM (flash memory), usually without access to
  1869. system RAM (because the memory controller is not initialized yet).
  1870. This means that we don't have writable Data or BSS segments, and BSS
  1871. is not initialized as zero. To be able to get a C environment working
  1872. at all, we have to allocate at least a minimal stack. Implementation
  1873. options for this are defined and restricted by the CPU used: Some CPU
  1874. models provide on-chip memory (like the IMMR area on MPC8xx and
  1875. MPC826x processors), on others (parts of) the data cache can be
  1876. locked as (mis-) used as memory, etc.
  1877. Chris Hallinan posted a good summary of these issues to the
  1878. U-Boot mailing list:
  1879. Subject: RE: [U-Boot-Users] RE: More On Memory Bank x (nothingness)?
  1880. From: "Chris Hallinan" <clh@net1plus.com>
  1881. Date: Mon, 10 Feb 2003 16:43:46 -0500 (22:43 MET)
  1882. ...
  1883. Correct me if I'm wrong, folks, but the way I understand it
  1884. is this: Using DCACHE as initial RAM for Stack, etc, does not
  1885. require any physical RAM backing up the cache. The cleverness
  1886. is that the cache is being used as a temporary supply of
  1887. necessary storage before the SDRAM controller is setup. It's
  1888. beyond the scope of this list to explain the details, but you
  1889. can see how this works by studying the cache architecture and
  1890. operation in the architecture and processor-specific manuals.
  1891. OCM is On Chip Memory, which I believe the 405GP has 4K. It
  1892. is another option for the system designer to use as an
  1893. initial stack/RAM area prior to SDRAM being available. Either
  1894. option should work for you. Using CS 4 should be fine if your
  1895. board designers haven't used it for something that would
  1896. cause you grief during the initial boot! It is frequently not
  1897. used.
  1898. CFG_SYS_INIT_RAM_ADDR should be somewhere that won't interfere
  1899. with your processor/board/system design. The default value
  1900. you will find in any recent u-boot distribution in
  1901. walnut.h should work for you. I'd set it to a value larger
  1902. than your SDRAM module. If you have a 64MB SDRAM module, set
  1903. it above 400_0000. Just make sure your board has no resources
  1904. that are supposed to respond to that address! That code in
  1905. start.S has been around a while and should work as is when
  1906. you get the config right.
  1907. -Chris Hallinan
  1908. DS4.COM, Inc.
  1909. It is essential to remember this, since it has some impact on the C
  1910. code for the initialization procedures:
  1911. * Initialized global data (data segment) is read-only. Do not attempt
  1912. to write it.
  1913. * Do not use any uninitialized global data (or implicitly initialized
  1914. as zero data - BSS segment) at all - this is undefined, initiali-
  1915. zation is performed later (when relocating to RAM).
  1916. * Stack space is very limited. Avoid big data buffers or things like
  1917. that.
  1918. Having only the stack as writable memory limits means we cannot use
  1919. normal global data to share information between the code. But it
  1920. turned out that the implementation of U-Boot can be greatly
  1921. simplified by making a global data structure (gd_t) available to all
  1922. functions. We could pass a pointer to this data as argument to _all_
  1923. functions, but this would bloat the code. Instead we use a feature of
  1924. the GCC compiler (Global Register Variables) to share the data: we
  1925. place a pointer (gd) to the global data into a register which we
  1926. reserve for this purpose.
  1927. When choosing a register for such a purpose we are restricted by the
  1928. relevant (E)ABI specifications for the current architecture, and by
  1929. GCC's implementation.
  1930. For PowerPC, the following registers have specific use:
  1931. R1: stack pointer
  1932. R2: reserved for system use
  1933. R3-R4: parameter passing and return values
  1934. R5-R10: parameter passing
  1935. R13: small data area pointer
  1936. R30: GOT pointer
  1937. R31: frame pointer
  1938. (U-Boot also uses R12 as internal GOT pointer. r12
  1939. is a volatile register so r12 needs to be reset when
  1940. going back and forth between asm and C)
  1941. ==> U-Boot will use R2 to hold a pointer to the global data
  1942. Note: on PPC, we could use a static initializer (since the
  1943. address of the global data structure is known at compile time),
  1944. but it turned out that reserving a register results in somewhat
  1945. smaller code - although the code savings are not that big (on
  1946. average for all boards 752 bytes for the whole U-Boot image,
  1947. 624 text + 127 data).
  1948. On ARM, the following registers are used:
  1949. R0: function argument word/integer result
  1950. R1-R3: function argument word
  1951. R9: platform specific
  1952. R10: stack limit (used only if stack checking is enabled)
  1953. R11: argument (frame) pointer
  1954. R12: temporary workspace
  1955. R13: stack pointer
  1956. R14: link register
  1957. R15: program counter
  1958. ==> U-Boot will use R9 to hold a pointer to the global data
  1959. Note: on ARM, only R_ARM_RELATIVE relocations are supported.
  1960. On Nios II, the ABI is documented here:
  1961. https://www.altera.com/literature/hb/nios2/n2cpu_nii51016.pdf
  1962. ==> U-Boot will use gp to hold a pointer to the global data
  1963. Note: on Nios II, we give "-G0" option to gcc and don't use gp
  1964. to access small data sections, so gp is free.
  1965. On RISC-V, the following registers are used:
  1966. x0: hard-wired zero (zero)
  1967. x1: return address (ra)
  1968. x2: stack pointer (sp)
  1969. x3: global pointer (gp)
  1970. x4: thread pointer (tp)
  1971. x5: link register (t0)
  1972. x8: frame pointer (fp)
  1973. x10-x11: arguments/return values (a0-1)
  1974. x12-x17: arguments (a2-7)
  1975. x28-31: temporaries (t3-6)
  1976. pc: program counter (pc)
  1977. ==> U-Boot will use gp to hold a pointer to the global data
  1978. Memory Management:
  1979. ------------------
  1980. U-Boot runs in system state and uses physical addresses, i.e. the
  1981. MMU is not used either for address mapping nor for memory protection.
  1982. The available memory is mapped to fixed addresses using the memory
  1983. controller. In this process, a contiguous block is formed for each
  1984. memory type (Flash, SDRAM, SRAM), even when it consists of several
  1985. physical memory banks.
  1986. U-Boot is installed in the first 128 kB of the first Flash bank (on
  1987. TQM8xxL modules this is the range 0x40000000 ... 0x4001FFFF). After
  1988. booting and sizing and initializing DRAM, the code relocates itself
  1989. to the upper end of DRAM. Immediately below the U-Boot code some
  1990. memory is reserved for use by malloc() [see CONFIG_SYS_MALLOC_LEN
  1991. configuration setting]. Below that, a structure with global Board
  1992. Info data is placed, followed by the stack (growing downward).
  1993. Additionally, some exception handler code is copied to the low 8 kB
  1994. of DRAM (0x00000000 ... 0x00001FFF).
  1995. So a typical memory configuration with 16 MB of DRAM could look like
  1996. this:
  1997. 0x0000 0000 Exception Vector code
  1998. :
  1999. 0x0000 1FFF
  2000. 0x0000 2000 Free for Application Use
  2001. :
  2002. :
  2003. :
  2004. :
  2005. 0x00FB FF20 Monitor Stack (Growing downward)
  2006. 0x00FB FFAC Board Info Data and permanent copy of global data
  2007. 0x00FC 0000 Malloc Arena
  2008. :
  2009. 0x00FD FFFF
  2010. 0x00FE 0000 RAM Copy of Monitor Code
  2011. ... eventually: LCD or video framebuffer
  2012. ... eventually: pRAM (Protected RAM - unchanged by reset)
  2013. 0x00FF FFFF [End of RAM]
  2014. System Initialization:
  2015. ----------------------
  2016. In the reset configuration, U-Boot starts at the reset entry point
  2017. (on most PowerPC systems at address 0x00000100). Because of the reset
  2018. configuration for CS0# this is a mirror of the on board Flash memory.
  2019. To be able to re-map memory U-Boot then jumps to its link address.
  2020. To be able to implement the initialization code in C, a (small!)
  2021. initial stack is set up in the internal Dual Ported RAM (in case CPUs
  2022. which provide such a feature like), or in a locked part of the data
  2023. cache. After that, U-Boot initializes the CPU core, the caches and
  2024. the SIU.
  2025. Next, all (potentially) available memory banks are mapped using a
  2026. preliminary mapping. For example, we put them on 512 MB boundaries
  2027. (multiples of 0x20000000: SDRAM on 0x00000000 and 0x20000000, Flash
  2028. on 0x40000000 and 0x60000000, SRAM on 0x80000000). Then UPM A is
  2029. programmed for SDRAM access. Using the temporary configuration, a
  2030. simple memory test is run that determines the size of the SDRAM
  2031. banks.
  2032. When there is more than one SDRAM bank, and the banks are of
  2033. different size, the largest is mapped first. For equal size, the first
  2034. bank (CS2#) is mapped first. The first mapping is always for address
  2035. 0x00000000, with any additional banks following immediately to create
  2036. contiguous memory starting from 0.
  2037. Then, the monitor installs itself at the upper end of the SDRAM area
  2038. and allocates memory for use by malloc() and for the global Board
  2039. Info data; also, the exception vector code is copied to the low RAM
  2040. pages, and the final stack is set up.
  2041. Only after this relocation will you have a "normal" C environment;
  2042. until that you are restricted in several ways, mostly because you are
  2043. running from ROM, and because the code will have to be relocated to a
  2044. new address in RAM.
  2045. Contributing
  2046. ============
  2047. The U-Boot projects depends on contributions from the user community.
  2048. If you want to participate, please, have a look at the 'General'
  2049. section of https://docs.u-boot.org/en/latest/develop/index.html
  2050. where we describe coding standards and the patch submission process.