summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/u-boot
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/u-boot')
-rw-r--r--recipes-bsp/u-boot/u-boot-qoriq_2015.01.bb196
1 files changed, 58 insertions, 138 deletions
diff --git a/recipes-bsp/u-boot/u-boot-qoriq_2015.01.bb b/recipes-bsp/u-boot/u-boot-qoriq_2015.01.bb
index eebd979..7b942c7 100644
--- a/recipes-bsp/u-boot/u-boot-qoriq_2015.01.bb
+++ b/recipes-bsp/u-boot/u-boot-qoriq_2015.01.bb
@@ -1,4 +1,7 @@
1DESCRIPTION = "U-boot bootloader" 1require recipes-bsp/u-boot/u-boot.inc
2inherit fsl-u-boot-localversion
3
4DESCRIPTION = "U-boot provided by Freescale with focus on QorIQ boards"
2HOMEPAGE = "http://u-boot.sf.net" 5HOMEPAGE = "http://u-boot.sf.net"
3SECTION = "bootloaders" 6SECTION = "bootloaders"
4PROVIDES = "virtual/bootloader u-boot" 7PROVIDES = "virtual/bootloader u-boot"
@@ -13,16 +16,16 @@ LIC_FILES_CHKSUM = " \
13 16
14PV_append = "+fslgit" 17PV_append = "+fslgit"
15INHIBIT_DEFAULT_DEPS = "1" 18INHIBIT_DEFAULT_DEPS = "1"
16DEPENDS = "boot-format-native libgcc ${@base_contains('TCMODE', 'external-fsl', '', 'virtual/${TARGET_PREFIX}gcc', d)}" 19DEPENDS = "libgcc virtual/${TARGET_PREFIX}gcc"
20DEPENDS_append_qoriq-ppc = " boot-format-native"
17 21
18inherit deploy 22inherit deploy
19 23
20SRC_URI = "git://git.freescale.com/ppc/sdk/u-boot.git;nobranch=1 \ 24SRC_URI = "git://git.freescale.com/ppc/sdk/u-boot.git;branch=sdk-v1.9.x \
21 file://0001-u-boot-mpc85xx-u-boot-.lds-remove-_GLOBAL_OFFSET_TAB.patch \
22 file://gcc5.patch \ 25 file://gcc5.patch \
23 file://add-fgnu89-inline-option-for-gcc5.patch \ 26 file://add-fgnu89-inline-option-for-gcc5.patch \
24" 27"
25SRCREV = "6ba8eedbcdc4b063f59a63e6288b938af739e8ad" 28SRCREV = "eb3d4fc5759729d7af71ac31ebf6a7e8d0e79da3"
26 29
27python () { 30python () {
28 if d.getVar("TCMODE", True) == "external-fsl": 31 if d.getVar("TCMODE", True) == "external-fsl":
@@ -45,148 +48,65 @@ WRAP_TARGET_PREFIX ?= "${TARGET_PREFIX}"
45 48
46PACKAGE_ARCH = "${MACHINE_ARCH}" 49PACKAGE_ARCH = "${MACHINE_ARCH}"
47 50
48UBOOT_LOCALVERSION = "${@d.getVar('SDK_VERSION', True).partition(' ')[0]}"
49
50USRC ?= "" 51USRC ?= ""
51S = '${@base_conditional("USRC", "", "${WORKDIR}/git", "${USRC}", d)}' 52S = '${@base_conditional("USRC", "", "${WORKDIR}/git", "${USRC}", d)}'
52 53
53EXTRA_OEMAKE = 'CROSS_COMPILE=${WRAP_TARGET_PREFIX} CC="${WRAP_TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"' 54LOCALVERSION = "+fsl"
54
55do_compile () {
56 unset LDFLAGS
57 unset CFLAGS
58 unset CPPFLAGS
59
60 if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
61 then
62 head=`git rev-parse --verify --short HEAD 2> /dev/null`
63 printf "%s%s%s" ${UBOOT_LOCALVERSION} +g $head > ${B}/.scmversion
64 printf "%s%s%s" ${UBOOT_LOCALVERSION} +g $head > ${S}/.scmversion
65 fi
66
67 if [ "x${UBOOT_MACHINES}" = "x" ]; then
68 UBOOT_MACHINES=${UBOOT_MACHINE}
69 fi
70
71 python ./tools/genboardscfg.py
72 for board in ${UBOOT_MACHINES}; do
73 if ! grep -wq $board ${S}/boards.cfg;then
74 echo "WARNING: $board not supported in boards.cfg"
75 continue
76 fi
77 55
78 oe_runmake O=${board} distclean 56EXTRA_OEMAKE = 'CROSS_COMPILE=${WRAP_TARGET_PREFIX} CC="${WRAP_TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"'
79 oe_runmake O=${board} ${board}_config
80 oe_runmake O=${board} all
81
82 case "${board}" in
83 *SDCARD*) UBOOT_TARGET="u-boot-sd";;
84 *SPIFLASH*) UBOOT_TARGET="u-boot-spi";;
85 *NAND*) UBOOT_TARGET="u-boot-nand";;
86 *SRIO*) UBOOT_TARGET="u-boot-srio";;
87 *) UBOOT_TARGET="";;
88 esac
89 57
90 # deal with sd/spi/nand/srio image 58do_compile_append_qoriq-ppc () {
91 UBOOT_SOURCE=u-boot.bin 59 # some board's final nand/spi/sdcard binary was not named as u-boot.bin
92 if [ "x${UBOOT_TARGET}" != "x" ] && echo $board |egrep -qi "SECBOOT|SECURE"; then 60 unset i j
93 cp ${S}/${board}/${UBOOT_SOURCE} ${S}/${board}/${UBOOT_TARGET}.bin 61 if [ "x${UBOOT_CONFIG}" != "x" ]; then
94 elif [ "x${UBOOT_TARGET}" != "x" ]; then 62 for config in ${UBOOT_MACHINE}; do
95 # some boards' final binary was not named as u-boot.bin 63 i=`expr $i + 1`;
96 if [ "${UBOOT_TARGET}" = "u-boot-nand" ];then 64 UBOOT_SOURCE=${UBOOT_BINARY}
97 if echo $board |egrep -q "^(BSC|C29|P10|P2020RDB)";then 65 if echo ${config} |egrep -v "SECBOOT|SECURE" |egrep -qi "SDCARD|SPIFLASH|NAND"; then
98 UBOOT_SOURCE=u-boot-with-spl.bin 66 if echo ${config} |egrep -qi "NAND";then
99 elif echo $board |egrep -q "^(B4|T1|T2|T4)";then 67 if echo ${config} |egrep -qi "^(BSC|C29|P10|P2020RDB)";then
100 UBOOT_SOURCE=u-boot-with-spl-pbl.bin 68 UBOOT_SOURCE=u-boot-with-spl.bin
101 elif echo $board |egrep -q "^(P2041|P3|P4|P5)";then 69 elif echo ${config} |egrep -qi "^(B4|T1|T2|T4)";then
102 UBOOT_SOURCE=u-boot.pbl 70 UBOOT_SOURCE=u-boot-with-spl-pbl.bin
71 elif echo ${config} |egrep -qi "^(P2041|P3|P4|P5)";then
72 UBOOT_SOURCE=u-boot.pbl
73 fi
74 elif echo ${config} |egrep -qi "SPIFLASH";then
75 if echo ${config} |egrep -qi "^(P10|P2020RDB)";then
76 UBOOT_SOURCE=u-boot-with-spl.bin
77 elif echo ${config} |egrep -qi "^(T1|T2)";then
78 UBOOT_SOURCE=u-boot-with-spl-pbl.bin
79 elif echo ${config} |egrep -qi "^(B4|P2041|P3|P4|P5|T4)";then
80 UBOOT_SOURCE=u-boot.pbl
81 fi
82 elif echo ${config} |egrep -qi "SDCARD";then
83 if echo ${config} |egrep -qi "^(P10|P2020RDB)";then
84 UBOOT_SOURCE=u-boot-with-spl.bin
85 elif echo ${config} |egrep -qi "^(B4|T1|T2|T4)";then
86 UBOOT_SOURCE=u-boot-with-spl-pbl.bin
87 elif echo ${config} |egrep -qi "^(P2041|P3|P4|P5)";then
88 UBOOT_SOURCE=u-boot.pbl
89 fi
103 fi 90 fi
104 elif [ "${UBOOT_TARGET}" = "u-boot-spi" ];then 91 for type in ${UBOOT_CONFIG}; do
105 if echo $board |egrep -q "^(P10|P2020RDB)";then 92 j=`expr $j + 1`;
106 UBOOT_SOURCE=u-boot-with-spl.bin 93 if [ $j -eq $i ]; then
107 elif echo $board |egrep -q "^(T1|T2)";then 94 cp ${S}/${config}/${UBOOT_SOURCE} ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
108 UBOOT_SOURCE=u-boot-with-spl-pbl.bin 95 # use boot-format to regenerate spi image if BOOTFORMAT_CONFIG is not empty
109 elif echo $board |egrep -q "^(B4|P2041|P3|P4|P5|T4)";then 96 if echo ${config} |egrep -qi "SPIFLASH" && [ -n "${BOOTFORMAT_CONFIG}" ];then
110 UBOOT_SOURCE=u-boot.pbl 97 ${STAGING_BINDIR_NATIVE}/boot_format \
111 fi 98 ${STAGING_DATADIR_NATIVE}/boot_format/${BOOTFORMAT_CONFIG} \
112 elif [ "${UBOOT_TARGET}" = "u-boot-sd" ];then 99 ${S}/${config}/${UBOOT_SOURCE} -spi ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
113 if echo $board |egrep -q "^(P10|P2020RDB)";then 100 fi
114 UBOOT_SOURCE=u-boot-with-spl.bin 101 fi
115 elif echo $board |egrep -q "^(B4|T1|T2|T4)";then 102 done
116 UBOOT_SOURCE=u-boot-with-spl-pbl.bin 103 unset j
117 elif echo $board |egrep -q "^(P2041|P3|P4|P5)";then
118 UBOOT_SOURCE=u-boot.pbl
119 fi
120 fi
121 cp ${S}/${board}/${UBOOT_SOURCE} ${S}/${board}/${UBOOT_TARGET}.bin
122
123 # use boot-format to regenerate spi image if BOOTFORMAT_CONFIG is not empty
124 if [ "${UBOOT_TARGET}" = "u-boot-spi" ] && [ -n "${BOOTFORMAT_CONFIG}" ];then
125 ${STAGING_BINDIR_NATIVE}/boot_format \
126 ${STAGING_DATADIR_NATIVE}/boot_format/${BOOTFORMAT_CONFIG} \
127 ${S}/${board}/${UBOOT_SOURCE} -spi ${S}/${board}/${UBOOT_TARGET}.bin
128 fi 104 fi
129 fi 105 done
130 done 106 unset i
131}
132
133do_install(){
134 if [ "x${UBOOT_MACHINES}" = "x" ]; then
135 UBOOT_MACHINES=${UBOOT_MACHINE}
136 fi
137
138 for board in ${UBOOT_MACHINES}; do
139 if ! grep -wq $board ${S}/boards.cfg;then
140 continue
141 fi
142
143 case "${board}" in
144 *SDCARD*) UBOOT_TARGET="u-boot-sd";;
145 *SPIFLASH*) UBOOT_TARGET="u-boot-spi";;
146 *NAND*) UBOOT_TARGET="u-boot-nand";;
147 *SRIO*) UBOOT_TARGET="u-boot-srio";;
148 *) UBOOT_TARGET="u-boot";;
149 esac
150
151 if [ -f ${S}/${board}/${UBOOT_TARGET}.bin ]; then
152 mkdir -p ${D}/boot/
153 install ${S}/${board}/${UBOOT_TARGET}.bin ${D}/boot/${UBOOT_TARGET}-${board}-${PV}-${PR}.bin
154 ln -sf ${UBOOT_TARGET}-${board}-${PV}-${PR}.bin ${D}/boot/${UBOOT_TARGET}.bin
155 fi
156 done
157}
158
159do_deploy(){
160 if [ "x${UBOOT_MACHINES}" = "x" ]; then
161 UBOOT_MACHINES=${UBOOT_MACHINE}
162 fi 107 fi
163
164 for board in ${UBOOT_MACHINES}; do
165 if ! grep -wq $board ${S}/boards.cfg;then
166 continue
167 fi
168
169 case "${board}" in
170 *SDCARD*) UBOOT_TARGET="u-boot-sd";;
171 *SPIFLASH*) UBOOT_TARGET="u-boot-spi";;
172 *NAND*) UBOOT_TARGET="u-boot-nand";;
173 *SRIO*) UBOOT_TARGET="u-boot-srio";;
174 *) UBOOT_TARGET="u-boot";;
175 esac
176
177 if [ -f ${S}/${board}/${UBOOT_TARGET}.bin ]; then
178 mkdir -p ${DEPLOYDIR}
179 install ${S}/${board}/${UBOOT_TARGET}.bin ${DEPLOYDIR}/${UBOOT_TARGET}-${board}-${PV}-${PR}.bin
180
181 cd ${DEPLOYDIR}
182 rm -f ${UBOOT_TARGET}-${board}.bin
183 ln -sf ${UBOOT_TARGET}-${board}-${PV}-${PR}.bin ${UBOOT_TARGET}-${board}.bin
184 fi
185 done
186} 108}
187addtask deploy after do_install
188 109
189PACKAGES += "${PN}-images" 110PACKAGES += "${PN}-images"
190FILES_${PN}-images += "/boot" 111FILES_${PN}-images += "/boot"
191 112COMPATIBLE_MACHINE = "(qoriq)"
192ALLOW_EMPTY_${PN} = "1"