You can customize U-Boot in Digi Embedded for Android by making permanent changes to the U-Boot default configuration and building it using Digi Embedded for Android.

1. Change the U-Boot configuration

Digi Embedded for Android uses a default configuration for U-Boot located in the U-Boot source tree. This path of the U-Boot configuration is defined in the variable TARGET_BOOTLOADER_CONFIG, which is declared in device/digi/imx8q/ccimx8xsbcpro/

The following instructions assume that your default U-Boot defconfig filename is ccimx8x_sbc_pro2GB_android_defconfig.

The U-Boot default configuration file name may differ by variant. Make sure you are using the correct name. See U-Boot files by variant to determine your variant.

Customize the default configuration (ccimx8x_sbc_pro2GB_android_defconfig) as follows.

  1. Go to the U-Boot source tree:

    $ cd /usr/local/dea-11.0-r2/vendor/digi/uboot-imx
  2. Android uses a prebuilt toolchain for compiling U-Boot, so you must include the toolchain binary in the PATH variable:

    $ export PATH="/usr/local/dea-11.0-r2/prebuilts/gcc/linux-x86/aarch64-nolibc/gcc-8.4.0-nolibc/aarch64-linux/bin:${PATH}"
  3. Apply the default defconfig.

    $ make CROSS_COMPILE=aarch64-linux- ccimx8x_sbc_pro2GB_android_defconfig
  4. Open the U-Boot configuration, make your changes, save, and quit the configuration tool.

    $ make CROSS_COMPILE=aarch64-linux- menuconfig
    Menuconfig is a terminal-oriented configuration tool (using ncurses). Wikipedia Menuconfig explains how to "navigate" within the configuration menu, and highlights main key strokes.

    You can access the configuration user interfaces using menuconfig. This builds and runs an ncurses-based configuration UI.

    You can also build and run a graphical QT-based UI using xconfig.

    For U-Boot configuration options, see Configuration options.
  5. Generate your custom configuration file. This step generates a default configuration file with your changes in the root directory of your U-Boot source tree.

    $ make CROSS_COMPILE=aarch64-linux- savedefconfig
  6. Override the default U-Boot defconfig with your custom defconfig. (Make sure the file name is correct before running this command.):

    $ cp defconfig configs/ccimx8x_sbc_pro2GB_android_defconfig

2. Rebuild new images

After customizing the U-Boot defconfig, you must generate new images. To do so:

  1. Clean the vendor/digi/uboot-imx U-Boot directory to avoid compilation errors.

    $ make CROSS_COMPILE=aarch64-linux- mrproper
  2. Build your images as usual. See Build your development images.

3. Deploy images on your target

After building U-Boot, program the new bootloader in your device. See Re-program U-Boot in the eMMC.