Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 08/25] u-boot: Separate out from kernel-arch.bbclass
Date: Sun,  2 Aug 2026 11:28:37 +0100	[thread overview]
Message-ID: <20260802102854.3952760-9-richard.purdie@linuxfoundation.org> (raw)
In-Reply-To: <20260802102854.3952760-1-richard.purdie@linuxfoundation.org>

Move the UBOOT_ARCH usage into u-boot.inc and stop using kernel-arch.bbclass
since there are things in there which u-boot might not want.

This does mean the ARCH and UBOOT_ARCH variables are no longer in the environment
but I hopefully covered the main uboot usages of the variables.

Also document where these values are from and what they're supposed to mean
explictly, including the difference between UBOOT_ARCH and UBOOT_ARCH_DIR.
UBOOT_ARCH_DIR has issues which will need discussion with newer platforms
which use dts/upstream.

You might think we need to set ARCH in EXTRA_OEMAKE for u-boot but it turns
out it was ignoring the value and setting it breaks builds. This patch
therefore doesn't do that after confirmation from the u-boot devs:

https://lists.u-boot-project.org/pipermail/u-boot/2026-July/627045.html

This is confirmed by the UBOOT_DTB patch which added the kernel-arch inherit
which is much later than when u-boot was established.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oe/kernel.py              | 2 ++
 meta/recipes-bsp/u-boot/u-boot.inc | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/kernel.py b/meta/lib/oe/kernel.py
index bab375c37ae..6c57ef402e8 100644
--- a/meta/lib/oe/kernel.py
+++ b/meta/lib/oe/kernel.py
@@ -38,6 +38,8 @@ def map_kernel_arch(d):
             return a
         bb.error("cannot map '%s' to a linux kernel architecture" % a)
 
+# Return a value for the -A parameter to u-boot's mkimage
+# This would be the value from the table in boot/image.c:uimage_arch
 def map_uboot_arch(d):
     a = map_kernel_arch(d)
 
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index a75948dfc34..3e2f5aa1a5f 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -6,7 +6,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 DEPENDS += "${@bb.utils.contains('UBOOT_ENV_SUFFIX', 'scr', 'u-boot-mkimage-native', '', d)}"
 DEPENDS += "${@ 'u-boot-mkenvimage-native' if bb.utils.to_boolean(d.getVar('UBOOT_INITIAL_ENV_BINARY')) else ''}"
 
-inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kernel-arch
+inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native
 
 DEPENDS += "swig-native"
 
@@ -34,6 +34,11 @@ UBOOT_INITIAL_ENV ?= "${PN}-initial-env"
 
 require u-boot-configure.inc
 
+UBOOT_ARCH = "${@oe.kernel.map_uboot_arch(d)}"
+# UBOOT_ARCH_DIR is the directory which contains the UBOOT_ARCH, i.e. the options are
+# the directories listed by "ls arch/" in the u-boot source. It is broken for platforms which
+# use dts/upstream.
+# arm contains arm and arm64.
 UBOOT_ARCH_DIR = "${@'arm' if d.getVar('UBOOT_ARCH').startswith('arm') else d.getVar('UBOOT_ARCH')}"
 do_compile () {
     unset LDFLAGS


  parent reply	other threads:[~2026-08-02 10:29 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-02 10:28 [PATCH 00/25] Class file improvements Richard Purdie
2026-08-02 10:28 ` [PATCH 01/25] sstatesig: Use kernel.bbclass instead of linux-kernel-base.bbclass Richard Purdie
2026-08-02 10:28 ` [PATCH 02/25] linux-kernel-base: Delete unused function Richard Purdie
2026-08-02 10:28 ` [PATCH 03/25] lib/oe/kernel: Move python functions from linux-kernel-base to library code Richard Purdie
2026-08-02 10:28 ` [PATCH 04/25] kernel-yocto: Simplify code for cleanliness and slight performance Richard Purdie
2026-08-02 10:28 ` [PATCH 05/25] kernel-arch: Move kernel and uboot arch functions to lib/oe/kernel.py Richard Purdie
2026-08-02 10:28 ` [PATCH 06/25] kernel-arch: Simplify KERNEL_ARCH variable usage Richard Purdie
2026-08-02 10:28 ` [PATCH 07/25] kernel-arch: Don't export UBOOT_ARCH Richard Purdie
2026-08-02 10:28 ` Richard Purdie [this message]
2026-08-02 10:28 ` [PATCH 09/25] barebox: Separate out from kernel-arch.bbclass Richard Purdie
2026-08-02 10:28 ` [PATCH 10/25] lib/oe/kernel: Simplify map_uboot_arch Richard Purdie
2026-08-02 10:28 ` [PATCH 11/25] image_types/kernel-uimage: Swap UBOOT_ARCH for oe.kernel.map_uboot_arch call Richard Purdie
2026-08-02 10:58   ` Patchtest results for " patchtest
2026-08-02 10:28 ` [PATCH 12/25] kernel-fit-image: " Richard Purdie
2026-08-02 10:28 ` [PATCH 13/25] linux-yocto-fitimage: Set UBOOT_ARCH Richard Purdie
2026-08-02 10:28 ` [PATCH 14/25] kernel-arch: Drop UBOOT_ARCH Richard Purdie
2026-08-02 10:28 ` [PATCH 15/25] linux-libc-headers: Drop kernel-arch and set ARCH directly Richard Purdie
2026-08-02 10:28 ` [PATCH 16/25] toolchain-scripts: Drop usage of kernel-arch Richard Purdie
2026-08-02 10:28 ` [PATCH 17/25] kernel-arch: Move ARCH usage into target classes Richard Purdie
2026-08-02 10:28 ` [PATCH 18/25] linux-yocto-fitimage: Drop obsolete dependency on linux-kernel-base Richard Purdie
2026-08-02 10:58   ` Patchtest results for " patchtest
2026-08-02 10:28 ` [PATCH 19/25] linux-kernel-base: Fold remainder into kernel-arch and drop Richard Purdie
2026-08-02 10:28 ` [PATCH 20/25] kernel-devicetree: Add missing function prefixes Richard Purdie
2026-08-02 10:28 ` [PATCH 21/25] utils: Drop explode_deps function Richard Purdie
2026-08-02 10:28 ` [PATCH 22/25] utils: Move functions from utils.bbclass to utils.py Richard Purdie
2026-08-02 10:58   ` Patchtest results for " patchtest
2026-08-02 10:28 ` [PATCH 23/25] lib/oe/lsb: Merge distro_identifier functions Richard Purdie
2026-08-02 10:28 ` [PATCH 24/25] sanity: Move code to lib/oe Richard Purdie
2026-08-02 10:58   ` Patchtest results for " patchtest
2026-08-02 10:28 ` [PATCH 25/25] sanity: Drop unreachable code Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260802102854.3952760-9-richard.purdie@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox