summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/uboot-config.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes-recipe/uboot-config.bbclass')
-rw-r--r--meta/classes-recipe/uboot-config.bbclass34
1 files changed, 21 insertions, 13 deletions
diff --git a/meta/classes-recipe/uboot-config.bbclass b/meta/classes-recipe/uboot-config.bbclass
index e55fc38b7c..bc20913f73 100644
--- a/meta/classes-recipe/uboot-config.bbclass
+++ b/meta/classes-recipe/uboot-config.bbclass
@@ -19,15 +19,20 @@ def removesuffix(s, suffix):
19 return s[:-len(suffix)] 19 return s[:-len(suffix)]
20 return s 20 return s
21 21
22UBOOT_ENTRYPOINT ?= "20008000" 22UBOOT_ENTRYPOINT ?= "0x20008000"
23UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}" 23UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
24 24
25# When naming the files we install/deploy, the package version and revision
26# are part of the filename. Create a single variable to represent this and
27# allow it to be customized if desired.
28UBOOT_VERSION ?= "${PV}-${PR}"
29
25# Some versions of u-boot use .bin and others use .img. By default use .bin 30# Some versions of u-boot use .bin and others use .img. By default use .bin
26# but enable individual recipes to change this value. 31# but enable individual recipes to change this value.
27UBOOT_SUFFIX ??= "bin" 32UBOOT_SUFFIX ??= "bin"
28UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}" 33UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}"
29UBOOT_BINARYNAME ?= "${@os.path.splitext(d.getVar("UBOOT_BINARY"))[0]}" 34UBOOT_BINARYNAME ?= "${@os.path.splitext(d.getVar("UBOOT_BINARY"))[0]}"
30UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}" 35UBOOT_IMAGE ?= "${UBOOT_BINARYNAME}-${MACHINE}-${UBOOT_VERSION}.${UBOOT_SUFFIX}"
31UBOOT_SYMLINK ?= "${UBOOT_BINARYNAME}-${MACHINE}.${UBOOT_SUFFIX}" 36UBOOT_SYMLINK ?= "${UBOOT_BINARYNAME}-${MACHINE}.${UBOOT_SUFFIX}"
32UBOOT_MAKE_TARGET ?= "all" 37UBOOT_MAKE_TARGET ?= "all"
33 38
@@ -36,7 +41,7 @@ UBOOT_MAKE_TARGET ?= "all"
36# purposes. 41# purposes.
37UBOOT_ELF ?= "" 42UBOOT_ELF ?= ""
38UBOOT_ELF_SUFFIX ?= "elf" 43UBOOT_ELF_SUFFIX ?= "elf"
39UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}" 44UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${UBOOT_VERSION}.${UBOOT_ELF_SUFFIX}"
40UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}" 45UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}"
41UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}" 46UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}"
42 47
@@ -49,7 +54,7 @@ SPL_BINARY ?= ""
49SPL_DELIMITER ?= "${@'.' if d.getVar("SPL_SUFFIX") else ''}" 54SPL_DELIMITER ?= "${@'.' if d.getVar("SPL_SUFFIX") else ''}"
50SPL_BINARYFILE ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}" 55SPL_BINARYFILE ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}"
51SPL_BINARYNAME ?= "${@removesuffix(d.getVar("SPL_BINARYFILE"), "." + d.getVar("SPL_SUFFIX"))}" 56SPL_BINARYNAME ?= "${@removesuffix(d.getVar("SPL_BINARYFILE"), "." + d.getVar("SPL_SUFFIX"))}"
52SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}${SPL_DELIMITER}${SPL_SUFFIX}" 57SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${UBOOT_VERSION}${SPL_DELIMITER}${SPL_SUFFIX}"
53SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}${SPL_DELIMITER}${SPL_SUFFIX}" 58SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}${SPL_DELIMITER}${SPL_SUFFIX}"
54 59
55# Additional environment variables or a script can be installed alongside 60# Additional environment variables or a script can be installed alongside
@@ -62,14 +67,14 @@ UBOOT_ENV ?= ""
62UBOOT_ENV_SRC_SUFFIX ?= "cmd" 67UBOOT_ENV_SRC_SUFFIX ?= "cmd"
63UBOOT_ENV_SRC ?= "${UBOOT_ENV}.${UBOOT_ENV_SRC_SUFFIX}" 68UBOOT_ENV_SRC ?= "${UBOOT_ENV}.${UBOOT_ENV_SRC_SUFFIX}"
64UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}" 69UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}"
65UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}" 70UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${UBOOT_VERSION}.${UBOOT_ENV_SUFFIX}"
66UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}" 71UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}"
67 72
68# U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf 73# U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf
69# to find EXTLINUX conf file. 74# to find EXTLINUX conf file.
70UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux" 75UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux"
71UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf" 76UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf"
72UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${PR}" 77UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${UBOOT_VERSION}"
73 78
74# Options for the device tree compiler passed to mkimage '-D' feature: 79# Options for the device tree compiler passed to mkimage '-D' feature:
75UBOOT_MKIMAGE_DTCOPTS ??= "" 80UBOOT_MKIMAGE_DTCOPTS ??= ""
@@ -101,12 +106,12 @@ python () {
101 # The "doc" varflag is special, we don't want to see it here 106 # The "doc" varflag is special, we don't want to see it here
102 ubootconfigflags.pop('doc', None) 107 ubootconfigflags.pop('doc', None)
103 ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split() 108 ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
109 recipename = d.getVar("PN")
104 110
105 if not ubootmachine and not ubootconfig: 111 if not ubootmachine and not ubootconfig:
106 PN = d.getVar("PN")
107 FILE = os.path.basename(d.getVar("FILE")) 112 FILE = os.path.basename(d.getVar("FILE"))
108 bb.debug(1, "To build %s, see %s for instructions on \ 113 bb.debug(1, "To build %s, see %s for instructions on \
109 setting up your machine config" % (PN, FILE)) 114 setting up your machine config" % (recipename, FILE))
110 raise bb.parse.SkipRecipe("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE")) 115 raise bb.parse.SkipRecipe("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE"))
111 116
112 if ubootmachine and ubootconfig: 117 if ubootmachine and ubootconfig:
@@ -140,9 +145,12 @@ python () {
140 if not found: 145 if not found:
141 raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys())) 146 raise bb.parse.SkipRecipe("The selected UBOOT_CONFIG key %s has no match in %s." % (ubootconfig, ubootconfigflags.keys()))
142 147
143 if len(ubootconfig) == 1: 148 # This recipe might be inherited e.g. by the kernel recipe via kernel-fitimage.bbclass
144 d.setVar('KCONFIG_CONFIG_ROOTDIR', os.path.join(d.getVar("B"), d.getVar("UBOOT_MACHINE").strip())) 149 # Ensure the uboot specific menuconfig settings do not leak into other recipes
145 else: 150 if 'u-boot' in recipename:
146 # Disable menuconfig for multiple configs 151 if len(ubootconfig) == 1:
147 d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false") 152 d.setVar('KCONFIG_CONFIG_ROOTDIR', os.path.join("${B}", d.getVar("UBOOT_MACHINE").strip()))
153 else:
154 # Disable menuconfig for multiple configs
155 d.setVar('KCONFIG_CONFIG_ENABLE_MENUCONFIG', "false")
148} 156}