Patchwork [meta-fsl-arm-extra,3/3] u-boot-script-boundary: Allow board-specific boot scripts

login
register
mail settings
Submitter Eric Nelson
Date Jan. 25, 2014, 11:12 p.m.
Message ID <1390691541-27298-4-git-send-email-eric.nelson@boundarydevices.com>
Download mbox | patch
Permalink /patch/65841/
State Accepted
Delegated to: Otavio Salvador
Headers show

Comments

Eric Nelson - Jan. 25, 2014, 11:12 p.m.
This update allows board directories to over-ride the boot script
(6x_bootscript-yocto.txt) or upgrade script (6x_upgrade.txt).

This is a bit complicated because the Yocto MACHINE variable
is not the same as the board directory (u-boot/board/boundary/x)
in either the imx6qsabrelite or nitrogen6x-lite case.

The scripts in board/boundary/nitrogen6x/ are used as a default
if a board doesn't override them.

Note that the boot scripts are only partially functional at this
stage, since there are references to named panels which are not
yet supported.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
---
 recipes-bsp/u-boot/u-boot-script-boundary_git.bb | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

Patch

diff --git a/recipes-bsp/u-boot/u-boot-script-boundary_git.bb b/recipes-bsp/u-boot/u-boot-script-boundary_git.bb
index 1a3b4d9..345294e 100644
--- a/recipes-bsp/u-boot/u-boot-script-boundary_git.bb
+++ b/recipes-bsp/u-boot/u-boot-script-boundary_git.bb
@@ -14,16 +14,33 @@  S = "${WORKDIR}/git"
 inherit deploy
 
 do_mkimage () {
-    # workaround the case where MACHINE=imx6qsabrelite
+
+    boarddir=nitrogen6x;
+    if test "${MACHINE}" = "nitrogen6x-lite"; then
+            boarddir=nit6xlite;
+    fi
+
+    # allow deploy to use the ${MACHINE} name to simplify things
     if [ ! -d board/boundary/${MACHINE} ]; then
         mkdir board/boundary/${MACHINE}
     fi
+    bootscript=board/boundary/${boarddir}/6x_bootscript-yocto.txt;
+    if ! [ -f $bootscript ]; then
+        bootscript=board/boundary/${boarddir}/6x_bootscript-yocto.txt;
+    fi
+    echo "bootscript == $bootscript"
+
+    upgradescript=board/boundary/${boarddir}/6x_upgrade.txt;
+    if ! [ -f $upgradescript ]; then
+        upgradescript=board/boundary/nitrogen6x/6x_upgrade.txt;
+    fi
+
     uboot-mkimage  -A arm -O linux -T script -C none -a 0 -e 0 \
-                   -n "boot script" -d board/boundary/nitrogen6x/6x_bootscript-yocto.txt \
+                   -n "boot script" -d $bootscript \
                    board/boundary/${MACHINE}/6x_bootscript
 
     uboot-mkimage  -A arm -O linux -T script -C none -a 0 -e 0 \
-                   -n "upgrade script" -d board/boundary/nitrogen6x/6x_upgrade.txt \
+                   -n "upgrade script" -d $upgradescript \
                    board/boundary/${MACHINE}/6x_upgrade
 }