diff options
Diffstat (limited to 'recipes-bsp/u-boot/u-boot-qoriq_2020.04.bb')
-rw-r--r-- | recipes-bsp/u-boot/u-boot-qoriq_2020.04.bb | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot-qoriq_2020.04.bb b/recipes-bsp/u-boot/u-boot-qoriq_2020.04.bb new file mode 100644 index 00000000..6f4f0d05 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-qoriq_2020.04.bb | |||
@@ -0,0 +1,79 @@ | |||
1 | require recipes-bsp/u-boot/u-boot.inc | ||
2 | require u-boot-qoriq-common_${PV}.inc | ||
3 | |||
4 | DESCRIPTION = "U-Boot provided by Freescale with focus on QorIQ boards" | ||
5 | PROVIDES += "u-boot" | ||
6 | |||
7 | INHIBIT_DEFAULT_DEPS = "1" | ||
8 | DEPENDS = "libgcc virtual/${TARGET_PREFIX}gcc bison-native bc-native swig-native python3-native" | ||
9 | DEPENDS_append_qoriq-arm64 = " change-file-endianess-native dtc-native tcl-native" | ||
10 | DEPENDS_append_qoriq-arm = " change-file-endianess-native dtc-native tcl-native" | ||
11 | DEPENDS_append_qoriq-ppc = " boot-format-native" | ||
12 | |||
13 | python () { | ||
14 | if d.getVar("TCMODE") == "external-fsl": | ||
15 | return | ||
16 | |||
17 | ml = d.getVar("MULTILIB_VARIANTS") | ||
18 | arch = d.getVar("OVERRIDES") | ||
19 | |||
20 | if "e5500-64b:" in arch or "e6500-64b:" in arch: | ||
21 | if not "lib32" in ml: | ||
22 | raise bb.parse.SkipPackage("Building the u-boot for this arch requires multilib to be enabled") | ||
23 | sys_multilib = d.getVar('TARGET_VENDOR') + 'mllib32-linux' | ||
24 | sys_original = d.getVar('TARGET_VENDOR') + '-' + d.getVar('TARGET_OS') | ||
25 | workdir = d.getVar('WORKDIR') | ||
26 | d.setVar('DEPENDS_append', ' lib32-gcc-cross-powerpc lib32-libgcc') | ||
27 | d.setVar('PATH_append', ':' + d.getVar('STAGING_BINDIR_NATIVE') + '/powerpc' + sys_multilib) | ||
28 | d.setVar('TOOLCHAIN_OPTIONS', '--sysroot=' + workdir + '/lib32-recipe-sysroot') | ||
29 | d.setVar("WRAP_TARGET_PREFIX", 'powerpc' + sys_multilib + '-') | ||
30 | elif "fsl-lsch2-32b:" in arch: | ||
31 | if not "lib64" in ml: | ||
32 | raise bb.parse.SkipRecipe("Building the u-boot for this arch requires multilib to be enabled") | ||
33 | sys_multilib = d.getVar('TARGET_VENDOR') + 'mllib64-linux' | ||
34 | sys_original = d.getVar('TARGET_VENDOR') + '-' + d.getVar('TARGET_OS') | ||
35 | workdir = d.getVar('WORKDIR') | ||
36 | d.setVar('DEPENDS_append', ' lib64-gcc-cross-aarch64 lib64-libgcc') | ||
37 | d.setVar('PATH_append', ':' + d.getVar('STAGING_BINDIR_NATIVE') + '/aarch64' + sys_multilib) | ||
38 | d.setVar('TOOLCHAIN_OPTIONS', '--sysroot=' + workdir + '/lib64-recipe-sysroot') | ||
39 | d.setVar("WRAP_TARGET_PREFIX", 'aarch64' + sys_multilib + '-') | ||
40 | } | ||
41 | |||
42 | LE_UBOOT_FOR_ARMBE_TARGET ?= "0" | ||
43 | ENDIANNESS_GCC = "${@bb.utils.contains("LE_UBOOT_FOR_ARMBE_TARGET", "1", "-mlittle-endian", "", d)}" | ||
44 | ENDIANNESS_LD = "${@bb.utils.contains("LE_UBOOT_FOR_ARMBE_TARGET", "1", "-EL", "", d)}" | ||
45 | |||
46 | WRAP_TARGET_PREFIX ?= "${TARGET_PREFIX}" | ||
47 | EXTRA_OEMAKE = 'CROSS_COMPILE=${WRAP_TARGET_PREFIX} CC="${WRAP_TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS} ${ENDIANNESS_GCC}" LD="${WRAP_TARGET_PREFIX}ld ${ENDIANNESS_LD}" V=1' | ||
48 | EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"' | ||
49 | |||
50 | do_compile_append_qoriq() { | ||
51 | unset i j k | ||
52 | for config in ${UBOOT_MACHINE}; do | ||
53 | i=`expr $i + 1`; | ||
54 | for type in ${UBOOT_CONFIG}; do | ||
55 | j=`expr $j + 1`; | ||
56 | for binary in ${UBOOT_BINARIES}; do | ||
57 | k=`expr $k + 1` | ||
58 | if [ $j -eq $i ] && [ $k -eq $i ]; then | ||
59 | if [ -n "${BOOTFORMAT_CONFIG}" ] && echo "${type}" |grep -q spi;then | ||
60 | # regenerate spi binary if BOOTFORMAT_CONFIG is set | ||
61 | boot_format ${STAGING_DATADIR_NATIVE}/boot_format/${BOOTFORMAT_CONFIG} \ | ||
62 | ${config}/u-boot-${type}.${UBOOT_SUFFIX} -spi ${config}/u-boot.format.bin | ||
63 | cp ${config}/u-boot.format.bin ${config}/u-boot-${type}.${UBOOT_SUFFIX} | ||
64 | elif [ "qspi" = "${type}" ];then | ||
65 | cp ${config}/${binary} ${config}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} | ||
66 | fi | ||
67 | fi | ||
68 | done | ||
69 | unset k | ||
70 | done | ||
71 | unset j | ||
72 | done | ||
73 | unset i | ||
74 | } | ||
75 | |||
76 | |||
77 | PACKAGES += "${PN}-images" | ||
78 | FILES_${PN}-images += "/boot" | ||
79 | COMPATIBLE_MACHINE = "(qoriq)" | ||