diff mbox series

[2/5] beaglebone-yocto: support FIT images

Message ID 20250620080840.562802-3-adrian.freihofer@siemens.com
State New
Headers show
Series FIT image beaglebone-yocto | expand

Commit Message

AdrianF June 20, 2025, 8:08 a.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

Introduce the FIT_IMAGE_KERNEL variable, which allows switching from the
zImage kernel to a FIT image kernel. This variable is not intended to be
officially documented; the goal is for the beaglebone-yocto MACHINE to
serve as an example for both use cases: zImage and FIT image.

The following tests have been performed on a beaglebone-black device
with poky and core-image-minimal running from SDCard:

* MACHINE = "beaglebone-yocto"
  Still boots the zImage kernel as before this commit

* MACHINE = "beaglebone-yocto"
  FIT_IMAGE_KERNEL = "1"
  Boots a FIT image kernel as expected

* MACHINE = "beaglebone-yocto"
  INITRAMFS_IMAGE = "core-image-initramfs-boot"
  FIT_IMAGE_KERNEL = "1"
  Boots a FIT image kernel with initramfs as expected

  Also booting like that behaves as expected:
   fatload mmc 0:1 $loadaddr /kernel
   iminfo $loadaddr
   setenv bootargs console=ttyS0,115200n8 root=/dev/mmcblk0p2 ro \
          rootfstype=ext4 rootwait shell_debug=true
   bootm ${loadaddr}#conf-am335x-boneblack.dtb

All the tested configurations just boot from the SDCard without manual
tweaks.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 .../conf/machine/beaglebone-yocto.conf        | 31 +++++++++++++++++--
 1 file changed, 28 insertions(+), 3 deletions(-)

Comments

patchtest@automation.yoctoproject.org June 20, 2025, 8:18 a.m. UTC | #1
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/2-5-beaglebone-yocto-support-FIT-images.patch

FAIL: test target mailing list: Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists (test_mbox.TestMbox.test_target_mailing_list)

PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
diff mbox series

Patch

diff --git a/meta-yocto-bsp/conf/machine/beaglebone-yocto.conf b/meta-yocto-bsp/conf/machine/beaglebone-yocto.conf
index d4b72361650..321d2c27c2a 100644
--- a/meta-yocto-bsp/conf/machine/beaglebone-yocto.conf
+++ b/meta-yocto-bsp/conf/machine/beaglebone-yocto.conf
@@ -14,8 +14,20 @@  include conf/machine/include/arm/armv7a/tune-cortexa8.inc
 IMAGE_FSTYPES += "tar.bz2 jffs2 wic wic.bmap"
 EXTRA_IMAGECMD:jffs2 = "-lnp "
 WKS_FILE ?= "beaglebone-yocto.wks"
-MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-image kernel-devicetree"
-do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot virtual/bootloader:do_deploy"
+
+# Setting this variable to "1" switches from zImage kernel to FIT image kernel
+FIT_IMAGE_KERNEL ?= "0"
+
+# Note: This is redundant if wic creates a separate /boot partition
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "${@'linux-yocto-fitimage' if d.getVar('FIT_IMAGE_KERNEL') == '1' else 'kernel-image kernel-devicetree'}"
+
+KERNEL_CLASSES += "${@'kernel-fit-extra-artifacts' if d.getVar('FIT_IMAGE_KERNEL') == '1' else ''}"
+do_image_wic[depends] += "\
+    mtools-native:do_populate_sysroot \
+    dosfstools-native:do_populate_sysroot \
+    virtual/bootloader:do_deploy \
+    ${@'linux-yocto-fitimage:do_deploy' if d.getVar('FIT_IMAGE_KERNEL') == '1' else ''} \
+"
 
 SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyO0 115200;ttyAMA0"
 
@@ -26,15 +38,28 @@  KERNEL_IMAGETYPE = "zImage"
 DTB_FILES = "am335x-bone.dtb am335x-boneblack.dtb am335x-bonegreen.dtb"
 KERNEL_DEVICETREE = '${@' '.join('ti/omap/%s' % d for d in '${DTB_FILES}'.split())}'
 
+# Configure the image.bbclass to depend on the fitImage instead of only
+# the kernel to ensure the fitImage is built with the image
+KERNEL_DEPLOY_DEPEND = "${@'linux-yocto-fitimage:do_deploy' if d.getVar('FIT_IMAGE_KERNEL') == '1' else 'virtual/kernel:do_deploy'}"
+
 PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
 
 SPL_BINARY = "MLO"
 UBOOT_SUFFIX = "img"
 UBOOT_MACHINE = "am335x_evm_defconfig"
+UBOOT_ENTRYPOINT = "0x80008000"
+UBOOT_LOADADDRESS = "0x80008000"
+UBOOT_DTB_LOADADDRESS = "0x88000000"
+UBOOT_DTBO_LOADADDRESS = "0x88080000"
+UBOOT_RD_LOADADDRESS = "0x89000000"
+UBOOT_RD_ENTRYPOINT = "0x89000000"
 
 MACHINE_FEATURES = "usbgadget usbhost vfat alsa"
 
-IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} ${SPL_BINARY} ${KERNEL_IMAGETYPE} ${DTB_FILES}"
+# Configure wic to create a /boot partition with either zImage or fitImage
+IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} ${SPL_BINARY} \
+    ${@'fitImage' if d.getVar('FIT_IMAGE_KERNEL') == '1' else '${KERNEL_IMAGETYPE} ${DTB_FILES}'} \
+"
 
 # support runqemu
 EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native"