[01/11] board: imx8mn-bsh-smm-s2-pro add boot script

Message ID 20240903152925.917831-1-dario.binacchi@amarulasolutions.com
State New
Headers show
Series
  • [01/11] board: imx8mn-bsh-smm-s2-pro add boot script
Related show

Commit Message

Dario Binacchi Sept. 3, 2024, 3:29 p.m. UTC
From: Michael Trimarchi <michael@amarulasolutions.com>

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
---
 board/bsh/imx8mn-bsh-smm-s2-pro/boot.sh       | 21 ++++++++++++++
 board/bsh/imx8mn-bsh-smm-s2-pro/emmc_boot.lst | 28 +++++++++++++++++++
 board/bsh/imx8mn-bsh-smm-s2-pro/post-build.sh |  1 +
 3 files changed, 50 insertions(+)
 create mode 100755 board/bsh/imx8mn-bsh-smm-s2-pro/boot.sh
 create mode 100644 board/bsh/imx8mn-bsh-smm-s2-pro/emmc_boot.lst

Patch

diff --git a/board/bsh/imx8mn-bsh-smm-s2-pro/boot.sh b/board/bsh/imx8mn-bsh-smm-s2-pro/boot.sh
new file mode 100755
index 000000000000..7aeeed810a72
--- /dev/null
+++ b/board/bsh/imx8mn-bsh-smm-s2-pro/boot.sh
@@ -0,0 +1,21 @@ 
+#!/bin/bash
+
+if [ $# -eq 0 ]; then
+    OUTPUT_DIR=output
+else
+    OUTPUT_DIR=$1
+fi
+
+if ! test -d "${OUTPUT_DIR}" ; then
+    echo "ERROR: no output directory specified."
+    echo "Usage: $0 OUTPUT_DIR"
+    echo ""
+    echo "Arguments:"
+    echo "    OUTPUT_DIR    The Buildroot output directory."
+    exit 1
+fi
+
+IMAGES_DIR=${OUTPUT_DIR}/images
+
+${OUTPUT_DIR}/host/bin/uuu -v -b ${IMAGES_DIR}/emmc_boot.lst \
+  ${IMAGES_DIR}/flash.bin
diff --git a/board/bsh/imx8mn-bsh-smm-s2-pro/emmc_boot.lst b/board/bsh/imx8mn-bsh-smm-s2-pro/emmc_boot.lst
new file mode 100644
index 000000000000..61ca1b753e8e
--- /dev/null
+++ b/board/bsh/imx8mn-bsh-smm-s2-pro/emmc_boot.lst
@@ -0,0 +1,28 @@ 
+uuu_version 1.4.149
+
+# @_flash.bin            | bootloader, which can extract from wic image
+# @_image   [_flash.bin] | wic image burn to emmc.
+
+
+# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
+SDP: boot -f _flash.bin -scanlimited 0x800000
+
+# This command will be run when ROM support stream mode
+# i.MX8QXP, i.MX8QM
+SDPS: boot -scanterm -f _flash.bin -scanlimited 0x800000
+
+# These commands will be run when use SPL and will be skipped if no spl
+# SDPU will be deprecated. please use SDPV instead of SDPU
+# {
+SDPU: delay 1000
+SDPU: write -f _flash.bin -offset 0x57c00
+SDPU: jump -scanlimited 0x800000
+# }
+
+# These commands will be run when use SPL and will be skipped if no spl
+# if (SPL support SDPV)
+# {
+SDPV: delay 1000
+SDPV: write -f _flash.bin -skipspl -scanterm -scanlimited 0x800000
+SDPV: jump -scanlimited 0x800000
+# }
diff --git a/board/bsh/imx8mn-bsh-smm-s2-pro/post-build.sh b/board/bsh/imx8mn-bsh-smm-s2-pro/post-build.sh
index bf8861f6a914..08eb3abc5b8f 100755
--- a/board/bsh/imx8mn-bsh-smm-s2-pro/post-build.sh
+++ b/board/bsh/imx8mn-bsh-smm-s2-pro/post-build.sh
@@ -5,3 +5,4 @@  PARTUUID="$($HOST_DIR/bin/uuidgen)"
 install -d "$TARGET_DIR/boot/extlinux/"
 sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/extlinux.conf" > "$TARGET_DIR/boot/extlinux/extlinux.conf"
 sed "s/%PARTUUID%/$PARTUUID/g" "$BOARD_DIR/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"
+install ${BOARD_DIR}/emmc_boot.lst ${BINARIES_DIR}