summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUsama Arif <usama.arif@arm.com>2020-07-20 18:18:21 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-08 09:17:48 +0100
commit8f8ec92d7b1b4c0676f7f9f7c12f00af8cc3a680 (patch)
treecbbc0603fe013cd0e726c483d5d38920b0575ebd
parentd5bb2216467da5427a36224ca80b9c10157893bd (diff)
downloadpoky-8f8ec92d7b1b4c0676f7f9f7c12f00af8cc3a680.tar.gz
kernel-fitimage: build configuration for image tree when dtb is not present
This patch adds support for adding configuration node even when dtb is not part of the FIT image. The conf and default node number are therefore changed to point to kernel ID rather than dtb ID when dtb does not exist. (From OE-Core rev: 2d9f3c3d763e2bca704da4019add973b9a2c572f) Signed-off-by: Usama Arif <usama.arif@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/kernel-fitimage.bbclass29
1 files changed, 27 insertions, 2 deletions
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 72b05ff8d1..fa4ea6feef 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -257,12 +257,21 @@ fitimage_emit_section_config() {
257 # Test if we have any DTBs at all 257 # Test if we have any DTBs at all
258 sep="" 258 sep=""
259 conf_desc="" 259 conf_desc=""
260 conf_node="conf@"
260 kernel_line="" 261 kernel_line=""
261 fdt_line="" 262 fdt_line=""
262 ramdisk_line="" 263 ramdisk_line=""
263 setup_line="" 264 setup_line=""
264 default_line="" 265 default_line=""
265 266
267 # conf node name is selected based on dtb ID if it is present,
268 # otherwise its selected based on kernel ID
269 if [ -n "${3}" ]; then
270 conf_node=$conf_node${3}
271 else
272 conf_node=$conf_node${2}
273 fi
274
266 if [ -n "${2}" ]; then 275 if [ -n "${2}" ]; then
267 conf_desc="Linux kernel" 276 conf_desc="Linux kernel"
268 sep=", " 277 sep=", "
@@ -287,12 +296,18 @@ fitimage_emit_section_config() {
287 fi 296 fi
288 297
289 if [ "${6}" = "1" ]; then 298 if [ "${6}" = "1" ]; then
290 default_line="default = \"conf@${3}\";" 299 # default node is selected based on dtb ID if it is present,
300 # otherwise its selected based on kernel ID
301 if [ -n "${3}" ]; then
302 default_line="default = \"conf@${3}\";"
303 else
304 default_line="default = \"conf@${2}\";"
305 fi
291 fi 306 fi
292 307
293 cat << EOF >> ${1} 308 cat << EOF >> ${1}
294 ${default_line} 309 ${default_line}
295 conf@${3} { 310 $conf_node {
296 description = "${6} ${conf_desc}"; 311 description = "${6} ${conf_desc}";
297 ${kernel_line} 312 ${kernel_line}
298 ${fdt_line} 313 ${fdt_line}
@@ -434,6 +449,13 @@ fitimage_assemble() {
434 # 449 #
435 fitimage_emit_section_maint ${1} confstart 450 fitimage_emit_section_maint ${1} confstart
436 451
452 # kernel-fitimage.bbclass currently only supports a single kernel (no less or
453 # more) to be added to the FIT image along with 0 or more device trees and
454 # 0 or 1 ramdisk.
455 # If a device tree is to be part of the FIT image, then select
456 # the default configuration to be used is based on the dtbcount. If there is
457 # no dtb present than select the default configuation to be based on
458 # the kernelcount.
437 if [ -n "${DTBS}" ]; then 459 if [ -n "${DTBS}" ]; then
438 i=1 460 i=1
439 for DTB in ${DTBS}; do 461 for DTB in ${DTBS}; do
@@ -445,6 +467,9 @@ fitimage_assemble() {
445 fi 467 fi
446 i=`expr ${i} + 1` 468 i=`expr ${i} + 1`
447 done 469 done
470 else
471 defaultconfigcount=1
472 fitimage_emit_section_config ${1} "${kernelcount}" "" "${ramdiskcount}" "${setupcount}" "${defaultconfigcount}"
448 fi 473 fi
449 474
450 fitimage_emit_section_maint ${1} sectend 475 fitimage_emit_section_maint ${1} sectend