From patchwork Sun May 2 21:21:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1472915 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.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 4FYJyn36QJz9s1l for ; Mon, 3 May 2021 07:24:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9B840403DF; Sun, 2 May 2021 21:24:31 +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 u8JfHTcKKHRT; Sun, 2 May 2021 21:24:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id CE92140411; Sun, 2 May 2021 21:24:29 +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 C8F981BF389 for ; Sun, 2 May 2021 21:22:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B890D403D3 for ; Sun, 2 May 2021 21:22:09 +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 RZrzmHPE6m8z for ; Sun, 2 May 2021 21:22:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by smtp2.osuosl.org (Postfix) with ESMTPS id 827ED403D2 for ; Sun, 2 May 2021 21:22:08 +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 relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 57420FF802; Sun, 2 May 2021 21:22:06 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Sun, 2 May 2021 23:21:41 +0200 Message-Id: <20210502212141.934384-14-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 --- 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