From patchwork Sun May 2 21:21:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1472906 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FYJwK3ndvz9s1l for ; Mon, 3 May 2021 07:22:25 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 5D9128455F; Sun, 2 May 2021 21:22:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ySyxkinD2A0D; Sun, 2 May 2021 21:22:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id A94F984FCD; Sun, 2 May 2021 21:22:21 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 3067D1BF389 for ; Sun, 2 May 2021 21:21:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 1ED294060A for ; Sun, 2 May 2021 21:21:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4NEWZm8AGGje for ; Sun, 2 May 2021 21:21:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by smtp4.osuosl.org (Postfix) with ESMTPS id B6B86405F4 for ; Sun, 2 May 2021 21:21:53 +0000 (UTC) Received: from localhost (lfbn-tou-1-1158-148.w90-76.abo.wanadoo.fr [90.76.218.148]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 19E58200005; Sun, 2 May 2021 21:21:49 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 2 May 2021 23:21:29 +0200 Message-Id: <20210502212141.934384-2-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> References: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/6] boot/opensbi: add options to enable/disable image installation X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Drew Fustini , Alistair Francis , Thomas Petazzoni , Bin Meng Errors-To: buildroot-bounces@busybox.net Sender: "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 Reviewed-by: Alistair Francis Reviewed-by: Bin Meng --- 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 From patchwork Sun May 2 21:21:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1472905 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FYJw56VGxz9s1l for ; Mon, 3 May 2021 07:22:13 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 057296089A; Sun, 2 May 2021 21:22:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rFVV9pXxM_02; Sun, 2 May 2021 21:22:09 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id D190F60684; Sun, 2 May 2021 21:22:08 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id ECDDF1BF389 for ; Sun, 2 May 2021 21:21:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id DBEEF84561 for ; Sun, 2 May 2021 21:21:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l5hRAa3KoQoj for ; Sun, 2 May 2021 21:21:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by smtp1.osuosl.org (Postfix) with ESMTPS id 88C1B8455F for ; Sun, 2 May 2021 21:21:53 +0000 (UTC) X-Originating-IP: 90.76.218.148 Received: from localhost (lfbn-tou-1-1158-148.w90-76.abo.wanadoo.fr [90.76.218.148]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 7409940006; Sun, 2 May 2021 21:21:51 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 2 May 2021 23:21:30 +0200 Message-Id: <20210502212141.934384-3-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> References: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 2/6] configs/beaglev_defconfig: new defconfig X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Drew Fustini , Bin Meng , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This commit introduces support for the RISC-V based BeagleV platform, which uses a Starfive JH7100. Signed-off-by: Thomas Petazzoni Reviewed-by: Alistair Francis --- 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 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 +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 +--- + 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..04153cb3b6 --- /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${O} --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..2320e2ca83 --- /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,beagle_kernel_5.10,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,beagle_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,beagle_uboot-opensbi,3f3ac01a29ad1cd5fa519d86f81daead2447f1d4)/uboot-3f3ac01a29ad1cd5fa519d86f81daead2447f1d4.tar.gz" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="starfive_vic7100_beagle_v_smode" +BR2_PACKAGE_HOST_GENIMAGE=y From patchwork Sun May 2 21:21:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1472907 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FYJwY4MpKz9s1l for ; Mon, 3 May 2021 07:22:37 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E57C98500C; Sun, 2 May 2021 21:22:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kM__olXvD-2x; Sun, 2 May 2021 21:22:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 2CFD484FE8; Sun, 2 May 2021 21:22:34 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 511D51BF389 for ; Sun, 2 May 2021 21:21:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4D8D684561 for ; Sun, 2 May 2021 21:21:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0A7ox_Gj1htt for ; Sun, 2 May 2021 21:21:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by smtp1.osuosl.org (Postfix) with ESMTPS id 1AC728455F for ; Sun, 2 May 2021 21:21:55 +0000 (UTC) X-Originating-IP: 90.76.218.148 Received: from localhost (lfbn-tou-1-1158-148.w90-76.abo.wanadoo.fr [90.76.218.148]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id D031260005; Sun, 2 May 2021 21:21:52 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 2 May 2021 23:21:31 +0200 Message-Id: <20210502212141.934384-4-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> References: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 3/6] package/riscv64-elf-toolchain: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Drew Fustini , Bin Meng , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "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 --- 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)) From patchwork Sun May 2 21:21:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1472909 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FYJx40Ffbz9s1l for ; Mon, 3 May 2021 07:23:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E86DF41957; Sun, 2 May 2021 21:23:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Le3xD13J7mhU; Sun, 2 May 2021 21:23:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id CC8194196C; Sun, 2 May 2021 21:22:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 83DAA1BF389 for ; Sun, 2 May 2021 21:21:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 6F5194060A for ; Sun, 2 May 2021 21:21:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LG0GCp_v16n5 for ; Sun, 2 May 2021 21:21:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by smtp4.osuosl.org (Postfix) with ESMTPS id B5A5840625 for ; Sun, 2 May 2021 21:21:57 +0000 (UTC) Received: from localhost (lfbn-tou-1-1158-148.w90-76.abo.wanadoo.fr [90.76.218.148]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 495AA100002; Sun, 2 May 2021 21:21:54 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 2 May 2021 23:21:32 +0200 Message-Id: <20210502212141.934384-5-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> References: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 4/6] boot/beaglev-ddrinit: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Drew Fustini , Bin Meng , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This commit adds a package for the DDR initialization code used on the BeagleV platform. Signed-off-by: Thomas Petazzoni Reviewed-by: Bin Meng --- 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 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)) From patchwork Sun May 2 21:21:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1472908 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FYJwp6BGnz9s1l for ; Mon, 3 May 2021 07:22:50 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id BAE0540638; Sun, 2 May 2021 21:22:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6sURDvEJjy4U; Sun, 2 May 2021 21:22:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id B63834063F; Sun, 2 May 2021 21:22:46 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 2691D1BF389 for ; Sun, 2 May 2021 21:21:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0FE8160684 for ; Sun, 2 May 2021 21:21:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oEr4EHUvoemt for ; Sun, 2 May 2021 21:21:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by smtp3.osuosl.org (Postfix) with ESMTPS id BBCDF6065A for ; Sun, 2 May 2021 21:21:57 +0000 (UTC) X-Originating-IP: 90.76.218.148 Received: from localhost (lfbn-tou-1-1158-148.w90-76.abo.wanadoo.fr [90.76.218.148]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 91CE060008; Sun, 2 May 2021 21:21:55 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 2 May 2021 23:21:33 +0200 Message-Id: <20210502212141.934384-6-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> References: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 5/6] boot/beaglev-secondboot: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Drew Fustini , Bin Meng , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "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 Reviewed-by: Bin Meng --- 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)) From patchwork Sun May 2 21:21:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1472910 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FYJxJ3hQhz9s1l for ; Mon, 3 May 2021 07:23:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id E29A6608A0; Sun, 2 May 2021 21:23:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b1qJ4knKNUmK; Sun, 2 May 2021 21:23:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 31273606A8; Sun, 2 May 2021 21:23:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 4672B1BF389 for ; Sun, 2 May 2021 21:22:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 432B3400BA for ; Sun, 2 May 2021 21:22:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uO9npjzF1MSM for ; Sun, 2 May 2021 21:21:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by smtp2.osuosl.org (Postfix) with ESMTPS id 05040400A6 for ; Sun, 2 May 2021 21:21:58 +0000 (UTC) Received: from localhost (lfbn-tou-1-1158-148.w90-76.abo.wanadoo.fr [90.76.218.148]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id D290A100005; Sun, 2 May 2021 21:21:56 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 2 May 2021 23:21:34 +0200 Message-Id: <20210502212141.934384-7-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> References: <20210502212141.934384-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 6/6] configs/beaglev: enable building of low-level firmware X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Drew Fustini , Bin Meng , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "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 Reviewed-by: Bin Meng --- 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@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 2320e2ca83..3efcab8d61 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