summaryrefslogtreecommitdiffstats
path: root/recipes-bsp
diff options
context:
space:
mode:
authorTing Liu <ting.liu@nxp.com>2016-07-16 00:35:43 +0800
committerOtavio Salvador <otavio@ossystems.com.br>2016-07-22 11:34:12 -0300
commit0ff0e401d09fb9e063611d32117d3507fd135599 (patch)
tree0f1c20db2f1275de014c7de70e4ce41cef9a7908 /recipes-bsp
parent79ba856434b0e2d28352afe7828fd00faa91f71a (diff)
downloadmeta-freescale-0ff0e401d09fb9e063611d32117d3507fd135599.tar.gz
u-boot-qoriq: switch to new UBOOT_CONFIG format
By using the new UBOOT_CONFIG format, the final u-boot binary will be configured in machine config file, and will be processed in upstream u-boot.inc. Remove the codes to copy final u-boot binary, and append the special steps which need boot-format/byte_swap tool to regenerate the binary. Signed-off-by: Ting Liu <ting.liu@nxp.com> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/u-boot/u-boot-qoriq_2016.01.bb100
1 files changed, 13 insertions, 87 deletions
diff --git a/recipes-bsp/u-boot/u-boot-qoriq_2016.01.bb b/recipes-bsp/u-boot/u-boot-qoriq_2016.01.bb
index 601edbd3..cfb345ed 100644
--- a/recipes-bsp/u-boot/u-boot-qoriq_2016.01.bb
+++ b/recipes-bsp/u-boot/u-boot-qoriq_2016.01.bb
@@ -55,56 +55,25 @@ S = "${WORKDIR}/git"
55 55
56EXTRA_OEMAKE = 'CROSS_COMPILE=${WRAP_TARGET_PREFIX} CC="${WRAP_TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"' 56EXTRA_OEMAKE = 'CROSS_COMPILE=${WRAP_TARGET_PREFIX} CC="${WRAP_TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"'
57 57
58do_compile_append_qoriq-ppc() { 58do_compile_append_qoriq () {
59 for board in ${UBOOT_MACHINE}; do
60 case "${board}" in
61 *SDCARD*) UBOOT_TARGET="u-boot-sd";;
62 *SPIFLASH*) UBOOT_TARGET="u-boot-spi";;
63 *NAND*) UBOOT_TARGET="u-boot-nand";;
64 *SRIO*) UBOOT_TARGET="u-boot-srio";;
65 *) UBOOT_TARGET="";;
66 esac
67
68 # deal with sd/spi/nand/srio image
69 UBOOT_SOURCE=u-boot.bin
70 if [ "x${UBOOT_TARGET}" != "x" ] && echo $board |egrep -qi "SECBOOT|SECURE"; then
71 cp ${S}/${board}/${UBOOT_SOURCE} ${S}/${board}/${UBOOT_TARGET}.bin
72 elif [ "x${UBOOT_TARGET}" != "x" ]; then
73 # some boards' final binary was not named as u-boot.bin
74 if [ "${UBOOT_TARGET}" = "u-boot-nand" ] && [ "${UBOOT_SOURCE_NAND}" != "" ]; then
75 UBOOT_SOURCE="${UBOOT_SOURCE_NAND}"
76 elif [ "${UBOOT_TARGET}" = "u-boot-spi" ] && [ "${UBOOT_SOURCE_SPI}" != "" ]; then
77 UBOOT_SOURCE="${UBOOT_SOURCE_SPI}"
78 elif [ "${UBOOT_TARGET}" = "u-boot-sd" ] && [ "${UBOOT_SOURCE_SD}" != "" ]; then
79 UBOOT_SOURCE="${UBOOT_SOURCE_SD}"
80 fi
81 cp ${S}/${board}/${UBOOT_SOURCE} ${S}/${board}/${UBOOT_TARGET}.bin
82
83 # use boot-format to regenerate spi image if BOOTFORMAT_CONFIG is not empty
84 if [ "${UBOOT_TARGET}" = "u-boot-spi" ] && [ -n "${BOOTFORMAT_CONFIG}" ];then
85 ${STAGING_BINDIR_NATIVE}/boot_format \
86 ${STAGING_DATADIR_NATIVE}/boot_format/${BOOTFORMAT_CONFIG} \
87 ${S}/${board}/${UBOOT_SOURCE} -spi ${S}/${board}/${UBOOT_TARGET}.bin
88 fi
89 fi
90 done
91}
92
93do_compile_append_qoriq-arm () {
94 unset i j 59 unset i j
95 if [ "x${UBOOT_CONFIG}" != "x" ]; then 60 if [ -n "${UBOOT_CONFIG}" ];then
96 for config in ${UBOOT_MACHINE}; do 61 for config in ${UBOOT_MACHINE}; do
97 i=`expr $i + 1`; 62 i=`expr $i + 1`;
98 for type in ${UBOOT_CONFIG}; do 63 for type in ${UBOOT_CONFIG}; do
99 j=`expr $j + 1`; 64 j=`expr $j + 1`;
100 if [ $j -eq $i ]; then 65 if [ $j -eq $i ]; then
101 case "${config}" in 66 if [ -n "${BOOTFORMAT_CONFIG}" ] && echo "${type}" |grep -q spi;then
102 *nand* | *sdcard*) 67 # regenerate spi binary if BOOTFORMAT_CONFIG is set
103 cp ${config}/u-boot-with-spl-pbl.bin ${config}/u-boot-${type}.${UBOOT_SUFFIX};; 68 boot_format ${STAGING_DATADIR_NATIVE}/boot_format/${BOOTFORMAT_CONFIG} \
104 *spi*) 69 ${config}/u-boot-${type}.${UBOOT_SUFFIX} -spi ${config}/u-boot.format.bin
105 tclsh ${STAGING_BINDIR_NATIVE}/byte_swap.tcl ${config}/u-boot-dtb.bin ${config}/u-boot.swap.bin 8 70 cp ${config}/u-boot.format.bin ${config}/u-boot-${type}.${UBOOT_SUFFIX}
106 cp ${config}/u-boot.swap.bin ${config}/u-boot-${type}.${UBOOT_SUFFIX};; 71 elif [ "qspi" = "${type}" ];then
107 esac 72 # change qspi binary endianess
73 tclsh ${STAGING_BINDIR_NATIVE}/byte_swap.tcl \
74 ${config}/u-boot-${type}.${UBOOT_SUFFIX} ${config}/u-boot.swap.bin 8
75 cp ${config}/u-boot.swap.bin ${config}/u-boot-${type}.${UBOOT_SUFFIX}
76 fi
108 fi 77 fi
109 done 78 done
110 unset j 79 unset j
@@ -113,49 +82,6 @@ do_compile_append_qoriq-arm () {
113 fi 82 fi
114} 83}
115 84
116
117do_install_append_qoriq-ppc() {
118 for board in ${UBOOT_MACHINE}; do
119 case "${board}" in
120 *SDCARD*) UBOOT_TARGET="u-boot-sd";;
121 *SPIFLASH*) UBOOT_TARGET="u-boot-spi";;
122 *NAND*) UBOOT_TARGET="u-boot-nand";;
123 *SRIO*) UBOOT_TARGET="u-boot-srio";;
124 *) UBOOT_TARGET="u-boot";;
125 esac
126
127 if [ -f ${S}/${board}/${UBOOT_TARGET}.bin ]; then
128 mkdir -p ${D}/boot/
129 install ${S}/${board}/${UBOOT_TARGET}.bin ${D}/boot/${UBOOT_TARGET}-${board}-${PV}-${PR}.bin
130 ln -sf ${UBOOT_TARGET}-${board}-${PV}-${PR}.bin ${D}/boot/${UBOOT_TARGET}.bin
131 fi
132 done
133}
134
135do_deploy_append_qoriq-ppc() {
136 if [ "x${UBOOT_MACHINES}" = "x" ]; then
137 UBOOT_MACHINES="${UBOOT_MACHINE}"
138 fi
139
140 for board in ${UBOOT_MACHINES}; do
141 case "${board}" in
142 *SDCARD*) UBOOT_TARGET="u-boot-sd";;
143 *SPIFLASH*) UBOOT_TARGET="u-boot-spi";;
144 *NAND*) UBOOT_TARGET="u-boot-nand";;
145 *SRIO*) UBOOT_TARGET="u-boot-srio";;
146 *) UBOOT_TARGET="u-boot";;
147 esac
148
149 if [ -f ${S}/${board}/${UBOOT_TARGET}.bin ]; then
150 mkdir -p ${DEPLOYDIR}
151 install ${S}/${board}/${UBOOT_TARGET}.bin ${DEPLOYDIR}/${UBOOT_TARGET}-${board}-${PV}-${PR}.bin
152 rm -f ${DEPLOYDIR}/${UBOOT_TARGET}-${board}.bin
153 ln -sf ${UBOOT_TARGET}-${board}-${PV}-${PR}.bin ${DEPLOYDIR}/${UBOOT_TARGET}-${board}.bin
154 fi
155 done
156}
157addtask deploy after do_install
158
159PACKAGES += "${PN}-images" 85PACKAGES += "${PN}-images"
160FILES_${PN}-images += "/boot" 86FILES_${PN}-images += "/boot"
161 87