Setting up U-Boot: Difference between revisions

From Linux/Xtensa
Jump to navigation Jump to search
No edit summary
(Blanked the page)
 
(74 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== U-Boot ==


[http://www.denx.de/wiki/UBoot U-Boot] is another popular boot loader.  A preliminary port to the Xtensa architecture is now available.  See [http://git.linux-xtensa.org/cgi-bin/git.cgi?p=u-boot/u-boot-xtensa.git;a=summary U-Boot Sources (GIT Summary)].  Or, to access this tree using <tt>git</tt> directly, use something like:
git clone git://git.linux-xtensa.org/git/u-boot/u-boot-xtensa.git u-boot
''('''Note:'''  This path is subject to change.)''
Before you can build U-Boot you must have built the toolchain for XTensa core.
Set your PATH to point to the toolchain built using buildroot.
  $ export PATH="''<workdir>''/buildroot/build_xtensa_''<cname>''/staging_dir/usr/bin:$PATH"
where ''<cname>'' is the name of the Xtensa core variant you wish to build for (e.g., <tt>dc232b</tt>).
To build U-Boot, first clone the tree as above, change to the top level of the tree, then configure it for your board and Xtensa core variant as follows:
make <cname>_<board>_config
This should only take a few seconds. For example, to build U-boot for the 'xtav60' board and 'dc232b' core:
make dc232b_xtav60_config
Only boards and core variants currently supported in the tree can be built out of the box. Headers for supported cores can be found in the tree under <tt>include/asm-xtensa/variant-<cname></tt>. The core specific headers are described in the <tt>doc/README.xtensa</tt> file. To support a new core, these headers must be copied from the overlay in the same way as for the linux kernel.
After the configuration step, to actually build U-Boot, simply:
make all
This will take a few minutes.
Next, start xt-gdb and load u-boot from the top of the git repository:
 
  cd u-boot-xtensa
  xt-gdb -n
  file u-boot
  target remote localhost:20000 0
  reset
  load
  break panic
  continue
Hopefully u-boot will start and display on the LCD
  U-Boot 50.00 Mhz
Next, set you environment variables to point the the DHCP and TFTP server:
    setenv serverip 192.168.11.78          rtos-lab2
    setenv ipaddr 192.168.11.95            I/P address of host running on the LX60
    setenv bootfile u-boot.bin
    saveenv
Next, download 'u-boot.bin' from the tftp server:
  tftpboot
    TFTP from server 192.168.11.78; our IP address is 192.168.11.95
    Filename 'u-boot.bin'.
    Load address: 0xd2000000
    Loading: T ########
    done
    Bytes transferred = 107592 (1a448 hex)
Note that the image is a bit less than 2 sectors,
so turn off protection on the 1st two sectors and
erase the current contents:
  protect off F8000000 F801FFFF
        ... done
        Un-Protected 2 sectors
  erase F8000000 F801FFFF
        erase F8000000 F801FFFF
        ... done
        Erased 2 sectors
Now copy the the image of u-boot.bin in memory to the flash:
  cp.b d2000000 F8000000 20000
  Copy to Flash... done
On the LX60 now move DIP switch 8 to the ON position, power cycle the LX60, and you should see U-boot in the LCD display and
 
U-Boot 1.3.2 (Aug 27 2009 - 18:23:04)
  CPU:    Xtensa dc232b at 50.00 MHz
  Board:  XT-AV60: Avnet board + Xilinx LX60 FPGA + Tensilica bitstream
  SysRAM: 64 MB
  Flash:  4 MB
  In:    serial
  Out:  serial
  Err:  serial
  MAC:
  U-Boot>
 
Further details on U-Boot in general are in the generic <tt>README</tt> at the top of the U-Boot tree. Details specific to the Xtensa architecture are in <tt>doc/README.xtensa</tt>. Details specific to a board are in <tt>board[/<family>]/<board>/README</tt> (for example <tt>board/avnet/xtav60/README</tt>).

Latest revision as of 23:31, 2 March 2018