Yocto Customizing U-Boot AM62: Difference between revisions

From Variscite Wiki
Line 52: Line 52:
   
   
  # Build only the U-Boot images:
  # Build only the U-Boot images:
  $ MACHINE=am62x-var-som bitbake -c deploy u-boot-variscite
  $ MACHINE=am62x-var-som bitbake -c deploy u-boot-variscite                   # tispl.bin and u-boot.img
  $ MACHINE=am62x-var-som bitbake -c deploy mc:k3r5:u-boot-variscite
  $ MACHINE=am62x-var-som bitbake -c deploy mc:k3r5:u-boot-variscite           # tiboot3.bin
   
   
  # Optionally, you may skip building U-Boot and just build your image:
  # Optionally, you may skip building U-Boot and just build your image:

Revision as of 20:43, 4 June 2024

Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release am62-yocto-kirkstone-6.1.46_09.01.00.08-v1.0.
To view this page for a specific Variscite SoM and software release, please follow these steps:

  1. Visit variwiki.com
  2. Select your SoM
  3. Select the software release
Yocto Build U-Boot from source code

Introduction

This guide demonstrates how to patch and rebuild the VAR-SOM-AM62 U-Boot images using Yocto.

To learn how to build the U-Boot images outside of Yocto, see: Build U-Boot from source code

Before Starting

Before starting this guide, you must have the Yocto environment setup and be able to build images for the VAR-SOM-AM62.

Please see: Build Yocto from source code.

The remainder of the guide assumes the Yocto working directory is ~/var-ti-yocto

Patching Yocto

Fetch the U-Boot source:

$ cd $WORKDIR
$ git clone https://github.com/varigit/ti-u-boot -b ti-u-boot-2023.04_var01 ti-u-boot

Checkout the version of U-Boot that is aligned with SRCREV in ~/var-ti-yocto/tisdk/sources/meta-variscite-bsp-ti/recipes-bsp/u-boot/u-boot-variscite_<u-boot version>.bb

For example, if:

SRCREV = "fbbe3117f5daa78d6df922b4f2d33154de1495b1"

Then run:

$ cd ti-u-boot
$ git checkout fbbe3117f5daa78d6df922b4f2d33154de1495b1

Next, make the desired changes to the U-Boot source code. After changing the source code, create a diff file:

$ git diff > ~/var-ti-yocto/tisdk/sources/meta-variscite-bsp-ti/recipes-bsp/u-boot/u-boot-variscite/uboot.diff

Finally, configure ~/var-ti-yocto/tisdk/sources/meta-variscite-bsp-ti/recipes-bsp/u-boot/u-boot-variscite_<u-boot version>.bb to apply the patch by appending:

SRC_URI += "file://uboot.diff"

Building U-Boot using Yocto

Build the U-Boot images by running:

$ cd ~/var-ti-yocto/tisdk/build
$ . conf/setenv

# Build only the U-Boot images:
$ MACHINE=am62x-var-som bitbake -c deploy u-boot-variscite                    # tispl.bin and u-boot.img
$ MACHINE=am62x-var-som bitbake -c deploy mc:k3r5:u-boot-variscite            # tiboot3.bin

# Optionally, you may skip building U-Boot and just build your image:
$ MACHINE=am62x-var-som bitbake <image name>

The relevant output files are:

deploy-ti/images/am62x-var-som/u-boot.img
deploy-ti/images/am62x-var-som/tispl.bin
deploy-ti/images/am62x-var-som/tiboot3.bin

see: Build U-Boot from source code to learn how to update a running board with these images.