All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 5/6] boot/beaglev-secondboot: new package
Date: Sun,  2 May 2021 23:21:40 +0200	[thread overview]
Message-ID: <20210502212141.934384-13-thomas.petazzoni@bootlin.com> (raw)
In-Reply-To: <20210502212141.934384-1-thomas.petazzoni@bootlin.com>

This packages allows to build the first stage bootloader used on the
BeagleV, which is used even before the DDR initialization and
OpenSBI/U-Boot. Yes, "secondboot" is strange for what is the first
stage bootloader, but that's the upstream name.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 DEVELOPERS                                    |  1 +
 boot/Config.in                                |  1 +
 boot/beaglev-secondboot/Config.in             |  9 ++++++
 boot/beaglev-secondboot/beaglev-secondboot.mk | 29 +++++++++++++++++++
 4 files changed, 40 insertions(+)
 create mode 100644 boot/beaglev-secondboot/Config.in
 create mode 100644 boot/beaglev-secondboot/beaglev-secondboot.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 39bc71ea34..1d786b6ffa 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2605,6 +2605,7 @@ F:	arch/Config.in.arm
 F:	board/beaglev/
 F:	board/stmicroelectronics/stm32mp157c-dk2/
 F:	boot/beaglev-ddrinit/
+F:	boot/beaglev-secondboot/
 F:	boot/boot-wrapper-aarch64/
 F:	boot/grub2/
 F:	boot/gummiboot/
diff --git a/boot/Config.in b/boot/Config.in
index f581205c6c..08d9ac06b2 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -7,6 +7,7 @@ source "boot/at91dataflashboot/Config.in"
 source "boot/arm-trusted-firmware/Config.in"
 source "boot/barebox/Config.in"
 source "boot/beaglev-ddrinit/Config.in"
+source "boot/beaglev-secondboot/Config.in"
 source "boot/binaries-marvell/Config.in"
 source "boot/boot-wrapper-aarch64/Config.in"
 source "boot/grub2/Config.in"
diff --git a/boot/beaglev-secondboot/Config.in b/boot/beaglev-secondboot/Config.in
new file mode 100644
index 0000000000..a9695fc138
--- /dev/null
+++ b/boot/beaglev-secondboot/Config.in
@@ -0,0 +1,9 @@
+config BR2_TARGET_BEAGLEV_SECONDBOOT
+	bool "beaglev-secondboot"
+	depends on BR2_riscv
+	depends on BR2_HOSTARCH = "x86_64" # host-riscv64-elf-toolchain
+	help
+	  This package builds the SecondBoot firmware used on the
+	  BeagleV platform.
+
+	  https://github.com/starfive-tech/beagle_secondBoot
diff --git a/boot/beaglev-secondboot/beaglev-secondboot.mk b/boot/beaglev-secondboot/beaglev-secondboot.mk
new file mode 100644
index 0000000000..f3b255fb0c
--- /dev/null
+++ b/boot/beaglev-secondboot/beaglev-secondboot.mk
@@ -0,0 +1,29 @@
+################################################################################
+#
+# beaglev-secondboot
+#
+################################################################################
+
+# HEAD of the starfive branch
+BEAGLEV_SECONDBOOT_VERSION = a4f0b4307f877890f998b3216cffcc9f27a5f993
+BEAGLEV_SECONDBOOT_SITE = $(call github,starfive-tech,beagle_secondBoot,$(BEAGLEV_SECONDBOOT_VERSION))
+BEAGLEV_SECONDBOOT_INSTALL_TARGET = NO
+BEAGLEV_SECONDBOOT_INSTALL_IMAGES = YES
+BEAGLEV_SECONDBOOT_DEPENDENCIES = host-riscv64-elf-toolchain
+# unfortunately, no real license file, but several sources files are
+# under GPL-2.0+, making the whole work GPL-2.0+
+BEAGLEV_SECONDBOOT_LICENSE = GPL-2.0+
+
+define BEAGLEV_SECONDBOOT_BUILD_CMDS
+	$(MAKE) -C $(@D)/build \
+		CROSSCOMPILE=$(HOST_DIR)/bin/riscv64-unknown-elf- \
+		SUFFIX=buildroot \
+		GIT_VERSION=$(BEAGLEV_SECONDBOOT_VERSION)
+endef
+
+define BEAGLEV_SECONDBOOT_INSTALL_IMAGES_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/build/bootloader-BEAGLEV-buildroot.bin.out \
+		$(BINARIES_DIR)/bootloader-BEAGLEV-buildroot.bin.out
+endef
+
+$(eval $(generic-package))
-- 
2.30.2

  parent reply	other threads:[~2021-05-02 21:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02 21:21 [Buildroot] [PATCH v2 0/6] Support for the BeagleV platform Thomas Petazzoni
2021-05-02 21:21 ` [Buildroot] [PATCH v2 1/6] boot/opensbi: add options to enable/disable image installation Thomas Petazzoni
2021-05-03  0:08   ` Alistair Francis
2021-05-03 11:26   ` Bin Meng
2021-05-02 21:21 ` [Buildroot] [PATCH v2 2/6] configs/beaglev_defconfig: new defconfig Thomas Petazzoni
2021-05-03  0:12   ` Alistair Francis
2021-05-03  1:14   ` Alistair Francis
2021-05-02 21:21 ` [Buildroot] [PATCH v2 3/6] package/riscv64-elf-toolchain: new package Thomas Petazzoni
2021-05-02 21:21 ` [Buildroot] [PATCH v2 4/6] boot/beaglev-ddrinit: " Thomas Petazzoni
2021-05-03 11:30   ` Bin Meng
2021-05-03 11:53     ` Thomas Petazzoni
2021-05-02 21:21 ` [Buildroot] [PATCH v2 5/6] boot/beaglev-secondboot: " Thomas Petazzoni
2021-05-03 11:31   ` Bin Meng
2021-05-02 21:21 ` [Buildroot] [PATCH v2 6/6] configs/beaglev: enable building of low-level firmware Thomas Petazzoni
2021-05-03 11:33   ` Bin Meng
2021-05-02 21:21 ` [Buildroot] [PATCH v2 0/6] Support for the BeagleV platform Thomas Petazzoni
2021-05-02 21:21 ` [Buildroot] [PATCH v2 1/6] boot/opensbi: add options to enable/disable image installation Thomas Petazzoni
2021-05-02 21:21 ` [Buildroot] [PATCH v2 2/6] configs/beaglev_defconfig: new defconfig Thomas Petazzoni
2021-05-02 21:21 ` [Buildroot] [PATCH v2 3/6] package/riscv64-elf-toolchain: new package Thomas Petazzoni
2021-05-03  0:14   ` Alistair Francis
2021-05-03  6:54     ` Thomas Petazzoni
2021-05-03  7:11       ` Alistair Francis
2021-05-03  7:13         ` Thomas Petazzoni
2021-05-03  7:29           ` Alistair Francis
2021-05-03  6:17   ` Peter Korsgaard
2021-05-03  6:57     ` Thomas Petazzoni
2021-05-03  7:09       ` Peter Korsgaard
2021-05-02 21:21 ` [Buildroot] [PATCH v2 4/6] boot/beaglev-ddrinit: " Thomas Petazzoni
2021-05-02 21:21 ` Thomas Petazzoni [this message]
2021-05-02 21:21 ` [Buildroot] [PATCH v2 6/6] configs/beaglev: enable building of low-level firmware Thomas Petazzoni
2021-05-03  7:18   ` Drew Fustini
2021-05-03  7:32     ` Thomas Petazzoni

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=20210502212141.934384-13-thomas.petazzoni@bootlin.com \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /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.