[v2,10/11] Add support for the BeaglePlay board

Message ID 749d29c9d45a4c9eb38ff37381e3317d59d29a88.1705239574.git.jan.kiszka@siemens.com
State Accepted, archived
Headers show
Series Add support for BeaglePlay | expand

Commit Message

Jan Kiszka Jan. 14, 2024, 1:39 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

This creates a minimal image for the BeaglePlay board [1], using UEFI as
boot method.

That is requiring some extra work so that the image can also be used on
SD cards: The ROM loader only supports legacy DOS partition tables, but
UEFI needs GPT. We address this by creating a hybrid image with both
partition tables in place using the new hybrid-boot bootloader source
plugin.

[1] https://www.beagleboard.org/boards/beagleplay

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 kas/machine/Kconfig                           |  5 +++++
 kas/machine/beagleplay.yaml                   |  9 +++++++++
 meta-isar/conf/machine/beagleplay.conf        | 20 +++++++++++++++++++
 meta-isar/conf/mc.conf                        |  1 +
 .../conf/multiconfig/beagleplay-bookworm.conf |  7 +++++++
 .../lib/wic/canned-wks/beagleplay.wks.in      | 11 ++++++++++
 6 files changed, 53 insertions(+)
 create mode 100644 kas/machine/beagleplay.yaml
 create mode 100644 meta-isar/conf/machine/beagleplay.conf
 create mode 100644 meta-isar/conf/multiconfig/beagleplay-bookworm.conf
 create mode 100644 meta-isar/scripts/lib/wic/canned-wks/beagleplay.wks.in

Patch

diff --git a/kas/machine/Kconfig b/kas/machine/Kconfig
index d0e3963a..b06cddf1 100644
--- a/kas/machine/Kconfig
+++ b/kas/machine/Kconfig
@@ -14,6 +14,10 @@  config MACHINE_BANANAPI
 	bool "bananapi"
 	depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
 
+config MACHINE_BEAGLEPLAY
+	bool "beagleplay"
+	depends on DEBIAN_BOOKWORM
+
 config MACHINE_CONTAINER_AMD64
 	bool "container-amd64"
 	depends on DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM
@@ -111,6 +115,7 @@  endchoice
 config KAS_INCLUDE_MACHINE
 	string
 	default "kas/machine/bananapi.yaml" if MACHINE_BANANAPI
+	default "kas/machine/beagleplay.yaml" if MACHINE_BEAGLEPLAY
 	default "kas/machine/container-amd64.yaml" if MACHINE_CONTAINER_AMD64
 	default "kas/machine/de0-nano-soc.yaml" if MACHINE_DE0_NANO_SOC
 	default "kas/machine/hikey.yaml" if MACHINE_HIKEY
diff --git a/kas/machine/beagleplay.yaml b/kas/machine/beagleplay.yaml
new file mode 100644
index 00000000..7c4ecfe7
--- /dev/null
+++ b/kas/machine/beagleplay.yaml
@@ -0,0 +1,9 @@ 
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2023-2024
+#
+# SPDX-License-Identifier: MIT
+
+header:
+  version: 14
+
+machine: beagleplay
diff --git a/meta-isar/conf/machine/beagleplay.conf b/meta-isar/conf/machine/beagleplay.conf
new file mode 100644
index 00000000..d030256d
--- /dev/null
+++ b/meta-isar/conf/machine/beagleplay.conf
@@ -0,0 +1,20 @@ 
+#
+# Copyright (c) Siemens AG, 2023-2024
+#
+# SPDX-License-Identifier: MIT
+
+DISTRO_ARCH ?= "arm64"
+
+KERNEL_NAME ?= "mainline"
+
+IMAGE_FSTYPES ?= "wic"
+WKS_FILE ?= "beagleplay.wks.in"
+IMAGER_INSTALL += "${SYSTEMD_BOOTLOADER_INSTALL} u-boot-beagleplay"
+IMAGER_BUILD_DEPS += "u-boot-beagleplay"
+
+IMAGE_BOOT_FILES = " \
+    /usr/lib/u-boot/beagleplay/tiboot3-am62x-gp-evm.bin;tiboot3.bin \
+    /usr/lib/u-boot/beagleplay/tispl.bin_unsigned;tispl.bin \
+    /usr/lib/u-boot/beagleplay/u-boot.img_unsigned;u-boot.img"
+
+IMAGE_PREINSTALL += "firmware-ti-connectivity"
diff --git a/meta-isar/conf/mc.conf b/meta-isar/conf/mc.conf
index d16f54b5..f1fb50c6 100644
--- a/meta-isar/conf/mc.conf
+++ b/meta-isar/conf/mc.conf
@@ -28,6 +28,7 @@  BBMULTICONFIG = " \
     qemuriscv64-sid \
     bananapi-buster \
     bananapi-bullseye \
+    beagleplay-bookworm \
     de0-nano-soc-buster \
     de0-nano-soc-bullseye \
     hikey-bullseye \
diff --git a/meta-isar/conf/multiconfig/beagleplay-bookworm.conf b/meta-isar/conf/multiconfig/beagleplay-bookworm.conf
new file mode 100644
index 00000000..2edd96d6
--- /dev/null
+++ b/meta-isar/conf/multiconfig/beagleplay-bookworm.conf
@@ -0,0 +1,7 @@ 
+#
+# Copyright (c) Siemens AG, 2023-2024
+#
+# SPDX-License-Identifier: MIT
+
+MACHINE ?= "beagleplay"
+DISTRO ?= "debian-bookworm"
diff --git a/meta-isar/scripts/lib/wic/canned-wks/beagleplay.wks.in b/meta-isar/scripts/lib/wic/canned-wks/beagleplay.wks.in
new file mode 100644
index 00000000..930db25c
--- /dev/null
+++ b/meta-isar/scripts/lib/wic/canned-wks/beagleplay.wks.in
@@ -0,0 +1,11 @@ 
+#
+# Copyright (c) Siemens AG, 2023-2024
+#
+# SPDX-License-Identifier: MIT
+
+part /boot/firmware --source bootimg-partition --fstype=vfat --label firmware --active --align 1024 --size 16M --overhead-factor 1 --extra-space 0 --use-uuid --part-type E3C9E316-0B5C-4DB8-817D-F92DF00215AE
+part /boot --source bootimg-efi-isar --sourceparams "loader=systemd-boot" --label efi --part-type EF00 --align 1024 --use-uuid
+
+part / --source rootfs --fstype ext4 --mkfs-extraopts "-T default" --label platform --align 1024 --use-uuid --exclude-path boot/
+
+bootloader --ptable gpt --source hybrid-boot --timeout=0 --append "rootwait rw"