From patchwork Sat Nov 7 02:29:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Leite X-Patchwork-Id: 541205 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8AE42140307 for ; Sat, 7 Nov 2015 13:31:29 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 3B41228BFEE; Sat, 7 Nov 2015 03:28:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D342028BFCF for ; Sat, 7 Nov 2015 03:27:37 +0100 (CET) X-policyd-weight: using cached result; rate: -5.5 Received: from smtp.rcn.com (smtp.rcn.com [69.168.97.78]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 7 Nov 2015 03:27:37 +0100 (CET) X_CMAE_Category: , , X-CNFS-Analysis: v=2.1 cv=KMX6dAxo c=1 sm=1 tr=0 a=2oE5fp73Cp9AF7JbdBHwrQ==:117 a=2oE5fp73Cp9AF7JbdBHwrQ==:17 a=K-v-2zaBAAAA:8 a=8ndMLmUfAAAA:8 a=8vsZZTaJnmbaeAdnu_wA:9 a=32QuhppAT2Uwaab0:21 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine X-Authed-Username: bGVpdGVjQHN0YXRpY2t5LmNvbQ== Authentication-Results: smtp02.rcn.cmh.synacor.com smtp.mail=leitec@staticky.com; spf=neutral; sender-id=neutral Authentication-Results: smtp02.rcn.cmh.synacor.com header.from=leitec@staticky.com; sender-id=neutral Received-SPF: neutral (smtp02.rcn.cmh.synacor.com: 207.172.128.145 is neither permitted nor denied by domain of staticky.com) Received: from [207.172.128.145] ([207.172.128.145:54435] helo=dirk.lan.staticky.com) by smtp.rcn.com (envelope-from ) (ecelerity 3.6.2.43620 r(Platform:3.6.2.0)) with ESMTP id 21/E6-19257-3026D365; Fri, 06 Nov 2015 21:29:24 -0500 From: Claudio Leite To: openwrt-devel@lists.openwrt.org Date: Fri, 6 Nov 2015 21:29:09 -0500 Message-Id: <1446863354-3263-3-git-send-email-leitec@staticky.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1446863354-3263-1-git-send-email-leitec@staticky.com> References: <1446863354-3263-1-git-send-email-leitec@staticky.com> Cc: luka@openwrt.org Subject: [OpenWrt-Devel] [PATCH 2/7] kirkwood: match factory partitions on EA[34]500 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Linksys uses a dual firmware layout, where the bootloader will switch to the other stored image when one fails to boot three consecutive times. In order to make this firmware compatible with the factory images and the stock bootloader we must match this layout. Signed-off-by: Claudio Leite --- package/boot/uboot-envtools/files/kirkwood | 2 +- .../linux/kirkwood/patches-3.18/160-ea4500.patch | 36 +++++++++++++++----- .../linux/kirkwood/patches-3.18/170-ea3500.patch | 39 ++++++++++++++++------ target/linux/kirkwood/patches-4.3/140-ea4500.patch | 36 +++++++++++++++----- target/linux/kirkwood/patches-4.3/150-ea3500.patch | 39 ++++++++++++++++------ 5 files changed, 115 insertions(+), 37 deletions(-) diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood index 98f85da..1066371 100644 --- a/package/boot/uboot-envtools/files/kirkwood +++ b/package/boot/uboot-envtools/files/kirkwood @@ -15,7 +15,7 @@ board=$(kirkwood_board_name) case "$board" in "ea3500") - ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x20000" + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" ;; "ea4500" | \ "guruplug-server-plus" | \ diff --git a/target/linux/kirkwood/patches-3.18/160-ea4500.patch b/target/linux/kirkwood/patches-3.18/160-ea4500.patch index 386b5ea..9027070 100644 --- a/target/linux/kirkwood/patches-3.18/160-ea4500.patch +++ b/target/linux/kirkwood/patches-3.18/160-ea4500.patch @@ -10,7 +10,7 @@ kirkwood-ib62x0.dtb \ --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ea4500.dts -@@ -0,0 +1,167 @@ +@@ -0,0 +1,187 @@ +/* + * kirkwood-ea4500.dts - Device Tree file for Linksys EA4500 + * @@ -140,22 +140,42 @@ + + partition@0 { + label = "u-boot"; -+ reg = <0x0000000 0x80000>; ++ reg = <0x0 0x80000>; + }; + + partition@80000 { -+ label = "u-boot environment"; ++ label = "u_env"; + reg = <0x80000 0x20000>; + }; + ++ partition@a0000 { ++ label = "s_env"; ++ reg = <0xa0000 0x20000>; ++ }; ++ + partition@200000 { -+ label = "kernel"; -+ reg = <0x200000 0x200000>; ++ label = "kernel1"; ++ reg = <0x200000 0x1a00000>; ++ }; ++ ++ partition@4a0000 { ++ label = "rootfs1"; ++ reg = <0x4a0000 0x1760000>; ++ }; ++ ++ partition@1c00000 { ++ label = "kernel2"; ++ reg = <0x1c00000 0x1a00000>; ++ }; ++ ++ partition@1ea0000 { ++ label = "rootfs2"; ++ reg = <0x1ea0000 0x1760000>; + }; + -+ partition@400000 { -+ label = "root"; -+ reg = <0x400000 0x1c00000>; ++ partition@3600000 { ++ label = "syscfg"; ++ reg = <0x3600000 0x4a00000>; + }; +}; + diff --git a/target/linux/kirkwood/patches-3.18/170-ea3500.patch b/target/linux/kirkwood/patches-3.18/170-ea3500.patch index 84645de..db69659 100644 --- a/target/linux/kirkwood/patches-3.18/170-ea3500.patch +++ b/target/linux/kirkwood/patches-3.18/170-ea3500.patch @@ -10,7 +10,7 @@ kirkwood-guruplug-server-plus.dtb \ --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ea3500.dts -@@ -0,0 +1,160 @@ +@@ -0,0 +1,179 @@ +/* + * kirkwood-ea3500.dts - Device Tree file for Linksys EA3500 + * @@ -132,23 +132,42 @@ + + partition@0 { + label = "u-boot"; -+ reg = <0x0000000 0x80000>; -+ read-only; ++ reg = <0x0 0x80000>; + }; + + partition@80000 { -+ label = "u-boot environment"; -+ reg = <0x80000 0x20000>; ++ label = "u_env"; ++ reg = <0x80000 0x4000>; ++ }; ++ ++ partition@84000 { ++ label = "s_env"; ++ reg = <0x84000 0x4000>; + }; + + partition@200000 { -+ label = "kernel"; -+ reg = <0x200000 0x200000>; ++ label = "kernel1"; ++ reg = <0x200000 0x1400000>; ++ }; ++ ++ partition@490000 { ++ label = "rootfs1"; ++ reg = <0x490000 0x1170000>; ++ }; ++ ++ partition@1600000 { ++ label = "kernel2"; ++ reg = <0x1600000 0x1400000>; ++ }; ++ ++ partition@1890000 { ++ label = "rootfs2"; ++ reg = <0x1890000 0x1170000>; + }; + -+ partition@400000 { -+ label = "root"; -+ reg = <0x400000 0x1200000>; ++ partition@2a00000 { ++ label = "syscfg"; ++ reg = <0x2a00000 0x1600000>; + }; +}; + diff --git a/target/linux/kirkwood/patches-4.3/140-ea4500.patch b/target/linux/kirkwood/patches-4.3/140-ea4500.patch index 4409394..7fd56a7 100644 --- a/target/linux/kirkwood/patches-4.3/140-ea4500.patch +++ b/target/linux/kirkwood/patches-4.3/140-ea4500.patch @@ -10,7 +10,7 @@ kirkwood-ib62x0.dtb \ --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ea4500.dts -@@ -0,0 +1,167 @@ +@@ -0,0 +1,187 @@ +/* + * kirkwood-ea4500.dts - Device Tree file for Linksys EA4500 + * @@ -140,22 +140,42 @@ + + partition@0 { + label = "u-boot"; -+ reg = <0x0000000 0x80000>; ++ reg = <0x0 0x80000>; + }; + + partition@80000 { -+ label = "u-boot environment"; ++ label = "u_env"; + reg = <0x80000 0x20000>; + }; + ++ partition@a0000 { ++ label = "s_env"; ++ reg = <0xa0000 0x20000>; ++ }; ++ + partition@200000 { -+ label = "kernel"; -+ reg = <0x200000 0x200000>; ++ label = "kernel1"; ++ reg = <0x200000 0x1a00000>; ++ }; ++ ++ partition@4a0000 { ++ label = "rootfs1"; ++ reg = <0x4a0000 0x1760000>; ++ }; ++ ++ partition@1c00000 { ++ label = "kernel2"; ++ reg = <0x1c00000 0x1a00000>; ++ }; ++ ++ partition@1ea0000 { ++ label = "rootfs2"; ++ reg = <0x1ea0000 0x1760000>; + }; + -+ partition@400000 { -+ label = "root"; -+ reg = <0x400000 0x1c00000>; ++ partition@3600000 { ++ label = "syscfg"; ++ reg = <0x3600000 0x4a00000>; + }; +}; + diff --git a/target/linux/kirkwood/patches-4.3/150-ea3500.patch b/target/linux/kirkwood/patches-4.3/150-ea3500.patch index a2d71e3..13abd02 100644 --- a/target/linux/kirkwood/patches-4.3/150-ea3500.patch +++ b/target/linux/kirkwood/patches-4.3/150-ea3500.patch @@ -10,7 +10,7 @@ kirkwood-guruplug-server-plus.dtb \ --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ea3500.dts -@@ -0,0 +1,160 @@ +@@ -0,0 +1,179 @@ +/* + * kirkwood-ea3500.dts - Device Tree file for Linksys EA3500 + * @@ -132,23 +132,42 @@ + + partition@0 { + label = "u-boot"; -+ reg = <0x0000000 0x80000>; -+ read-only; ++ reg = <0x0 0x80000>; + }; + + partition@80000 { -+ label = "u-boot environment"; -+ reg = <0x80000 0x20000>; ++ label = "u_env"; ++ reg = <0x80000 0x4000>; ++ }; ++ ++ partition@84000 { ++ label = "s_env"; ++ reg = <0x84000 0x4000>; + }; + + partition@200000 { -+ label = "kernel"; -+ reg = <0x200000 0x200000>; ++ label = "kernel1"; ++ reg = <0x200000 0x1400000>; ++ }; ++ ++ partition@490000 { ++ label = "rootfs1"; ++ reg = <0x490000 0x1170000>; ++ }; ++ ++ partition@1600000 { ++ label = "kernel2"; ++ reg = <0x1600000 0x1400000>; ++ }; ++ ++ partition@1890000 { ++ label = "rootfs2"; ++ reg = <0x1890000 0x1170000>; + }; + -+ partition@400000 { -+ label = "root"; -+ reg = <0x400000 0x1200000>; ++ partition@2a00000 { ++ label = "syscfg"; ++ reg = <0x2a00000 0x1600000>; + }; +}; +