Build AT91Bootstrap using Yocto for SAMA5D27-SOM-EK1 Eval Board

Moderator: nferre

dthomas
Posts: 10
Joined: Mon Oct 21, 2019 4:27 pm

Build AT91Bootstrap using Yocto for SAMA5D27-SOM-EK1 Eval Board

Fri Nov 01, 2019 5:02 pm

I have a SAMA5D27-SOM-EK1 evaluation board. I am currently building the AT91Bootstrap bootloader, U-Boot, Kernel, and Root Filesystem from source. I am also using the micro SD Memory Card (MMC1) to boot.

For the AT91Bootstrap bootloader, I used the following steps to build it:

$ git clone git://github.com/linux4sam/at91bootstrap.git
$ cd at91bootstrap/
$ make sama5d27_som1_eksd1_uboot_defconfig
$ make

For the Root Filesystem, I'm using the Yocto Project with MACHINE ??= "sama5d27-som1-ek-sd" set in the conf/local.conf file.

I would like to start using the AT91Bootstrap bootloader produced by the Yocto Project instead of building it separately (eventually I'll do the same for U-boot and the Kernel as well). Currently the Yocto Project is configuring the AT91Bootstrap bootloader with sama5d27_som1_eksd_uboot_defconfig based on how the variables are built up in the at91bootstrap.inc file:

AT91BOOTSTRAP_MACHINE ??= "${MACHINE}"
AT91BOOTSTRAP_CONFIG_sama5d27-som1-ek-sd ??= "${AT91BOOTSTRAP_MACHINE}sd_uboot"
AT91BOOTSTRAP_TARGET ??= "${AT91BOOTSTRAP_CONFIG}_defconfig"

What is the best way to change this configuration? Should I create a .bbappend file to modify the AT91BOOTSTRAP_CONFIG_sama5d27-som1-ek-sd value? Or is there a way to pass the appropriate changes to a menuconfig command?
blue_z
Location: USA
Posts: 2005
Joined: Thu Apr 19, 2007 10:15 pm

Re: Build AT91Bootstrap using Yocto for SAMA5D27-SOM-EK1 Eval Board

Mon Nov 04, 2019 10:46 pm

If you have to ask basic questions on how to use Yocto, then be sure you have reason(s) for using Yocto.
See Buildroot vs. OpenEmbedded/Yocto Project.

(I don't use Yocto, and don't have any Yocto answers.)

Regards
dthomas
Posts: 10
Joined: Mon Oct 21, 2019 4:27 pm

Re: Build AT91Bootstrap using Yocto for SAMA5D27-SOM-EK1 Eval Board

Tue Nov 05, 2019 6:50 pm

The "Build From source code" (https://www.linux4sam.org/bin/view/Linu ... ource_code) instructions use Yocto to build the rootfs. I also do not have any experience with Buildroot, but I have some experience with Yocto from several years ago. That's why I went with Yocto.

No worries, I just need to refresh my memory.
methos
Posts: 9
Joined: Fri Jan 04, 2019 5:37 pm

Re: Build AT91Bootstrap using Yocto for SAMA5D27-SOM-EK1 Eval Board

Sat Nov 16, 2019 12:26 am

Your best bet is to create a bbappend and create patches. Changes in menuconfig will not be persistent across different machines.
larryg
Posts: 2
Joined: Tue Mar 20, 2018 11:54 pm

Re: Build AT91Bootstrap using Yocto for SAMA5D27-SOM-EK1 Eval Board

Thu Nov 21, 2019 1:08 am

You can make an assignment in your conf/local.conf file that can select the proper defconfig. You use the same MACHINE assignment, just add an assignment for AT91BOOTSTRAP_CONFIG_sama5d27-som1-ek-sd as follows:

MACHINE ??= "sama5d27-som1-ek-sd"
AT91BOOTSTRAP_CONFIG_sama5d27-som1-ek-sd = "sama5d27_som1_eksd1_uboot"
dthomas
Posts: 10
Joined: Mon Oct 21, 2019 4:27 pm

Re: Build AT91Bootstrap using Yocto for SAMA5D27-SOM-EK1 Eval Board

Thu Nov 21, 2019 4:33 pm

To solve the problem, I created a /recipes-bsp/at91bootstrap directory. Inside it, I created two files:

at91bootstrap_3.9.0.bb

Code: Select all

require recipes-bsp/at91bootstrap/at91bootstrap.inc

LIC_FILES_CHKSUM = "file://main.c;endline=27;md5=a2a70db58191379e2550cbed95449fbd"

COMPATIBLE_MACHINE = '(sama5d3xek|sama5d3-xplained|sama5d3-xplained-sd|at91sam9x5ek|at91sam9rlek|at91sam9m10g45ek|sama5d4ek|sama5d4-xplained|sama5d4-xplained-sd|sama5d2-xplained|sama5d2-xplained-sd|sama5d2-xplained-emmc|sama5d2-ptc-ek|sama5d2-ptc-ek-sd|sama5d27-som1-ek|sama5d27-som1-ek-sd)'

SRC_URI = "git://github.com/linux4sam/at91bootstrap.git;protocol=https"
PV = "3.9.0+git${SRCPV}"
SRCREV = "889ed2c7fc239454f8c6f30e4c53ce63c321f7e1"

S = "${WORKDIR}/git"

at91bootstrap_3.9.0.bbappend

Code: Select all

# The default CONFIG uses "sd_uboot" or MMC0 (full-size SD memory card)
# Change the CONFIG to "sd1_uboot" to use MMC1 (micro SD memory card)

AT91BOOTSTRAP_CONFIG_sama5d27-som1-ek-sd ??= "${AT91BOOTSTRAP_MACHINE}sd1_uboot"

The first file selects the source revision and the second file selects the configuration.
manuels
Posts: 1
Joined: Tue Oct 01, 2019 5:37 pm

Re: Build AT91Bootstrap using Yocto for SAMA5D27-SOM-EK1 Eval Board

Thu Nov 28, 2019 12:52 pm

Why have you created a new at91bootstrap_3.9.0.bb that is a copy of the original one from meta-atmel layer? I think you only need to add a bbappend file to modify the original recipe with your changes.
dthomas
Posts: 10
Joined: Mon Oct 21, 2019 4:27 pm

Re: Build AT91Bootstrap using Yocto for SAMA5D27-SOM-EK1 Eval Board

Mon Dec 02, 2019 5:37 pm

manuels wrote:
Thu Nov 28, 2019 12:52 pm
Why have you created a new at91bootstrap_3.9.0.bb that is a copy of the original one from meta-atmel layer? I think you only need to add a bbappend file to modify the original recipe with your changes.
Sorry, I should mention I'm using the sumo branch. That branch is using v3.8.11 of the at91bootstrap bootloader. I'm including the bb file to upgrade the version number and the bbappend file to modify the recipe to use the MMC device of my choosing.

In the future I plan to move to a later OpenEmbedded branch. Depending on the version of the bootloader in the branch I could remove the bb file.

Return to “SAMA5-based”

Who is online

Users browsing this forum: No registered users and 2 guests