1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
require recipes-bsp/u-boot/u-boot.inc
DESCRIPTION = "U-Boot provided by Freescale with focus on QorIQ boards"
PROVIDES += "u-boot"
inherit fsl-u-boot-localversion
LICENSE = "GPL-2.0-only & BSD-3-Clause & BSD-2-Clause & LGPL-2.0-only & LGPL-2.1-only"
LIC_FILES_CHKSUM = " \
file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://Licenses/bsd-2-clause.txt;md5=6a31f076f5773aabd8ff86191ad6fdd5 \
file://Licenses/bsd-3-clause.txt;md5=4a1190eac56a9db675d58ebe86eaf50c \
file://Licenses/lgpl-2.0.txt;md5=4cf66a4984120007c9881cc871cf49db \
file://Licenses/lgpl-2.1.txt;md5=4fbd65380cdd255951079008b364516c \
"
PV:append = "+${SRCPV}"
UBOOT_BRANCH ?= "lf_v2025.04"
UBOOT_SRC ?= "git://github.com/nxp-qoriq/u-boot.git;protocol=https"
SRC_URI = "${UBOOT_SRC};branch=${UBOOT_BRANCH}"
SRCREV = "9383f8387dc76524524da69992db96c22195a57c"
B = "${UNPACKDIR}/build"
PV:append = "+fslgit"
LOCALVERSION = "+fsl"
INHIBIT_DEFAULT_DEPS = "1"
DEPENDS = "libgcc virtual/cross-cc bison-native bc-native gnutls-native swig-native python3-native"
DEPENDS:append:qoriq-arm64 = " dtc-native"
DEPENDS:append:qoriq-arm = " dtc-native"
DEPENDS:append:qoriq-ppc = " boot-format-native"
python () {
if d.getVar("TCMODE") == "external-fsl":
return
ml = d.getVar("MULTILIB_VARIANTS")
arch = d.getVar("OVERRIDES")
if "e5500-64b:" in arch or "e6500-64b:" in arch:
if not "lib32" in ml:
raise bb.parse.SkipPackage("Building the u-boot for this arch requires multilib to be enabled")
sys_multilib = d.getVar('TARGET_VENDOR') + 'mllib32-linux'
sys_original = d.getVar('TARGET_VENDOR') + '-' + d.getVar('TARGET_OS')
workdir = d.getVar('UNPACKDIR')
d.setVar('DEPENDS:append', ' lib32-gcc-cross-powerpc lib32-libgcc')
d.setVar('PATH:append', ':' + d.getVar('STAGING_BINDIR_NATIVE') + '/powerpc' + sys_multilib)
d.setVar('TOOLCHAIN_OPTIONS', '--sysroot=' + workdir + '/lib32-recipe-sysroot')
d.setVar("WRAP_TARGET_PREFIX", 'powerpc' + sys_multilib + '-')
elif "fsl-lsch2-32b:" in arch:
if not "lib64" in ml:
raise bb.parse.SkipRecipe("Building the u-boot for this arch requires multilib to be enabled")
sys_multilib = d.getVar('TARGET_VENDOR') + 'mllib64-linux'
sys_original = d.getVar('TARGET_VENDOR') + '-' + d.getVar('TARGET_OS')
workdir = d.getVar('UNPACKDIR')
d.setVar('DEPENDS:append', ' lib64-gcc-cross-aarch64 lib64-libgcc')
d.setVar('PATH:append', ':' + d.getVar('STAGING_BINDIR_NATIVE') + '/aarch64' + sys_multilib)
d.setVar('TOOLCHAIN_OPTIONS', '--sysroot=' + workdir + '/lib64-recipe-sysroot')
d.setVar("WRAP_TARGET_PREFIX", 'aarch64' + sys_multilib + '-')
}
LE_UBOOT_FOR_ARMBE_TARGET ?= "0"
ENDIANNESS_GCC = "${@bb.utils.contains("LE_UBOOT_FOR_ARMBE_TARGET", "1", "-mlittle-endian", "", d)}"
ENDIANNESS_LD = "${@bb.utils.contains("LE_UBOOT_FOR_ARMBE_TARGET", "1", "-EL", "", d)}"
WRAP_TARGET_PREFIX ?= "${TARGET_PREFIX}"
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'
EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
EXTRA_OEMAKE += 'STAGING_INCDIR=${STAGING_INCDIR_NATIVE} STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}'
do_compile:append:qoriq() {
unset i j k
for config in ${UBOOT_MACHINE}; do
i=`expr $i + 1`;
for type in ${UBOOT_CONFIG}; do
j=`expr $j + 1`;
for binary in ${UBOOT_BINARIES}; do
k=`expr $k + 1`
if [ $j -eq $i ] && [ $k -eq $i ]; then
if [ -n "${BOOTFORMAT_CONFIG}" ] && echo "${type}" |grep -q spi;then
# regenerate spi binary if BOOTFORMAT_CONFIG is set
boot_format ${STAGING_DATADIR_NATIVE}/boot_format/${BOOTFORMAT_CONFIG} \
${config}/u-boot-${type}.${UBOOT_SUFFIX} -spi ${config}/u-boot.format.bin
cp ${config}/u-boot.format.bin ${config}/u-boot-${type}.${UBOOT_SUFFIX}
fi
fi
done
unset k
done
unset j
done
unset i
}
do_deploy:append:lx2162a () {
if [ -n "${UBOOT_CONFIG}" ]
then
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
j=$(expr $j + 1);
if [ $j -eq $i ]
then
if [ "tfa-verified-boot" = "${type}" ];then
builddir="${config}-${type}"
install -m 644 ${B}/${builddir/u-boot.dtb ${DEPLOYDIR}/u-boot.dtb
fi
fi
done
unset j
done
unset i
fi
}
do_deploy:append:ls102xa () {
if [ -n "${UBOOT_CONFIG}" ]
then
for config in ${UBOOT_MACHINE}; do
i=$(expr $i + 1);
for type in ${UBOOT_CONFIG}; do
j=$(expr $j + 1);
if [ $j -eq $i ]
then
if expr "$type" : sdcard;then
builddir="${config}-${type}"
install -m 644 ${B}/${builddir}/u-boot-dtb.bin ${DEPLOYDIR}/u-boot-dtb.${UBOOT_SUFFIX}-${type}
install -m 644 ${B}/${builddir}/spl/u-boot-spl.bin ${DEPLOYDIR}/u-boot-spl.${UBOOT_SUFFIX}-${type}
fi
fi
done
unset j
done
unset i
fi
}
PACKAGES += "${PN}-images"
FILES:${PN}-images += "/boot"
COMPATIBLE_MACHINE = "(qoriq)"
|