build uboot

来源:互联网 发布:2017网络行业利润率 编辑:程序博客网 时间:2024/06/11 21:19
Building the Software:======================Building U-Boot has been tested in several native build environmentsand in many different cross environments. Of course we cannot supportall possibly existing versions of cross development tools in all(potentially obsolete) versions. In case of tool chain problems werecommend to use the ELDK (see http://www.denx.de/wiki/DULG/ELDK)which is extensively used to build and test U-Boot.If you are not using a native environment, it is assumed that youhave GNU cross compiling tools available in your path. In this case,you must set the environment variable CROSS_COMPILE in your shell.Note that no changes to the Makefile or any other source files arenecessary. For example using the ELDK on a 4xx CPU, please enter:$ CROSS_COMPILE=ppc_4xx-$ export CROSS_COMPILENote: If you wish to generate Windows versions of the utilities in      the tools directory you can use the MinGW toolchain      (http://www.mingw.org).  Set your HOST tools to the MinGW      toolchain and execute 'make tools'.  For example:       $ make HOSTCC=i586-mingw32msvc-gcc HOSTSTRIP=i586-mingw32msvc-strip tools      Binaries such as tools/mkimage.exe will be created which can      be executed on computers running Windows.U-Boot is intended to be simple to build. After installing thesources you must configure U-Boot for one specific board type. Thisis done by typing:make NAME_configwhere "NAME_config" is the name of one of the existing configu-rations; see the main Makefile for supported names.Note: for some board special configuration names may exist; check if      additional information is available from the board vendor; for      instance, the TQM823L systems are available without (standard)      or with LCD support. You can select such additional "features"      when choosing the configuration, i. e.      make TQM823L_config- will configure for a plain TQM823L, i. e. no LCD support      make TQM823L_LCD_config- will configure for a TQM823L with U-Boot console on LCD      etc.Finally, type "make all", and you should get some working U-Bootimages ready for download to / installation on your system:- "u-boot.bin" is a raw binary image- "u-boot" is an image in ELF binary format- "u-boot.srec" is in Motorola S-Record formatBy default the build is performed locally and the objects are savedin the source directory. One of the two methods can be used to changethis behavior and build U-Boot to some external directory:1. Add O= to the make command line invocations:make O=/tmp/build distcleanmake O=/tmp/build NAME_configmake O=/tmp/build all2. Set environment variable BUILD_DIR to point to the desired location:export BUILD_DIR=/tmp/buildmake distcleanmake NAME_configmake allNote that the command line "O=" setting overrides the BUILD_DIR environmentvariable.Please be aware that the Makefiles assume you are using GNU make, sofor instance on NetBSD you might need to use "gmake" instead ofnative "make".If the system board that you have is not listed, then you will needto port U-Boot to your hardware platform. To do this, follow thesesteps:1.  Add a new configuration option for your board to the toplevel    "Makefile" and to the "MAKEALL" script, using the existing    entries as examples. Note that here and at many other places    boards and other names are listed in alphabetical sort order. Please    keep this order.2.  Create a new directory to hold your board specific code. Add any    files you need. In your board directory, you will need at least    the "Makefile", a "<board>.c", "flash.c" and "u-boot.lds".3.  Create a new configuration file "include/configs/<board>.h" for    your board3.  If you're porting U-Boot to a new CPU, then also create a new    directory to hold your CPU specific code. Add any files you need.4.  Run "make <board>_config" with your new name.5.  Type "make", and you should get a working "u-boot.srec" file    to be installed on your target system.6.  Debug and solve any problems that might arise.    [Of course, this last step is much harder than it sounds.]