From patchwork Mon May 3 10:39:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baptiste Jonglez X-Patchwork-Id: 1473126 X-Patchwork-Delegate: baptiste@bitsofnetworks.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=Fx7gjhz7; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FYfhV3bSpz9s1l for ; Mon, 3 May 2021 20:43:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=9LIXLlyFfVR4YwMHikX7pS1ktcbf0lJAYwkM2hugaTc=; b=Fx7gjhz7odvfEZCEOFHrtCPg+a 33kRE5/hrk8ZGCp5yw/Me5w00R9B1rVga1NQ4Jca4DdxD0H/mSihT3SWOCA94O8LAUfLDOHAbk4iG a/U8fwcLgPL/k/msRTTPSXHagj5RiXBUMNLPul6CwPmf9hJ8pTJ8ODd1TVtZFafO7RIZ5ZfWfsWQJ 2AWyvYhSh8UTTcP0FiZXkb5q5rz8ONRQmpVG5zrMWwDwKwlRHh6JjFnc8J5IGGPVVS7txcOMHUqBs 4mjOPgQSURxUfjocRO/VOYe/U4wKD0YyUt8uUxuLJuR46lfxRDUMd6Djc93tbs1MSx7o0U7JwpbU4 2Axu88mg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ldW0C-00Dg5s-Bw; Mon, 03 May 2021 10:40:36 +0000 Received: from mails.bitsofnetworks.org ([2001:912:1800:ff::131]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ldW03-00Dg4p-4l for openwrt-devel@lists.openwrt.org; Mon, 03 May 2021 10:40:32 +0000 Received: from [2001:912:1800:0:9e09:27e0:3360:73b4] (helo=thunderclap.lan) by mails.bitsofnetworks.org with esmtp (Exim 4.89) (envelope-from ) id 1ldW01-0002AR-Jj; Mon, 03 May 2021 12:40:25 +0200 From: Baptiste Jonglez To: openwrt-devel@lists.openwrt.org, Robert Marko , Thibaut Cc: Baptiste Jonglez Subject: [PATCH] ipq40xx: fix hard_config partition size on MikroTik hAP-ac2 Date: Mon, 3 May 2021 12:39:47 +0200 Message-Id: <20210503103947.3527098-1-baptiste@bitsofnetworks.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210503_114030_240150_E57C2D5A X-CRM114-Status: UNSURE ( 9.69 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) 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: Baptiste Jonglez The routerbootparts driver dynamically discovers the location of MikroTik partitions, but it cannot determine their size (except by extending them up to the start of the next discovered partition). Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 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: Baptiste Jonglez The routerbootparts driver dynamically discovers the location of MikroTik partitions, but it cannot determine their size (except by extending them up to the start of the next discovered partition). The hard_config partition has a default size of 0x1000 in the driver, while it actually takes 0x2000 on the hAP-ac2. Set the correct size in the hAP-ac2 DTS. On most devices, this isn't a problem as the actual data fits in 0x1000 bytes. However, some devices have larger data that doesn't fit in 0x1000 bytes. In any case, all devices seen so far have enough space for a 0x2000 hard_config partition before the start of the dtb_config partition. With the current 0x1000 size: 0x00000000e000-0x00000000f000 : "hard_config" 0x000000010000-0x000000017bbc : "dtb_config" With this patch extending the size to 0x2000: 0x00000000e000-0x000000010000 : "hard_config" 0x000000010000-0x000000017bbc : "dtb_config" Other ipq40xx boards may need the same fix but it needs testing. References: https://forum.openwrt.org/t/support-for-mikrotik-hap-ac2/23333/324 Signed-off-by: Baptiste Jonglez --- .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-hap-ac2.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-hap-ac2.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-hap-ac2.dts index e1e6326ae9..d03409b556 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-hap-ac2.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-hap-ac2.dts @@ -191,6 +191,7 @@ hard_config { read-only; + size = <0x2000>; }; dtb_config {