[v8,19/23] board/ti/am62x-sk: move post-{build,image}.sh to board/ti/common/am6xx

Message ID 20240301133620.3547430-20-dario.binacchi@amarulasolutions.com
State New
Headers show
Series
  • Add support for AM62x-SK HS-FS devices
Related show

Commit Message

Dario Binacchi March 1, 2024, 1:36 p.m. UTC
The patch makes it clear that the moved scripts can be used by the
am6{2,4}x platforms.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Added in v8

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 board/ti/am62x-sk/post-image.sh                   |  5 -----
 board/ti/{am62x-sk => common/am6xx}/post-build.sh |  0
 board/ti/common/am6xx/post-image.sh               | 11 +++++++++++
 configs/ti_am62x_sk_defconfig                     |  4 ++--
 4 files changed, 13 insertions(+), 7 deletions(-)
 delete mode 100755 board/ti/am62x-sk/post-image.sh
 rename board/ti/{am62x-sk => common/am6xx}/post-build.sh (100%)
 create mode 100755 board/ti/common/am6xx/post-image.sh

Patch

diff --git a/board/ti/am62x-sk/post-image.sh b/board/ti/am62x-sk/post-image.sh
deleted file mode 100755
index 34f732c091ad..000000000000
--- a/board/ti/am62x-sk/post-image.sh
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#!/bin/sh -x
-
-BOARD_DIR="$(dirname "$0")"
-
-support/scripts/genimage.sh -c "${BOARD_DIR}/genimage.cfg"
diff --git a/board/ti/am62x-sk/post-build.sh b/board/ti/common/am6xx/post-build.sh
similarity index 100%
rename from board/ti/am62x-sk/post-build.sh
rename to board/ti/common/am6xx/post-build.sh
diff --git a/board/ti/common/am6xx/post-image.sh b/board/ti/common/am6xx/post-image.sh
new file mode 100755
index 000000000000..917ca238aa78
--- /dev/null
+++ b/board/ti/common/am6xx/post-image.sh
@@ -0,0 +1,11 @@ 
+#!/bin/sh -x
+
+board_dir() {
+    if grep -Eq "^BR2_DEFCONFIG=.*/ti_am64x_sk_defconfig\"$" "${BR2_CONFIG}"; then
+        echo "am64x-sk"
+    else
+        echo "am62x-sk"
+    fi
+}
+
+support/scripts/genimage.sh -c "board/ti/$(board_dir)/genimage.cfg"
diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
index bd294bb712ee..310ba6fb6453 100644
--- a/configs/ti_am62x_sk_defconfig
+++ b/configs/ti_am62x_sk_defconfig
@@ -1,7 +1,7 @@ 
 BR2_aarch64=y
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
-BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/am62x-sk/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/am62x-sk/post-image.sh"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/common/am6xx/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/common/am6xx/post-image.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="-c ttyS2,115200n8 -d k3-am625-sk.dtb -l am62x-sk-buildroot -r /dev/mmcblk1p2 -x earlycon=ns16550a,mmio32,0x02800000"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y