From patchwork Mon Nov 26 18:14:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 1003374 X-Patchwork-Delegate: openwrt@kresin.me Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="T57BSGRd"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="d+DAjsno"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 433Znf0m31z9s3l for ; Tue, 27 Nov 2018 05:14:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date: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=DunjMLsoQKYiHXOT4tgjGLrrHS2Fd02ojQC4zO/rFEA=; b=T57BSGRdmthCWn OpZ4oFqtB8XaGmAcfm/n9s1Ma3jyUleOwZavTdCbfHN5165F97i5+1Bt3YUOMmpJZaeUutOoLPae8 m3XWuxnPy2V6wTY/1NTUW0vYjGcPcnZi0ZA0IgKkEiTFY75Ub1d9waeXtW9oXoDUglX/ZNRdm6MNj uwILgoH6pyf1dcE/etE6ndHw8T4NW66Fqsnr9JvjCVfutfw4iTy54PDjBMOdzoGPYcQV/feGBdBIo wyef0P9dyRV+EzsNjdKID5wxppF3/WpWPLEvfOPR0vYDcyyRAHpTZH6sfU5ZaJYIvQFXPUDQuxKLM 4wYsbSe3JI1W1f3OrShg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRLP3-0003Xh-Pw; Mon, 26 Nov 2018 18:14:37 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRLP0-0003XH-CO for openwrt-devel@lists.openwrt.org; Mon, 26 Nov 2018 18:14:35 +0000 Received: by mail-wr1-x441.google.com with SMTP id t27so12008744wra.6 for ; Mon, 26 Nov 2018 10:14:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K3jnCkUKivcW1EwPadkTP5Td3EMKexAtpbLrf+8DbpI=; b=d+DAjsnokY+D3UKVLOsTg1HDyiLUqQaJV4t/YLj+NJrZc9LFRDbJ7FZegAGgheTiGR GaATwfHUWwL8zPwhW5evdXH7mwl8GQHy5OdulyC1PynxBeFaKwNKb2qduK7c3xyDz/Ik ZEbTlUBppL27OnbEAAAZY6QkTXMwdWXYAlpxVlIpPbbqVq+XghEatE5ANwTCZyBwCSnx 47q7BcsrJIeqGQx//yMI/ZLZ+xghlcB+hx7do18PI1Uxsen9a7F1wBreDGxNqqTwJBC0 0vmIbxDsIO3GdrQYpQNBnNMX4pIpOjhvBnxUJI8d38ISeUCE/OUM3PKr2/Cer8qbiG/L XKQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K3jnCkUKivcW1EwPadkTP5Td3EMKexAtpbLrf+8DbpI=; b=MrvVWqy3W6BqqRJMOsOB8UrZeAi9EmAALF2J2ymbVQeu+U0+izLGla8ObIGHJuFJ1B 5UKLQIY4GNsW8HVr88H36lxIFTFWdcRXuXEg5OSYIlJ5moi8DYvla3Sl9JsarViMFPFx GzvV3TbvIBo6QYSVFgNk67vQGejnHD6FLA+gcm2gFQxBTAMYdSkSCDjnQF/m8Wgzjsr2 nnSx1wMZrLgvEuRhp7EYZzUqvI+WwTzFEQUN/W8p4p+uEmgTM4Ktk9BVHVnb7ZWFICDN q1QHGIFDcqvLtat17OC85dRa4F+9RWsSaSz557A/Zn3GBT2uMCa8QVoWrxBKP9o5DJ9k nrBg== X-Gm-Message-State: AA+aEWYXO8xlqD1DZpfDVQnb0dE2HiNv5QO1uZ+qfbsWrXd4iymUa7K0 A1o8NQdoZ7210uQjVwKKvUGZJJb2 X-Google-Smtp-Source: AFSGD/VRfS3c7ShVCV5iJxtQcbseJK8+J8+ziLplzajU59fLSsSjtL9inhWG6ZRdn/KpON/sR1iK/A== X-Received: by 2002:a5d:43d0:: with SMTP id v16mr26151479wrr.67.1543256061568; Mon, 26 Nov 2018 10:14:21 -0800 (PST) Received: from debian64.daheim (p5B0D7AA3.dip0.t-ipconnect.de. [91.13.122.163]) by smtp.gmail.com with ESMTPSA id y34sm1426184wrd.68.2018.11.26.10.14.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Nov 2018 10:14:20 -0800 (PST) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1gRLOl-0006Gl-M2; Mon, 26 Nov 2018 19:14:19 +0100 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Date: Mon, 26 Nov 2018 19:14:19 +0100 Message-Id: <20181126181419.24057-1-chunkeey@gmail.com> X-Mailer: git-send-email 2.20.0.rc1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181126_101434_422079_E5B8AB24 X-CRM114-Status: GOOD ( 11.82 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]gmail.com) -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 Subject: [OpenWrt-Devel] [PATCH v2][18.06] apm821xx: MBL: load kernel/dtb from SATA 0:1 first X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Freddy Leitner Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Freddy Leitner This remedies an issue with the MBL Duo if both disks are inserted and contain OpenWrt. kernel and dtb would be loaded from SATA 1:1 while rootfs (/dev/sda2) would be mounted on SATA 0:1. Such a mix&match would obviously only work if both OpenWrt versions/ builds are identical, and especially fail after sysupgrade upgraded the system disk on SATA 0:1. The fallback to SATA 1:1 needs to be kept for MBL Single (only has SATA 1:1) and MBL Duo with one disk inserted on SATA 1:1. To speed up booting in those cases, the unneccesarily doubled "sata init" will only be called once. (In theory it could be omitted completely since the on-flash boot script already initializes SATA to load the on-disk boot script.) Tested on MBL Duo (all possible combination of disks) and MBL Single Signed-off-by: Freddy Leitner Acked-by: Christian Lamparter --- Commit in -master: 7aa5dc46ee79c095e53f2b8e19c640cee8a58e0f I'm so sorry John. It was stupid of me to assume that the same patch would work for 18.06. Anyway, the "fuzz" caused by the addition of the squashfs image in -master should now be fixed. --- target/linux/apm821xx/image/mbl_boot.scr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/apm821xx/image/mbl_boot.scr b/target/linux/apm821xx/image/mbl_boot.scr index 955216983b..394659a5b5 100644 --- a/target/linux/apm821xx/image/mbl_boot.scr +++ b/target/linux/apm821xx/image/mbl_boot.scr @@ -1,6 +1,6 @@ setenv boot_args 'setenv bootargs root=/dev/sda2 rw rootfstype=ext4' -setenv load_part1 'sata init; ext2load sata 1:1 ${kernel_addr_r} /boot/uImage; ext2load sata 1:1 ${fdt_addr_r} /boot/apollo3g.dtb' -setenv load_part2 'sata init; ext2load sata 0:1 ${kernel_addr_r} /boot/uImage; ext2load sata 0:1 ${fdt_addr_r} /boot/apollo3g.dtb' -setenv load_sata 'if run load_part1; then echo Loaded part 1; elif run load_part2; then echo Loaded part 2; fi' +setenv load_part1 'ext2load sata 0:1 ${kernel_addr_r} /boot/uImage; ext2load sata 0:1 ${fdt_addr_r} /boot/apollo3g.dtb' +setenv load_part2 'ext2load sata 1:1 ${kernel_addr_r} /boot/uImage; ext2load sata 1:1 ${fdt_addr_r} /boot/apollo3g.dtb' +setenv load_sata 'sata init; if run load_part1; then echo Loaded part 1; elif run load_part2; then echo Loaded part 2; fi' setenv boot_sata 'run load_sata; run boot_args addtty; bootm ${kernel_addr_r} - ${fdt_addr_r}' run boot_sata