From patchwork Thu Jul 27 16:45:14 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: 1813868 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=EgdtwAY2; 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=E1WnxLoq; 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 4RBcVb5mYqz1yYc for ; Fri, 28 Jul 2023 03:01:26 +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=xzWJ1kqTWURE4/zWy6Qv96w05eE7bIceg/TdGCr5BT4=; b=EgdtwAY2E20oP/ jZmwX2bag5AY4TgWyPzlK+FHswb87cfUJSq82Gr94UPIzGyI4bwL8JaREyT+ep9v+vcG+hwKOKWWq 9FfFYhYYuUL5y1COh9RZ476TrTvwyaQWsifcylFKCw1sY1vc4V/FnNsAEdtvDp6BeNKy/gSDm3iZJ V6fhW9yxxl1mrEP1HplWAgY1DS6JiZeIutqJvJ6ezUTTu/qALEKvoSPt47M2biB1exCLoIYHebjNJ uCtROsthesDwOzcloXMSnzofwyDiZJllTSypQdFEd/AkrZZvPY5vAizV1DZprkoFGVRQPowwL0+xh sMKtNlh1iB4kjDZjwFBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qP4Jp-00GzMl-2q; Thu, 27 Jul 2023 16:58:29 +0000 Received: from [2a04:52c0:101:a4a::1] (helo=terefe.re) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qP4Jk-00GzFZ-29 for openwrt-devel@lists.openwrt.org; Thu, 27 Jul 2023 16:58:26 +0000 Received: from localhost.localdomain (unknown [212.106.161.94]) by terefe.re (Postfix) with ESMTPSA id 80A93200C6; Thu, 27 Jul 2023 18:58:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=terefe.re; s=default; t=1690477099; bh=5944JejDkPbmPIoNc5svbGLugCnk1yfvN49WZd+glwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E1WnxLoq2MgISAbN0VzVKmQPSsX/kgNlKXtHE6ZW0AZAZzEBCw9MLyFd4y33Dlq53 BO3UzbOPW5T/mwbOwQ3xMTKQZRi11hLn88Zta3IPcPC3bJQ3DnGh/3fjsGiAAGBL4F 072zjvgojOw7blpa8BQLgpTCsKBUUgvSPiULysa/E4ZYWynDpbCo0S5yEC+zxSHPiP l/PqXiBA9TZ7KP2cZulw1SpCyd62jAZlp6gVzhbMagMi/uCx/jYYStNABoYLOEod1q ATYXb358bLdZbzCL/KP59+ht9LM3CQGMkj4Cp3Yk/35QIrMKq5mAizAeSyrsSRFLdv y23+KVtwP2HLg== From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Cc: Tomasz Maciej Nowak Subject: [PATCH v4 1/3] ipq40xx: image: limit kernel size for NOR devices Date: Thu, 27 Jul 2023 18:45:14 +0200 Message-ID: <20230727165809.175714-2-tmn505@terefe.re> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230727165809.175714-1-tmn505@terefe.re> References: <20230727165809.175714-1-tmn505@terefe.re> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230727_095825_153408_0371FCA1 X-CRM114-Status: UNSURE ( 8.38 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.1 (+) 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: (1.1 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 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS 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 or GZIP compressed kernel image. 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index a9dd2aa0912f..13b6ce1fee41 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -400,6 +400,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 +479,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 +802,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 +957,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 +1034,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 @@ -1218,6 +1223,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 Thu Jul 27 16:45:15 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: 1813870 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=hkH0mxWN; 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=T0Pe1w+k; 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 4RBcVm6fV5z1yYc for ; Fri, 28 Jul 2023 03:01:36 +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=hFw40f18kPrk71cStsWbYi70O5WCVU/D9W+YmuMRITo=; b=hkH0mxWN514gt6 7yKvHZwd3qOWh/76Bt+14EfRa7nkkX5/ztfSaYBiBh3L6NvkXCmmbRAkqJ4e0fYs8bM2WG7mRm8ii FY+p961W9A6OMoIQ7NRPvhHlBD58P8Ueqd6PmrlMI9zKr3eRiUbbMA2nfyqCgRoX/9z/ttp5WMmMF BSRns4v+M1IeIiS2jNQlY983eCFQktFNJMESYD486pOnvinTnkqbM7grhRd5rpKkHlm7r47erqawH 6bofsQc20xfahC5YlA66eflBRDuKSOn5N2NE1KfH50iCDn++TE1xzrDk4zbcC03kSeOGjJn3hrOcc /ECHsSaXk8qB6oHygTuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qP4K1-00GzVz-37; Thu, 27 Jul 2023 16:58:41 +0000 Received: from terefe.re ([5.255.96.200]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qP4Jl-00GzGA-0p for openwrt-devel@lists.openwrt.org; Thu, 27 Jul 2023 16:58:28 +0000 Received: from localhost.localdomain (unknown [212.106.161.94]) by terefe.re (Postfix) with ESMTPSA id C21832017E; Thu, 27 Jul 2023 18:58:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=terefe.re; s=default; t=1690477099; bh=KbkyAOx+ng0dFC5JDOHZ4H5ymG06aI4UpO+Iv7Jl+t4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T0Pe1w+kio+e/XZwvzTbSqbFXKKpf/kc4CwJHaXcnIq1qzEwqMHiNqtX/s4876GmH yndPMs7lT8BR/LPRUmv3xBsPH7i8vP6ukG0h+sDBJkz7dIVtwIxSc6FrekHZYAVjvH i95viiMZulT0x2HVXwv4EffFCYK4Lr5t1Mi9SEsu3N3J/0xCuCk/9Gj/ouUP32sBPg y53ivOL4Sf48sIsBu2AlgQFulh9tdtytMEGT9MDDHcjMpiTLc9viTfdyHy4hjIhJOF y42AmrgH6YYljrl2c9YZ+fFZrW0q5YVETTG7OSMN9+0+rZlvob6cZjXbo6piJTKBsJ 4CE4jHu6MOT0A== From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Cc: Tomasz Maciej Nowak Subject: [PATCH v4 2/3] ipq40xx: dts: allow writing to U-Boot environment Date: Thu, 27 Jul 2023 18:45:15 +0200 Message-ID: <20230727165809.175714-3-tmn505@terefe.re> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230727165809.175714-1-tmn505@terefe.re> References: <20230727165809.175714-1-tmn505@terefe.re> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230727_095825_584396_9B8502A4 X-CRM114-Status: UNSURE ( 7.26 ) 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 or GZIP compressed 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. [...] 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 or GZIP compressed 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 Thu Jul 27 16:45:16 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: 1813896 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=L8ylKWCr; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=mv9YtqTf; 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=TkESL/ED; 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 4RBdmV621hz1yY5 for ; Fri, 28 Jul 2023 03:58:34 +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=QWNLz5n/xggQoAehDdAYsMDKtQjKUuKuSOTkSqTptig=; b=L8ylKWCrV3R41s n835lxTbfeNT7tRNNe7mXxFBVENyoDTv1rXrkMVKfN0UaXWbzrHR72Rd5ERCXq4qRWC80s3ykWNhk vJIxXbnXsVpdDnuykYH3puhd1ueX6swkI8Ex+aCbdUpYteiPuiaKmxoIRCzPKI4d6Iu0D74mpISN3 yxVIyZ9DOFnn0JQ3KqeBd809XcXff8bE66MPK3+3h4MFUmD/xWZji2E5RTNSgvJd2OsZ3ZSGumQW6 Z1BeilN3KHLujZ2ZQTChVmLYIqnxtMsoahSyf6vZNqPv/Yey+sw483ZAi3KFhCxeYOOq2twyRDCbs HuZtymZ0DXyJ6pJbfdXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qP5EH-00Hb4u-04; Thu, 27 Jul 2023 17:56:49 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qP5EE-00Hb1i-1b for openwrt-devel@bombadil.infradead.org; Thu, 27 Jul 2023 17:56:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=j7/KqP985YFLdO4mj1DFGW1ZFBpCM16pc4G1IAAltiQ=; b=mv9YtqTfRcgq0Q3HJnOzpCLcvn 7QVZPEVHT5TXsAFD49y99AIy3sZoe5XZ9QsdXgpERyPI2D572i/1eGiweuWnBdJ73YvUZJvVixeVd eE/TI6Cwuk/5qeb6ABCBpn6RzB5HJDpMej1GJFvz307uAt54rPhmCwuVrsIEh8Cq/IfqfFQLFV/l/ f0i/FsSWiLKP25K9O0PRfy/epVfyCcpbuNj2S8aP/jJa9bFuZbR7fFFX+R/FSY9ow1zo2TACx9oEl W8k+uUUd2ogMZm8QtQ26gLN5SW1VJ+XobbrjCrgBGYkExu5gaAs6OFlCMsAdW3Li8Q4R4C+NrpYLR GbQuvQ7g==; Received: from terefe.re ([5.255.96.200]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qP4Jp-007BQH-0v for openwrt-devel@lists.openwrt.org; Thu, 27 Jul 2023 16:58:32 +0000 Received: from localhost.localdomain (unknown [212.106.161.94]) by terefe.re (Postfix) with ESMTPSA id 0F9B120181; Thu, 27 Jul 2023 18:58:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=terefe.re; s=default; t=1690477100; bh=welhz/i6RWlUHg/QmTBwD0wDIrXbjx7sQHxn1aqM3ZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TkESL/EDgHldTPtOesJHZQvSpZB0qGL8djz/JvjhTDaktF+EIA82J76/gBQtr2sQS APcT5BAiFtcZ17kL5OODG0rVdQiRLG9NFsowqo49H0n1zNvWl/hniyIlsUenbn85Je z3jLhPO+F2K2eXp1gtMlsQxmruRJRaGGj/7dKUmz63hx9do/xzC5WHauOpZaviqGqQ 0hb8llbK0jvh40q0jCKM8hxxti9mZEcW9mZ/rSNgZqM6SPdQuEPhshiyV355JkmdIY nNdiRunw/XuGX0gOCplviL4tzP7wVwYlK3A8/UUCeLMm787ANTFomdH4a3cf/oo9XV 2n10gs+Qz0g9Q== From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Cc: Tomasz Maciej Nowak Subject: [PATCH v4 3/3] ipq40xx: pakedge_wr-1: workaround for kernel bigger than 4MiB Date: Thu, 27 Jul 2023 18:45:16 +0200 Message-ID: <20230727165809.175714-4-tmn505@terefe.re> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230727165809.175714-1-tmn505@terefe.re> References: <20230727165809.175714-1-tmn505@terefe.re> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230727_175829_601310_74E01F73 X-CRM114-Status: GOOD ( 11.32 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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 booting command 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 precau [...] 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_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 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 booting command 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 | 8 +++++++- 3 files changed, 23 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..0cc0ab0fca6f --- /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,')" + 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 13b6ce1fee41..742576a29e5e 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -957,8 +957,14 @@ 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. Force upgrade to 23.05.0 first and it will \n$\ + 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