From patchwork Sat Aug 4 13:44:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thibaut X-Patchwork-Id: 953453 X-Patchwork-Delegate: zajec5@gmail.com 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="o2jqb4tC"; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=slashdirt.org header.i=@slashdirt.org header.b="EzFGk7AB"; 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 41jQC73Pdyz9sXY for ; Sat, 4 Aug 2018 23:45:07 +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=72jj0Q22HQjfOmbnEVEPc7O6Ms+sTOfCOlgObU5/CQ0=; b=o2jqb4tCIYEDB2 0BcLgGITqnyqo+/Z0okJZx+IbBNkNw3cUpy10EhGE29P2UQyVeOvxBSE9Z26iH+eHPaF5B/G+cP0x yFYgMM4LgUN39f25ZIftol1EVvRtGRUmI0eptV7w8+rjm/f9I7UbDKK0A6Yb3Uc/e6uby4oLD/fLo sX2XdzvlCJDF1lCvnjTiuTYr52c3YN5YH03GAmij/4FKS7fESFf49I0ePxUrkuxlBHU7RtVdlfIMg UwcWtAuZcqmnMdqZcJkUC1gmvzOms+Pb0kk878nG6/D64QczejmCkx2xRvvnqQOR8bgVBG1rFer1R 8kRv5XnGuSSQZEmsZNfQ==; 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 1flwrg-0004rX-RS; Sat, 04 Aug 2018 13:45:04 +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 1flwrL-0004Qt-7c for openwrt-devel@lists.openwrt.org; Sat, 04 Aug 2018 13:44:46 +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 3393912009E; Sat, 4 Aug 2018 15:44:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.9.2 vps.slashdirt.org 3393912009E DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=slashdirt.org; s=mail; t=1533390268; bh=IeniK7wELYcpZeZ3U1Jvo1kCg8bWT0jctEPGOKycNKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EzFGk7AB9QB3ZcPQbYoEQhue2lm+2aziYs0YNiVtpZMe58B9SVrXunQXYT37a1c4y eesCylAVyQHMYDvRaiZ5nc3qhKRdRKA0X0l6NgvdPVe7aTabrWSnerj5bOusYogrky oqh5sTIcAB31fhN+q8DHtENiHNpnITY37h3nwxRo= From: =?utf-8?q?Thibaut_VAR=C3=88NE?= To: openwrt-devel@lists.openwrt.org Date: Sat, 4 Aug 2018 15:44:25 +0200 Message-Id: <20180804134426.42093-2-hacks@slashdirt.org> X-Mailer: git-send-email 2.13.6 (Apple Git-96) In-Reply-To: <20180804134426.42093-1-hacks@slashdirt.org> References: <20180729090724.8436-1-hacks@slashdirt.org> <20180804134426.42093-1-hacks@slashdirt.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180804_064443_881753_F3D58CDB X-CRM114-Status: GOOD ( 10.56 ) 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_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_AU Message has a valid DKIM or DK signature from author's domain Subject: [OpenWrt-Devel] [PATCH v3 1/2] 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: rafal@milecki.pl, 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. The partition scheme initially submitted is incorrect and does not reflect the actual flash structure. The "RouterBoot" section (name matching OEM) is subdivided in several static segments, as they are on ar71xx RB devices albeit with different offsets and sizes. The naming convention from ar71xx has been preserved, except for the bootloaders which are named "bootloader1" and "bootloader2" to avoid confusion with the master "RouterBoot" partition. The preferred 'fixed-partitions' DTS node syntax is used, with nesting support as introduced in 2a598bbaa3. "partition" is used for node names, with associated "label" to match policy set by 6dd94c2781. 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 : "bootloader1" [ 10.154336] 0x00000000f000-0x000000010000 : "hard_config" [ 10.160665] 0x000000010000-0x00000001f000 : "bootloader2" [ 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 | 52 +++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/target/linux/ramips/dts/RBM33G.dts b/target/linux/ramips/dts/RBM33G.dts index 65560ab821..db4d1599d7 100644 --- a/target/linux/ramips/dts/RBM33G.dts +++ b/target/linux/ramips/dts/RBM33G.dts @@ -106,15 +106,41 @@ #size-cells = <1>; partition@0 { - label = "routerboot"; - reg = <0x0 0xf000>; - read-only; - }; - - factory: partition@f000 { - label = "factory"; - reg = <0xf000 0x71000>; + label = "RouterBoot"; + reg = <0x0 0x40000>; read-only; + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader1"; + reg = <0x0 0xf000>; + read-only; + }; + + hard_config: partition@f000 { + label = "hard_config"; + reg = <0xf000 0x1000>; + read-only; + }; + + partition@10000 { + label = "bootloader2"; + reg = <0x10000 0xf000>; + read-only; + }; + + partition@20000 { + label = "soft_config"; + reg = <0x20000 0x1000>; + }; + + partition@30000 { + label = "bios"; + reg = <0x30000 0x1000>; + read-only; + }; }; }; }; @@ -122,6 +148,7 @@ w25q128@1 { compatible = "jedec,spi-nor"; reg = <1>; + // XXX empiric value to obtain actual 10MHz SCK at the chip spi-max-frequency = <3125000>; partitions { @@ -129,6 +156,13 @@ #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; + }; + partition@40000 { label = "firmware"; reg = <0x040000 0xFC0000>; @@ -138,7 +172,7 @@ }; ðernet { - mtd-mac-address = <&factory 0x0010>; + mtd-mac-address = <&hard_config 0x0010>; mtd-mac-address-increment = <1>; }; From patchwork Sat Aug 4 13:44:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thibaut X-Patchwork-Id: 953451 X-Patchwork-Delegate: zajec5@gmail.com 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="S5SfqgIO"; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=slashdirt.org header.i=@slashdirt.org header.b="NUfqLyM2"; 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 41jQBz4f5cz9sXZ for ; Sat, 4 Aug 2018 23:44:59 +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=mLX+MAJFhiBm5zPfPnRBlR1NFaMyQMs3mueBiHAzZ9E=; b=S5SfqgIO9sJEzr nfSRYPX85caY40Z/b6cR0Bptzu3IgCC/bAvmIIFAOP0LQbmjT0KlY4WUc8rYBvprjafUfoGtSiJbP vQgrVoqz9lozacp7SeK9mHqJPlh4tUCBjYr5MMRUUxUMtqHWmO2yjGqOKvQD1A5SvLjKzMOBwsIoF ZGgxztSLmWXBkabjfsfo4b85MMD4Jh6AlpWCwlUHFLIzYoLrp7KhR9R+z6jmSQgK5jLYT3bdqhtIz 4lXY9KzwkpZ4BhlGrLTMKlBz/lAnafQZY0KkNCssNrM4KYzu1ZwzBvxCGfok1l4x58e5wZTjtZrjO dSxMoxP+ccrud0HPt66A==; 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 1flwrV-0004Zl-Rp; Sat, 04 Aug 2018 13:44:53 +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 1flwrL-0004Qv-7a for openwrt-devel@lists.openwrt.org; Sat, 04 Aug 2018 13:44:45 +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 6E74512009F; Sat, 4 Aug 2018 15:44:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.9.2 vps.slashdirt.org 6E74512009F DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=slashdirt.org; s=mail; t=1533390268; bh=uDwPelsLeIOd/6eh80Q9wEIu/z7jV1V0qJ/QI1W08os=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NUfqLyM2FV1yznAIyjZUJypPydjCZRc4F2nSebEqdYE2ip+sI4PXIR+Jwysp3shWY VoTP+46t2L3KAtO35+KnbtbuNFfWvzaPXxOgxvBy1UzbfjTBx0y/T/dxdwP4sy6MdP TFG2Otx+r8/eDlZgBI9+BrZC0ANTxoi4zWHDsfBQ= From: =?utf-8?q?Thibaut_VAR=C3=88NE?= To: openwrt-devel@lists.openwrt.org Date: Sat, 4 Aug 2018 15:44:26 +0200 Message-Id: <20180804134426.42093-3-hacks@slashdirt.org> X-Mailer: git-send-email 2.13.6 (Apple Git-96) In-Reply-To: <20180804134426.42093-1-hacks@slashdirt.org> References: <20180729090724.8436-1-hacks@slashdirt.org> <20180804134426.42093-1-hacks@slashdirt.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180804_064443_431377_7D2F461D X-CRM114-Status: UNSURE ( 9.09 ) 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_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_AU Message has a valid DKIM or DK signature from author's domain Subject: [OpenWrt-Devel] [PATCH v3 2/2] ramips: fix RBM11G 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: rafal@milecki.pl, tobleminer@gmail.com Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This patch improves faf64056ddd46992a75b1e277d94541c7251035c by correcting the partition scheme for the "RouterBoot" section of the flash. The partition scheme initially submitted is incorrect and does not reflect the actual flash structure. The "RouterBoot" section (name matching OEM) is subdivided in several static segments, as they are on ar71xx RB devices albeit with different offsets and sizes. The naming convention from ar71xx has been preserved, except for the bootloaders which are named "bootloader1" and "bootloader2" to avoid confusion with the master "RouterBoot" partition. The preferred 'fixed-partitions' DTS node syntax is used, with nesting support as introduced in 2a598bbaa3. "partition" is used for node names, with associated "label" to match policy set by 6dd94c2781. 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/RBM11G.dts | 45 ++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/target/linux/ramips/dts/RBM11G.dts b/target/linux/ramips/dts/RBM11G.dts index 800f230d95..41dabdd1a3 100644 --- a/target/linux/ramips/dts/RBM11G.dts +++ b/target/linux/ramips/dts/RBM11G.dts @@ -86,6 +86,7 @@ w25q128@0 { compatible = "jedec,spi-nor"; reg = <0>; + // XXX empiric value to obtain actual 10MHz SCK at the chip spi-max-frequency = <3125000>; partitions { @@ -94,15 +95,41 @@ #size-cells = <1>; partition@0 { - label = "routerboot"; - reg = <0x000000 0x00F000>; - read-only; - }; - - factory: partition@f000 { - label = "factory"; - reg = <0x00F000 0x031000>; + label = "RouterBoot"; + reg = <0x0 0x40000>; read-only; + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader1"; + reg = <0x0 0xf000>; + read-only; + }; + + hard_config: partition@f000 { + label = "hard_config"; + reg = <0xf000 0x1000>; + read-only; + }; + + partition@10000 { + label = "bootloader2"; + reg = <0x10000 0xf000>; + read-only; + }; + + partition@20000 { + label = "soft_config"; + reg = <0x20000 0x1000>; + }; + + partition@30000 { + label = "bios"; + reg = <0x30000 0x1000>; + read-only; + }; }; partition@40000 { @@ -114,7 +141,7 @@ }; ðernet { - mtd-mac-address = <&factory 0x0010>; + mtd-mac-address = <&hard_config 0x0010>; mtd-mac-address-increment = <1>; };