diff options
-rw-r--r-- | meta/recipes-bsp/u-boot/u-boot.inc | 63 |
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}" | |||
29 | UBOOT_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_SUFFIX}" | 29 | UBOOT_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_SUFFIX}" |
30 | UBOOT_MAKE_TARGET ?= "all" | 30 | UBOOT_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. | ||
35 | UBOOT_ELF ?= "" | ||
36 | UBOOT_ELF_SUFFIX ?= "elf" | ||
37 | UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}" | ||
38 | UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}" | ||
39 | UBOOT_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 | ||
149 | FILES_${PN} = "/boot ${sysconfdir}" | 182 | FILES_${PN} = "/boot ${sysconfdir}" |
183 | # Ensure the split debug part of any elf files are put into dbg | ||
184 | FILES_${PN}-dbg += "/boot/.debug" | ||
150 | 185 | ||
151 | do_deploy () { | 186 | do_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" ] |