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)
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"
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