All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform
@ 2021-05-04 20:51 Thomas Petazzoni
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 1/7] package/Makefile.in: expose CONFIG_DIR to post-build/post-image scripts Thomas Petazzoni
                   ` (8 more replies)
  0 siblings, 9 replies; 38+ messages in thread
From: Thomas Petazzoni @ 2021-05-04 20:51 UTC (permalink / raw)
  To: buildroot

Hello,

Here is a third iteration of the BeagleV patch series, which brings a
few fixes:

 * The post-build script of v1 calling "make printvars" was working
   only for in-tree builds. Following a comment from Frank Hunleth on
   the v1, it was changed in v2 to use "make -C ${O} printvars", which
   made out-of-tree builds work, but broke in-tree builds. So in this
   new version, we introduced a preliminary patch that exposes
   $(CONFIG_DIR) to post-build/post-image scripts, to make such "make
   printvars" invocations possible.

 * The beaglev_defconfig is updated to take into account the rename of
   the Git repositories by Starfive for Linux, U-Boot and OpenSBI.

 * Reviewed-by tags from Bin Meng are added on beaglev-ddrinit,
   beaglev-secondboot and the corresponding beaglev_defconfig
   update. Thanks Bin!

As usual, the whole thing is also available at:

  https://github.com/tpetazzoni/buildroot/commits/beaglev

Best regards,

Thomas Petazzoni

Thomas Petazzoni (7):
  package/Makefile.in: expose CONFIG_DIR to post-build/post-image
    scripts
  boot/opensbi: add options to enable/disable image installation
  configs/beaglev_defconfig: new defconfig
  package/riscv64-elf-toolchain: new package
  boot/beaglev-ddrinit: new package
  boot/beaglev-secondboot: new package
  configs/beaglev: enable building of low-level firmware

 DEVELOPERS                                    |   5 +
 board/beaglev/extlinux.conf                   |   4 +
 board/beaglev/genimage.cfg                    |  12 ++
 ...s-starfive-vic7100-adjust-fdt_addr_r.patch |  39 ++++++
 board/beaglev/post-build.sh                   |  17 +++
 board/beaglev/readme.txt                      | 122 ++++++++++++++++++
 boot/Config.in                                |   2 +
 boot/beaglev-ddrinit/Config.in                |   9 ++
 boot/beaglev-ddrinit/beaglev-ddrinit.mk       |  29 +++++
 boot/beaglev-secondboot/Config.in             |   9 ++
 boot/beaglev-secondboot/beaglev-secondboot.mk |  29 +++++
 boot/opensbi/Config.in                        |  20 +++
 boot/opensbi/opensbi.mk                       |  16 ++-
 configs/beaglev_defconfig                     |  37 ++++++
 docs/manual/customize-post-image.txt          |   3 +-
 docs/manual/customize-rootfs.txt              |   3 +
 package/Makefile.in                           |   1 +
 .../riscv64-elf-toolchain.mk                  |  25 ++++
 18 files changed, 375 insertions(+), 7 deletions(-)
 create mode 100644 board/beaglev/extlinux.conf
 create mode 100644 board/beaglev/genimage.cfg
 create mode 100644 board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
 create mode 100755 board/beaglev/post-build.sh
 create mode 100644 board/beaglev/readme.txt
 create mode 100644 boot/beaglev-ddrinit/Config.in
 create mode 100644 boot/beaglev-ddrinit/beaglev-ddrinit.mk
 create mode 100644 boot/beaglev-secondboot/Config.in
 create mode 100644 boot/beaglev-secondboot/beaglev-secondboot.mk
 create mode 100644 configs/beaglev_defconfig
 create mode 100644 package/riscv64-elf-toolchain/riscv64-elf-toolchain.mk

-- 
2.30.2

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 1/7] package/Makefile.in: expose CONFIG_DIR to post-build/post-image scripts
  2021-05-04 20:51 [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Thomas Petazzoni
@ 2021-05-04 20:51 ` Thomas Petazzoni
  2021-05-06 21:03   ` Yann E. MORIN
  2021-05-08 14:32   ` Peter Korsgaard
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 2/7] boot/opensbi: add options to enable/disable image installation Thomas Petazzoni
                   ` (7 subsequent siblings)
  8 siblings, 2 replies; 38+ messages in thread
From: Thomas Petazzoni @ 2021-05-04 20:51 UTC (permalink / raw)
  To: buildroot

Sometimes, post-build or post-image scripts need to reinvoke
Buildroot's make, for example to execute "make printvars".

However, so far none of the variables exposed to post-build/post-image
scripts allowed to do that in a way that worked for both in-tree and
out-of-tree builds. Indeed:

 * "make printvars" would work for in-tree builds, but not out of tree
   builds

 * "make -C ${O} printvars" would work for out-of-tree builds, but not
   in-tree builds

In order to solve this, this commit exposes $(CONFIG_DIR) to
post-build/post-image scripts, through the EXTRA_ENV variable.

The documentation is updated accordingly.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 docs/manual/customize-post-image.txt | 3 ++-
 docs/manual/customize-rootfs.txt     | 3 +++
 package/Makefile.in                  | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/docs/manual/customize-post-image.txt b/docs/manual/customize-post-image.txt
index 90ea2b9328..5308093d06 100644
--- a/docs/manual/customize-post-image.txt
+++ b/docs/manual/customize-post-image.txt
@@ -28,7 +28,8 @@ different sets of arguments to each script.
 
 Again just like for the post-build scripts, the scripts have access to
 the environment variables +BR2_CONFIG+, +HOST_DIR+, +STAGING_DIR+,
-+TARGET_DIR+, +BUILD_DIR+, +BINARIES_DIR+ and +BASE_DIR+.
++TARGET_DIR+, +BUILD_DIR+, +BINARIES_DIR+, +CONFIG_DIR+ and
++BASE_DIR+.
 
 The post-image scripts will be executed as the user that executes
 Buildroot, which should normally _not_ be the root user. Therefore, any
diff --git a/docs/manual/customize-rootfs.txt b/docs/manual/customize-rootfs.txt
index e1dbadda5b..8b361f8621 100644
--- a/docs/manual/customize-rootfs.txt
+++ b/docs/manual/customize-rootfs.txt
@@ -65,6 +65,9 @@ In addition, you may also use these environment variables:
   - +BUILD_DIR+: the directory where packages are extracted and built
   - +BINARIES_DIR+: the place where all binary files (aka images) are
     stored
+  - +CONFIG_DIR+: the directory containing the .config file, and
+    therefore the top-level Buildroot Makefile to use (which is
+    correct for both in-tree and out-of-tree builds)
   - +BASE_DIR+: the base output directory
 
 Below three more methods of customizing the target filesystem are
diff --git a/package/Makefile.in b/package/Makefile.in
index 51f5cbce4f..f4028bc67c 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -318,6 +318,7 @@ EXTRA_ENV = \
 	PATH=$(BR_PATH) \
 	BR2_DL_DIR=$(BR2_DL_DIR) \
 	BUILD_DIR=$(BUILD_DIR) \
+	CONFIG_DIR=$(CONFIG_DIR) \
 	O=$(CANONICAL_O)
 
 ################################################################################
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 2/7] boot/opensbi: add options to enable/disable image installation
  2021-05-04 20:51 [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Thomas Petazzoni
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 1/7] package/Makefile.in: expose CONFIG_DIR to post-build/post-image scripts Thomas Petazzoni
@ 2021-05-04 20:51 ` Thomas Petazzoni
  2021-05-05  1:03   ` Alistair Francis
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 3/7] configs/beaglev_defconfig: new defconfig Thomas Petazzoni
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 38+ messages in thread
From: Thomas Petazzoni @ 2021-05-04 20:51 UTC (permalink / raw)
  To: buildroot

Until now, whenever a BR2_TARGET_OPENSBI_PLAT value was specified,
opensbi.mk was assuming that both fw_jump and fw_dynamic would be
produced. However, this is not the case: the OpenSBI per-platform
config.mk can decide which image to build.

As an example, the config.mk for VIC7100-based BeagleV only enables
producing the fw_payload image.

This commit adds three options to enable the installation of images:
one for fw_jump, one for fw_dynamic, one for fw_payload.

The options for fw_jump and fw_dynamic are "default y" when
BR2_TARGET_OPENSBI_PLAT is not empty, to preserve existing behavior.

The option for fw_payload is forcefully selected when either Linux or
U-Boot are selected as payloads.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 boot/opensbi/Config.in  | 20 ++++++++++++++++++++
 boot/opensbi/opensbi.mk | 16 ++++++++++------
 2 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/boot/opensbi/Config.in b/boot/opensbi/Config.in
index 236bf74a90..55a644506f 100644
--- a/boot/opensbi/Config.in
+++ b/boot/opensbi/Config.in
@@ -74,11 +74,30 @@ config BR2_TARGET_OPENSBI_PLAT
 	  the platform specific static library libplatsbi.a and firmware
 	  examples are built.
 
+config BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG
+	bool "Install fw_dynamic image"
+	default y if BR2_TARGET_OPENSBI_PLAT != ""
+	help
+	  This installs the fw_dynamic image.
+
+config BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG
+	bool "Install fw_jump image"
+	default y if BR2_TARGET_OPENSBI_PLAT != ""
+	help
+	  This installs the fw_jump image.
+
+config BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
+	bool "Install fw_payload image"
+	help
+	  This option enables the installation of the fw_paylaod
+	  image.
+
 config BR2_TARGET_OPENSBI_LINUX_PAYLOAD
 	bool "Include Linux as OpenSBI Payload"
 	depends on BR2_TARGET_OPENSBI_PLAT != ""
 	depends on BR2_LINUX_KERNEL
 	depends on BR2_LINUX_KERNEL_IMAGE
+	select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
 	help
 	  Build OpenSBI with the Linux kernel as a Payload.
 
@@ -86,6 +105,7 @@ config BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
 	bool "Include U-Boot as OpenSBI Payload"
 	depends on BR2_TARGET_OPENSBI_PLAT != ""
 	depends on BR2_TARGET_UBOOT
+	select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
 	help
 	  Build OpenSBI with the U-Boot as a Payload.
 
diff --git a/boot/opensbi/opensbi.mk b/boot/opensbi/opensbi.mk
index 8ebe4566fd..f8cbbb8fcc 100644
--- a/boot/opensbi/opensbi.mk
+++ b/boot/opensbi/opensbi.mk
@@ -50,15 +50,19 @@ define OPENSBI_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
 endef
 
-ifneq ($(OPENSBI_PLAT),)
+ifeq ($(BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG),y)
 OPENSBI_INSTALL_IMAGES = YES
-OPENSBI_FW_IMAGES += jump dynamic
-ifeq ($(BR2_TARGET_OPENSBI_LINUX_PAYLOAD),y)
-OPENSBI_FW_IMAGES += payload
+OPENSBI_FW_IMAGES += dynamic
 endif
-ifeq ($(BR2_TARGET_OPENSBI_UBOOT_PAYLOAD),y)
-OPENSBI_FW_IMAGES = payload
+
+ifeq ($(BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG),y)
+OPENSBI_INSTALL_IMAGES = YES
+OPENSBI_FW_IMAGES += jump
 endif
+
+ifeq ($(BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG),y)
+OPENSBI_INSTALL_IMAGES = YES
+OPENSBI_FW_IMAGES += payload
 endif
 
 define OPENSBI_INSTALL_IMAGES_CMDS
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 3/7] configs/beaglev_defconfig: new defconfig
  2021-05-04 20:51 [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Thomas Petazzoni
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 1/7] package/Makefile.in: expose CONFIG_DIR to post-build/post-image scripts Thomas Petazzoni
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 2/7] boot/opensbi: add options to enable/disable image installation Thomas Petazzoni
@ 2021-05-04 20:51 ` Thomas Petazzoni
  2021-05-05  1:05   ` Alistair Francis
  2021-05-07 22:02   ` Yann E. MORIN
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 4/7] package/riscv64-elf-toolchain: new package Thomas Petazzoni
                   ` (5 subsequent siblings)
  8 siblings, 2 replies; 38+ messages in thread
From: Thomas Petazzoni @ 2021-05-04 20:51 UTC (permalink / raw)
  To: buildroot

This commit introduces support for the RISC-V based BeagleV platform,
which uses a Starfive JH7100.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 DEVELOPERS                                    |  2 +
 board/beaglev/extlinux.conf                   |  4 +
 board/beaglev/genimage.cfg                    | 12 +++
 ...s-starfive-vic7100-adjust-fdt_addr_r.patch | 39 ++++++++
 board/beaglev/post-build.sh                   | 17 ++++
 board/beaglev/readme.txt                      | 88 +++++++++++++++++++
 configs/beaglev_defconfig                     | 35 ++++++++
 7 files changed, 197 insertions(+)
 create mode 100644 board/beaglev/extlinux.conf
 create mode 100644 board/beaglev/genimage.cfg
 create mode 100644 board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
 create mode 100755 board/beaglev/post-build.sh
 create mode 100644 board/beaglev/readme.txt
 create mode 100644 configs/beaglev_defconfig

diff --git a/DEVELOPERS b/DEVELOPERS
index 573d8d84de..cec63a3715 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2602,10 +2602,12 @@ F:	package/xorcurses/
 
 N:	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
 F:	arch/Config.in.arm
+F:	board/beaglev/
 F:	board/stmicroelectronics/stm32mp157c-dk2/
 F:	boot/boot-wrapper-aarch64/
 F:	boot/grub2/
 F:	boot/gummiboot/
+F:	configs/beaglev_defconfig
 F:	configs/stm32mp157c_dk2_defconfig
 F:	package/android-tools/
 F:	package/b43-firmware/
diff --git a/board/beaglev/extlinux.conf b/board/beaglev/extlinux.conf
new file mode 100644
index 0000000000..c5444d094c
--- /dev/null
+++ b/board/beaglev/extlinux.conf
@@ -0,0 +1,4 @@
+label linux
+  kernel /boot/Image
+  devicetree /boot/starfive_vic7100_beagle_v.dtb
+  append console=ttyS0,115200 earlyprintk root=PARTUUID=0fef845a-c6e1-45bc-82f7-002fa720f958 rootwait
diff --git a/board/beaglev/genimage.cfg b/board/beaglev/genimage.cfg
new file mode 100644
index 0000000000..f38bb7f86c
--- /dev/null
+++ b/board/beaglev/genimage.cfg
@@ -0,0 +1,12 @@
+image sdcard.img {
+  hdimage {
+    gpt = true
+  }
+
+  partition rootfs {
+    partition-type-uuid = 72ec70a6-cf74-40e6-bd49-4bda08e8f224
+    partition-uuid = 0fef845a-c6e1-45bc-82f7-002fa720f958
+    bootable = "true"
+    image = "rootfs.ext4"
+  }
+}
diff --git a/board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch b/board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
new file mode 100644
index 0000000000..74d70f2721
--- /dev/null
+++ b/board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
@@ -0,0 +1,39 @@
+From 2c4c813940c577590f3352cef0c49a8def17905d Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+Date: Wed, 28 Apr 2021 22:58:45 +0200
+Subject: [PATCH] include/configs/starfive-vic7100: adjust fdt_addr_r
+
+The default fdt_addr_r of 0x88000000 doesn't work, the kernel never
+boots. Using 0x90000000 works fine.
+
+Since it would overlap with the kernel_comp_addr_r area, this one is
+moved 16 MB further, at 0x91000000.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ include/configs/starfive-vic7100.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/configs/starfive-vic7100.h b/include/configs/starfive-vic7100.h
+index 8c5915a73c..7150a23873 100644
+--- a/include/configs/starfive-vic7100.h
++++ b/include/configs/starfive-vic7100.h
+@@ -111,13 +111,13 @@
+ 	"fdt_high=0xffffffffffffffff\0" \
+ 	"initrd_high=0xffffffffffffffff\0" \
+ 	"kernel_addr_r=0x84000000\0" \
+-	"fdt_addr_r=0x88000000\0" \
++	"fdt_addr_r=0x90000000\0" \
+ 	"scriptaddr=0x88100000\0" \
+ 	"script_offset_f=0x1fff000\0" \
+ 	"script_size_f=0x1000\0" \
+ 	"pxefile_addr_r=0x88200000\0" \
+ 	"ramdisk_addr_r=0x88300000\0" \
+-	"kernel_comp_addr_r=0x90000000\0" \
++	"kernel_comp_addr_r=0x91000000\0" \
+ 	"kernel_comp_size=0x10000000\0" \
+ 	"type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \
+ 	"type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \
+-- 
+2.30.2
+
diff --git a/board/beaglev/post-build.sh b/board/beaglev/post-build.sh
new file mode 100755
index 0000000000..e303d4b8d9
--- /dev/null
+++ b/board/beaglev/post-build.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+BOARD_DIR=$(dirname $0)
+
+# The DTB to use is provided within the U-Boot source tree, so we grab
+# it from there, and install it to TARGET_DIR/boot/.
+UBOOT_DIR=$(make -C ${CONFIG_DIR} --no-print-directory VARS=UBOOT_DIR printvars | cut -f2 -d'=')
+install -D -m0644 ${UBOOT_DIR}/arch/riscv/dts/starfive_vic7100_beagle_v.dtb \
+	${TARGET_DIR}/boot/starfive_vic7100_beagle_v.dtb
+
+# Bring the extlinux.conf file in.
+install -D -m 0644 ${BOARD_DIR}/extlinux.conf \
+	${TARGET_DIR}/boot/extlinux/extlinux.conf
+
+# To be reflashed through Xmodem, the bootloader needs to be prepended
+# with a 4-byte header that contains the total size of the file.
+perl -e 'print pack("l", (stat @ARGV[0])[7])' ${BINARIES_DIR}/fw_payload.bin > ${BINARIES_DIR}/fw_payload.bin.out
+cat ${BINARIES_DIR}/fw_payload.bin >> ${BINARIES_DIR}/fw_payload.bin.out
diff --git a/board/beaglev/readme.txt b/board/beaglev/readme.txt
new file mode 100644
index 0000000000..d8511d3fd1
--- /dev/null
+++ b/board/beaglev/readme.txt
@@ -0,0 +1,88 @@
+BeagleV
+=======
+
+BeagleV is a low-cost RISC-V 64-bit based platform, powered by a
+Starfive JH7100 processor. The current defconfig in Buildroot has been
+tested with the JH7100 chip used on the beta version of the BeagleV
+board.
+
+How to build
+============
+
+$ make beaglev_defconfig
+$ make
+
+Build results
+=============
+
+After building, output/images contains:
+
++ Image
++ fw_payload.bin
++ fw_payload.bin.out
++ fw_payload.elf
++ rootfs.ext2
++ rootfs.ext4
++ sdcard.img
++ u-boot.bin
+
+The two important files are:
+
+ - fw_payload.bin.out, which is the bootloader image, containing
+   both OpenSBI and U-Boot.
+
+ - sdcard.img, the SD card image, which contains the root filesystem,
+   kernel image and Device Tree.
+
+Flashing the SD card image
+==========================
+
+$ sudo dd if=output/images/sdcard.img of=/dev/sdX
+
+Preparing the board
+===================
+
+Connect the Beagle-V fan to the 5V supply (pin 2 or 4 of the GPIO
+connector) and GND (pin 6 of the GPIO connector).
+
+Connect a TTL UART cable to pin 8 (TX), 10 (RX) and 14 (GND).
+
+Insert your SD card.
+
+Power-up the board using an USB-C cable.
+
+Flashing the bootloader
+=======================
+
+The bootloader pre-flashed on the Beagle-V has a non-working
+fdt_addr_r environment variable value, so it won't work
+as-is. Reflashing the bootloader with the bootloader image produced by
+Buildroot is necessary.
+
+When the board starts up, a pre-loader shows a count down of 2
+seconds, interrupt by pressing any key. You should reach a menu like
+this:
+
+--------8<----------
+
+bootloader version:210209-4547a8d
+ddr 0x00000000, 1M test
+ddr 0x00100000, 2M test
+DDR clk 2133M,Version: 210302-5aea32f
+0
+***************************************************
+*************** FLASH PROGRAMMING *****************
+***************************************************
+
+0:update uboot
+1:quit
+select the function:
+
+--------8<----------
+
+Press 0 and Enter. You will now see "C" characters being
+displayed. Ask your serial port communication program to send
+fw_payload.bin.out using the Xmodem protocol.
+
+After reflashing is complete, restart the board, it will automatically
+start the system from the SD card, and reach the login prompt.
diff --git a/configs/beaglev_defconfig b/configs/beaglev_defconfig
new file mode 100644
index 0000000000..e94c4ab639
--- /dev/null
+++ b/configs/beaglev_defconfig
@@ -0,0 +1,35 @@
+BR2_riscv=y
+BR2_riscv_custom=y
+BR2_RISCV_ISA_CUSTOM_RVM=y
+BR2_RISCV_ISA_CUSTOM_RVF=y
+BR2_RISCV_ISA_CUSTOM_RVD=y
+BR2_RISCV_ISA_CUSTOM_RVC=y
+BR2_GLOBAL_PATCH_DIR="board/beaglev/patches/"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/beaglev/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/beaglev/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
+# HEAD of the Fedora branch
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,linux,710cf052d6abda73584481d920b4b6befc7240ea)/linux-710cf052d6abda73584481d920b4b6befc7240ea.tar.gz"
+BR2_LINUX_KERNEL_DEFCONFIG="starfive_vic7100_evb_sd_net"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_OPENSBI=y
+BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
+# HEAD of the Fedora branch
+BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,opensbi,2524b0ecd8684b42bc7a4c69794f40f11cbbe2a5)/opensbi-2524b0ecd8684b42bc7a4c69794f40f11cbbe2a5.tar.gz"
+BR2_TARGET_OPENSBI_PLAT="starfive/vic7100"
+# BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG is not set
+# BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
+BR2_TARGET_OPENSBI_UBOOT_PAYLOAD=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
+# HEAD of the Fedora branch
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,u-boot,3f3ac01a29ad1cd5fa519d86f81daead2447f1d4)/uboot-3f3ac01a29ad1cd5fa519d86f81daead2447f1d4.tar.gz"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="starfive_vic7100_beagle_v_smode"
+BR2_PACKAGE_HOST_GENIMAGE=y
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 4/7] package/riscv64-elf-toolchain: new package
  2021-05-04 20:51 [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 3/7] configs/beaglev_defconfig: new defconfig Thomas Petazzoni
@ 2021-05-04 20:51 ` Thomas Petazzoni
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: " Thomas Petazzoni
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 38+ messages in thread
From: Thomas Petazzoni @ 2021-05-04 20:51 UTC (permalink / raw)
  To: buildroot

This commit adds a new package for a prebuilt bare-metal toolchain for
RISC-V 64-bit. Indeed, some bootloader/firmware for the BeagleV (and
potentially later for other platforms?) do not build with a
Linux-capable toolchain.

This uses a pre-built toolchain from SiFive, precompiled for x86-64,
so all packages using this toolchain must have the appropriate
BR2_HOSTARCH dependency.

This package is modeled after package/arm-gnu-a-toolchain/, which
package a pre-built ARM32 bare-metal toolchain.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 DEVELOPERS                                    |  1 +
 .../riscv64-elf-toolchain.mk                  | 25 +++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 package/riscv64-elf-toolchain/riscv64-elf-toolchain.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index cec63a3715..7ce78742fc 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2651,6 +2651,7 @@ F:	package/python3/
 F:	package/python-mad/
 F:	package/python-serial/
 F:	package/qextserialport/
+F:	package/riscv64-elf-toolchain/
 F:	package/rpcbind/
 F:	package/rt-tests/
 F:	package/rtc-tools/
diff --git a/package/riscv64-elf-toolchain/riscv64-elf-toolchain.mk b/package/riscv64-elf-toolchain/riscv64-elf-toolchain.mk
new file mode 100644
index 0000000000..9b08ee0fec
--- /dev/null
+++ b/package/riscv64-elf-toolchain/riscv64-elf-toolchain.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# riscv64-elf-toolchain
+#
+################################################################################
+
+RISCV64_ELF_TOOLCHAIN_VERSION = 2020.12.8
+RISCV64_ELF_TOOLCHAIN_SITE = https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12
+RISCV64_ELF_TOOLCHAIN_SOURCE = riscv64-unknown-elf-toolchain-10.2.0-$(RISCV64_ELF_TOOLCHAIN_VERSION)-x86_64-linux-centos6.tar.gz
+
+HOST_RISCV64_ELF_TOOLCHAIN_INSTALL_DIR = $(HOST_DIR)/opt/riscv64-elf
+
+define HOST_RISCV64_ELF_TOOLCHAIN_INSTALL_CMDS
+	rm -rf $(HOST_RISCV64_ELF_TOOLCHAIN_INSTALL_DIR)
+	mkdir -p $(HOST_RISCV64_ELF_TOOLCHAIN_INSTALL_DIR)
+	cp -rf $(@D)/* $(HOST_RISCV64_ELF_TOOLCHAIN_INSTALL_DIR)/
+
+	mkdir -p $(HOST_DIR)/bin
+	cd $(HOST_DIR)/bin && \
+	for i in ../opt/riscv64-elf/bin/*; do \
+		ln -sf $$i; \
+	done
+endef
+
+$(eval $(host-generic-package))
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-04 20:51 [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Thomas Petazzoni
                   ` (3 preceding siblings ...)
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 4/7] package/riscv64-elf-toolchain: new package Thomas Petazzoni
@ 2021-05-04 20:51 ` Thomas Petazzoni
  2021-05-07 22:04   ` Yann E. MORIN
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 6/7] boot/beaglev-secondboot: " Thomas Petazzoni
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 38+ messages in thread
From: Thomas Petazzoni @ 2021-05-04 20:51 UTC (permalink / raw)
  To: buildroot

This commit adds a package for the DDR initialization code used on the
BeagleV platform.

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

diff --git a/DEVELOPERS b/DEVELOPERS
index 7ce78742fc..39bc71ea34 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2604,6 +2604,7 @@ N:	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
 F:	arch/Config.in.arm
 F:	board/beaglev/
 F:	board/stmicroelectronics/stm32mp157c-dk2/
+F:	boot/beaglev-ddrinit/
 F:	boot/boot-wrapper-aarch64/
 F:	boot/grub2/
 F:	boot/gummiboot/
diff --git a/boot/Config.in b/boot/Config.in
index b3adbfc8bc..f581205c6c 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -6,6 +6,7 @@ source "boot/at91bootstrap3/Config.in"
 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/binaries-marvell/Config.in"
 source "boot/boot-wrapper-aarch64/Config.in"
 source "boot/grub2/Config.in"
diff --git a/boot/beaglev-ddrinit/Config.in b/boot/beaglev-ddrinit/Config.in
new file mode 100644
index 0000000000..5392f49088
--- /dev/null
+++ b/boot/beaglev-ddrinit/Config.in
@@ -0,0 +1,9 @@
+config BR2_TARGET_BEAGLEV_DDRINIT
+	bool "beaglev-ddrinit"
+	depends on BR2_riscv
+	depends on BR2_HOSTARCH = "x86_64" # host-riscv64-elf-toolchain
+	help
+	  This package builds the DDRinit firmware used on the BeagleV
+	  platform.
+
+	  https://github.com/starfive-tech/beagle_ddrlnit
diff --git a/boot/beaglev-ddrinit/beaglev-ddrinit.mk b/boot/beaglev-ddrinit/beaglev-ddrinit.mk
new file mode 100644
index 0000000000..72e6aea965
--- /dev/null
+++ b/boot/beaglev-ddrinit/beaglev-ddrinit.mk
@@ -0,0 +1,29 @@
+################################################################################
+#
+# beaglev-ddrinit
+#
+################################################################################
+
+# HEAD of the starfive branch
+BEAGLEV_DDRINIT_VERSION = 15b80de81263996affb2a29332aa681925709983
+BEAGLEV_DDRINIT_SITE = $(call github,starfive-tech,beagle_ddrlnit,$(BEAGLEV_DDRINIT_VERSION))
+BEAGLEV_DDRINIT_INSTALL_TARGET = NO
+BEAGLEV_DDRINIT_INSTALL_IMAGES = YES
+BEAGLEV_DDRINIT_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_DDRINIT_LICENSE = GPL-2.0+
+
+define BEAGLEV_DDRINIT_BUILD_CMDS
+	$(MAKE) -C $(@D)/build \
+		CROSSCOMPILE=$(HOST_DIR)/bin/riscv64-unknown-elf- \
+		SUFFIX=buildroot \
+		GIT_VERSION=$(BEAGLEV_DDRINIT_VERSION)
+endef
+
+define BEAGLEV_DDRINIT_INSTALL_IMAGES_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/build/ddrinit-2133-buildroot.bin.out \
+		$(BINARIES_DIR)/ddrinit-2133-buildroot.bin.out
+endef
+
+$(eval $(generic-package))
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 6/7] boot/beaglev-secondboot: new package
  2021-05-04 20:51 [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Thomas Petazzoni
                   ` (4 preceding siblings ...)
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: " Thomas Petazzoni
@ 2021-05-04 20:51 ` Thomas Petazzoni
  2021-05-07 22:07   ` Yann E. MORIN
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 7/7] configs/beaglev: enable building of low-level firmware Thomas Petazzoni
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 38+ messages in thread
From: Thomas Petazzoni @ 2021-05-04 20:51 UTC (permalink / raw)
  To: buildroot

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>
Reviewed-by: Bin Meng <bmeng.cn@gmail.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

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 7/7] configs/beaglev: enable building of low-level firmware
  2021-05-04 20:51 [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Thomas Petazzoni
                   ` (5 preceding siblings ...)
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 6/7] boot/beaglev-secondboot: " Thomas Petazzoni
@ 2021-05-04 20:51 ` Thomas Petazzoni
  2021-05-07 22:08   ` Yann E. MORIN
  2021-05-07 22:00 ` [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Yann E. MORIN
  2021-05-14 21:06 ` Drew Fustini
  8 siblings, 1 reply; 38+ messages in thread
From: Thomas Petazzoni @ 2021-05-04 20:51 UTC (permalink / raw)
  To: buildroot

This commit extends the beaglev_defconfig and its documentation to
build the low-level firmware, and explain how to reflash it.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
 board/beaglev/readme.txt  | 38 ++++++++++++++++++++++++++++++++++++--
 configs/beaglev_defconfig |  2 ++
 2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/board/beaglev/readme.txt b/board/beaglev/readme.txt
index d8511d3fd1..a3adaba3ae 100644
--- a/board/beaglev/readme.txt
+++ b/board/beaglev/readme.txt
@@ -17,6 +17,8 @@ Build results
 
 After building, output/images contains:
 
++ bootloader-BEAGLEV-buildroot.bin.out
++ ddrinit-2133-buildroot.bin.out
 + Image
 + fw_payload.bin
 + fw_payload.bin.out
@@ -26,7 +28,11 @@ After building, output/images contains:
 + sdcard.img
 + u-boot.bin
 
-The two important files are:
+The four important files are:
+
+ - bootloader-BEAGLEV-buildroot.bin.out, the first stage bootloader
+
+ - ddrinit-2133-buildroot.bin.out, the DDR initialization firmware
 
  - fw_payload.bin.out, which is the bootloader image, containing
    both OpenSBI and U-Boot.
@@ -51,7 +57,7 @@ Insert your SD card.
 
 Power-up the board using an USB-C cable.
 
-Flashing the bootloader
+Flashing OpenSBI/U-Boot
 =======================
 
 The bootloader pre-flashed on the Beagle-V has a non-working
@@ -86,3 +92,31 @@ fw_payload.bin.out using the Xmodem protocol.
 
 After reflashing is complete, restart the board, it will automatically
 start the system from the SD card, and reach the login prompt.
+
+Flashing low-level bootloaders
+==============================
+
+The BeagleV comes pre-flashed with functional low-level bootloaders
+(called "secondboot" and "ddrinit"). Re-flashing them is not necessary
+to use this Buildroot defconfig. However, for the sake of
+completeness, Buildroot builds and provides those low-level bootloader
+images.
+
+You can flash them as follows:
+
+ - In the same "pre-loader" menu as the one used above, instead of
+   entering 0 or 1, enter the magic "root at s5t" string. This enters the
+   "expert" features.
+
+ - Then, press 0 and send over X-modem the
+   bootloader-BEAGLEV-buildroot.bin.out file.
+
+ - Then, press 1 and send over X-modem the
+   ddrinit-2133-buildroot.bin.out.
+
+Note that the reflashing mechanism itself relies on those low-level
+bootloaders, so if you flash non-working versions, you'll have to go
+through a recovery process. This requires wiring up to a separate
+debug UART, whose pins are located near the HDMI connector. See
+https://wiki.seeedstudio.com/BeagleV-Update-bootloader-ddr-init-boot-uboot-Recover-bootloader/
+section "Recover the bootloader" for more details.
diff --git a/configs/beaglev_defconfig b/configs/beaglev_defconfig
index e94c4ab639..8943ce9c34 100644
--- a/configs/beaglev_defconfig
+++ b/configs/beaglev_defconfig
@@ -18,6 +18,8 @@ BR2_LINUX_KERNEL_INSTALL_TARGET=y
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_BEAGLEV_DDRINIT=y
+BR2_TARGET_BEAGLEV_SECONDBOOT=y
 BR2_TARGET_OPENSBI=y
 BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
 # HEAD of the Fedora branch
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 2/7] boot/opensbi: add options to enable/disable image installation
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 2/7] boot/opensbi: add options to enable/disable image installation Thomas Petazzoni
@ 2021-05-05  1:03   ` Alistair Francis
  0 siblings, 0 replies; 38+ messages in thread
From: Alistair Francis @ 2021-05-05  1:03 UTC (permalink / raw)
  To: buildroot

On Wed, May 5, 2021 at 6:52 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Until now, whenever a BR2_TARGET_OPENSBI_PLAT value was specified,
> opensbi.mk was assuming that both fw_jump and fw_dynamic would be
> produced. However, this is not the case: the OpenSBI per-platform
> config.mk can decide which image to build.
>
> As an example, the config.mk for VIC7100-based BeagleV only enables
> producing the fw_payload image.
>
> This commit adds three options to enable the installation of images:
> one for fw_jump, one for fw_dynamic, one for fw_payload.
>
> The options for fw_jump and fw_dynamic are "default y" when
> BR2_TARGET_OPENSBI_PLAT is not empty, to preserve existing behavior.
>
> The option for fw_payload is forcefully selected when either Linux or
> U-Boot are selected as payloads.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  boot/opensbi/Config.in  | 20 ++++++++++++++++++++
>  boot/opensbi/opensbi.mk | 16 ++++++++++------
>  2 files changed, 30 insertions(+), 6 deletions(-)
>
> diff --git a/boot/opensbi/Config.in b/boot/opensbi/Config.in
> index 236bf74a90..55a644506f 100644
> --- a/boot/opensbi/Config.in
> +++ b/boot/opensbi/Config.in
> @@ -74,11 +74,30 @@ config BR2_TARGET_OPENSBI_PLAT
>           the platform specific static library libplatsbi.a and firmware
>           examples are built.
>
> +config BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG
> +       bool "Install fw_dynamic image"
> +       default y if BR2_TARGET_OPENSBI_PLAT != ""
> +       help
> +         This installs the fw_dynamic image.
> +
> +config BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG
> +       bool "Install fw_jump image"
> +       default y if BR2_TARGET_OPENSBI_PLAT != ""
> +       help
> +         This installs the fw_jump image.
> +
> +config BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
> +       bool "Install fw_payload image"
> +       help
> +         This option enables the installation of the fw_paylaod
> +         image.
> +
>  config BR2_TARGET_OPENSBI_LINUX_PAYLOAD
>         bool "Include Linux as OpenSBI Payload"
>         depends on BR2_TARGET_OPENSBI_PLAT != ""
>         depends on BR2_LINUX_KERNEL
>         depends on BR2_LINUX_KERNEL_IMAGE
> +       select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
>         help
>           Build OpenSBI with the Linux kernel as a Payload.
>
> @@ -86,6 +105,7 @@ config BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
>         bool "Include U-Boot as OpenSBI Payload"
>         depends on BR2_TARGET_OPENSBI_PLAT != ""
>         depends on BR2_TARGET_UBOOT
> +       select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
>         help
>           Build OpenSBI with the U-Boot as a Payload.
>
> diff --git a/boot/opensbi/opensbi.mk b/boot/opensbi/opensbi.mk
> index 8ebe4566fd..f8cbbb8fcc 100644
> --- a/boot/opensbi/opensbi.mk
> +++ b/boot/opensbi/opensbi.mk
> @@ -50,15 +50,19 @@ define OPENSBI_BUILD_CMDS
>         $(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
>  endef
>
> -ifneq ($(OPENSBI_PLAT),)
> +ifeq ($(BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG),y)
>  OPENSBI_INSTALL_IMAGES = YES
> -OPENSBI_FW_IMAGES += jump dynamic
> -ifeq ($(BR2_TARGET_OPENSBI_LINUX_PAYLOAD),y)
> -OPENSBI_FW_IMAGES += payload
> +OPENSBI_FW_IMAGES += dynamic
>  endif
> -ifeq ($(BR2_TARGET_OPENSBI_UBOOT_PAYLOAD),y)
> -OPENSBI_FW_IMAGES = payload
> +
> +ifeq ($(BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG),y)
> +OPENSBI_INSTALL_IMAGES = YES
> +OPENSBI_FW_IMAGES += jump
>  endif
> +
> +ifeq ($(BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG),y)
> +OPENSBI_INSTALL_IMAGES = YES
> +OPENSBI_FW_IMAGES += payload
>  endif
>
>  define OPENSBI_INSTALL_IMAGES_CMDS
> --
> 2.30.2
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 3/7] configs/beaglev_defconfig: new defconfig
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 3/7] configs/beaglev_defconfig: new defconfig Thomas Petazzoni
@ 2021-05-05  1:05   ` Alistair Francis
  2021-05-07 22:02   ` Yann E. MORIN
  1 sibling, 0 replies; 38+ messages in thread
From: Alistair Francis @ 2021-05-05  1:05 UTC (permalink / raw)
  To: buildroot

On Wed, May 5, 2021 at 6:52 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> This commit introduces support for the RISC-V based BeagleV platform,
> which uses a Starfive JH7100.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  DEVELOPERS                                    |  2 +
>  board/beaglev/extlinux.conf                   |  4 +
>  board/beaglev/genimage.cfg                    | 12 +++
>  ...s-starfive-vic7100-adjust-fdt_addr_r.patch | 39 ++++++++
>  board/beaglev/post-build.sh                   | 17 ++++
>  board/beaglev/readme.txt                      | 88 +++++++++++++++++++
>  configs/beaglev_defconfig                     | 35 ++++++++
>  7 files changed, 197 insertions(+)
>  create mode 100644 board/beaglev/extlinux.conf
>  create mode 100644 board/beaglev/genimage.cfg
>  create mode 100644 board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
>  create mode 100755 board/beaglev/post-build.sh
>  create mode 100644 board/beaglev/readme.txt
>  create mode 100644 configs/beaglev_defconfig
>
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 573d8d84de..cec63a3715 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2602,10 +2602,12 @@ F:      package/xorcurses/
>
>  N:     Thomas Petazzoni <thomas.petazzoni@bootlin.com>
>  F:     arch/Config.in.arm
> +F:     board/beaglev/
>  F:     board/stmicroelectronics/stm32mp157c-dk2/
>  F:     boot/boot-wrapper-aarch64/
>  F:     boot/grub2/
>  F:     boot/gummiboot/
> +F:     configs/beaglev_defconfig
>  F:     configs/stm32mp157c_dk2_defconfig
>  F:     package/android-tools/
>  F:     package/b43-firmware/
> diff --git a/board/beaglev/extlinux.conf b/board/beaglev/extlinux.conf
> new file mode 100644
> index 0000000000..c5444d094c
> --- /dev/null
> +++ b/board/beaglev/extlinux.conf
> @@ -0,0 +1,4 @@
> +label linux
> +  kernel /boot/Image
> +  devicetree /boot/starfive_vic7100_beagle_v.dtb
> +  append console=ttyS0,115200 earlyprintk root=PARTUUID=0fef845a-c6e1-45bc-82f7-002fa720f958 rootwait
> diff --git a/board/beaglev/genimage.cfg b/board/beaglev/genimage.cfg
> new file mode 100644
> index 0000000000..f38bb7f86c
> --- /dev/null
> +++ b/board/beaglev/genimage.cfg
> @@ -0,0 +1,12 @@
> +image sdcard.img {
> +  hdimage {
> +    gpt = true
> +  }
> +
> +  partition rootfs {
> +    partition-type-uuid = 72ec70a6-cf74-40e6-bd49-4bda08e8f224
> +    partition-uuid = 0fef845a-c6e1-45bc-82f7-002fa720f958
> +    bootable = "true"
> +    image = "rootfs.ext4"
> +  }
> +}
> diff --git a/board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch b/board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
> new file mode 100644
> index 0000000000..74d70f2721
> --- /dev/null
> +++ b/board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
> @@ -0,0 +1,39 @@
> +From 2c4c813940c577590f3352cef0c49a8def17905d Mon Sep 17 00:00:00 2001
> +From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> +Date: Wed, 28 Apr 2021 22:58:45 +0200
> +Subject: [PATCH] include/configs/starfive-vic7100: adjust fdt_addr_r
> +
> +The default fdt_addr_r of 0x88000000 doesn't work, the kernel never
> +boots. Using 0x90000000 works fine.
> +
> +Since it would overlap with the kernel_comp_addr_r area, this one is
> +moved 16 MB further, at 0x91000000.
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> +---
> + include/configs/starfive-vic7100.h | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/include/configs/starfive-vic7100.h b/include/configs/starfive-vic7100.h
> +index 8c5915a73c..7150a23873 100644
> +--- a/include/configs/starfive-vic7100.h
> ++++ b/include/configs/starfive-vic7100.h
> +@@ -111,13 +111,13 @@
> +       "fdt_high=0xffffffffffffffff\0" \
> +       "initrd_high=0xffffffffffffffff\0" \
> +       "kernel_addr_r=0x84000000\0" \
> +-      "fdt_addr_r=0x88000000\0" \
> ++      "fdt_addr_r=0x90000000\0" \
> +       "scriptaddr=0x88100000\0" \
> +       "script_offset_f=0x1fff000\0" \
> +       "script_size_f=0x1000\0" \
> +       "pxefile_addr_r=0x88200000\0" \
> +       "ramdisk_addr_r=0x88300000\0" \
> +-      "kernel_comp_addr_r=0x90000000\0" \
> ++      "kernel_comp_addr_r=0x91000000\0" \
> +       "kernel_comp_size=0x10000000\0" \
> +       "type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \
> +       "type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \
> +--
> +2.30.2
> +
> diff --git a/board/beaglev/post-build.sh b/board/beaglev/post-build.sh
> new file mode 100755
> index 0000000000..e303d4b8d9
> --- /dev/null
> +++ b/board/beaglev/post-build.sh
> @@ -0,0 +1,17 @@
> +#!/bin/sh
> +BOARD_DIR=$(dirname $0)
> +
> +# The DTB to use is provided within the U-Boot source tree, so we grab
> +# it from there, and install it to TARGET_DIR/boot/.
> +UBOOT_DIR=$(make -C ${CONFIG_DIR} --no-print-directory VARS=UBOOT_DIR printvars | cut -f2 -d'=')
> +install -D -m0644 ${UBOOT_DIR}/arch/riscv/dts/starfive_vic7100_beagle_v.dtb \
> +       ${TARGET_DIR}/boot/starfive_vic7100_beagle_v.dtb
> +
> +# Bring the extlinux.conf file in.
> +install -D -m 0644 ${BOARD_DIR}/extlinux.conf \
> +       ${TARGET_DIR}/boot/extlinux/extlinux.conf
> +
> +# To be reflashed through Xmodem, the bootloader needs to be prepended
> +# with a 4-byte header that contains the total size of the file.
> +perl -e 'print pack("l", (stat @ARGV[0])[7])' ${BINARIES_DIR}/fw_payload.bin > ${BINARIES_DIR}/fw_payload.bin.out
> +cat ${BINARIES_DIR}/fw_payload.bin >> ${BINARIES_DIR}/fw_payload.bin.out
> diff --git a/board/beaglev/readme.txt b/board/beaglev/readme.txt
> new file mode 100644
> index 0000000000..d8511d3fd1
> --- /dev/null
> +++ b/board/beaglev/readme.txt
> @@ -0,0 +1,88 @@
> +BeagleV
> +=======
> +
> +BeagleV is a low-cost RISC-V 64-bit based platform, powered by a
> +Starfive JH7100 processor. The current defconfig in Buildroot has been
> +tested with the JH7100 chip used on the beta version of the BeagleV
> +board.
> +
> +How to build
> +============
> +
> +$ make beaglev_defconfig
> +$ make
> +
> +Build results
> +=============
> +
> +After building, output/images contains:
> +
> ++ Image
> ++ fw_payload.bin
> ++ fw_payload.bin.out
> ++ fw_payload.elf
> ++ rootfs.ext2
> ++ rootfs.ext4
> ++ sdcard.img
> ++ u-boot.bin
> +
> +The two important files are:
> +
> + - fw_payload.bin.out, which is the bootloader image, containing
> +   both OpenSBI and U-Boot.
> +
> + - sdcard.img, the SD card image, which contains the root filesystem,
> +   kernel image and Device Tree.
> +
> +Flashing the SD card image
> +==========================
> +
> +$ sudo dd if=output/images/sdcard.img of=/dev/sdX
> +
> +Preparing the board
> +===================
> +
> +Connect the Beagle-V fan to the 5V supply (pin 2 or 4 of the GPIO
> +connector) and GND (pin 6 of the GPIO connector).
> +
> +Connect a TTL UART cable to pin 8 (TX), 10 (RX) and 14 (GND).
> +
> +Insert your SD card.
> +
> +Power-up the board using an USB-C cable.
> +
> +Flashing the bootloader
> +=======================
> +
> +The bootloader pre-flashed on the Beagle-V has a non-working
> +fdt_addr_r environment variable value, so it won't work
> +as-is. Reflashing the bootloader with the bootloader image produced by
> +Buildroot is necessary.
> +
> +When the board starts up, a pre-loader shows a count down of 2
> +seconds, interrupt by pressing any key. You should reach a menu like
> +this:
> +
> +--------8<----------
> +
> +bootloader version:210209-4547a8d
> +ddr 0x00000000, 1M test
> +ddr 0x00100000, 2M test
> +DDR clk 2133M,Version: 210302-5aea32f
> +0
> +***************************************************
> +*************** FLASH PROGRAMMING *****************
> +***************************************************
> +
> +0:update uboot
> +1:quit
> +select the function:
> +
> +--------8<----------
> +
> +Press 0 and Enter. You will now see "C" characters being
> +displayed. Ask your serial port communication program to send
> +fw_payload.bin.out using the Xmodem protocol.
> +
> +After reflashing is complete, restart the board, it will automatically
> +start the system from the SD card, and reach the login prompt.
> diff --git a/configs/beaglev_defconfig b/configs/beaglev_defconfig
> new file mode 100644
> index 0000000000..e94c4ab639
> --- /dev/null
> +++ b/configs/beaglev_defconfig
> @@ -0,0 +1,35 @@
> +BR2_riscv=y
> +BR2_riscv_custom=y
> +BR2_RISCV_ISA_CUSTOM_RVM=y
> +BR2_RISCV_ISA_CUSTOM_RVF=y
> +BR2_RISCV_ISA_CUSTOM_RVD=y
> +BR2_RISCV_ISA_CUSTOM_RVC=y
> +BR2_GLOBAL_PATCH_DIR="board/beaglev/patches/"
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
> +BR2_ROOTFS_POST_BUILD_SCRIPT="board/beaglev/post-build.sh"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
> +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/beaglev/genimage.cfg"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
> +# HEAD of the Fedora branch
> +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,linux,710cf052d6abda73584481d920b4b6befc7240ea)/linux-710cf052d6abda73584481d920b4b6befc7240ea.tar.gz"
> +BR2_LINUX_KERNEL_DEFCONFIG="starfive_vic7100_evb_sd_net"
> +BR2_LINUX_KERNEL_INSTALL_TARGET=y
> +BR2_TARGET_ROOTFS_EXT2=y
> +BR2_TARGET_ROOTFS_EXT2_4=y
> +# BR2_TARGET_ROOTFS_TAR is not set
> +BR2_TARGET_OPENSBI=y
> +BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
> +# HEAD of the Fedora branch
> +BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,opensbi,2524b0ecd8684b42bc7a4c69794f40f11cbbe2a5)/opensbi-2524b0ecd8684b42bc7a4c69794f40f11cbbe2a5.tar.gz"
> +BR2_TARGET_OPENSBI_PLAT="starfive/vic7100"
> +# BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG is not set
> +# BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
> +BR2_TARGET_OPENSBI_UBOOT_PAYLOAD=y
> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
> +# HEAD of the Fedora branch
> +BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,starfive-tech,u-boot,3f3ac01a29ad1cd5fa519d86f81daead2447f1d4)/uboot-3f3ac01a29ad1cd5fa519d86f81daead2447f1d4.tar.gz"
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="starfive_vic7100_beagle_v_smode"
> +BR2_PACKAGE_HOST_GENIMAGE=y
> --
> 2.30.2
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 1/7] package/Makefile.in: expose CONFIG_DIR to post-build/post-image scripts
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 1/7] package/Makefile.in: expose CONFIG_DIR to post-build/post-image scripts Thomas Petazzoni
@ 2021-05-06 21:03   ` Yann E. MORIN
  2021-05-08 14:32   ` Peter Korsgaard
  1 sibling, 0 replies; 38+ messages in thread
From: Yann E. MORIN @ 2021-05-06 21:03 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> Sometimes, post-build or post-image scripts need to reinvoke
> Buildroot's make, for example to execute "make printvars".
> 
> However, so far none of the variables exposed to post-build/post-image
> scripts allowed to do that in a way that worked for both in-tree and
> out-of-tree builds. Indeed:

As we discussed on IRC, there is in fact one possibility to do that:

    make -C ${BR2_CONFIG%/*} printvars

Indeed, BR2_CONFIG points to the full path of the .config file, so by
removing the last path component of BR2_CONFIG, we end up with the
directory that is CONFIG_DIR.

However, it is not ver convenient to extract info from Br2_CONFIG, so
exposing CONFIG_DIR is a godd adition.

Applied to master, after referencing BR2_CONFIG, thanks.

Regards,
Yann E. MORIN.

>  * "make printvars" would work for in-tree builds, but not out of tree
>    builds
> 
>  * "make -C ${O} printvars" would work for out-of-tree builds, but not
>    in-tree builds
> 
> In order to solve this, this commit exposes $(CONFIG_DIR) to
> post-build/post-image scripts, through the EXTRA_ENV variable.
> 
> The documentation is updated accordingly.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  docs/manual/customize-post-image.txt | 3 ++-
>  docs/manual/customize-rootfs.txt     | 3 +++
>  package/Makefile.in                  | 1 +
>  3 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/docs/manual/customize-post-image.txt b/docs/manual/customize-post-image.txt
> index 90ea2b9328..5308093d06 100644
> --- a/docs/manual/customize-post-image.txt
> +++ b/docs/manual/customize-post-image.txt
> @@ -28,7 +28,8 @@ different sets of arguments to each script.
>  
>  Again just like for the post-build scripts, the scripts have access to
>  the environment variables +BR2_CONFIG+, +HOST_DIR+, +STAGING_DIR+,
> -+TARGET_DIR+, +BUILD_DIR+, +BINARIES_DIR+ and +BASE_DIR+.
> ++TARGET_DIR+, +BUILD_DIR+, +BINARIES_DIR+, +CONFIG_DIR+ and
> ++BASE_DIR+.
>  
>  The post-image scripts will be executed as the user that executes
>  Buildroot, which should normally _not_ be the root user. Therefore, any
> diff --git a/docs/manual/customize-rootfs.txt b/docs/manual/customize-rootfs.txt
> index e1dbadda5b..8b361f8621 100644
> --- a/docs/manual/customize-rootfs.txt
> +++ b/docs/manual/customize-rootfs.txt
> @@ -65,6 +65,9 @@ In addition, you may also use these environment variables:
>    - +BUILD_DIR+: the directory where packages are extracted and built
>    - +BINARIES_DIR+: the place where all binary files (aka images) are
>      stored
> +  - +CONFIG_DIR+: the directory containing the .config file, and
> +    therefore the top-level Buildroot Makefile to use (which is
> +    correct for both in-tree and out-of-tree builds)
>    - +BASE_DIR+: the base output directory
>  
>  Below three more methods of customizing the target filesystem are
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 51f5cbce4f..f4028bc67c 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -318,6 +318,7 @@ EXTRA_ENV = \
>  	PATH=$(BR_PATH) \
>  	BR2_DL_DIR=$(BR2_DL_DIR) \
>  	BUILD_DIR=$(BUILD_DIR) \
> +	CONFIG_DIR=$(CONFIG_DIR) \
>  	O=$(CANONICAL_O)
>  
>  ################################################################################
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform
  2021-05-04 20:51 [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Thomas Petazzoni
                   ` (6 preceding siblings ...)
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 7/7] configs/beaglev: enable building of low-level firmware Thomas Petazzoni
@ 2021-05-07 22:00 ` Yann E. MORIN
  2021-05-14 21:06 ` Drew Fustini
  8 siblings, 0 replies; 38+ messages in thread
From: Yann E. MORIN @ 2021-05-07 22:00 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> Hello,
> 
> Here is a third iteration of the BeagleV patch series, which brings a
> few fixes:
> 
>  * The post-build script of v1 calling "make printvars" was working
>    only for in-tree builds. Following a comment from Frank Hunleth on
>    the v1, it was changed in v2 to use "make -C ${O} printvars", which
>    made out-of-tree builds work, but broke in-tree builds. So in this
>    new version, we introduced a preliminary patch that exposes
>    $(CONFIG_DIR) to post-build/post-image scripts, to make such "make
>    printvars" invocations possible.
> 
>  * The beaglev_defconfig is updated to take into account the rename of
>    the Git repositories by Starfive for Linux, U-Boot and OpenSBI.
> 
>  * Reviewed-by tags from Bin Meng are added on beaglev-ddrinit,
>    beaglev-secondboot and the corresponding beaglev_defconfig
>    update. Thanks Bin!

Series applied to master, thanks.

I'll reply to each individual patches where I did some changes.

Regards,
Yann E. MORIN.

> As usual, the whole thing is also available at:
> 
>   https://github.com/tpetazzoni/buildroot/commits/beaglev
> 
> Best regards,
> 
> Thomas Petazzoni
> 
> Thomas Petazzoni (7):
>   package/Makefile.in: expose CONFIG_DIR to post-build/post-image
>     scripts
>   boot/opensbi: add options to enable/disable image installation
>   configs/beaglev_defconfig: new defconfig
>   package/riscv64-elf-toolchain: new package
>   boot/beaglev-ddrinit: new package
>   boot/beaglev-secondboot: new package
>   configs/beaglev: enable building of low-level firmware
> 
>  DEVELOPERS                                    |   5 +
>  board/beaglev/extlinux.conf                   |   4 +
>  board/beaglev/genimage.cfg                    |  12 ++
>  ...s-starfive-vic7100-adjust-fdt_addr_r.patch |  39 ++++++
>  board/beaglev/post-build.sh                   |  17 +++
>  board/beaglev/readme.txt                      | 122 ++++++++++++++++++
>  boot/Config.in                                |   2 +
>  boot/beaglev-ddrinit/Config.in                |   9 ++
>  boot/beaglev-ddrinit/beaglev-ddrinit.mk       |  29 +++++
>  boot/beaglev-secondboot/Config.in             |   9 ++
>  boot/beaglev-secondboot/beaglev-secondboot.mk |  29 +++++
>  boot/opensbi/Config.in                        |  20 +++
>  boot/opensbi/opensbi.mk                       |  16 ++-
>  configs/beaglev_defconfig                     |  37 ++++++
>  docs/manual/customize-post-image.txt          |   3 +-
>  docs/manual/customize-rootfs.txt              |   3 +
>  package/Makefile.in                           |   1 +
>  .../riscv64-elf-toolchain.mk                  |  25 ++++
>  18 files changed, 375 insertions(+), 7 deletions(-)
>  create mode 100644 board/beaglev/extlinux.conf
>  create mode 100644 board/beaglev/genimage.cfg
>  create mode 100644 board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
>  create mode 100755 board/beaglev/post-build.sh
>  create mode 100644 board/beaglev/readme.txt
>  create mode 100644 boot/beaglev-ddrinit/Config.in
>  create mode 100644 boot/beaglev-ddrinit/beaglev-ddrinit.mk
>  create mode 100644 boot/beaglev-secondboot/Config.in
>  create mode 100644 boot/beaglev-secondboot/beaglev-secondboot.mk
>  create mode 100644 configs/beaglev_defconfig
>  create mode 100644 package/riscv64-elf-toolchain/riscv64-elf-toolchain.mk
> 
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 3/7] configs/beaglev_defconfig: new defconfig
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 3/7] configs/beaglev_defconfig: new defconfig Thomas Petazzoni
  2021-05-05  1:05   ` Alistair Francis
@ 2021-05-07 22:02   ` Yann E. MORIN
  2021-05-08 18:23     ` Thomas Petazzoni
  1 sibling, 1 reply; 38+ messages in thread
From: Yann E. MORIN @ 2021-05-07 22:02 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> This commit introduces support for the RISC-V based BeagleV platform,
> which uses a Starfive JH7100.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
[--SNIP--]
> diff --git a/board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch b/board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
> new file mode 100644
> index 0000000000..74d70f2721
> --- /dev/null
> +++ b/board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
> @@ -0,0 +1,39 @@
> +From 2c4c813940c577590f3352cef0c49a8def17905d Mon Sep 17 00:00:00 2001
> +From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> +Date: Wed, 28 Apr 2021 22:58:45 +0200
> +Subject: [PATCH] include/configs/starfive-vic7100: adjust fdt_addr_r
> +
> +The default fdt_addr_r of 0x88000000 doesn't work, the kernel never
> +boots. Using 0x90000000 works fine.
> +
> +Since it would overlap with the kernel_comp_addr_r area, this one is
> +moved 16 MB further, at 0x91000000.

Is this something that is so board specific that we can't upstream it?

[--SNIP--]
> diff --git a/board/beaglev/post-build.sh b/board/beaglev/post-build.sh
> new file mode 100755
> index 0000000000..e303d4b8d9
> --- /dev/null
> +++ b/board/beaglev/post-build.sh
> @@ -0,0 +1,17 @@
> +#!/bin/sh
> +BOARD_DIR=$(dirname $0)
> +
> +# The DTB to use is provided within the U-Boot source tree, so we grab
> +# it from there, and install it to TARGET_DIR/boot/.
> +UBOOT_DIR=$(make -C ${CONFIG_DIR} --no-print-directory VARS=UBOOT_DIR printvars | cut -f2 -d'=')

Here, I've used eval, as suggested in the manual:

    eval $(make -C ${CONFIG_DIR} --no-print-directory QUOTED_VARS=YES VARS=UBOOT_DIR printvars)

Applied to master, thanks.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: " Thomas Petazzoni
@ 2021-05-07 22:04   ` Yann E. MORIN
  2021-05-07 22:06     ` Yann E. MORIN
                       ` (3 more replies)
  0 siblings, 4 replies; 38+ messages in thread
From: Yann E. MORIN @ 2021-05-07 22:04 UTC (permalink / raw)
  To: buildroot

On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> This commit adds a package for the DDR initialization code used on the
> BeagleV platform.

The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
of an 'i'. I've renamed the package to match upstream name, so that
users that look for it can actually find it.

Applied to master, thanks.

Regards,
Yann E. MORIN.

> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>  DEVELOPERS                              |  1 +
>  boot/Config.in                          |  1 +
>  boot/beaglev-ddrinit/Config.in          |  9 ++++++++
>  boot/beaglev-ddrinit/beaglev-ddrinit.mk | 29 +++++++++++++++++++++++++
>  4 files changed, 40 insertions(+)
>  create mode 100644 boot/beaglev-ddrinit/Config.in
>  create mode 100644 boot/beaglev-ddrinit/beaglev-ddrinit.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 7ce78742fc..39bc71ea34 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2604,6 +2604,7 @@ N:	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
>  F:	arch/Config.in.arm
>  F:	board/beaglev/
>  F:	board/stmicroelectronics/stm32mp157c-dk2/
> +F:	boot/beaglev-ddrinit/
>  F:	boot/boot-wrapper-aarch64/
>  F:	boot/grub2/
>  F:	boot/gummiboot/
> diff --git a/boot/Config.in b/boot/Config.in
> index b3adbfc8bc..f581205c6c 100644
> --- a/boot/Config.in
> +++ b/boot/Config.in
> @@ -6,6 +6,7 @@ source "boot/at91bootstrap3/Config.in"
>  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/binaries-marvell/Config.in"
>  source "boot/boot-wrapper-aarch64/Config.in"
>  source "boot/grub2/Config.in"
> diff --git a/boot/beaglev-ddrinit/Config.in b/boot/beaglev-ddrinit/Config.in
> new file mode 100644
> index 0000000000..5392f49088
> --- /dev/null
> +++ b/boot/beaglev-ddrinit/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_TARGET_BEAGLEV_DDRINIT
> +	bool "beaglev-ddrinit"
> +	depends on BR2_riscv
> +	depends on BR2_HOSTARCH = "x86_64" # host-riscv64-elf-toolchain
> +	help
> +	  This package builds the DDRinit firmware used on the BeagleV
> +	  platform.
> +
> +	  https://github.com/starfive-tech/beagle_ddrlnit
> diff --git a/boot/beaglev-ddrinit/beaglev-ddrinit.mk b/boot/beaglev-ddrinit/beaglev-ddrinit.mk
> new file mode 100644
> index 0000000000..72e6aea965
> --- /dev/null
> +++ b/boot/beaglev-ddrinit/beaglev-ddrinit.mk
> @@ -0,0 +1,29 @@
> +################################################################################
> +#
> +# beaglev-ddrinit
> +#
> +################################################################################
> +
> +# HEAD of the starfive branch
> +BEAGLEV_DDRINIT_VERSION = 15b80de81263996affb2a29332aa681925709983
> +BEAGLEV_DDRINIT_SITE = $(call github,starfive-tech,beagle_ddrlnit,$(BEAGLEV_DDRINIT_VERSION))
> +BEAGLEV_DDRINIT_INSTALL_TARGET = NO
> +BEAGLEV_DDRINIT_INSTALL_IMAGES = YES
> +BEAGLEV_DDRINIT_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_DDRINIT_LICENSE = GPL-2.0+
> +
> +define BEAGLEV_DDRINIT_BUILD_CMDS
> +	$(MAKE) -C $(@D)/build \
> +		CROSSCOMPILE=$(HOST_DIR)/bin/riscv64-unknown-elf- \
> +		SUFFIX=buildroot \
> +		GIT_VERSION=$(BEAGLEV_DDRINIT_VERSION)
> +endef
> +
> +define BEAGLEV_DDRINIT_INSTALL_IMAGES_CMDS
> +	$(INSTALL) -D -m 0644 $(@D)/build/ddrinit-2133-buildroot.bin.out \
> +		$(BINARIES_DIR)/ddrinit-2133-buildroot.bin.out
> +endef
> +
> +$(eval $(generic-package))
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-07 22:04   ` Yann E. MORIN
@ 2021-05-07 22:06     ` Yann E. MORIN
  2021-05-07 23:30     ` Drew Fustini
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 38+ messages in thread
From: Yann E. MORIN @ 2021-05-07 22:06 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2021-05-08 00:04 +0200, Yann E. MORIN spake thusly:
> On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> > This commit adds a package for the DDR initialization code used on the
> > BeagleV platform.
> 
> The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> of an 'i'. I've renamed the package to match upstream name, so that
> users that look for it can actually find it.

I've also added a hash file.

Also, the comment was stating "HEAD of the starfive branch", but it was
HEAD only at the time you wrote it. It already is no longer HEAD.

So I changed the comment, but kept the hash as-is, since that what you
tested. Feel free to send a bump if it makes sense.

> Applied to master, thanks.
> 
> Regards,
> Yann E. MORIN.
> 
> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> > Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> > ---
> >  DEVELOPERS                              |  1 +
> >  boot/Config.in                          |  1 +
> >  boot/beaglev-ddrinit/Config.in          |  9 ++++++++
> >  boot/beaglev-ddrinit/beaglev-ddrinit.mk | 29 +++++++++++++++++++++++++
> >  4 files changed, 40 insertions(+)
> >  create mode 100644 boot/beaglev-ddrinit/Config.in
> >  create mode 100644 boot/beaglev-ddrinit/beaglev-ddrinit.mk
> > 
> > diff --git a/DEVELOPERS b/DEVELOPERS
> > index 7ce78742fc..39bc71ea34 100644
> > --- a/DEVELOPERS
> > +++ b/DEVELOPERS
> > @@ -2604,6 +2604,7 @@ N:	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> >  F:	arch/Config.in.arm
> >  F:	board/beaglev/
> >  F:	board/stmicroelectronics/stm32mp157c-dk2/
> > +F:	boot/beaglev-ddrinit/
> >  F:	boot/boot-wrapper-aarch64/
> >  F:	boot/grub2/
> >  F:	boot/gummiboot/
> > diff --git a/boot/Config.in b/boot/Config.in
> > index b3adbfc8bc..f581205c6c 100644
> > --- a/boot/Config.in
> > +++ b/boot/Config.in
> > @@ -6,6 +6,7 @@ source "boot/at91bootstrap3/Config.in"
> >  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/binaries-marvell/Config.in"
> >  source "boot/boot-wrapper-aarch64/Config.in"
> >  source "boot/grub2/Config.in"
> > diff --git a/boot/beaglev-ddrinit/Config.in b/boot/beaglev-ddrinit/Config.in
> > new file mode 100644
> > index 0000000000..5392f49088
> > --- /dev/null
> > +++ b/boot/beaglev-ddrinit/Config.in
> > @@ -0,0 +1,9 @@
> > +config BR2_TARGET_BEAGLEV_DDRINIT
> > +	bool "beaglev-ddrinit"
> > +	depends on BR2_riscv
> > +	depends on BR2_HOSTARCH = "x86_64" # host-riscv64-elf-toolchain
> > +	help
> > +	  This package builds the DDRinit firmware used on the BeagleV
> > +	  platform.
> > +
> > +	  https://github.com/starfive-tech/beagle_ddrlnit
> > diff --git a/boot/beaglev-ddrinit/beaglev-ddrinit.mk b/boot/beaglev-ddrinit/beaglev-ddrinit.mk
> > new file mode 100644
> > index 0000000000..72e6aea965
> > --- /dev/null
> > +++ b/boot/beaglev-ddrinit/beaglev-ddrinit.mk
> > @@ -0,0 +1,29 @@
> > +################################################################################
> > +#
> > +# beaglev-ddrinit
> > +#
> > +################################################################################
> > +
> > +# HEAD of the starfive branch
> > +BEAGLEV_DDRINIT_VERSION = 15b80de81263996affb2a29332aa681925709983
> > +BEAGLEV_DDRINIT_SITE = $(call github,starfive-tech,beagle_ddrlnit,$(BEAGLEV_DDRINIT_VERSION))
> > +BEAGLEV_DDRINIT_INSTALL_TARGET = NO
> > +BEAGLEV_DDRINIT_INSTALL_IMAGES = YES
> > +BEAGLEV_DDRINIT_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_DDRINIT_LICENSE = GPL-2.0+
> > +
> > +define BEAGLEV_DDRINIT_BUILD_CMDS
> > +	$(MAKE) -C $(@D)/build \
> > +		CROSSCOMPILE=$(HOST_DIR)/bin/riscv64-unknown-elf- \
> > +		SUFFIX=buildroot \
> > +		GIT_VERSION=$(BEAGLEV_DDRINIT_VERSION)
> > +endef
> > +
> > +define BEAGLEV_DDRINIT_INSTALL_IMAGES_CMDS
> > +	$(INSTALL) -D -m 0644 $(@D)/build/ddrinit-2133-buildroot.bin.out \
> > +		$(BINARIES_DIR)/ddrinit-2133-buildroot.bin.out
> > +endef
> > +
> > +$(eval $(generic-package))
> > -- 
> > 2.30.2
> > 
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
> 
> -- 
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 6/7] boot/beaglev-secondboot: new package
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 6/7] boot/beaglev-secondboot: " Thomas Petazzoni
@ 2021-05-07 22:07   ` Yann E. MORIN
  0 siblings, 0 replies; 38+ messages in thread
From: Yann E. MORIN @ 2021-05-07 22:07 UTC (permalink / raw)
  To: buildroot

On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> 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.

I've added a hash file.

I also changed the comment to not mention 'HEAD' since this will no
longer be the case when upstream pushes a new commit.

Applied to master, thanks.

Regards,
Yann E. MORIN.

> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.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
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 7/7] configs/beaglev: enable building of low-level firmware
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 7/7] configs/beaglev: enable building of low-level firmware Thomas Petazzoni
@ 2021-05-07 22:08   ` Yann E. MORIN
  0 siblings, 0 replies; 38+ messages in thread
From: Yann E. MORIN @ 2021-05-07 22:08 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> This commit extends the beaglev_defconfig and its documentation to
> build the low-level firmware, and explain how to reflash it.

I just had to adapt thedefconfig to use the real beagle_ddrlnit package
name, since I renamed it.

Applied to master, thanks.

Regards,
Yann E. MORIN.

> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>  board/beaglev/readme.txt  | 38 ++++++++++++++++++++++++++++++++++++--
>  configs/beaglev_defconfig |  2 ++
>  2 files changed, 38 insertions(+), 2 deletions(-)
> 
> diff --git a/board/beaglev/readme.txt b/board/beaglev/readme.txt
> index d8511d3fd1..a3adaba3ae 100644
> --- a/board/beaglev/readme.txt
> +++ b/board/beaglev/readme.txt
> @@ -17,6 +17,8 @@ Build results
>  
>  After building, output/images contains:
>  
> ++ bootloader-BEAGLEV-buildroot.bin.out
> ++ ddrinit-2133-buildroot.bin.out
>  + Image
>  + fw_payload.bin
>  + fw_payload.bin.out
> @@ -26,7 +28,11 @@ After building, output/images contains:
>  + sdcard.img
>  + u-boot.bin
>  
> -The two important files are:
> +The four important files are:
> +
> + - bootloader-BEAGLEV-buildroot.bin.out, the first stage bootloader
> +
> + - ddrinit-2133-buildroot.bin.out, the DDR initialization firmware
>  
>   - fw_payload.bin.out, which is the bootloader image, containing
>     both OpenSBI and U-Boot.
> @@ -51,7 +57,7 @@ Insert your SD card.
>  
>  Power-up the board using an USB-C cable.
>  
> -Flashing the bootloader
> +Flashing OpenSBI/U-Boot
>  =======================
>  
>  The bootloader pre-flashed on the Beagle-V has a non-working
> @@ -86,3 +92,31 @@ fw_payload.bin.out using the Xmodem protocol.
>  
>  After reflashing is complete, restart the board, it will automatically
>  start the system from the SD card, and reach the login prompt.
> +
> +Flashing low-level bootloaders
> +==============================
> +
> +The BeagleV comes pre-flashed with functional low-level bootloaders
> +(called "secondboot" and "ddrinit"). Re-flashing them is not necessary
> +to use this Buildroot defconfig. However, for the sake of
> +completeness, Buildroot builds and provides those low-level bootloader
> +images.
> +
> +You can flash them as follows:
> +
> + - In the same "pre-loader" menu as the one used above, instead of
> +   entering 0 or 1, enter the magic "root at s5t" string. This enters the
> +   "expert" features.
> +
> + - Then, press 0 and send over X-modem the
> +   bootloader-BEAGLEV-buildroot.bin.out file.
> +
> + - Then, press 1 and send over X-modem the
> +   ddrinit-2133-buildroot.bin.out.
> +
> +Note that the reflashing mechanism itself relies on those low-level
> +bootloaders, so if you flash non-working versions, you'll have to go
> +through a recovery process. This requires wiring up to a separate
> +debug UART, whose pins are located near the HDMI connector. See
> +https://wiki.seeedstudio.com/BeagleV-Update-bootloader-ddr-init-boot-uboot-Recover-bootloader/
> +section "Recover the bootloader" for more details.
> diff --git a/configs/beaglev_defconfig b/configs/beaglev_defconfig
> index e94c4ab639..8943ce9c34 100644
> --- a/configs/beaglev_defconfig
> +++ b/configs/beaglev_defconfig
> @@ -18,6 +18,8 @@ BR2_LINUX_KERNEL_INSTALL_TARGET=y
>  BR2_TARGET_ROOTFS_EXT2=y
>  BR2_TARGET_ROOTFS_EXT2_4=y
>  # BR2_TARGET_ROOTFS_TAR is not set
> +BR2_TARGET_BEAGLEV_DDRINIT=y
> +BR2_TARGET_BEAGLEV_SECONDBOOT=y
>  BR2_TARGET_OPENSBI=y
>  BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y
>  # HEAD of the Fedora branch
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-07 22:04   ` Yann E. MORIN
  2021-05-07 22:06     ` Yann E. MORIN
@ 2021-05-07 23:30     ` Drew Fustini
  2021-05-08  7:37       ` Yann E. MORIN
  2021-05-08 18:21     ` Thomas Petazzoni
  2021-05-09 11:03     ` Arnout Vandecappelle
  3 siblings, 1 reply; 38+ messages in thread
From: Drew Fustini @ 2021-05-07 23:30 UTC (permalink / raw)
  To: buildroot

On Fri, May 7, 2021, 15:04 Yann E. MORIN <yann.morin.1998@free.fr> wrote:

> On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> > This commit adds a package for the DDR initialization code used on the
> > BeagleV platform.
>
> The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> of an 'i'. I've renamed the package to match upstream name, so that
> users that look for it can actually find it.
>
> Applied to master, thanks.
>
> Regards,
> Yann E. MORIN.


Would it be helpful if I get StarFive to fix the typo and rename it to
ddrinit?

 I am thinking that would probably be good to have happen before other
projects start pointing to it.  Thomas was so fast with the buildroot
patches I think it is the first to notice this.

Thank you,
Drew

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210507/84b66ae4/attachment.html>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-07 23:30     ` Drew Fustini
@ 2021-05-08  7:37       ` Yann E. MORIN
  2021-05-08  7:48         ` Drew Fustini
  0 siblings, 1 reply; 38+ messages in thread
From: Yann E. MORIN @ 2021-05-08  7:37 UTC (permalink / raw)
  To: buildroot

Drew, All,

On 2021-05-07 16:30 -0700, Drew Fustini spake thusly:
> On Fri, May 7, 2021, 15:04 Yann E. MORIN < [1]yann.morin.1998@free.fr> wrote:
>   On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
>   > This commit adds a package for the DDR initialization code used on the
>   > BeagleV platform.
> 
>   The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
>   of an 'i'. I've renamed the package to match upstream name, so that
>   users that look for it can actually find it.
> Would it be helpful if I get StarFive to fix the typo and rename it to ddrinit?
> I am thinking that would probably be good to have happen before other projects
> start pointing to it. Thomas was so fast with the buildroot patches I think it
> is the first to notice this.

It is not so important that the upstream name gets fixed; in fact quite
the opposite: we are now already referencing it. Granted, it's brand
new, and we can fix it quick before the release. But note that our
2021.05-rc1 is due this WE, for example; we can still fix this kind of
thing post rc1, of course, but we can't fix a release...

But as you mention, once other projects start referencing it, it will be
too late. For example, Khem Raj already has started such support:

    https://github.com/riscv/meta-riscv/blob/master/beaglev.yml
    https://github.com/YoeDistro/yoe-distro/blob/master/beaglev-starlight-jh7100-envsetup.sh

So even if it is still very early, I think it is already too late to
rename the repository...

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-08  7:37       ` Yann E. MORIN
@ 2021-05-08  7:48         ` Drew Fustini
  2021-05-08 16:01           ` Khem Raj
  0 siblings, 1 reply; 38+ messages in thread
From: Drew Fustini @ 2021-05-08  7:48 UTC (permalink / raw)
  To: buildroot

On Sat, May 8, 2021 at 12:37 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> Drew, All,
>
> On 2021-05-07 16:30 -0700, Drew Fustini spake thusly:
> > On Fri, May 7, 2021, 15:04 Yann E. MORIN < [1]yann.morin.1998@free.fr> wrote:
> >   On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> >   > This commit adds a package for the DDR initialization code used on the
> >   > BeagleV platform.
> >
> >   The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> >   of an 'i'. I've renamed the package to match upstream name, so that
> >   users that look for it can actually find it.
> > Would it be helpful if I get StarFive to fix the typo and rename it to ddrinit?
> > I am thinking that would probably be good to have happen before other projects
> > start pointing to it. Thomas was so fast with the buildroot patches I think it
> > is the first to notice this.
>
> It is not so important that the upstream name gets fixed; in fact quite
> the opposite: we are now already referencing it. Granted, it's brand
> new, and we can fix it quick before the release. But note that our
> 2021.05-rc1 is due this WE, for example; we can still fix this kind of
> thing post rc1, of course, but we can't fix a release...
>
> But as you mention, once other projects start referencing it, it will be
> too late. For example, Khem Raj already has started such support:
>
>     https://github.com/riscv/meta-riscv/blob/master/beaglev.yml
>     https://github.com/YoeDistro/yoe-distro/blob/master/beaglev-starlight-jh7100-envsetup.sh
>
> So even if it is still very early, I think it is already too late to
> rename the repository...

Ok, thank you for the insights.  I agree more important to have the
release go forward and not risk breaking references.   My goal is that
ddrinit will eventually be replaced with u-boot SPL anyways.  Bin Meng
is actively looking into this right now.

Thank you,
Drew

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 1/7] package/Makefile.in: expose CONFIG_DIR to post-build/post-image scripts
  2021-05-04 20:51 ` [Buildroot] [PATCH v3 1/7] package/Makefile.in: expose CONFIG_DIR to post-build/post-image scripts Thomas Petazzoni
  2021-05-06 21:03   ` Yann E. MORIN
@ 2021-05-08 14:32   ` Peter Korsgaard
  1 sibling, 0 replies; 38+ messages in thread
From: Peter Korsgaard @ 2021-05-08 14:32 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:

 > Sometimes, post-build or post-image scripts need to reinvoke
 > Buildroot's make, for example to execute "make printvars".

 > However, so far none of the variables exposed to post-build/post-image
 > scripts allowed to do that in a way that worked for both in-tree and
 > out-of-tree builds. Indeed:

 >  * "make printvars" would work for in-tree builds, but not out of tree
 >    builds

 >  * "make -C ${O} printvars" would work for out-of-tree builds, but not
 >    in-tree builds

 > In order to solve this, this commit exposes $(CONFIG_DIR) to
 > post-build/post-image scripts, through the EXTRA_ENV variable.

 > The documentation is updated accordingly.

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

While this is a new feature, it is arguably something we should have
fixed a long time ago and it seems fairly low risk, so committed to
2021.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-08  7:48         ` Drew Fustini
@ 2021-05-08 16:01           ` Khem Raj
  2021-05-08 18:20             ` Yann E. MORIN
  2021-05-08 21:10             ` Drew Fustini
  0 siblings, 2 replies; 38+ messages in thread
From: Khem Raj @ 2021-05-08 16:01 UTC (permalink / raw)
  To: buildroot

On Sat, May 8, 2021 at 12:48 AM Drew Fustini <drew@beagleboard.org> wrote:
>
> On Sat, May 8, 2021 at 12:37 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> >
> > Drew, All,
> >
> > On 2021-05-07 16:30 -0700, Drew Fustini spake thusly:
> > > On Fri, May 7, 2021, 15:04 Yann E. MORIN < [1]yann.morin.1998@free.fr> wrote:
> > >   On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> > >   > This commit adds a package for the DDR initialization code used on the
> > >   > BeagleV platform.
> > >
> > >   The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> > >   of an 'i'. I've renamed the package to match upstream name, so that
> > >   users that look for it can actually find it.
> > > Would it be helpful if I get StarFive to fix the typo and rename it to ddrinit?
> > > I am thinking that would probably be good to have happen before other projects
> > > start pointing to it. Thomas was so fast with the buildroot patches I think it
> > > is the first to notice this.
> >
> > It is not so important that the upstream name gets fixed; in fact quite
> > the opposite: we are now already referencing it. Granted, it's brand
> > new, and we can fix it quick before the release. But note that our
> > 2021.05-rc1 is due this WE, for example; we can still fix this kind of
> > thing post rc1, of course, but we can't fix a release...
> >
> > But as you mention, once other projects start referencing it, it will be
> > too late. For example, Khem Raj already has started such support:
> >
> >     https://github.com/riscv/meta-riscv/blob/master/beaglev.yml
> >     https://github.com/YoeDistro/yoe-distro/blob/master/beaglev-starlight-jh7100-envsetup.sh
> >
> > So even if it is still very early, I think it is already too late to
> > rename the repository...

Is there general consensus on what it should be called ?
I am happy to remove references to SOC name, if we have clear naming
convention and strategy to also name future iterations of beagleV based on RISCV

>
> Ok, thank you for the insights.  I agree more important to have the
> release go forward and not risk breaking references.   My goal is that
> ddrinit will eventually be replaced with u-boot SPL anyways.  Bin Meng
> is actively looking into this right now.
>
> Thank you,
> Drew

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-08 16:01           ` Khem Raj
@ 2021-05-08 18:20             ` Yann E. MORIN
  2021-05-08 19:54               ` Drew Fustini
  2021-05-08 21:10             ` Drew Fustini
  1 sibling, 1 reply; 38+ messages in thread
From: Yann E. MORIN @ 2021-05-08 18:20 UTC (permalink / raw)
  To: buildroot

Khem, All,

On 2021-05-08 09:01 -0700, Khem Raj spake thusly:
> On Sat, May 8, 2021 at 12:48 AM Drew Fustini <drew@beagleboard.org> wrote:
> > On Sat, May 8, 2021 at 12:37 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > On 2021-05-07 16:30 -0700, Drew Fustini spake thusly:
> > > > On Fri, May 7, 2021, 15:04 Yann E. MORIN < [1]yann.morin.1998@free.fr> wrote:
> > > >   The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> > > >   of an 'i'. [...]
> > > > Would it be helpful if I get StarFive to fix the typo and rename it to ddrinit?
> > > It is not so important that the upstream name gets fixed; [...]
> Is there general consensus on what it should be called ?
> I am happy to remove references to SOC name, if we have clear naming
> convention and strategy to also name future iterations of beagleV based on RISCV

Khem: note that we were speaking about a typo in one of the upstream
repositories: beaglev-ddrlnit (dee-dee-are-ell-hen-eye-tee) instead of
ddrinit (dee-dee-are-eye-hen-eye-tee).

But Drew said this should be a short-term repository, which will
eventually get phased out in favour of uboot spl.

I am not sure what kind of level support OE so far has for BeagleV, and
whether it uses that repository or not, but I used your layers just as
a hint that it is too late (IMHO) to rename repositories upstream...

And as far as I understand, BeagleV is named BeagleV, and the SoC is
JH7100. So your layers/scripts seemed to be aptly named. ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-07 22:04   ` Yann E. MORIN
  2021-05-07 22:06     ` Yann E. MORIN
  2021-05-07 23:30     ` Drew Fustini
@ 2021-05-08 18:21     ` Thomas Petazzoni
  2021-05-09 11:03     ` Arnout Vandecappelle
  3 siblings, 0 replies; 38+ messages in thread
From: Thomas Petazzoni @ 2021-05-08 18:21 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 8 May 2021 00:04:01 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> > This commit adds a package for the DDR initialization code used on the
> > BeagleV platform.  
> 
> The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> of an 'i'. I've renamed the package to match upstream name, so that
> users that look for it can actually find it.

Ah, in fact I had only seen the package name on github with a font
where the l and I are pretty much the same, so I thought it was named
ddrInit (with a capital 'I') and I normalized that to 'ddrinit' was we
like lower-case name in Buildroot packages.

But indeed, I see that the repository is named ddrlnit. I'm wondering
if this isn't just a mistake, because then everywhere it is referred to
as ddrinit. ddrlnit doesn't make much sense to me.

But fair enough, for now it's named beaglev-ddrlnit so our Buildroot
package should follow that naming.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 3/7] configs/beaglev_defconfig: new defconfig
  2021-05-07 22:02   ` Yann E. MORIN
@ 2021-05-08 18:23     ` Thomas Petazzoni
  0 siblings, 0 replies; 38+ messages in thread
From: Thomas Petazzoni @ 2021-05-08 18:23 UTC (permalink / raw)
  To: buildroot

On Sat, 8 May 2021 00:02:32 +0200
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> > diff --git a/board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch b/board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
> > new file mode 100644
> > index 0000000000..74d70f2721
> > --- /dev/null
> > +++ b/board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
> > @@ -0,0 +1,39 @@
> > +From 2c4c813940c577590f3352cef0c49a8def17905d Mon Sep 17 00:00:00 2001
> > +From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> > +Date: Wed, 28 Apr 2021 22:58:45 +0200
> > +Subject: [PATCH] include/configs/starfive-vic7100: adjust fdt_addr_r
> > +
> > +The default fdt_addr_r of 0x88000000 doesn't work, the kernel never
> > +boots. Using 0x90000000 works fine.
> > +
> > +Since it would overlap with the kernel_comp_addr_r area, this one is
> > +moved 16 MB further, at 0x91000000.  
> 
> Is this something that is so board specific that we can't upstream it?

It's not so much that is it board specific or not, but rather than it's
odd that the default value used in the BeagleV repo doesn't work for
us. So at this point I don't have a very convincing argument for
upstream other than "it doesn't work for me without this change".

> Here, I've used eval, as suggested in the manual:
> 
>     eval $(make -C ${CONFIG_DIR} --no-print-directory QUOTED_VARS=YES VARS=UBOOT_DIR printvars)

Sounds good, thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-08 18:20             ` Yann E. MORIN
@ 2021-05-08 19:54               ` Drew Fustini
  0 siblings, 0 replies; 38+ messages in thread
From: Drew Fustini @ 2021-05-08 19:54 UTC (permalink / raw)
  To: buildroot

On Sat, May 8, 2021 at 11:21 AM Yann E. MORIN <yann.morin.1998@free.fr>
wrote:
>
> Khem, All,
>
> On 2021-05-08 09:01 -0700, Khem Raj spake thusly:
> > On Sat, May 8, 2021 at 12:48 AM Drew Fustini <drew@beagleboard.org>
wrote:
> > > On Sat, May 8, 2021 at 12:37 AM Yann E. MORIN <yann.morin.1998@free.fr>
wrote:
> > > > On 2021-05-07 16:30 -0700, Drew Fustini spake thusly:
> > > > > On Fri, May 7, 2021, 15:04 Yann E. MORIN < [1]
yann.morin.1998@free.fr> wrote:
> > > > >   The upstream package name is beaglev-ddrlnit, yes, with an 'l'
instead
> > > > >   of an 'i'. [...]
> > > > > Would it be helpful if I get StarFive to fix the typo and rename
it to ddrinit?
> > > > It is not so important that the upstream name gets fixed; [...]
> > Is there general consensus on what it should be called ?
> > I am happy to remove references to SOC name, if we have clear naming
> > convention and strategy to also name future iterations of beagleV based
on RISCV
>
> Khem: note that we were speaking about a typo in one of the upstream
> repositories: beaglev-ddrlnit (dee-dee-are-ell-hen-eye-tee) instead of
> ddrinit (dee-dee-are-eye-hen-eye-tee).
>
> But Drew said this should be a short-term repository, which will
> eventually get phased out in favour of uboot spl.

Bin Meng is trying to get u-boot SPL working on the StarFive JH7100 SoC and
that could replace ddrinit.  Although I am not sure exactly when that goal
will be accomplished.

StarFive will fix the 'l' typo in the ddrinit repo if I ask them to, but
they probably would not get that done until Monday or Tuesday.  It seemed
like from your previous email it would be best to avoid that churn of
renaming the repository as the patch already went into buildroot.

I am happy to do whatever is best for buildroot and also Khem's meta-riscv
OE layer.

Thank you,
Drew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210508/f4ea970a/attachment.html>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-08 16:01           ` Khem Raj
  2021-05-08 18:20             ` Yann E. MORIN
@ 2021-05-08 21:10             ` Drew Fustini
  2021-05-08 22:09               ` Khem Raj
  1 sibling, 1 reply; 38+ messages in thread
From: Drew Fustini @ 2021-05-08 21:10 UTC (permalink / raw)
  To: buildroot

On Sat, May 8, 2021 at 9:02 AM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Sat, May 8, 2021 at 12:48 AM Drew Fustini <drew@beagleboard.org> wrote:
> >
> > On Sat, May 8, 2021 at 12:37 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > >
> > > Drew, All,
> > >
> > > On 2021-05-07 16:30 -0700, Drew Fustini spake thusly:
> > > > On Fri, May 7, 2021, 15:04 Yann E. MORIN < [1]yann.morin.1998@free.fr> wrote:
> > > >   On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> > > >   > This commit adds a package for the DDR initialization code used on the
> > > >   > BeagleV platform.
> > > >
> > > >   The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> > > >   of an 'i'. I've renamed the package to match upstream name, so that
> > > >   users that look for it can actually find it.
> > > > Would it be helpful if I get StarFive to fix the typo and rename it to ddrinit?
> > > > I am thinking that would probably be good to have happen before other projects
> > > > start pointing to it. Thomas was so fast with the buildroot patches I think it
> > > > is the first to notice this.
> > >
> > > It is not so important that the upstream name gets fixed; in fact quite
> > > the opposite: we are now already referencing it. Granted, it's brand
> > > new, and we can fix it quick before the release. But note that our
> > > 2021.05-rc1 is due this WE, for example; we can still fix this kind of
> > > thing post rc1, of course, but we can't fix a release...
> > >
> > > But as you mention, once other projects start referencing it, it will be
> > > too late. For example, Khem Raj already has started such support:
> > >
> > >     https://github.com/riscv/meta-riscv/blob/master/beaglev.yml
> > >     https://github.com/YoeDistro/yoe-distro/blob/master/beaglev-starlight-jh7100-envsetup.sh
> > >
> > > So even if it is still very early, I think it is already too late to
> > > rename the repository...
>
> Is there general consensus on what it should be called ?
> I am happy to remove references to SOC name, if we have clear naming
> convention and strategy to also name future iterations of beagleV based on RISCV

The board that Thomas and you received is the beta prototype version
of BeagleV Starlight board with the StarFive JH7100 SoC, which is a
low quantity test SoC.  BeagleV is BeagleBoard.org Foundation's name
for RISC-V boards.  BeagleV Starlight is a BeagleBoard.org board with
a StarFive RISC-V SoC.

The production BeagleV Starlight will have the StarFive JH7110, the
mass production SoC.  Due to the different SoC models, BeagleV
Starlight JH7100 would refer to the beta prototype, and BeagleV
Starlight JH7110 would be the product that will be launched later this
year.

That README is the best public URL to reference in documentation and
patches and it includes guidance on naming conventions:
https://github.com/beagleboard/beaglev-starlight#guidance-on-naming-conventions

Thanks.
Drew

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-08 21:10             ` Drew Fustini
@ 2021-05-08 22:09               ` Khem Raj
  2021-05-09 20:23                 ` Drew Fustini
  0 siblings, 1 reply; 38+ messages in thread
From: Khem Raj @ 2021-05-08 22:09 UTC (permalink / raw)
  To: buildroot

Hi Drew

On Sat, May 8, 2021 at 2:10 PM Drew Fustini <drew@beagleboard.org> wrote:
>
> On Sat, May 8, 2021 at 9:02 AM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > On Sat, May 8, 2021 at 12:48 AM Drew Fustini <drew@beagleboard.org> wrote:
> > >
> > > On Sat, May 8, 2021 at 12:37 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > >
> > > > Drew, All,
> > > >
> > > > On 2021-05-07 16:30 -0700, Drew Fustini spake thusly:
> > > > > On Fri, May 7, 2021, 15:04 Yann E. MORIN < [1]yann.morin.1998@free.fr> wrote:
> > > > >   On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> > > > >   > This commit adds a package for the DDR initialization code used on the
> > > > >   > BeagleV platform.
> > > > >
> > > > >   The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> > > > >   of an 'i'. I've renamed the package to match upstream name, so that
> > > > >   users that look for it can actually find it.
> > > > > Would it be helpful if I get StarFive to fix the typo and rename it to ddrinit?
> > > > > I am thinking that would probably be good to have happen before other projects
> > > > > start pointing to it. Thomas was so fast with the buildroot patches I think it
> > > > > is the first to notice this.
> > > >
> > > > It is not so important that the upstream name gets fixed; in fact quite
> > > > the opposite: we are now already referencing it. Granted, it's brand
> > > > new, and we can fix it quick before the release. But note that our
> > > > 2021.05-rc1 is due this WE, for example; we can still fix this kind of
> > > > thing post rc1, of course, but we can't fix a release...
> > > >
> > > > But as you mention, once other projects start referencing it, it will be
> > > > too late. For example, Khem Raj already has started such support:
> > > >
> > > >     https://github.com/riscv/meta-riscv/blob/master/beaglev.yml
> > > >     https://github.com/YoeDistro/yoe-distro/blob/master/beaglev-starlight-jh7100-envsetup.sh
> > > >
> > > > So even if it is still very early, I think it is already too late to
> > > > rename the repository...
> >
> > Is there general consensus on what it should be called ?
> > I am happy to remove references to SOC name, if we have clear naming
> > convention and strategy to also name future iterations of beagleV based on RISCV
>
> The board that Thomas and you received is the beta prototype version
> of BeagleV Starlight board with the StarFive JH7100 SoC, which is a
> low quantity test SoC.  BeagleV is BeagleBoard.org Foundation's name
> for RISC-V boards.  BeagleV Starlight is a BeagleBoard.org board with
> a StarFive RISC-V SoC.
>
> The production BeagleV Starlight will have the StarFive JH7110, the
> mass production SoC.  Due to the different SoC models, BeagleV
> Starlight JH7100 would refer to the beta prototype, and BeagleV
> Starlight JH7110 would be the product that will be launched later this
> year.
>
> That README is the best public URL to reference in documentation and
> patches and it includes guidance on naming conventions:
> https://github.com/beagleboard/beaglev-starlight#guidance-on-naming-conventions

So perhaps we could call this machine as beaglev-beta ? and the final
one beaglev in Yocto machine names ?
I am not sure adding SOC info adds some meaningful information, unless
you plan to have other SOCs also in
beagleV boards variants

>
> Thanks.
> Drew

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-07 22:04   ` Yann E. MORIN
                       ` (2 preceding siblings ...)
  2021-05-08 18:21     ` Thomas Petazzoni
@ 2021-05-09 11:03     ` Arnout Vandecappelle
  2021-05-09 11:04       ` Arnout Vandecappelle
  3 siblings, 1 reply; 38+ messages in thread
From: Arnout Vandecappelle @ 2021-05-09 11:03 UTC (permalink / raw)
  To: buildroot



On 08/05/2021 00:04, Yann E. MORIN wrote:
> On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
>> This commit adds a package for the DDR initialization code used on the
>> BeagleV platform.
> 
> The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> of an 'i'. I've renamed the package to match upstream name, so that
> users that look for it can actually find it.

 What's done is done of course, but in this case, I think we should have stuck
to ddrinit with an eye. That name makes much more sense, and in fact when people
search for it (with / in menuconfig) they're IMHO much more likely to search for
it with an eye than with an el. The el you'd probably only use when you copy and
paste the name from github, but who does that?


 @Drew/Bing, on github, when you rename a repository, the old name will still
redirect to the new one (at least until you create a new repo with that name).
So I'd go ahead and to the rename to ddrinit, it should break anything.


 Regards,
 Arnout


> 
> Applied to master, thanks.
> 
> Regards,
> Yann E. MORIN.
> 
>> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>> ---
>>  DEVELOPERS                              |  1 +
>>  boot/Config.in                          |  1 +
>>  boot/beaglev-ddrinit/Config.in          |  9 ++++++++
>>  boot/beaglev-ddrinit/beaglev-ddrinit.mk | 29 +++++++++++++++++++++++++
>>  4 files changed, 40 insertions(+)
>>  create mode 100644 boot/beaglev-ddrinit/Config.in
>>  create mode 100644 boot/beaglev-ddrinit/beaglev-ddrinit.mk
>>
>> diff --git a/DEVELOPERS b/DEVELOPERS
>> index 7ce78742fc..39bc71ea34 100644
>> --- a/DEVELOPERS
>> +++ b/DEVELOPERS
>> @@ -2604,6 +2604,7 @@ N:	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
>>  F:	arch/Config.in.arm
>>  F:	board/beaglev/
>>  F:	board/stmicroelectronics/stm32mp157c-dk2/
>> +F:	boot/beaglev-ddrinit/
>>  F:	boot/boot-wrapper-aarch64/
>>  F:	boot/grub2/
>>  F:	boot/gummiboot/
>> diff --git a/boot/Config.in b/boot/Config.in
>> index b3adbfc8bc..f581205c6c 100644
>> --- a/boot/Config.in
>> +++ b/boot/Config.in
>> @@ -6,6 +6,7 @@ source "boot/at91bootstrap3/Config.in"
>>  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/binaries-marvell/Config.in"
>>  source "boot/boot-wrapper-aarch64/Config.in"
>>  source "boot/grub2/Config.in"
>> diff --git a/boot/beaglev-ddrinit/Config.in b/boot/beaglev-ddrinit/Config.in
>> new file mode 100644
>> index 0000000000..5392f49088
>> --- /dev/null
>> +++ b/boot/beaglev-ddrinit/Config.in
>> @@ -0,0 +1,9 @@
>> +config BR2_TARGET_BEAGLEV_DDRINIT
>> +	bool "beaglev-ddrinit"
>> +	depends on BR2_riscv
>> +	depends on BR2_HOSTARCH = "x86_64" # host-riscv64-elf-toolchain
>> +	help
>> +	  This package builds the DDRinit firmware used on the BeagleV
>> +	  platform.
>> +
>> +	  https://github.com/starfive-tech/beagle_ddrlnit
>> diff --git a/boot/beaglev-ddrinit/beaglev-ddrinit.mk b/boot/beaglev-ddrinit/beaglev-ddrinit.mk
>> new file mode 100644
>> index 0000000000..72e6aea965
>> --- /dev/null
>> +++ b/boot/beaglev-ddrinit/beaglev-ddrinit.mk
>> @@ -0,0 +1,29 @@
>> +################################################################################
>> +#
>> +# beaglev-ddrinit
>> +#
>> +################################################################################
>> +
>> +# HEAD of the starfive branch
>> +BEAGLEV_DDRINIT_VERSION = 15b80de81263996affb2a29332aa681925709983
>> +BEAGLEV_DDRINIT_SITE = $(call github,starfive-tech,beagle_ddrlnit,$(BEAGLEV_DDRINIT_VERSION))
>> +BEAGLEV_DDRINIT_INSTALL_TARGET = NO
>> +BEAGLEV_DDRINIT_INSTALL_IMAGES = YES
>> +BEAGLEV_DDRINIT_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_DDRINIT_LICENSE = GPL-2.0+
>> +
>> +define BEAGLEV_DDRINIT_BUILD_CMDS
>> +	$(MAKE) -C $(@D)/build \
>> +		CROSSCOMPILE=$(HOST_DIR)/bin/riscv64-unknown-elf- \
>> +		SUFFIX=buildroot \
>> +		GIT_VERSION=$(BEAGLEV_DDRINIT_VERSION)
>> +endef
>> +
>> +define BEAGLEV_DDRINIT_INSTALL_IMAGES_CMDS
>> +	$(INSTALL) -D -m 0644 $(@D)/build/ddrinit-2133-buildroot.bin.out \
>> +		$(BINARIES_DIR)/ddrinit-2133-buildroot.bin.out
>> +endef
>> +
>> +$(eval $(generic-package))
>> -- 
>> 2.30.2
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot at busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
> 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-09 11:03     ` Arnout Vandecappelle
@ 2021-05-09 11:04       ` Arnout Vandecappelle
  2021-05-09 20:29         ` Drew Fustini
  0 siblings, 1 reply; 38+ messages in thread
From: Arnout Vandecappelle @ 2021-05-09 11:04 UTC (permalink / raw)
  To: buildroot



On 09/05/2021 13:03, Arnout Vandecappelle wrote:
> 
> 
> On 08/05/2021 00:04, Yann E. MORIN wrote:
>> On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
>>> This commit adds a package for the DDR initialization code used on the
>>> BeagleV platform.
>>
>> The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
>> of an 'i'. I've renamed the package to match upstream name, so that
>> users that look for it can actually find it.
> 
>  What's done is done of course, but in this case, I think we should have stuck
> to ddrinit with an eye. That name makes much more sense, and in fact when people
> search for it (with / in menuconfig) they're IMHO much more likely to search for
> it with an eye than with an el. The el you'd probably only use when you copy and
> paste the name from github, but who does that?
> 
> 
>  @Drew/Bing, on github, when you rename a repository, the old name will still
> redirect to the new one (at least until you create a new repo with that name).
> So I'd go ahead and to the rename to ddrinit, it should break anything.

 I forgot the reference:

https://docs.github.com/en/github/administering-a-repository/renaming-a-repository


 Regards,
 Arnout

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-08 22:09               ` Khem Raj
@ 2021-05-09 20:23                 ` Drew Fustini
  2021-05-09 20:26                   ` Khem Raj
  0 siblings, 1 reply; 38+ messages in thread
From: Drew Fustini @ 2021-05-09 20:23 UTC (permalink / raw)
  To: buildroot

On Sat, May 8, 2021, 15:10 Khem Raj <raj.khem@gmail.com> wrote:
>
> Hi Drew
>
> On Sat, May 8, 2021 at 2:10 PM Drew Fustini <drew@beagleboard.org> wrote:
> >
> > On Sat, May 8, 2021 at 9:02 AM Khem Raj <raj.khem@gmail.com> wrote:
> > >
> > > On Sat, May 8, 2021 at 12:48 AM Drew Fustini <drew@beagleboard.org> wrote:
> > > >
> > > > On Sat, May 8, 2021 at 12:37 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > >
> > > > > Drew, All,
> > > > >
> > > > > On 2021-05-07 16:30 -0700, Drew Fustini spake thusly:
> > > > > > On Fri, May 7, 2021, 15:04 Yann E. MORIN < [1]yann.morin.1998@free.fr> wrote:
> > > > > >   On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> > > > > >   > This commit adds a package for the DDR initialization code used on the
> > > > > >   > BeagleV platform.
> > > > > >
> > > > > >   The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> > > > > >   of an 'i'. I've renamed the package to match upstream name, so that
> > > > > >   users that look for it can actually find it.
> > > > > > Would it be helpful if I get StarFive to fix the typo and rename it to ddrinit?
> > > > > > I am thinking that would probably be good to have happen before other projects
> > > > > > start pointing to it. Thomas was so fast with the buildroot patches I think it
> > > > > > is the first to notice this.
> > > > >
> > > > > It is not so important that the upstream name gets fixed; in fact quite
> > > > > the opposite: we are now already referencing it. Granted, it's brand
> > > > > new, and we can fix it quick before the release. But note that our
> > > > > 2021.05-rc1 is due this WE, for example; we can still fix this kind of
> > > > > thing post rc1, of course, but we can't fix a release...
> > > > >
> > > > > But as you mention, once other projects start referencing it, it will be
> > > > > too late. For example, Khem Raj already has started such support:
> > > > >
> > > > >     https://github.com/riscv/meta-riscv/blob/master/beaglev.yml
> > > > >     https://github.com/YoeDistro/yoe-distro/blob/master/beaglev-starlight-jh7100-envsetup.sh
> > > > >
> > > > > So even if it is still very early, I think it is already too late to
> > > > > rename the repository...
> > >
> > > Is there general consensus on what it should be called ?
> > > I am happy to remove references to SOC name, if we have clear naming
> > > convention and strategy to also name future iterations of beagleV based on RISCV
> >
> > The board that Thomas and you received is the beta prototype version
> > of BeagleV Starlight board with the StarFive JH7100 SoC, which is a
> > low quantity test SoC.  BeagleV is BeagleBoard.org Foundation's name
> > for RISC-V boards.  BeagleV Starlight is a BeagleBoard.org board with
> > a StarFive RISC-V SoC.
> >
> > The production BeagleV Starlight will have the StarFive JH7110, the
> > mass production SoC.  Due to the different SoC models, BeagleV
> > Starlight JH7100 would refer to the beta prototype, and BeagleV
> > Starlight JH7110 would be the product that will be launched later this
> > year.
> >
> > That README is the best public URL to reference in documentation and
> > patches and it includes guidance on naming conventions:
> > https://github.com/beagleboard/beaglev-starlight#guidance-on-naming-conventions
>
> So perhaps we could call this machine as beaglev-beta ? and the final
> one beaglev in Yocto machine names ?
> I am not sure adding SOC info adds some meaningful information, unless
> you plan to have other SOCs also in
> beagleV boards variants

BeagleV is a name that will exist for long into the future for any
BeagleBoard.org board with a RISC-V processor.  Therefore I think
beaglev-starlight-beta would be a good machine name which would
represent the beta version of BeagleV Starlight with StarFive JH7100
SoC.  Machine beagle-starlight could then represent the production
BeagleV Starlight with StarFive JH7110 SoC.

Thank you,
Drew

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-09 20:23                 ` Drew Fustini
@ 2021-05-09 20:26                   ` Khem Raj
  2021-05-09 20:34                     ` Drew Fustini
  0 siblings, 1 reply; 38+ messages in thread
From: Khem Raj @ 2021-05-09 20:26 UTC (permalink / raw)
  To: buildroot

On Sun, May 9, 2021 at 1:23 PM Drew Fustini <drew@beagleboard.org> wrote:
>
> On Sat, May 8, 2021, 15:10 Khem Raj <raj.khem@gmail.com> wrote:
> >
> > Hi Drew
> >
> > On Sat, May 8, 2021 at 2:10 PM Drew Fustini <drew@beagleboard.org> wrote:
> > >
> > > On Sat, May 8, 2021 at 9:02 AM Khem Raj <raj.khem@gmail.com> wrote:
> > > >
> > > > On Sat, May 8, 2021 at 12:48 AM Drew Fustini <drew@beagleboard.org> wrote:
> > > > >
> > > > > On Sat, May 8, 2021 at 12:37 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > > >
> > > > > > Drew, All,
> > > > > >
> > > > > > On 2021-05-07 16:30 -0700, Drew Fustini spake thusly:
> > > > > > > On Fri, May 7, 2021, 15:04 Yann E. MORIN < [1]yann.morin.1998@free.fr> wrote:
> > > > > > >   On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> > > > > > >   > This commit adds a package for the DDR initialization code used on the
> > > > > > >   > BeagleV platform.
> > > > > > >
> > > > > > >   The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> > > > > > >   of an 'i'. I've renamed the package to match upstream name, so that
> > > > > > >   users that look for it can actually find it.
> > > > > > > Would it be helpful if I get StarFive to fix the typo and rename it to ddrinit?
> > > > > > > I am thinking that would probably be good to have happen before other projects
> > > > > > > start pointing to it. Thomas was so fast with the buildroot patches I think it
> > > > > > > is the first to notice this.
> > > > > >
> > > > > > It is not so important that the upstream name gets fixed; in fact quite
> > > > > > the opposite: we are now already referencing it. Granted, it's brand
> > > > > > new, and we can fix it quick before the release. But note that our
> > > > > > 2021.05-rc1 is due this WE, for example; we can still fix this kind of
> > > > > > thing post rc1, of course, but we can't fix a release...
> > > > > >
> > > > > > But as you mention, once other projects start referencing it, it will be
> > > > > > too late. For example, Khem Raj already has started such support:
> > > > > >
> > > > > >     https://github.com/riscv/meta-riscv/blob/master/beaglev.yml
> > > > > >     https://github.com/YoeDistro/yoe-distro/blob/master/beaglev-starlight-jh7100-envsetup.sh
> > > > > >
> > > > > > So even if it is still very early, I think it is already too late to
> > > > > > rename the repository...
> > > >
> > > > Is there general consensus on what it should be called ?
> > > > I am happy to remove references to SOC name, if we have clear naming
> > > > convention and strategy to also name future iterations of beagleV based on RISCV
> > >
> > > The board that Thomas and you received is the beta prototype version
> > > of BeagleV Starlight board with the StarFive JH7100 SoC, which is a
> > > low quantity test SoC.  BeagleV is BeagleBoard.org Foundation's name
> > > for RISC-V boards.  BeagleV Starlight is a BeagleBoard.org board with
> > > a StarFive RISC-V SoC.
> > >
> > > The production BeagleV Starlight will have the StarFive JH7110, the
> > > mass production SoC.  Due to the different SoC models, BeagleV
> > > Starlight JH7100 would refer to the beta prototype, and BeagleV
> > > Starlight JH7110 would be the product that will be launched later this
> > > year.
> > >
> > > That README is the best public URL to reference in documentation and
> > > patches and it includes guidance on naming conventions:
> > > https://github.com/beagleboard/beaglev-starlight#guidance-on-naming-conventions
> >
> > So perhaps we could call this machine as beaglev-beta ? and the final
> > one beaglev in Yocto machine names ?
> > I am not sure adding SOC info adds some meaningful information, unless
> > you plan to have other SOCs also in
> > beagleV boards variants
>
> BeagleV is a name that will exist for long into the future for any
> BeagleBoard.org board with a RISC-V processor.  Therefore I think
> beaglev-starlight-beta would be a good machine name which would
> represent the beta version of BeagleV Starlight with StarFive JH7100
> SoC.  Machine beagle-starlight could then represent the production
> BeagleV Starlight with StarFive JH7110 SoC.

OK, but I was also thinking that tomorrow there might be a different
starlight soc
in beagleV next version in future so perhal
beaglev-<SOC-Vendor>-<SOC-name> might be future proof

>
> Thank you,
> Drew

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-09 11:04       ` Arnout Vandecappelle
@ 2021-05-09 20:29         ` Drew Fustini
  2021-05-09 20:31           ` Khem Raj
  2021-05-10  7:02           ` Drew Fustini
  0 siblings, 2 replies; 38+ messages in thread
From: Drew Fustini @ 2021-05-09 20:29 UTC (permalink / raw)
  To: buildroot

On Sun, May 9, 2021 at 4:04 AM Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
>
> On 09/05/2021 13:03, Arnout Vandecappelle wrote:
> >
> >
> > On 08/05/2021 00:04, Yann E. MORIN wrote:
> >> On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> >>> This commit adds a package for the DDR initialization code used on the
> >>> BeagleV platform.
> >>
> >> The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> >> of an 'i'. I've renamed the package to match upstream name, so that
> >> users that look for it can actually find it.
> >
> >  What's done is done of course, but in this case, I think we should have stuck
> > to ddrinit with an eye. That name makes much more sense, and in fact when people
> > search for it (with / in menuconfig) they're IMHO much more likely to search for
> > it with an eye than with an el. The el you'd probably only use when you copy and
> > paste the name from github, but who does that?
> >
> >
> >  @Drew/Bing, on github, when you rename a repository, the old name will still
> > redirect to the new one (at least until you create a new repo with that name).
> > So I'd go ahead and to the rename to ddrinit, it should break anything.
>
>  I forgot the reference:
>
> https://docs.github.com/en/github/administering-a-repository/renaming-a-repository

Thank you.  I knew that the redirect worked on the website, but this
clarifies that it also works for git clone as well.  Therefore, it
seems like I should ask starfive to fix the typo as the old repo url
with the typo will still work.

-Drew

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-09 20:29         ` Drew Fustini
@ 2021-05-09 20:31           ` Khem Raj
  2021-05-10  7:02           ` Drew Fustini
  1 sibling, 0 replies; 38+ messages in thread
From: Khem Raj @ 2021-05-09 20:31 UTC (permalink / raw)
  To: buildroot

On Sun, May 9, 2021 at 1:29 PM Drew Fustini <drew@beagleboard.org> wrote:
>
> On Sun, May 9, 2021 at 4:04 AM Arnout Vandecappelle <arnout@mind.be> wrote:
> >
> >
> >
> > On 09/05/2021 13:03, Arnout Vandecappelle wrote:
> > >
> > >
> > > On 08/05/2021 00:04, Yann E. MORIN wrote:
> > >> On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> > >>> This commit adds a package for the DDR initialization code used on the
> > >>> BeagleV platform.
> > >>
> > >> The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> > >> of an 'i'. I've renamed the package to match upstream name, so that
> > >> users that look for it can actually find it.
> > >
> > >  What's done is done of course, but in this case, I think we should have stuck
> > > to ddrinit with an eye. That name makes much more sense, and in fact when people
> > > search for it (with / in menuconfig) they're IMHO much more likely to search for
> > > it with an eye than with an el. The el you'd probably only use when you copy and
> > > paste the name from github, but who does that?
> > >
> > >
> > >  @Drew/Bing, on github, when you rename a repository, the old name will still
> > > redirect to the new one (at least until you create a new repo with that name).
> > > So I'd go ahead and to the rename to ddrinit, it should break anything.
> >
> >  I forgot the reference:
> >
> > https://docs.github.com/en/github/administering-a-repository/renaming-a-repository
>
> Thank you.  I knew that the redirect worked on the website, but this
> clarifies that it also works for git clone as well.  Therefore, it
> seems like I should ask starfive to fix the typo as the old repo url
> with the typo will still work.

yes renaming in github repos should be painless w.r.t. redirects IIRC

>
> -Drew

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-09 20:26                   ` Khem Raj
@ 2021-05-09 20:34                     ` Drew Fustini
  0 siblings, 0 replies; 38+ messages in thread
From: Drew Fustini @ 2021-05-09 20:34 UTC (permalink / raw)
  To: buildroot

On Sun, May 9, 2021 at 1:27 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Sun, May 9, 2021 at 1:23 PM Drew Fustini <drew@beagleboard.org> wrote:
> >
> > On Sat, May 8, 2021, 15:10 Khem Raj <raj.khem@gmail.com> wrote:
> > >
> > > Hi Drew
> > >
> > > On Sat, May 8, 2021 at 2:10 PM Drew Fustini <drew@beagleboard.org> wrote:
> > > >
> > > > On Sat, May 8, 2021 at 9:02 AM Khem Raj <raj.khem@gmail.com> wrote:
> > > > >
> > > > > On Sat, May 8, 2021 at 12:48 AM Drew Fustini <drew@beagleboard.org> wrote:
> > > > > >
> > > > > > On Sat, May 8, 2021 at 12:37 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > > > > > >
> > > > > > > Drew, All,
> > > > > > >
> > > > > > > On 2021-05-07 16:30 -0700, Drew Fustini spake thusly:
> > > > > > > > On Fri, May 7, 2021, 15:04 Yann E. MORIN < [1]yann.morin.1998@free.fr> wrote:
> > > > > > > >   On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> > > > > > > >   > This commit adds a package for the DDR initialization code used on the
> > > > > > > >   > BeagleV platform.
> > > > > > > >
> > > > > > > >   The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> > > > > > > >   of an 'i'. I've renamed the package to match upstream name, so that
> > > > > > > >   users that look for it can actually find it.
> > > > > > > > Would it be helpful if I get StarFive to fix the typo and rename it to ddrinit?
> > > > > > > > I am thinking that would probably be good to have happen before other projects
> > > > > > > > start pointing to it. Thomas was so fast with the buildroot patches I think it
> > > > > > > > is the first to notice this.
> > > > > > >
> > > > > > > It is not so important that the upstream name gets fixed; in fact quite
> > > > > > > the opposite: we are now already referencing it. Granted, it's brand
> > > > > > > new, and we can fix it quick before the release. But note that our
> > > > > > > 2021.05-rc1 is due this WE, for example; we can still fix this kind of
> > > > > > > thing post rc1, of course, but we can't fix a release...
> > > > > > >
> > > > > > > But as you mention, once other projects start referencing it, it will be
> > > > > > > too late. For example, Khem Raj already has started such support:
> > > > > > >
> > > > > > >     https://github.com/riscv/meta-riscv/blob/master/beaglev.yml
> > > > > > >     https://github.com/YoeDistro/yoe-distro/blob/master/beaglev-starlight-jh7100-envsetup.sh
> > > > > > >
> > > > > > > So even if it is still very early, I think it is already too late to
> > > > > > > rename the repository...
> > > > >
> > > > > Is there general consensus on what it should be called ?
> > > > > I am happy to remove references to SOC name, if we have clear naming
> > > > > convention and strategy to also name future iterations of beagleV based on RISCV
> > > >
> > > > The board that Thomas and you received is the beta prototype version
> > > > of BeagleV Starlight board with the StarFive JH7100 SoC, which is a
> > > > low quantity test SoC.  BeagleV is BeagleBoard.org Foundation's name
> > > > for RISC-V boards.  BeagleV Starlight is a BeagleBoard.org board with
> > > > a StarFive RISC-V SoC.
> > > >
> > > > The production BeagleV Starlight will have the StarFive JH7110, the
> > > > mass production SoC.  Due to the different SoC models, BeagleV
> > > > Starlight JH7100 would refer to the beta prototype, and BeagleV
> > > > Starlight JH7110 would be the product that will be launched later this
> > > > year.
> > > >
> > > > That README is the best public URL to reference in documentation and
> > > > patches and it includes guidance on naming conventions:
> > > > https://github.com/beagleboard/beaglev-starlight#guidance-on-naming-conventions
> > >
> > > So perhaps we could call this machine as beaglev-beta ? and the final
> > > one beaglev in Yocto machine names ?
> > > I am not sure adding SOC info adds some meaningful information, unless
> > > you plan to have other SOCs also in
> > > beagleV boards variants
> >
> > BeagleV is a name that will exist for long into the future for any
> > BeagleBoard.org board with a RISC-V processor.  Therefore I think
> > beaglev-starlight-beta would be a good machine name which would
> > represent the beta version of BeagleV Starlight with StarFive JH7100
> > SoC.  Machine beagle-starlight could then represent the production
> > BeagleV Starlight with StarFive JH7110 SoC.
>
> OK, but I was also thinking that tomorrow there might be a different
> starlight soc
> in beagleV next version in future so perhal
> beaglev-<SOC-Vendor>-<SOC-name> might be future proof

yes, this is a good idea.  thus we would have:

beaglev-starfive-jh7100: beta BeagleV Starlight board with StarFive JH7100 SoC
beaglev-starfive-jh7110: production BeagleV Starlight board with
StarFive JH7110 SoC

I do like using the SoC model instead of words like beta and
production.  The name 'Starlight' in the context of the BeagleV
Starlight board is the result of StarFive believing it would have a
positive meaning in Chinese.  Starlight does not really mean anything
in a technical sense so I think that "starfive" is more useful to have
in the machine name such as 'beaglev-starfive-jh7100'.

thanks,
drew

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-09 20:29         ` Drew Fustini
  2021-05-09 20:31           ` Khem Raj
@ 2021-05-10  7:02           ` Drew Fustini
  2021-05-10  9:07             ` Peter Korsgaard
  1 sibling, 1 reply; 38+ messages in thread
From: Drew Fustini @ 2021-05-10  7:02 UTC (permalink / raw)
  To: buildroot

On Sun, May 9, 2021 at 1:29 PM Drew Fustini <drew@beagleboard.org> wrote:
>
> On Sun, May 9, 2021 at 4:04 AM Arnout Vandecappelle <arnout@mind.be> wrote:
> >
> >
> >
> > On 09/05/2021 13:03, Arnout Vandecappelle wrote:
> > >
> > >
> > > On 08/05/2021 00:04, Yann E. MORIN wrote:
> > >> On 2021-05-04 22:51 +0200, Thomas Petazzoni spake thusly:
> > >>> This commit adds a package for the DDR initialization code used on the
> > >>> BeagleV platform.
> > >>
> > >> The upstream package name is beaglev-ddrlnit, yes, with an 'l' instead
> > >> of an 'i'. I've renamed the package to match upstream name, so that
> > >> users that look for it can actually find it.
> > >
> > >  What's done is done of course, but in this case, I think we should have stuck
> > > to ddrinit with an eye. That name makes much more sense, and in fact when people
> > > search for it (with / in menuconfig) they're IMHO much more likely to search for
> > > it with an eye than with an el. The el you'd probably only use when you copy and
> > > paste the name from github, but who does that?
> > >
> > >
> > >  @Drew/Bing, on github, when you rename a repository, the old name will still
> > > redirect to the new one (at least until you create a new repo with that name).
> > > So I'd go ahead and to the rename to ddrinit, it should break anything.
> >
> >  I forgot the reference:
> >
> > https://docs.github.com/en/github/administering-a-repository/renaming-a-repository
>
> Thank you.  I knew that the redirect worked on the website, but this
> clarifies that it also works for git clone as well.  Therefore, it
> seems like I should ask starfive to fix the typo as the old repo url
> with the typo will still work.

The typo has now been fixed by Michael Zhu at StarFive:
https://github.com/starfive-tech/beagle_ddrinit/issues/6

The typo name (with "l") does still work:
https://github.com/starfive-tech/beagle_ddrlnit

but it will redirect to the correct name (with "i"):
https://github.com/starfive-tech/beagle_ddrinit

thank you,
drew

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: new package
  2021-05-10  7:02           ` Drew Fustini
@ 2021-05-10  9:07             ` Peter Korsgaard
  0 siblings, 0 replies; 38+ messages in thread
From: Peter Korsgaard @ 2021-05-10  9:07 UTC (permalink / raw)
  To: buildroot

>>>>> "Drew" == Drew Fustini <drew@beagleboard.org> writes:

Hi,

 > The typo has now been fixed by Michael Zhu at StarFive:
 > https://github.com/starfive-tech/beagle_ddrinit/issues/6

 > The typo name (with "l") does still work:
 > https://github.com/starfive-tech/beagle_ddrlnit

 > but it will redirect to the correct name (with "i"):
 > https://github.com/starfive-tech/beagle_ddrinit

Great, thanks. I've sent a patch to rename the corresponding package:

https://patchwork.ozlabs.org/project/buildroot/patch/20210510090658.24276-1-peter at korsgaard.com/

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform
  2021-05-04 20:51 [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Thomas Petazzoni
                   ` (7 preceding siblings ...)
  2021-05-07 22:00 ` [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Yann E. MORIN
@ 2021-05-14 21:06 ` Drew Fustini
  8 siblings, 0 replies; 38+ messages in thread
From: Drew Fustini @ 2021-05-14 21:06 UTC (permalink / raw)
  To: buildroot

On Tue, May 4, 2021 at 1:51 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello,
>
> Here is a third iteration of the BeagleV patch series, which brings a
> few fixes:
>
>  * The post-build script of v1 calling "make printvars" was working
>    only for in-tree builds. Following a comment from Frank Hunleth on
>    the v1, it was changed in v2 to use "make -C ${O} printvars", which
>    made out-of-tree builds work, but broke in-tree builds. So in this
>    new version, we introduced a preliminary patch that exposes
>    $(CONFIG_DIR) to post-build/post-image scripts, to make such "make
>    printvars" invocations possible.
>
>  * The beaglev_defconfig is updated to take into account the rename of
>    the Git repositories by Starfive for Linux, U-Boot and OpenSBI.
>
>  * Reviewed-by tags from Bin Meng are added on beaglev-ddrinit,
>    beaglev-secondboot and the corresponding beaglev_defconfig
>    update. Thanks Bin!
>
> As usual, the whole thing is also available at:
>
>   https://github.com/tpetazzoni/buildroot/commits/beaglev
>
> Best regards,
>
> Thomas Petazzoni
>
> Thomas Petazzoni (7):
>   package/Makefile.in: expose CONFIG_DIR to post-build/post-image
>     scripts
>   boot/opensbi: add options to enable/disable image installation
>   configs/beaglev_defconfig: new defconfig
>   package/riscv64-elf-toolchain: new package
>   boot/beaglev-ddrinit: new package
>   boot/beaglev-secondboot: new package
>   configs/beaglev: enable building of low-level firmware
>
>  DEVELOPERS                                    |   5 +
>  board/beaglev/extlinux.conf                   |   4 +
>  board/beaglev/genimage.cfg                    |  12 ++
>  ...s-starfive-vic7100-adjust-fdt_addr_r.patch |  39 ++++++
>  board/beaglev/post-build.sh                   |  17 +++
>  board/beaglev/readme.txt                      | 122 ++++++++++++++++++
>  boot/Config.in                                |   2 +
>  boot/beaglev-ddrinit/Config.in                |   9 ++
>  boot/beaglev-ddrinit/beaglev-ddrinit.mk       |  29 +++++
>  boot/beaglev-secondboot/Config.in             |   9 ++
>  boot/beaglev-secondboot/beaglev-secondboot.mk |  29 +++++
>  boot/opensbi/Config.in                        |  20 +++
>  boot/opensbi/opensbi.mk                       |  16 ++-
>  configs/beaglev_defconfig                     |  37 ++++++
>  docs/manual/customize-post-image.txt          |   3 +-
>  docs/manual/customize-rootfs.txt              |   3 +
>  package/Makefile.in                           |   1 +
>  .../riscv64-elf-toolchain.mk                  |  25 ++++
>  18 files changed, 375 insertions(+), 7 deletions(-)
>  create mode 100644 board/beaglev/extlinux.conf
>  create mode 100644 board/beaglev/genimage.cfg
>  create mode 100644 board/beaglev/patches/uboot/0001-include-configs-starfive-vic7100-adjust-fdt_addr_r.patch
>  create mode 100755 board/beaglev/post-build.sh
>  create mode 100644 board/beaglev/readme.txt
>  create mode 100644 boot/beaglev-ddrinit/Config.in
>  create mode 100644 boot/beaglev-ddrinit/beaglev-ddrinit.mk
>  create mode 100644 boot/beaglev-secondboot/Config.in
>  create mode 100644 boot/beaglev-secondboot/beaglev-secondboot.mk
>  create mode 100644 configs/beaglev_defconfig
>  create mode 100644 package/riscv64-elf-toolchain/riscv64-elf-toolchain.mk
>
> --
> 2.30.2
>

Thank you so much again for getting support added to buildroot.

I wanted to note that Kali Prasad (cc'd) has developed a very helpful
bootloader recovery tool [1] that is a simple C program and would
probably be useful to include in the beaglev buildroot config.  This
works around the problem that the BootROM in the StarFive JH7100 has a
buggy xmodem crc implementation that did not work with any of the
existing open source terminal emulators.

-Drew

[1] https://github.com/kprasadvnsi/JH71xx-tools

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2021-05-14 21:06 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04 20:51 [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Thomas Petazzoni
2021-05-04 20:51 ` [Buildroot] [PATCH v3 1/7] package/Makefile.in: expose CONFIG_DIR to post-build/post-image scripts Thomas Petazzoni
2021-05-06 21:03   ` Yann E. MORIN
2021-05-08 14:32   ` Peter Korsgaard
2021-05-04 20:51 ` [Buildroot] [PATCH v3 2/7] boot/opensbi: add options to enable/disable image installation Thomas Petazzoni
2021-05-05  1:03   ` Alistair Francis
2021-05-04 20:51 ` [Buildroot] [PATCH v3 3/7] configs/beaglev_defconfig: new defconfig Thomas Petazzoni
2021-05-05  1:05   ` Alistair Francis
2021-05-07 22:02   ` Yann E. MORIN
2021-05-08 18:23     ` Thomas Petazzoni
2021-05-04 20:51 ` [Buildroot] [PATCH v3 4/7] package/riscv64-elf-toolchain: new package Thomas Petazzoni
2021-05-04 20:51 ` [Buildroot] [PATCH v3 5/7] boot/beaglev-ddrinit: " Thomas Petazzoni
2021-05-07 22:04   ` Yann E. MORIN
2021-05-07 22:06     ` Yann E. MORIN
2021-05-07 23:30     ` Drew Fustini
2021-05-08  7:37       ` Yann E. MORIN
2021-05-08  7:48         ` Drew Fustini
2021-05-08 16:01           ` Khem Raj
2021-05-08 18:20             ` Yann E. MORIN
2021-05-08 19:54               ` Drew Fustini
2021-05-08 21:10             ` Drew Fustini
2021-05-08 22:09               ` Khem Raj
2021-05-09 20:23                 ` Drew Fustini
2021-05-09 20:26                   ` Khem Raj
2021-05-09 20:34                     ` Drew Fustini
2021-05-08 18:21     ` Thomas Petazzoni
2021-05-09 11:03     ` Arnout Vandecappelle
2021-05-09 11:04       ` Arnout Vandecappelle
2021-05-09 20:29         ` Drew Fustini
2021-05-09 20:31           ` Khem Raj
2021-05-10  7:02           ` Drew Fustini
2021-05-10  9:07             ` Peter Korsgaard
2021-05-04 20:51 ` [Buildroot] [PATCH v3 6/7] boot/beaglev-secondboot: " Thomas Petazzoni
2021-05-07 22:07   ` Yann E. MORIN
2021-05-04 20:51 ` [Buildroot] [PATCH v3 7/7] configs/beaglev: enable building of low-level firmware Thomas Petazzoni
2021-05-07 22:08   ` Yann E. MORIN
2021-05-07 22:00 ` [Buildroot] [PATCH v3 0/7] Support for the BeagleV platform Yann E. MORIN
2021-05-14 21:06 ` Drew Fustini

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.