From patchwork Fri Mar 13 22:01:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Olivari X-Patchwork-Id: 450112 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.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BCCC714007D for ; Sat, 14 Mar 2015 09:03:09 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 48C2028BB56; Fri, 13 Mar 2015 23:01:36 +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, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 25E432844FB for ; Fri, 13 Mar 2015 23:00:57 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -7.6 Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Fri, 13 Mar 2015 23:00:52 +0100 (CET) Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 71BC1140ECB; Fri, 13 Mar 2015 22:01:14 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 5BA93140ECE; Fri, 13 Mar 2015 22:01:14 +0000 (UTC) Received: from mathieu-linux.qualcomm.com (qf-scl1nat.qualcomm.com [207.114.132.30]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mathieu@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1C194140ECB; Fri, 13 Mar 2015 22:01:13 +0000 (UTC) From: Mathieu Olivari To: blogic@openwrt.org, kaloz@openwrt.org Date: Fri, 13 Mar 2015 15:01:02 -0700 Message-Id: <1426284062-4305-3-git-send-email-mathieu@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426284062-4305-1-git-send-email-mathieu@codeaurora.org> References: <1426284062-4305-1-git-send-email-mathieu@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH 3/3] ipq806x: fix AP148 boot from NOR 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" This patch allows AP148 to boot from NOR flash. As we're using a FIT image as kernel (which includes kernel bin + DTB) we enable the MTD_SPLIT_FIT_FW kernel option, which will detect the FIT image and automatically split the "firmware" partition into 2 MTD parts (kernel + rootfs). The rootfs will then be parsed and split between rootfs + rootfs_data, as usual. Signed-off-by: Mathieu Olivari --- target/linux/ipq806x/config-3.18 | 3 ++ .../patches-3.18/021-add-ap148-partitions.patch | 35 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18 index e5ce0e4..97687ac 100644 --- a/target/linux/ipq806x/config-3.18 +++ b/target/linux/ipq806x/config-3.18 @@ -226,6 +226,9 @@ CONFIG_MSM_MMCC_8974=y CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_M25P80=y CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_FIT_FW=y +CONFIG_MTD_SPLIT_SUPPORT=y CONFIG_MULTI_IRQ_HANDLER=y CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NEED_DMA_MAP_STATE=y diff --git a/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch b/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch new file mode 100644 index 0000000..34eb9c0 --- /dev/null +++ b/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch @@ -0,0 +1,35 @@ +--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts ++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts +@@ -78,13 +78,28 @@ + reg = <0>; + + partition@0 { +- label = "rootfs"; +- reg = <0x0 0x1000000>; ++ label = "lowlevel_init"; ++ reg = <0x0 0x1b0000>; + }; + + partition@1 { +- label = "scratch"; +- reg = <0x1000000 0x1000000>; ++ label = "u-boot"; ++ reg = <0x1b0000 0x80000>; ++ }; ++ ++ partition@2 { ++ label = "u-boot-env"; ++ reg = <0x230000 0x40000>; ++ }; ++ ++ partition@3 { ++ label = "caldata"; ++ reg = <0x270000 0x40000>; ++ }; ++ ++ partition@4 { ++ label = "firmware"; ++ reg = <0x2b0000 0x1d50000>; + }; + }; + };