summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2015-09-10 00:13:19 +1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-12 22:48:44 +0100
commitc2165c97411c11949c65954568818d6ea9aca052 (patch)
treef19b3c7eaf849e05ce730e0599bcf55d0a536079 /meta/recipes-bsp
parent302ec4665011ed71bb3487f97ef80be6e90844f7 (diff)
downloadpoky-c2165c97411c11949c65954568818d6ea9aca052.tar.gz
u-boot.inc: Add U-Boot ELF install and deploy
Add support for U-Boot recipes to install and deploy the generated ELF files for each config. The U-Boot ELF's are useful for debugging, and booting (directly booting, e.g. by JTAG or using QEMU) and complement the generated binary image. This additional feature is disabled by default, machines/etc that want to use it need to set UBOOT_ELF to the corresponding ELF file (generally u-boot or u-boot.elf depending on the architecture) (From OE-Core rev: fae697dedf6ab04b7c123ea5615b1003a79c2422) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp')
-rw-r--r--meta/recipes-bsp/u-boot/u-boot.inc63
1 files changed, 62 insertions, 1 deletions
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index 990ddb168e..b89ddfc127 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -29,6 +29,15 @@ UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}"
29UBOOT_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_SUFFIX}" 29UBOOT_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_SUFFIX}"
30UBOOT_MAKE_TARGET ?= "all" 30UBOOT_MAKE_TARGET ?= "all"
31 31
32# Output the ELF generated. Some platforms can use the ELF file and directly
33# load it (JTAG booting, QEMU) additionally the ELF can be used for debugging
34# purposes.
35UBOOT_ELF ?= ""
36UBOOT_ELF_SUFFIX ?= "elf"
37UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}"
38UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}"
39UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}"
40
32# Some versions of u-boot build an SPL (Second Program Loader) image that 41# Some versions of u-boot build an SPL (Second Program Loader) image that
33# should be packaged along with the u-boot binary as well as placed in the 42# should be packaged along with the u-boot binary as well as placed in the
34# deploy directory. For those versions they can set the following variables 43# deploy directory. For those versions they can set the following variables
@@ -110,6 +119,30 @@ do_install () {
110 ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY} 119 ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
111 fi 120 fi
112 121
122 if [ "x${UBOOT_ELF}" != "x" ]
123 then
124 if [ "x${UBOOT_CONFIG}" != "x" ]
125 then
126 for config in ${UBOOT_MACHINE}; do
127 i=`expr $i + 1`;
128 for type in ${UBOOT_CONFIG}; do
129 j=`expr $j + 1`;
130 if [ $j -eq $i ]
131 then
132 install ${S}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
133 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
134 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}
135 fi
136 done
137 unset j
138 done
139 unset i
140 else
141 install ${S}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE}
142 ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY}
143 fi
144 fi
145
113 if [ -e ${WORKDIR}/fw_env.config ] ; then 146 if [ -e ${WORKDIR}/fw_env.config ] ; then
114 install -d ${D}${sysconfdir} 147 install -d ${D}${sysconfdir}
115 install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config 148 install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
@@ -147,6 +180,8 @@ do_install () {
147} 180}
148 181
149FILES_${PN} = "/boot ${sysconfdir}" 182FILES_${PN} = "/boot ${sysconfdir}"
183# Ensure the split debug part of any elf files are put into dbg
184FILES_${PN}-dbg += "/boot/.debug"
150 185
151do_deploy () { 186do_deploy () {
152 if [ "x${UBOOT_CONFIG}" != "x" ] 187 if [ "x${UBOOT_CONFIG}" != "x" ]
@@ -177,7 +212,33 @@ do_deploy () {
177 ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK} 212 ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
178 ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY} 213 ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
179 fi 214 fi
180 215
216 if [ "x${UBOOT_ELF}" != "x" ]
217 then
218 if [ "x${UBOOT_CONFIG}" != "x" ]
219 then
220 for config in ${UBOOT_MACHINE}; do
221 i=`expr $i + 1`;
222 for type in ${UBOOT_CONFIG}; do
223 j=`expr $j + 1`;
224 if [ $j -eq $i ]
225 then
226 install ${S}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
227 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type}
228 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
229 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type}
230 ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
231 fi
232 done
233 unset j
234 done
235 unset i
236 else
237 install ${S}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE}
238 ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
239 ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
240 fi
241 fi
181 242
182 243
183 if [ "x${SPL_BINARY}" != "x" ] 244 if [ "x${SPL_BINARY}" != "x" ]