From patchwork Fri Jul 7 14:23:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1804957 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=YXW/Ecig; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=terefe.re header.i=@terefe.re header.a=rsa-sha256 header.s=default header.b=d17BAeGB; 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 4QyGRQ5rKxz20b8 for ; Sat, 8 Jul 2023 00:45:54 +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:References:In-Reply-To: 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: List-Owner; bh=nq7qi65BSMltqLcMAgg0VaaaPTHaESmeHZxdSV7fhYg=; b=YXW/EcigKqTLnv c/b5eZOd2+FGaH5d1b+yJy0VNapaknbwMfve5xmmxHs6VV7gKK2UIfAk00sDK/bKPWSvFBIJAnOu0 FB5yR2vVedbsrQe1IYfPXsSOpEch51pUHiwIWKVGAwH7wdh/1iGsC0IQ52nOkv5DNMFQXfvkLw3LI IQYt5gtybJlrnQGYsD7Reak8P1mtW3r8yrSQlUO53chCgdL9EYJ+Rwh1wBQcSSdW/5mE4M6LkVQsG 3ykQmLirqiZrOHUNwDzjopRgH73uvbg8JjwThI6qp32dMBHdeDsAUdQZ/Wiy+C+w2bOE0Ryn2bpGU oi29hpuHG5vhf/k13t/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHmfd-004tn8-1N; Fri, 07 Jul 2023 14:42:53 +0000 Received: from terefe.re ([5.255.96.200]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qHmfW-004tiP-2e for openwrt-devel@lists.openwrt.org; Fri, 07 Jul 2023 14:42:48 +0000 Received: from localhost.localdomain (unknown [212.106.161.94]) by terefe.re (Postfix) with ESMTPSA id A21E220021; Fri, 7 Jul 2023 16:42:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=terefe.re; s=default; t=1688740960; bh=biTgvzWaBNkjaxKTdo/Bwn4xAqjsMpCJOktoQJHkpcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d17BAeGBJlmwISE65EUH7MaH6L6/NbMRRncZKIqQM0BAbkdeyrN2SQHqaCXZbFmSv 2nhKYkYVK9SjlJuonCRk0qYJFf+gwKJGAD0h+xtkcOTTq4GlZh/X0sO4b2xvCBa+75 u9J3nTnL3Ib7yodjSS6zG76l02Wgc01CXM2wec5ytzZEw2347eZmLOnb2Ca3f0aZVF w/NhqOuC63mWqGGrIApfczxeMnJpJS8V5IFrB/sRwjHUSL5IQYbSi9xNiOaHae5yKt HSAg1ILGRY6WGJsUV/OHdVuW37W6AoHoBho/JgfXFWlYEdWWSN9ITAaR2vWWsl2NSf 3vhkgsVr+GaRQ== From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Cc: Tomasz Maciej Nowak Subject: [PATCH 1/3] ipq40xx: image: limit kernel size for NOR devices Date: Fri, 7 Jul 2023 16:23:28 +0200 Message-ID: <20230707144229.23323-2-tmn505@terefe.re> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707144229.23323-1-tmn505@terefe.re> References: <20230707144229.23323-1-tmn505@terefe.re> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230707_074247_012678_8114C5DC X-CRM114-Status: UNSURE ( 8.39 ) X-CRM114-Notice: Please train this message. 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: From: Tomasz Maciej Nowak 'bootipq' command, on some devices with kernel on NOR flash chip, read kernel partition size from Qualcomm proprietary partition table, which seems to be stored in MIBIB partition. The partition table [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -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 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 From: Tomasz Maciej Nowak 'bootipq' command, on some devices with kernel on NOR flash chip, read kernel partition size from Qualcomm proprietary partition table, which seems to be stored in MIBIB partition. The partition table can be read by 'smeminfo' command in U-Boot command line interface. Because this partition table is never updated on sysupgrade (even when the kernel size changes) kernel size is capped at initial value, usually 4MiB. Sysupgrading such kernel will soft-brick the device, which will need serial console for recovery. Some devices already suffer from this, beacuse its U-Boot does not allow to boot LZMA compressed kernel image and/or kernel zImage. Even some devices allowing to boot LZMA compressed kernel will hit this limitation later. Therefore limit the kernel size to 4MiB for devices not having it specified, so we won't create soft-bricking images. Signed-off-by: Tomasz Maciej Nowak --- target/linux/ipq40xx/image/generic.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index f15463ae8ca5..d9d60a25ff0f 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -130,6 +130,7 @@ define Device/8dev_habanero-dvk DEVICE_VENDOR := 8devices DEVICE_MODEL := Habanero DVK IMAGE_SIZE := 30976k + KERNEL_SIZE := 4096k SOC := qcom-ipq4019 IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | check-size | append-metadata endef @@ -400,6 +401,7 @@ define Device/dlink_dap-2610 WRGG_DEVNAME := /dev/mtdblock/8 WRGG_SIGNATURE := wapac30_dkbs_dap2610 IMAGE_SIZE := 14080k + KERNEL_SIZE := 4096k IMAGES += factory.bin # Bootloader expects a special 160 byte header which is added by # wrgg-image. @@ -478,6 +480,7 @@ define Device/engenius_emd1 DEVICE_DTS_CONFIG := config@4 SOC := qcom-ipq4018 IMAGE_SIZE := 30720k + KERNEL_SIZE := 4096k IMAGES += factory.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata IMAGE/factory.bin := qsdk-ipq-factory-nor | check-size @@ -800,6 +803,7 @@ define Device/netgear_ex61x0v2 NETGEAR_BOARD_ID := EX6150v2series NETGEAR_HW_ID := 29765285+16+0+128+2x2 IMAGE_SIZE := 14400k + KERNEL_SIZE := 4096k SOC := qcom-ipq4018 endef @@ -954,6 +958,7 @@ define Device/pakedge_wr-1 SOC := qcom-ipq4018 BLOCKSIZE := 64k IMAGE_SIZE := 31232k + KERNEL_SIZE := 4096k IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | append-metadata endef TARGET_DEVICES += pakedge_wr-1 @@ -1030,6 +1035,7 @@ define Device/qxwlan_e2600ac-c1 BOARD_NAME := e2600ac-c1 SOC := qcom-ipq4019 IMAGE_SIZE := 31232k + KERNEL_SIZE := 4096k IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata endef TARGET_DEVICES += qxwlan_e2600ac-c1 @@ -1202,6 +1208,7 @@ define Device/zyxel_wre6606 DEVICE_DTS_CONFIG := config@4 SOC := qcom-ipq4018 IMAGE_SIZE := 13184k + KERNEL_SIZE := 4096k IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers endef From patchwork Fri Jul 7 14:23:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1804954 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=wjeCvKKG; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=terefe.re header.i=@terefe.re header.a=rsa-sha256 header.s=default header.b=gbXd/C6j; 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 4QyGRC0JrNz20WT for ; Sat, 8 Jul 2023 00:45:41 +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:References:In-Reply-To: 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: List-Owner; bh=9ibEs4+JYgT0efO07fGTrSTPlLiW0oPM3dHL5oq/PrU=; b=wjeCvKKGP0empH gD1mzYtYpRc1BDLyIJ2+fDDuePWS/5zqF5LKQ7yDLYCtuG+FRQYxZhqnIn5rbOnh5IcyHp7doabzF xtf2D8eAwEg06DFJ9ccMlZAJj3SKFYHYSlxhze0Fib4BPnFQt6b+6Tar63ukF+py7Z6aaG7yN6WHs RXVWnMzGXUF0QQ83U6Y0/q7BohYmN8KwqaAKTOY9xmlRwhIk0xoHd5G0bnn3w6Kw5xaz8JwykmGc/ jXx5OnRaAI1Yi8I5ieMUysJADLldG5G+UqMrq6Y2/YJi6oDnlFW7P3MzlMVHf5xSnGM0W3sL0S1Sm h+CrmE9XZhwkn2JGCn+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHmfe-004tng-2K; Fri, 07 Jul 2023 14:42:54 +0000 Received: from terefe.re ([5.255.96.200]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qHmfW-004tiT-2k for openwrt-devel@lists.openwrt.org; Fri, 07 Jul 2023 14:42:49 +0000 Received: from localhost.localdomain (unknown [212.106.161.94]) by terefe.re (Postfix) with ESMTPSA id F1319200F7; Fri, 7 Jul 2023 16:42:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=terefe.re; s=default; t=1688740961; bh=5LMUXR1YlkjEnt8GhwggETm31iADUiLQqwSxEVLGPRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gbXd/C6jDoNtslFqcE6TVNijwXHl9mMosklWwrc0BrG030Cq15+e+W7y7m/ZKKzCU 2kkBVipPmB0V3jRtwl3CjuLLLyfY/mbiJ49AcCg5cvR4lPPNeb1fO5ZE4M81lekyYs BA99AZJDFO2paDi/z6nFRxQZhA4Auy1CZWtK7XLnE/iAyxSY9LmKS303EL4YtO67GB a5ct6nPxtbSoJwnVO8B2PNa7CVNRlSqv/KXQ7nTDFKeCeS5o4rUNEKokgeR7dG7816 bjcAFdZJpNhGLYbO/2OYRC5XLZvRtLVctg+Iy3xd+XFB1fSFHs1jvkWiKKv9+YhcDL t7tJKXLy6HJmw== From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Cc: Tomasz Maciej Nowak Subject: [PATCH 2/3] ipq40xx: dts: allow writing to U-Boot environment Date: Fri, 7 Jul 2023 16:23:29 +0200 Message-ID: <20230707144229.23323-3-tmn505@terefe.re> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707144229.23323-1-tmn505@terefe.re> References: <20230707144229.23323-1-tmn505@terefe.re> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230707_074247_153334_7E8B0B85 X-CRM114-Status: UNSURE ( 7.78 ) X-CRM114-Notice: Please train this message. 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: From: Tomasz Maciej Nowak Devices allowing to boot LZMA compressed kernel or zImage kernel didn't hit yet the 4MiB boundary for kernel size, thus allowing to prepare workaround for the issue, without need for serial console at [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -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 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 From: Tomasz Maciej Nowak Devices allowing to boot LZMA compressed kernel or zImage kernel didn't hit yet the 4MiB boundary for kernel size, thus allowing to prepare workaround for the issue, without need for serial console attachment. The workaround is modifying 'bootcmd' variable in U-Boot environment which will replace 'bootipq' command with equivalent not limited by imposed partition table. This commit also touches devices which boot uncompressed kernel, so even if those are already soft-bricked, it will still allow to alter U-Boot environment from initramfs booted device. Signed-off-by: Tomasz Maciej Nowak --- .../files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts | 1 - .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts | 1 - .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts | 1 - .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts | 1 - .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts | 1 - .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts | 1 - .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi | 1 - .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts | 1 - .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts | 1 - .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts | 1 - .../files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts | 1 - .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts | 1 - .../linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts | 1 - .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts | 1 - .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts | 1 - .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts | 1 - 16 files changed, 16 deletions(-) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts index 22a48c12c44e..0772c5ac464a 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts @@ -185,7 +185,6 @@ partition5@E0000 { label = "APPSBLENV"; reg = <0x000e0000 0x00010000>; - read-only; }; partition6@F0000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts index 493905d56d8f..dea90b13e209 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts @@ -117,7 +117,6 @@ partition@e0000 { label = "APPSBLENV"; reg = <0xe0000 0x10000>; - read-only; }; partition@f0000 { label = "APPSBL"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts index a8f24aa00e60..2e9cb8ecdb68 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts @@ -165,7 +165,6 @@ partition5@e0000 { label = "0:APPSBLENV"; reg = <0x000e0000 0x00010000>; - read-only; }; partition6@f0000 { label = "0:APPSBL"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts index 396595ba5185..615c6aaf678f 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emd1.dts @@ -163,7 +163,6 @@ partition5@e0000 { label = "0:APPSBLENV"; reg = <0x000e0000 0x00010000>; - read-only; }; partition6@f0000 { label = "0:APPSBL"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts index 361614945145..8c038917b668 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-emr3500.dts @@ -164,7 +164,6 @@ partition@e0000 { label = "0:APPSBLENV"; reg = <0x000e0000 0x00010000>; - read-only; }; partition@f0000 { label = "0:APPSBL"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts index 69275e24b8cd..bba1dd89b7a8 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ens620ext.dts @@ -184,7 +184,6 @@ partition@e0000 { label = "APPSBLENV"; /* uboot env*/ reg = <0x000e0000 0x00010000>; - read-only; }; partition@f0000 { label = "APPSBL"; /* uboot */ diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi index dc5c25c84ab7..b4d9d195c7f4 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi @@ -228,7 +228,6 @@ partition5@E0000 { label = "APPSBLENV"; reg = <0x000e0000 0x00010000>; - read-only; }; partition6@F0000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts index 16951da47fc0..4c707e73d862 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wr-1.dts @@ -140,7 +140,6 @@ partition@e0000 { label = "0:APPSBLENV"; reg = <0x00e0000 0x0010000>; - read-only; }; partition@f0000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts index efb267ae3692..decd7d5fdcc0 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wre6606.dts @@ -195,7 +195,6 @@ partition5@E0000 { label = "APPSBLENV"; reg = <0x000e0000 0x00010000>; - read-only; }; partition6@F0000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts index 70e05c7eef3a..eac11b02d144 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts @@ -57,7 +57,6 @@ partition@e0000 { label = "0:APPSBLENV"; reg = <0xe0000 0x10000>; - read-only; }; partition@f0000 { label = "0:APPSBL"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts index 23a654dcff5a..690db0143891 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts @@ -262,7 +262,6 @@ partition@e0000 { label = "APPSBLENV"; /* uboot env */ reg = <0x000e0000 0x00010000>; - read-only; }; partition@f0000 { label = "APPSBL"; /* uboot */ diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts index 4efcdaf39418..5304870a43fa 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts @@ -54,7 +54,6 @@ partition@e0000 { label = "0:APPSBLENV"; reg = <0xe0000 0x10000>; - read-only; }; partition@f0000 { label = "0:APPSBL"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts index 681300c502bf..aa401892fef3 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts @@ -56,7 +56,6 @@ partition@e0000 { label = "0:APPSBLENV"; reg = <0xe0000 0x10000>; - read-only; }; partition@f0000 { label = "0:APPSBL"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts index 48b5cd53d80b..a1ede1dcbdb1 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts @@ -205,7 +205,6 @@ partition5@e0000 { label = "0:APPSBLENV"; /* uboot env*/ reg = <0x000e0000 0x00010000>; - read-only; }; partition5@f0000 { label = "0:APPSBL"; /* uboot */ diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts index 7e4519a74661..78d044b67893 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts @@ -182,7 +182,6 @@ APPSBLENV@e0000 { label = "APPSBLENV"; reg = <0xe0000 0x10000>; - read-only; }; APPSBL@f0000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts index 0e7f4c970f47..752397a1752d 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts @@ -180,7 +180,6 @@ APPSBLENV@e0000 { label = "APPSBLENV"; reg = <0xe0000 0x10000>; - read-only; }; APPSBL@f0000 { From patchwork Fri Jul 7 14:23:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1804953 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=XREB8ddq; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=terefe.re header.i=@terefe.re header.a=rsa-sha256 header.s=default header.b=Sar35XCj; 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 4QyGRC0dvTz20b8 for ; Sat, 8 Jul 2023 00:45:41 +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:References:In-Reply-To: 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: List-Owner; bh=LyAl9ZIuB+h4KWPUxUFwCct2vj0XroPJEOZq06grf64=; b=XREB8ddqSXg72l UNiDhQrLPuqt4/oOjhtz5xLK2SRpcbe7MnimQjJyzBcBF1QNooNfr1oR/jQnKEhN+X4V5aAnbi0h6 g7FpVgWM9i8Xs7qvlMCIPZx7SgX57OwLJAVgUnJnL8P3bKgEQM3Nn+2S/3BZ0sW71WLAFeQDe9Adc jRy8ITO6sWIgJuUZqv8wzS3GTDir+rIIMTn0VmqZRp+ejWt2wB1E64owPEWT9xamanXnkOoKMh3o7 x28XOgEXQx8/73TdMl/3qAAnsnb3NBAWCXvql+dce5PUfCD2NmRlind0SAdyg3VQnY2id55IHzzLH acQM/JglcjCLLxeFvcvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qHmfb-004tlQ-2M; Fri, 07 Jul 2023 14:42:51 +0000 Received: from terefe.re ([5.255.96.200]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qHmfW-004tiX-2J for openwrt-devel@lists.openwrt.org; Fri, 07 Jul 2023 14:42:48 +0000 Received: from localhost.localdomain (unknown [212.106.161.94]) by terefe.re (Postfix) with ESMTPSA id 40AA820131; Fri, 7 Jul 2023 16:42:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=terefe.re; s=default; t=1688740961; bh=tl2MUfmdojAdD2CPB7ldNOCCqS3EB6QiXopXmIEGx4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sar35XCjS+mSkpT3S1VBgYCrVq9v4fdKmAS7lE0V+HnqvrwoA70IoHuPQNcFDObqt DK2aPk/4v03Jame0KUr0C2Ua6PvHaDKUBXZr8UavvNDRzKHlWppb5uwhCq119cJDyR q5nSEnSrFQEPREqDZES2NWdowr9vbEhaqwH9F6fcvtHl6kyVBx33YQJmAF2uHb6h6H I91F7Ld2r+ceox7G9MPUgsqJgMAzZsT3w9okhOnMw6pNOK4upXXk94Kt/uMPTPSF/j pj8mHj2yTc0qJ84v58u5ocaBcbce/cG1N8sxwDCMKP2ljevS51QbVJUx+Kcr4fj91I o4H2mdZrWverg== From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Cc: Tomasz Maciej Nowak Subject: [PATCH 3/3] ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB Date: Fri, 7 Jul 2023 16:23:30 +0200 Message-ID: <20230707144229.23323-4-tmn505@terefe.re> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707144229.23323-1-tmn505@terefe.re> References: <20230707144229.23323-1-tmn505@terefe.re> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230707_074246_910369_99EDD129 X-CRM114-Status: GOOD ( 12.38 ) 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: From: Tomasz Maciej Nowak Alter command boot sequence in U-Boot on first boot after upgrade to workaround the kernel size limitation. The kernel size read from flash will be 8MiB, which should suffice for forseable future. As [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -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 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 From: Tomasz Maciej Nowak Alter command boot sequence in U-Boot on first boot after upgrade to workaround the kernel size limitation. The kernel size read from flash will be 8MiB, which should suffice for forseable future. As precaution a warning interupting upgrade is emited, explaining what to do. Signed-off-by: Tomasz Maciej Nowak --- .../etc/uci-defaults/05_fix-compat-version | 3 ++- .../base-files/lib/preinit/81_patch_uboot_env.sh | 14 ++++++++++++++ target/linux/ipq40xx/image/generic.mk | 10 +++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh diff --git a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version index c01192089712..a3f90125c6e5 100644 --- a/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version +++ b/target/linux/ipq40xx/base-files/etc/uci-defaults/05_fix-compat-version @@ -4,7 +4,8 @@ case "$(board_name)" in linksys,ea6350v3|\ linksys,ea8300|\ linksys,mr8300|\ -ezviz,cs-w3-wd1200g-eup) +ezviz,cs-w3-wd1200g-eup|\ +pakedge,wr-1) uci set system.@system[0].compat_version="2.0" uci commit system ;; diff --git a/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh new file mode 100644 index 000000000000..b5e508aac402 --- /dev/null +++ b/target/linux/ipq40xx/base-files/lib/preinit/81_patch_uboot_env.sh @@ -0,0 +1,14 @@ +. /lib/functions.sh + +preinit_patch_uboot_env() { + case $(board_name) in + pakedge,wr-1) + if ! fw_printenv -n OpenWrt &>/dev/null; then + fw_setenv OpenWrt 'sf probe; sf read 0x84000000 0x180000 0x800000; bootm 0x84000000' + fw_setenv bootcmd "$(fw_printenv -n bootcmd | sed -e 's,bootipq,run OpenWrt,p')" + fi + ;; + esac +} + +boot_hook_add preinit_main preinit_patch_uboot_env diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index d9d60a25ff0f..0dadae122a87 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -958,8 +958,16 @@ define Device/pakedge_wr-1 SOC := qcom-ipq4018 BLOCKSIZE := 64k IMAGE_SIZE := 31232k - KERNEL_SIZE := 4096k + KERNEL_SIZE := 8192k IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | append-metadata + DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_MESSAGE := \n$\ + Booting command in U-Boot needs to be changed because of kernel \n$\ + growing beyond 4MiB. If OpenWrt 23.05.0 or later is running on \n$\ + on the device, it has already been done and You can safely force \n$\ + upgrade. If that's not the case, first upgrade to 23.05.0 and it \n$\ + will automatically amend booting command in U-Boot on first boot. \n$\ + Then proceed with the upgrade to desired version. endef TARGET_DEVICES += pakedge_wr-1