From patchwork Sun Jul 29 09:07:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thibaut X-Patchwork-Id: 950550 X-Patchwork-Delegate: blogic@openwrt.org 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=slashdirt.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="L93/BJFn"; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=slashdirt.org header.i=@slashdirt.org header.b="PvhJqIP7"; 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 41dcLX48GKz9s0n for ; Sun, 29 Jul 2018 19:08:20 +1000 (AEST) 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:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ykheIsTmjty77LAjey92QEcWJSJht7zHsic+4mXUU5s=; b=L93/BJFnf3QP5s uoVzT0DzY07B6WzKsUQihAR7kg2j2+CR0vJ181goNWm1h03TNvPq0roOBLcWwt/lf9wpVU6G1PS24 J4s5ddVEE0nzoTEmLUxEiDq7hltxiH/FcBSauqCjPS3znHHk88yek+DX9q+/C4AZT0uie83w1kSLe q1BAicjGH2HFWVPvFwZSgju6E0c2FERK+KbodcRRNOMhKMqbJnWzZ42YhMYDaxGqx3VbZ+xdwVBIJ 5ZXPGqDW0/2HLLAb82o7xbGvVyZBeoaBoSgTE1oZGrAqDo2VHmJ9DMxiLmDyelPX8WrLBdl81gsIc wSyuYwYLk2NX9kB25D8w==; 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 1fjhgV-0006cO-9H; Sun, 29 Jul 2018 09:08:15 +0000 Received: from vps.slashdirt.org ([178.238.224.32]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fjhg1-0005uZ-4r for openwrt-devel@lists.openwrt.org; Sun, 29 Jul 2018 09:07:48 +0000 Received: from Chuck.lan (tardis.herebedragons.eu [185.144.46.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by vps.slashdirt.org (Postfix) with ESMTPSA id 43BDC12009E; Sun, 29 Jul 2018 11:07:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.9.2 vps.slashdirt.org 43BDC12009E DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=slashdirt.org; s=mail; t=1532855245; bh=02tm3nfHhpR7868owHi1awCgZlSUXHsNetwA/akquLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PvhJqIP7XJXhRbSUJ6VrOOndWYhQO6NjDGEHNd+J8+NC8VDq+OKmSkOC+0PaSRp22 ijrd/e+X8vMxAvoEzqQ2q/y2Gc8ud81ltQeM+l/LlCICa8Q7T1TtUG8+A3dd4xfG44 Sg/VJOEyeJ+3lFOBmhtANvaXixWWn5HoMcn74NJw= From: =?utf-8?q?Thibaut_VAR=C3=88NE?= To: openwrt-devel@lists.openwrt.org Date: Sun, 29 Jul 2018 11:07:22 +0200 Message-Id: <20180729090724.8436-2-hacks@slashdirt.org> X-Mailer: git-send-email 2.13.6 (Apple Git-96) In-Reply-To: <20180729090724.8436-1-hacks@slashdirt.org> References: <20180729090724.8436-1-hacks@slashdirt.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180729_020745_528311_8F6203B2 X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.3 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.4 NO_DNS_FOR_FROM RBL: Envelope sender has no MX or A DNS records [listed in slashdirt.org. IN A] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 Subject: [OpenWrt-Devel] [PATCH v2 2/4] ramips: fix RBM33G partitioning 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: tobleminer@gmail.com Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This patch improves 5684d087418d176cfdef4e045e1950ca7ba3b09f by correcting the partition scheme for the "RouterBoot" section of the flash. This section is subdivided in several segments, as they are on ar71xx RB devices, albeit with different offsets and sizes. The naming convention from ar71xx has been preserved. The preferred 'fixed-partitions' DTS node syntax is used, with nesting support as introduced in 2a598bbaa3. The OEM source code also define a "RouterBootFake" partition at the beginning of the secondary flash chip: to avoid trouble if OEM ever makes use of that space, it is also defined here. The resulting partition scheme looks like this: [ 10.114241] m25p80 spi0.0: w25x40 (512 Kbytes) [ 10.118708] 1 fixed-partitions partitions found on MTD device spi0.0 [ 10.125049] Creating 1 MTD partitions on "spi0.0": [ 10.129824] 0x000000000000-0x000000040000 : "RouterBoot" [ 10.136215] 5 fixed-partitions partitions found on MTD device RouterBoot [ 10.142894] Creating 5 MTD partitions on "RouterBoot": [ 10.148032] 0x000000000000-0x00000000f000 : "routerboot" [ 10.154336] 0x00000000f000-0x000000010000 : "hard_config" [ 10.160665] 0x000000010000-0x00000001f000 : "routerboot2" [ 10.167046] 0x000000020000-0x000000021000 : "soft_config" [ 10.173461] 0x000000030000-0x000000031000 : "bios" [ 10.190191] m25p80 spi0.1: w25q128 (16384 Kbytes) [ 10.194950] 2 fixed-partitions partitions found on MTD device spi0.1 [ 10.201271] Creating 2 MTD partitions on "spi0.1": [ 10.206071] 0x000000000000-0x000000040000 : "RouterBootFake" [ 10.212746] 0x000000040000-0x000001000000 : "firmware" [ 10.307216] 2 minor-fw partitions found on MTD device firmware [ 10.313044] 0x000000040000-0x000000220000 : "kernel" [ 10.319002] 0x000000220000-0x000001000000 : "rootfs" [ 10.324906] mtd: device 9 (rootfs) set to be root filesystem [ 10.330678] 1 squashfs-split partitions found on MTD device rootfs [ 10.336886] 0x000000b40000-0x000001000000 : "rootfs_data" Leave a note in DTS to explain how the original author selected the SPI speed. Tested-by: Tobias Schramm Signed-off-by: Thibaut VARĂˆNE --- target/linux/ramips/dts/RBM33G.dts | 69 +++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 15 deletions(-) diff --git a/target/linux/ramips/dts/RBM33G.dts b/target/linux/ramips/dts/RBM33G.dts index 612dc106ed..a02d03818f 100644 --- a/target/linux/ramips/dts/RBM33G.dts +++ b/target/linux/ramips/dts/RBM33G.dts @@ -104,18 +104,44 @@ reg = <0>; spi-max-frequency = <3125000>; - partition@0 { - label = "routerboot"; - reg = <0x0 0xf000>; - read-only; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "RouterBoot"; + reg = <0x0 0x40000>; + read-only; + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + routerboot@0 { + reg = <0x0 0xf000>; + read-only; + }; + + hard_config: hard_config@f000 { + reg = <0xf000 0x1000>; + read-only; + }; + + routerboot2@10000 { + reg = <0x10000 0xf000>; + read-only; + }; + + soft_config@20000 { + reg = <0x20000 0x1000>; + }; + + bios@30000 { + reg = <0x30000 0x1000>; + read-only; + }; + }; }; - - factory: partition@f000 { - label = "factory"; - reg = <0xf000 0x71000>; - read-only; - }; - }; w25q128@0 { @@ -123,17 +149,30 @@ #size-cells = <1>; compatible = "jedec,spi-nor"; reg = <1>; + // XXX empiric value to obtain actual 10MHz SCK at the chip spi-max-frequency = <3125000>; - partition@40000 { - label = "firmware"; - reg = <0x040000 0xFC0000>; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + // this contains no data but is named so in OEM source + partition@0 { + label = "RouterBootFake"; + reg = <0x0 0x40000>; + read-only; + }; + + firmware@40000 { + reg = <0x040000 0xFC0000>; + }; }; }; }; ðernet { - mtd-mac-address = <&factory 0x0010>; + mtd-mac-address = <&hard_config 0x0010>; mtd-mac-address-increment = <1>; };