summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/u-boot/u-boot-qoriq_2014.07.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/u-boot/u-boot-qoriq_2014.07.bb')
-rw-r--r--recipes-bsp/u-boot/u-boot-qoriq_2014.07.bb187
1 files changed, 187 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot-qoriq_2014.07.bb b/recipes-bsp/u-boot/u-boot-qoriq_2014.07.bb
new file mode 100644
index 0000000..b780658
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-qoriq_2014.07.bb
@@ -0,0 +1,187 @@
1DESCRIPTION = "U-boot bootloader"
2HOMEPAGE = "http://u-boot.sf.net"
3SECTION = "bootloaders"
4PROVIDES = "virtual/bootloader u-boot"
5LICENSE = "GPLv2 & BSD-3-Clause & BSD-2-Clause & LGPL-2.0 & LGPL-2.1"
6LIC_FILES_CHKSUM = " \
7 file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
8 file://Licenses/bsd-2-clause.txt;md5=6a31f076f5773aabd8ff86191ad6fdd5 \
9 file://Licenses/bsd-3-clause.txt;md5=4a1190eac56a9db675d58ebe86eaf50c \
10 file://Licenses/lgpl-2.0.txt;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
11 file://Licenses/lgpl-2.1.txt;md5=4fbd65380cdd255951079008b364516c \
12"
13
14PV = "2014.07+fslgit"
15INHIBIT_DEFAULT_DEPS = "1"
16DEPENDS = "boot-format-native libgcc ${@base_contains('TCMODE', 'external-fsl', '', 'virtual/${TARGET_PREFIX}gcc', d)}"
17
18inherit deploy
19
20SRC_URI = "git://git.freescale.com/ppc/sdk/u-boot.git;nobranch=1"
21SRCREV = "659b6a23a8b1f3026200bc6352dbacef53f4dcb1"
22
23python () {
24 if d.getVar("TCMODE", True) == "external-fsl":
25 return
26
27 ml = d.getVar("MULTILIB_VARIANTS", True)
28 arch = d.getVar("OVERRIDES", True)
29
30 if "e5500-64b:" in arch or "e6500-64b:" in arch:
31 if not "lib32" in ml:
32 raise bb.parse.SkipPackage("Building the u-boot for this arch requires multilib to be enabled")
33 sys_multilib = 'powerpc' + d.getVar('TARGET_VENDOR') + 'mllib32-' + d.getVar('HOST_OS')
34 d.setVar('DEPENDS_append', ' lib32-gcc-cross-powerpc lib32-libgcc')
35 d.setVar('PATH_append', ':' + d.getVar('STAGING_BINDIR_NATIVE') + '/' + sys_multilib)
36 d.setVar('TOOLCHAIN_OPTIONS_append', '/../lib32-' + d.getVar("MACHINE"))
37 d.setVar("WRAP_TARGET_PREFIX", sys_multilib + '-')
38}
39
40WRAP_TARGET_PREFIX ?= "${TARGET_PREFIX}"
41
42PACKAGE_ARCH = "${MACHINE_ARCH}"
43
44UBOOT_LOCALVERSION = "${@d.getVar('SDK_VERSION', True).partition(' ')[0]}"
45
46USRC ?= ""
47S = '${@base_conditional("USRC", "", "${WORKDIR}/git", "${USRC}", d)}'
48
49EXTRA_OEMAKE = 'CROSS_COMPILE=${WRAP_TARGET_PREFIX} CC="${WRAP_TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"'
50
51do_compile () {
52 unset LDFLAGS
53 unset CFLAGS
54 unset CPPFLAGS
55
56 if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
57 then
58 head=`git rev-parse --verify --short HEAD 2> /dev/null`
59 printf "%s%s%s" ${UBOOT_LOCALVERSION} +g $head > ${B}/.scmversion
60 printf "%s%s%s" ${UBOOT_LOCALVERSION} +g $head > ${S}/.scmversion
61 fi
62
63 if [ "x${UBOOT_MACHINES}" = "x" ]; then
64 UBOOT_MACHINES=${UBOOT_MACHINE}
65 fi
66
67 for board in ${UBOOT_MACHINES}; do
68 if ! grep -wq $board ${S}/boards.cfg;then
69 echo "WARNING: $board not supported in boards.cfg"
70 continue
71 fi
72
73 oe_runmake O=${board} distclean
74 oe_runmake O=${board} ${board}_config
75 oe_runmake O=${board} all
76
77 case "${board}" in
78 *SDCARD*) UBOOT_TARGET="u-boot-sd";;
79 *SPIFLASH*) UBOOT_TARGET="u-boot-spi";;
80 *NAND*) UBOOT_TARGET="u-boot-nand";;
81 *SRIO*) UBOOT_TARGET="u-boot-srio";;
82 *) UBOOT_TARGET="";;
83 esac
84
85 # deal with sd/spi/nand/srio image
86 UBOOT_SOURCE=u-boot.bin
87 if [ "x${UBOOT_TARGET}" != "x" ] && echo $board |egrep -qi "SECBOOT|SECURE"; then
88 cp ${S}/${board}/${UBOOT_SOURCE} ${S}/${board}/${UBOOT_TARGET}.bin
89 elif [ "x${UBOOT_TARGET}" != "x" ]; then
90 # some boards' final binary was not named as u-boot.bin
91 if [ "${UBOOT_TARGET}" = "u-boot-nand" ];then
92 if echo $board |egrep -q "^(BSC|C29|P10|P2020RDB)";then
93 UBOOT_SOURCE=u-boot-with-spl.bin
94 elif echo $board |egrep -q "^(B4|T1|T2|T4)";then
95 UBOOT_SOURCE=u-boot-with-spl-pbl.bin
96 elif echo $board |egrep -q "^(P2041|P3|P4|P5)";then
97 UBOOT_SOURCE=u-boot.pbl
98 fi
99 elif [ "${UBOOT_TARGET}" = "u-boot-spi" ];then
100 if echo $board |egrep -q "^(P10|P2020RDB)";then
101 UBOOT_SOURCE=u-boot-with-spl.bin
102 elif echo $board |egrep -q "^(T1|T2)";then
103 UBOOT_SOURCE=u-boot-with-spl-pbl.bin
104 elif echo $board |egrep -q "^(B4|P2041|P3|P4|P5|T4)";then
105 UBOOT_SOURCE=u-boot.pbl
106 fi
107 elif [ "${UBOOT_TARGET}" = "u-boot-sd" ];then
108 if echo $board |egrep -q "^(P10|P2020RDB)";then
109 UBOOT_SOURCE=u-boot-with-spl.bin
110 elif echo $board |egrep -q "^(B4|T1|T2|T4)";then
111 UBOOT_SOURCE=u-boot-with-spl-pbl.bin
112 elif echo $board |egrep -q "^(P2041|P3|P4|P5)";then
113 UBOOT_SOURCE=u-boot.pbl
114 fi
115 fi
116 cp ${S}/${board}/${UBOOT_SOURCE} ${S}/${board}/${UBOOT_TARGET}.bin
117
118 # use boot-format to regenerate spi image if BOOTFORMAT_CONFIG is not empty
119 if [ "${UBOOT_TARGET}" = "u-boot-spi" ] && [ -n "${BOOTFORMAT_CONFIG}" ];then
120 ${STAGING_BINDIR_NATIVE}/boot_format \
121 ${STAGING_DATADIR_NATIVE}/boot_format/${BOOTFORMAT_CONFIG} \
122 ${S}/${board}/${UBOOT_SOURCE} -spi ${S}/${board}/${UBOOT_TARGET}.bin
123 fi
124 fi
125 done
126}
127
128do_install(){
129 if [ "x${UBOOT_MACHINES}" = "x" ]; then
130 UBOOT_MACHINES=${UBOOT_MACHINE}
131 fi
132
133 for board in ${UBOOT_MACHINES}; do
134 if ! grep -wq $board ${S}/boards.cfg;then
135 continue
136 fi
137
138 case "${board}" in
139 *SDCARD*) UBOOT_TARGET="u-boot-sd";;
140 *SPIFLASH*) UBOOT_TARGET="u-boot-spi";;
141 *NAND*) UBOOT_TARGET="u-boot-nand";;
142 *SRIO*) UBOOT_TARGET="u-boot-srio";;
143 *) UBOOT_TARGET="u-boot";;
144 esac
145
146 if [ -f ${S}/${board}/${UBOOT_TARGET}.bin ]; then
147 mkdir -p ${D}/boot/
148 install ${S}/${board}/${UBOOT_TARGET}.bin ${D}/boot/${UBOOT_TARGET}-${board}-${PV}-${PR}.bin
149 ln -sf ${UBOOT_TARGET}-${board}-${PV}-${PR}.bin ${D}/boot/${UBOOT_TARGET}.bin
150 fi
151 done
152}
153
154do_deploy(){
155 if [ "x${UBOOT_MACHINES}" = "x" ]; then
156 UBOOT_MACHINES=${UBOOT_MACHINE}
157 fi
158
159 for board in ${UBOOT_MACHINES}; do
160 if ! grep -wq $board ${S}/boards.cfg;then
161 continue
162 fi
163
164 case "${board}" in
165 *SDCARD*) UBOOT_TARGET="u-boot-sd";;
166 *SPIFLASH*) UBOOT_TARGET="u-boot-spi";;
167 *NAND*) UBOOT_TARGET="u-boot-nand";;
168 *SRIO*) UBOOT_TARGET="u-boot-srio";;
169 *) UBOOT_TARGET="u-boot";;
170 esac
171
172 if [ -f ${S}/${board}/${UBOOT_TARGET}.bin ]; then
173 mkdir -p ${DEPLOYDIR}
174 install ${S}/${board}/${UBOOT_TARGET}.bin ${DEPLOYDIR}/${UBOOT_TARGET}-${board}-${PV}-${PR}.bin
175
176 cd ${DEPLOYDIR}
177 rm -f ${UBOOT_TARGET}-${board}.bin
178 ln -sf ${UBOOT_TARGET}-${board}-${PV}-${PR}.bin ${UBOOT_TARGET}-${board}.bin
179 fi
180 done
181}
182addtask deploy after do_install
183
184PACKAGES += "${PN}-images"
185FILES_${PN}-images += "/boot"
186
187ALLOW_EMPTY_${PN} = "1"