Adding a custom U-Boot machine

In the same way, the U-Boot source may be patched to add a new custom machine. Bootloader modifications are not as likely to be needed as kernel modifications though, and most custom platforms will leave the bootloader unchanged. The patch would be added to the meta-bsp-custom/recipes-bsp/u-boot/u-boot-fslc/ directory and the U-Boot recipe appended with a meta-bsp-custom/recipes-bsp/u-boot/u-boot-fslc_%.bbappend file with the following content:

FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" 
SRC_URI_append = " file://0001-02_01-Add-a-custom-wandboard-custom-machine.patch" 
COMPATIBLE_MACHINE = "(wandboard|wandboard-custom)" 
The percentage sign in u-boot-fslc_%.bbappend matches all versions of the recipe.

The changes needed to add a new machine to U-Boot are as follows:

  1. Add a new board/wandboard-custom directory copied from the Wandboard reference board with the following content:
    • A Kconfig file
    • MAINTAINERS and README files
    • A Makefile
    • Copies of the spl.c (unchanged from the reference spl.c) and wandboard-custom.c (renamed from the reference wandboard.c) files
  1. Add a new machine configuration file as the configs/wandboard-custom_defconfig file.
The configuration file needs to be already configured for the new wandboard-custom target platform.
  1. Add a new machine include file under the include/configs/wandboard-custom.h include file (copied from the reference wandboard.h file)

An example patch that adds a custom machine to U-Boot can be found in the source code that accompanies the book.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset