From patchwork Fri Jan 6 17:17:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan-Niklas Burfeind X-Patchwork-Id: 1722552 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=HOMFj3hI; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aiyionpri.me header.i=@aiyionpri.me header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=jtRVEgbF; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NpVj12HDyz23fF for ; Sat, 7 Jan 2023 04:30:12 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=crsrM9uThJNH8MqxcGTicrzM5RNy1YzR0ezo5e6aWk4=; b=HOMFj3hIknmSOS 1UgqTIMbO9ifeADaQ18aZoKEJ5ydGOMn5QHZNnCLSZz3/OIwPK36VL4EPCZmXTFqcaP3xBuuhDpxX DRmQsZK1h9T3G6WAQqhZdipdlxWqCFNR2L5CsoYuQkbhOd2gaO2PWOni1NBsLiqOjfdFLzZLyX0kp 9tDa4u2uG5fryKDId8HT57h2eKN5YJT4woYnOjuxaJswNyCnuRnD1lluMY2zVdSNxAFdpVoUPS0NF Os5fOvtIHep2G3orwvXvk5/8gTDm64V7aaTKav5in8LwzRu2THJJUFkloydx/8VXmzgWcErluvjYD 7ookkapJHv3BoU3WrAFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDqUl-00Bgo7-As; Fri, 06 Jan 2023 17:27:10 +0000 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.163]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDqLt-00BKlz-QW for openwrt-devel@lists.openwrt.org; Fri, 06 Jan 2023 17:17:59 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1673025460; cv=none; d=strato.com; s=strato-dkim-0002; b=HwkJzD+JIHzI2fophY+aqPO7jvWRFMnsTeOVEkI5aiCPWXtuXSM85l07gYpKVTZPs8 zyjvGnHTjxrSMaqouaJ9x+7b11ao0MFQKmK/Rg4fMrIegEDzHhVMvnlintUVLyqq4b19 ULocFY5eS9KhLAogEIpNcz9PPQ1dEELroqFDPHa2BwapYwZFnFlv3dP1cW9UiFoedIWM w5Mlwu/XBVFSTAovTeum61JfOglePyBKWa+8AcXXxKRLlpPeSJ14X3iah8PYqKygjsBq 3X/dvhydYkGelnXCgYew2jf63Z/v+B2qw86rCrFkgXfFxONH807OY0Hhsz7ZDrmZxv/F hAEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1673025460; s=strato-dkim-0002; d=strato.com; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=JKy+srhYoLe4RMocbl7E451MGEjaIitMw6FGoPKj1QY=; b=RGegq0NweXpuX69VUyOkn8rjC1JdFtBDhMjtnmsRbslssxEPKasd9KL3f0uuYtxvg6 kAwESQCeWd4YD6vdC6BH376sxLq+wrHABUb3JZpMw39RwzpMeHn0n0lFioZZpTBUwn7g gBK292Ij2FXpmvzTZvONxqPxxll97g8W57yTfBQvghPwCz1p1TNvrKK5nGqxOZYaj1uB AjnIebUFymjdVbH9VVY4CWwNiTLPOVaUz97Ws4/P585ozOOTXnLpyefqpc2Q7kKqMERL yBPQ+cIDS/jSgzyfGVxIfjnLef3jHzEzFOoU1ZArlK45KALMqluO0NsOmlZ8Bse0Zfs7 tY0w== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1673025460; s=strato-dkim-0002; d=aiyionpri.me; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=JKy+srhYoLe4RMocbl7E451MGEjaIitMw6FGoPKj1QY=; b=jtRVEgbFyCY/1gZ8Be9biVdmLQ2tz1d1cVlKq6P0lb53bAjjUntsqvWq96O4qQrvmP f2NR/9SA5lUF8UahoXsqmx2syD+3ZBSlTHVBuqYq118fAzVUQPKu3fFXzOy8V7bVJmPV NOyI6hcaJ1I6/qjPHQdEf6bcO/6k+d9yddqmLlKyy/eZ9pefU8W8NuUC7fhr7dgseJ1Q 7ynIIg6UD+4ch9gsv/h2jT4tHBcE7C9A7Z+dy2KfWnftiQdgMrm0GhQszjNw5yDPHooq xl7yhydA4HOr6zT9gO8DZrHgQy6JLV9w8Gq7wA03dkJVoH5G2BafSYjN2znzePmr9tfA w2kA== X-RZG-AUTH: ":IWkkdEmxcvCtRDtHUQOu48a0Nfy9hOkboq9r6d0vrgVDHZTjCI2AM0yZX6WZJhCkFc9F6c48nf2L4jELJl7xXZUOYd+C5NO+lpT/QQ==" Received: from chromia.fritz.box by smtp.strato.de (RZmta 48.6.2 AUTH) with ESMTPSA id R44263z06HHeMLz (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 6 Jan 2023 18:17:40 +0100 (CET) From: Jan-Niklas Burfeind To: openwrt-devel@lists.openwrt.org Cc: Jan-Niklas Burfeind , Karl Palsson , Stijn Tintel Subject: [PATCH-22.03 1/2] uboot-sunxi: use UUID of bootdev and bootpart Date: Fri, 6 Jan 2023 18:17:27 +0100 Message-Id: <20230106171728.5654-1-git@aiyionpri.me> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230106_091758_136628_7CFD606F X-CRM114-Status: GOOD ( 10.03 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Several sunxi devices come with multiple mmc devices. On such devices, the mmc device order is unpredictable, so using /dev/mmcblk0p2 as root device doesn't always work, which results in unbootable de [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [81.169.146.163 listed in list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [81.169.146.163 listed in wl.mailspike.net] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Several sunxi devices come with multiple mmc devices. On such devices, the mmc device order is unpredictable, so using /dev/mmcblk0p2 as root device doesn't always work, which results in unbootable devices. For the Banana Pi BPI-R3 in the mediatek target, this has been solved by defining aliases for the mmc devices in the DTS. Ideally we would do the same here, but for sunxi-a64 we already use UUID probing, so let's start with that (5f2ff607e286 ("uboot-sunxi: a64: allow booting directly from eMMC")). Since we're building and including u-boot in each supported device image, and this method has been proven to work fine for a64, let's just change the default u-boot env file to do the same. Fixes: #10080 Fixes: e6d9f6fdff ("sunxi: add support for FriendlyARM NanoPi R1") Co-authored-by: Karl Palsson Signed-off-by: Jan-Niklas Burfeind [use UUID in default u-boot env, rewrite commit message] Signed-off-by: Stijn Tintel (cherry picked from commit bf06a7c865531cf20735cbdfac46d4947fcc18a6) --- package/boot/uboot-sunxi/uEnv-default.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package/boot/uboot-sunxi/uEnv-default.txt b/package/boot/uboot-sunxi/uEnv-default.txt index e024954516..36e41c59b1 100644 --- a/package/boot/uboot-sunxi/uEnv-default.txt +++ b/package/boot/uboot-sunxi/uEnv-default.txt @@ -1,6 +1,8 @@ setenv fdt_high ffffffff -setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage -setenv loaddtb fatload mmc 0 \$fdt_addr_r dtb -setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait +setenv mmc_rootpart 2 +part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid +setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_addr_r uImage +setenv loaddtb fatload mmc \$mmc_bootdev \$fdt_addr_r dtb +setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=${uuid} rootwait setenv uenvcmd run loadkernel \&\& run loaddtb \&\& bootm \$kernel_addr_r - \$fdt_addr_r run uenvcmd