From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 09 Jun 2023 12:28:53 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q7ZMV-00H26Z-8W for lore@lore.pengutronix.de; Fri, 09 Jun 2023 12:28:53 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1q7ZMR-0001vR-TJ; Fri, 09 Jun 2023 12:28:51 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q7ZMM-0001r5-Uu; Fri, 09 Jun 2023 12:28:46 +0200 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1q7ZMM-006BAx-9e; Fri, 09 Jun 2023 12:28:46 +0200 Received: from localhost ([::1] helo=dude03.red.stw.pengutronix.de) by dude03.red.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1q7ZMK-00CAFT-Nw; Fri, 09 Jun 2023 12:28:44 +0200 From: Johannes Zink Date: Fri, 09 Jun 2023 12:28:42 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230606-default_enable_fastboot_rock3a-v2-3-92606c4de9a9@pengutronix.de> References: <20230606-default_enable_fastboot_rock3a-v2-0-92606c4de9a9@pengutronix.de> In-Reply-To: <20230606-default_enable_fastboot_rock3a-v2-0-92606c4de9a9@pengutronix.de> To: distrokit@pengutronix.de X-Mailer: b4 0.12.2 Subject: [DistroKit] [PATCH v2 3/4] v8a: barebox: enable loading kernel, dtb and initrd via fastboot X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Johannes Zink , patchwork-jzi@pengutronix.de Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false This allows to load kernel, dtb and initrd as sparse images to RAM-files. While at it, also enable the acm gadget, which exposes the barebox shell as an USB gadget and autostart the usb gadgets. Also expose mmc{0,1,2} as fastboot partitions and add init script to force barebox to detect these devices and have them available for fastboot. Signed-off-by: Johannes Zink --- Changes: v1 -> v2: - worked in Ahmad's and Jan's review findings, thanks for your review: - use generic names mmc{0,1,2} instead of {sd,emmc, } to allow generic reuse of the fastboot partitions across multiple boards - use more obvious partition names ram-{kernel,initramfs,oftree} to - add init script for detecting /dev/mmc{0,1,2} --- configs/platform-v8a/barebox-common-defaultenv/init/detect-mmcs | 3 +++ configs/platform-v8a/barebox-common-defaultenv/nv/fastboot.acm | 1 + configs/platform-v8a/barebox-common-defaultenv/nv/fastboot.bbu | 1 + configs/platform-v8a/barebox-common-defaultenv/nv/fastboot.partitions | 1 + configs/platform-v8a/barebox-common-defaultenv/nv/usbgadget.autostart | 1 + 5 files changed, 7 insertions(+) diff --git a/configs/platform-v8a/barebox-common-defaultenv/init/detect-mmcs b/configs/platform-v8a/barebox-common-defaultenv/init/detect-mmcs new file mode 100755 index 000000000000..e3433f6da09f --- /dev/null +++ b/configs/platform-v8a/barebox-common-defaultenv/init/detect-mmcs @@ -0,0 +1,3 @@ +#!/bin/sh + +detect mmc0 mmc1 mmc2 diff --git a/configs/platform-v8a/barebox-common-defaultenv/nv/fastboot.acm b/configs/platform-v8a/barebox-common-defaultenv/nv/fastboot.acm new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/configs/platform-v8a/barebox-common-defaultenv/nv/fastboot.acm @@ -0,0 +1 @@ +1 diff --git a/configs/platform-v8a/barebox-common-defaultenv/nv/fastboot.bbu b/configs/platform-v8a/barebox-common-defaultenv/nv/fastboot.bbu new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/configs/platform-v8a/barebox-common-defaultenv/nv/fastboot.bbu @@ -0,0 +1 @@ +1 diff --git a/configs/platform-v8a/barebox-common-defaultenv/nv/fastboot.partitions b/configs/platform-v8a/barebox-common-defaultenv/nv/fastboot.partitions new file mode 100644 index 000000000000..527925e1c58b --- /dev/null +++ b/configs/platform-v8a/barebox-common-defaultenv/nv/fastboot.partitions @@ -0,0 +1 @@ +/dev/mmc0(mmc0)o,/dev/mmc1(mmc1)o,/dev/mmc2(mmc2)o,/tmp/ram-kernel(ram-kernel)c,/tmp/ram-initramfs(ram-initramfs)c,/tmp/ram-oftree(ram-oftree)c diff --git a/configs/platform-v8a/barebox-common-defaultenv/nv/usbgadget.autostart b/configs/platform-v8a/barebox-common-defaultenv/nv/usbgadget.autostart new file mode 100644 index 000000000000..d00491fd7e5b --- /dev/null +++ b/configs/platform-v8a/barebox-common-defaultenv/nv/usbgadget.autostart @@ -0,0 +1 @@ +1 -- 2.39.2