All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: cip-dev@lists.cip-project.org
Subject: [isar-cip-core][PATCH 4/6] u-boot-bbb: Switch BeagleBone Black to self-built U-Boot
Date: Wed, 31 Aug 2022 09:31:19 +0200	[thread overview]
Message-ID: <9c95ca26dbeb8dc1a8bdf377433e5dd94991d049.1661931081.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1661931081.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

This will allow to boot via UEFI and use EFI Boot Guard and our standard
SWUpdate mode.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 conf/machine/bbb.conf                         |  5 +++-
 recipes-bsp/u-boot/u-boot-bbb_2022.07.bb      | 22 ++++++++++++++++
 ...boot-qemu-common.inc => u-boot-common.inc} | 11 --------
 recipes-bsp/u-boot/u-boot-qemu-common.inc     | 26 +------------------
 wic/bbb.wks                                   |  4 +--
 5 files changed, 29 insertions(+), 39 deletions(-)
 create mode 100644 recipes-bsp/u-boot/u-boot-bbb_2022.07.bb
 copy recipes-bsp/u-boot/{u-boot-qemu-common.inc => u-boot-common.inc} (75%)

diff --git a/conf/machine/bbb.conf b/conf/machine/bbb.conf
index 01206cc..eaec5a3 100644
--- a/conf/machine/bbb.conf
+++ b/conf/machine/bbb.conf
@@ -10,9 +10,12 @@ DISTRO_ARCH = "armhf"
 DTB_FILES = "am335x-boneblack.dtb"
 
 IMAGE_FSTYPES ?= "wic"
-IMAGER_INSTALL += "u-boot-omap"
+IMAGER_INSTALL += "u-boot-bbb"
+IMAGER_BUILD_DEPS += "u-boot-bbb"
 
 IMAGE_INSTALL += "u-boot-script"
 
 USE_CIP_KERNEL_CONFIG = "1"
 KERNEL_DEFCONFIG = "cip-kernel-config/${KERNEL_DEFCONFIG_VERSION}/arm/cip_bbb_defconfig"
+
+PREFERRED_PROVIDER_u-boot-${MACHINE} = "u-boot-bbb"
diff --git a/recipes-bsp/u-boot/u-boot-bbb_2022.07.bb b/recipes-bsp/u-boot/u-boot-bbb_2022.07.bb
new file mode 100644
index 0000000..3be09dc
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-bbb_2022.07.bb
@@ -0,0 +1,22 @@
+#
+# CIP Core, generic profile
+#
+# Copyright (c) Siemens AG, 2022
+#
+# Authors:
+#  Jan Kiszka <jan.kiszka@siemens.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+require u-boot-common.inc
+
+U_BOOT_CONFIG = "am335x_evm_defconfig"
+U_BOOT_BIN = "all"
+
+EFI_ARCH = "arm"
+
+do_prepare_build_append() {
+    echo "MLO u-boot.img /usr/lib/u-boot/${MACHINE}" > \
+        ${S}/debian/u-boot-${MACHINE}.install
+}
diff --git a/recipes-bsp/u-boot/u-boot-qemu-common.inc b/recipes-bsp/u-boot/u-boot-common.inc
similarity index 75%
copy from recipes-bsp/u-boot/u-boot-qemu-common.inc
copy to recipes-bsp/u-boot/u-boot-common.inc
index 2bb9ac0..60f0da3 100644
--- a/recipes-bsp/u-boot/u-boot-qemu-common.inc
+++ b/recipes-bsp/u-boot/u-boot-common.inc
@@ -27,8 +27,6 @@ DEBIAN_BUILD_DEPENDS_append_secureboot = ", \
     openssl, pesign, secure-boot-secrets, python3-openssl:native"
 DEPENDS_append_secureboot = " secure-boot-secrets"
 
-U_BOOT_BIN = "u-boot.bin"
-
 TEMPLATE_FILES_append_secureboot = " secure-boot.cfg.tmpl"
 TEMPLATE_VARS_append_secureboot = " EFI_ARCH"
 
@@ -36,12 +34,3 @@ do_prepare_build_append_secureboot() {
     sed -ni '/### Secure boot config/q;p' ${S}/configs/${U_BOOT_CONFIG}
     cat ${WORKDIR}/secure-boot.cfg >> ${S}/configs/${U_BOOT_CONFIG}
 }
-
-do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
-do_deploy() {
-    dpkg --fsys-tarfile "${WORKDIR}/u-boot-${MACHINE}_${PV}_${DISTRO_ARCH}.deb" | \
-        tar xOf - "./usr/lib/u-boot/${MACHINE}/${U_BOOT_BIN}" \
-        > "${DEPLOY_DIR_IMAGE}/firmware.bin"
-}
-
-addtask deploy after do_dpkg_build before do_deploy_deb
diff --git a/recipes-bsp/u-boot/u-boot-qemu-common.inc b/recipes-bsp/u-boot/u-boot-qemu-common.inc
index 2bb9ac0..0a9a15a 100644
--- a/recipes-bsp/u-boot/u-boot-qemu-common.inc
+++ b/recipes-bsp/u-boot/u-boot-qemu-common.inc
@@ -9,34 +9,10 @@
 # SPDX-License-Identifier: MIT
 #
 
-require recipes-bsp/u-boot/u-boot-custom.inc
-
-SRC_URI += " \
-    https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
-    file://rules.tmpl;subdir=debian"
-SRC_URI[sha256sum] = "92b08eb49c24da14c1adbf70a71ae8f37cc53eeb4230e859ad8b6733d13dcf5e"
-
-SRC_URI_append_secureboot = " \
-    file://secure-boot.cfg.tmpl"
-
-S = "${WORKDIR}/u-boot-${PV}"
-
-DEBIAN_BUILD_DEPENDS += ", libssl-dev:native, libssl-dev:${DISTRO_ARCH}"
-
-DEBIAN_BUILD_DEPENDS_append_secureboot = ", \
-    openssl, pesign, secure-boot-secrets, python3-openssl:native"
-DEPENDS_append_secureboot = " secure-boot-secrets"
+require recipes-bsp/u-boot/u-boot-common.inc
 
 U_BOOT_BIN = "u-boot.bin"
 
-TEMPLATE_FILES_append_secureboot = " secure-boot.cfg.tmpl"
-TEMPLATE_VARS_append_secureboot = " EFI_ARCH"
-
-do_prepare_build_append_secureboot() {
-    sed -ni '/### Secure boot config/q;p' ${S}/configs/${U_BOOT_CONFIG}
-    cat ${WORKDIR}/secure-boot.cfg >> ${S}/configs/${U_BOOT_CONFIG}
-}
-
 do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
 do_deploy() {
     dpkg --fsys-tarfile "${WORKDIR}/u-boot-${MACHINE}_${PV}_${DISTRO_ARCH}.deb" | \
diff --git a/wic/bbb.wks b/wic/bbb.wks
index 2822ce7..6131c78 100644
--- a/wic/bbb.wks
+++ b/wic/bbb.wks
@@ -6,8 +6,8 @@
 # SPDX-License-Identifier: MIT
 #
 
-part --source rawcopy --sourceparams "file=/usr/lib/u-boot/am335x_boneblack/MLO" --no-table --align 128
-part --source rawcopy --sourceparams "file=/usr/lib/u-boot/am335x_boneblack/u-boot.img" --no-table --align 384
+part --source rawcopy --sourceparams "file=/usr/lib/u-boot/bbb/MLO" --no-table --align 128
+part --source rawcopy --sourceparams "file=/usr/lib/u-boot/bbb/u-boot.img" --no-table --align 384
 
 part / --source rootfs-u-boot --ondisk mmcblk0 --fstype ext4 --mkfs-extraopts "-T default" --label platform --align 1024 --active
 
-- 
2.35.3



  parent reply	other threads:[~2022-08-31  7:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31  7:31 [isar-cip-core][PATCH 0/6] Enable SWUpdate support for bbb, update Isar Jan Kiszka
2022-08-31  7:31 ` [isar-cip-core][PATCH 1/6] swupdate: Use cpio from buildchroot Jan Kiszka
2022-08-31  7:31 ` [isar-cip-core][PATCH 2/6] Update Isar revision Jan Kiszka
2022-08-31  7:31 ` [isar-cip-core][PATCH 3/6] linux-cip: Update cip-kernel-config revision Jan Kiszka
2022-08-31  7:31 ` Jan Kiszka [this message]
2022-08-31  7:31 ` [isar-cip-core][PATCH 5/6] swupdate: Drop u-boot-script from EFI Boot Guard images Jan Kiszka
2022-08-31  7:31 ` [isar-cip-core][PATCH 6/6] Enable BeagleBone Black images with A/B SWUpdate support Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9c95ca26dbeb8dc1a8bdf377433e5dd94991d049.1661931081.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=cip-dev@lists.cip-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.