From patchwork Mon Jul 1 07:37:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enrico Mioso X-Patchwork-Id: 1954529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=Mt7X9T2C; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=ZUPNOT1Q; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WCHzr1TKXz1xpN for ; Mon, 1 Jul 2024 17:41:43 +1000 (AEST) 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=h2DN47N8fmFj/06o71yZn9PkpjIIp2Jf1jPK7fyWx5c=; b=Mt7X9T2CINX/yz O9YF9Mo5N6fXxwzb7RjBFxRPj1jyNHsKCi98aUXVyAy/PkXDhGE8B0w2XP+rv72hYWzKdcFUG7e75 PyWJD1etE1vafoCKoGNGGdM3fqtagWhJrIVZ6zWsPHq86+u6oh/aw3vgxVWvJ7Xujta1wY8pdPCUz jBxtPqzWS8ZlmlNhEqZbHHH4YOAA0sahDb0Iqss/NoQvPlT6LVeB4pjF09fpTZCKNvbiGgGaikBPp Q8N/RT0GziFeGvC0nmGCpAmUo+Q3TSxDb38TxJ9U8Z69Pt65KFzd3fMJnmmnXa5euQ1pJE7B15gUj Ob3oHca9z3fPFjEmSYaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOBdp-000000024oM-0fKc; Mon, 01 Jul 2024 07:40:01 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOBdl-000000024mg-3lPC for openwrt-devel@lists.openwrt.org; Mon, 01 Jul 2024 07:39:59 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3627ef1fc07so1603461f8f.3 for ; Mon, 01 Jul 2024 00:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719819596; x=1720424396; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=nS8Un57YH9F7oJhZoaMjN34sqPJZpD9KNV52ebseiAE=; b=ZUPNOT1QgxpxA3+iJl2m4SwFCRLMnSxfIZ8/fJdGHZuLPFgyiJIUT91ho4oN6+AHCC NQi6gP5dBf6zeE55X7HRbc3wm5clTCyas/ZAjTPtpWNQnQGuELPMOPcui5ZYblNGsQ1A e/pa0o65FrL6jeh2o9F4p+y1yDjOi+g/+Z1DhHzzS9wUELVnQjMgFEWzgqEiKFt37owp ZyobQ5fyVHaUkKhSlqkdFwZ8nccBq8CJ7do2Z5c6eJfbS63rAqK8NVpSGVqkYEqMZtDa dkWPoeLkcWK5VjiLAAy/G8pmWtJCi4OCyhZw8I50/0T3PQWfQtSklmO0K/rwqXVLOTLE 3m3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719819596; x=1720424396; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nS8Un57YH9F7oJhZoaMjN34sqPJZpD9KNV52ebseiAE=; b=SuaiqxK1hvsMxhYRWggZMRzQXxQlVnsAWfWvI9ZgU6qoqvFC5fsyYHFDHyRJvAYYSf f4zLPAzxhNJNagk/yD7jNCVxgjfpDcZB8vpwaG+YPfPRHz7UJGbJR5Kc/L/kyLDcO/GM Gho/RZxyeCB0F0zfFn3ez12p+Hz3qVfTEdeRwf3MAyBsqs4Bdim2qaeuzYCPAlm1x7BZ i9vsAk5nr2lW2NCcBb6gRhQ5KXOWgUphtcoT1ldxFz5hXonpGFVJgVUzyKhgQhWU1m3A M5wuTmEfH80PMQto5lAA/hWtQF0e0JBGSpiIAeP8EIgyGbO7Kgn199VzpR0o5zCHNJYT jPAQ== X-Gm-Message-State: AOJu0YyOkiMU9tIXYWDGDHLPJhurVDAWtLjEjc/jxBCrJspHv+NdfO/E jYbdZmQ70zCOb3F9SqTSPM4jnv28kLvJ8U3zb+jszUHW1IITapowXhmz7Jbq X-Google-Smtp-Source: AGHT+IFz/j+Ph37ivZwnTyxHiSwatAFSj1VAr2DfsH/tEiUx9mgX7oFPKy8xgvfv56wgChoTNx0kxA== X-Received: by 2002:a5d:4949:0:b0:362:ea80:db1d with SMTP id ffacd0b85a97d-3677569dd77mr2664189f8f.6.1719819595592; Mon, 01 Jul 2024 00:39:55 -0700 (PDT) Received: from localhost.localdomain (u-k-77-240-224.4bone.mynet.it. [77.240.224.17]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0cd5fcsm9203148f8f.11.2024.07.01.00.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 00:39:55 -0700 (PDT) From: Enrico Mioso To: OpenWrt Development List Cc: Enrico Mioso Subject: [PATCH 1/2] mvebu: GL-MV1000: add custom boot script Date: Mon, 1 Jul 2024 09:37:58 +0200 Message-ID: <20240701073943.3886539-1-mrkiko.rs@gmail.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240701_003957_955577_07116006 X-CRM114-Status: GOOD ( 13.98 ) 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: This allows booting from internal eMMC or SD card just changing the U-Boot mmc_dev variable. In particular, setting mmc_dev to 1 will result in booting from the SD card. Setting the variable to 0 will [...] 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 [2a00:1450:4864:20:0:0:0:434 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [mrkiko.rs(at)gmail.com] 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 This allows booting from internal eMMC or SD card just changing the U-Boot mmc_dev variable. In particular, setting mmc_dev to 1 will result in booting from the SD card. Setting the variable to 0 will result in internal eMMC boot (the default). Should the variable be unset or an error condition occur while reading from SD card, internal MMC booting will be tried. Signed-off-by: Enrico Mioso --- target/linux/mvebu/image/cortexa53.mk | 1 + target/linux/mvebu/image/gl-mv1000.bootscript | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 target/linux/mvebu/image/gl-mv1000.bootscript diff --git a/target/linux/mvebu/image/cortexa53.mk b/target/linux/mvebu/image/cortexa53.mk index afe8d9ce21..2a3b5ee11e 100644 --- a/target/linux/mvebu/image/cortexa53.mk +++ b/target/linux/mvebu/image/cortexa53.mk @@ -3,6 +3,7 @@ define Device/glinet_gl-mv1000 DEVICE_VENDOR := GL.iNet DEVICE_MODEL := GL-MV1000 SOC := armada-3720 + BOOT_SCRIPT := gl-mv1000 endef TARGET_DEVICES += glinet_gl-mv1000 diff --git a/target/linux/mvebu/image/gl-mv1000.bootscript b/target/linux/mvebu/image/gl-mv1000.bootscript new file mode 100644 index 0000000000..be93aa36a0 --- /dev/null +++ b/target/linux/mvebu/image/gl-mv1000.bootscript @@ -0,0 +1,28 @@ +# Boot script for GL.iNet GL-MV1000 to make it easier to boot from eMMC or SD +# card. + +setenv bootargs "root=PARTUUID=@ROOT@-02 rw rootwait" + +if test -n "${console}"; then + setenv bootargs "${bootargs} ${console}" +fi + +# Should mmc_dev not be present, default to internal MMC boot +if test -z "${mmc_dev}"; then + setenv mmc_dev 0 +fi + +setenv mmcdev "${mmc_dev}" + +if test -n "${fdt_addr_r}"; then + setenv fdt_addr ${fdt_addr_r} +fi + +if test -n "${kernel_addr_r}"; then + setenv kernel_addr ${kernel_addr_r} +fi + +load mmc ${mmcdev}:1 ${fdt_addr} @DTB@.dtb +load mmc ${mmcdev}:1 ${kernel_addr} Image + +booti ${kernel_addr} - ${fdt_addr}