(→Compiling U-Boot for the BeagleBone Black) |
(→Compiling U-Boot for the BeagleBone Black) |
||
Line 1: | Line 1: | ||
== Compiling U-Boot for the BeagleBone Black == | == Compiling U-Boot for the BeagleBone Black == | ||
− | Download the latest version of U-Boot and extract the files to a working folder: | + | Download the latest version of U-Boot and extract the files to a working folder and patch: |
<PRE> | <PRE> | ||
Line 7: | Line 7: | ||
tar -xjf u-boot-latest.tar.bz2 | tar -xjf u-boot-latest.tar.bz2 | ||
cd u-boot-2015.07 | cd u-boot-2015.07 | ||
+ | https://rcn-ee.com/repos/git/u-boot-patches/v2015.07/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch | ||
+ | patch -p1 < 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch | ||
</PRE> | </PRE> | ||
Download the latest version of U-Boot and extract the files to a working folder and patch:
wget ftp://ftp.denx.de/pub/u-boot/u-boot-latest.tar.bz2 tar -xjf u-boot-latest.tar.bz2 cd u-boot-2015.07 https://rcn-ee.com/repos/git/u-boot-patches/v2015.07/0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch patch -p1 < 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch
Now cross compile U-Boot using the am335x BeagleBone Black configuration:
make CROSS_COMPILE=arm-linux-gnueabi- distclean make CROSS_COMPILE=arm-linux-gnueabi- am335x_boneblack_config make CROSS_COMPILE=arm-linux-gnueabi-
Compiling should conclude with output similar to below showing that an image of MLO - the first stage uBoot Bootloader is generated.
LD spl/u-boot-spl OBJCOPY spl/u-boot-spl.bin MKIMAGE MLO CFG spl/u-boot-spl.cfg
Scrolling up the output messages, you should find where the second stage U-Boot bootloader (u-boot.img) is generated.
LDS u-boot.lds LD u-boot OBJCOPY u-boot.bin MKIMAGE u-boot.img OBJCOPY u-boot.srec CFG u-boot.cfg
If desired, you can test the second stage bootloader by loading it to RAM:
setenv ipaddr 192.168.0.250 setenv serverip 192.168.0.251 tftp 0x80800000 u-boot.bin go 0x80800000
Copy the files to the start of the uSD Card (/dev/sdb) or MMC Flash (/dev/mmcblk0):
dd if=MLO of=/dev/sdb count=1 seek=1 conv=notrunc bs=128k dd if=u-boot.img of=/dev/sdb count=2 seek=1 conv=notrunc bs=384k