From patchwork Tue Aug 4 21:55:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Olivari X-Patchwork-Id: 503831 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 BEE14140316 for ; Wed, 5 Aug 2015 07:57:42 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 4B6C0287562; Tue, 4 Aug 2015 23:56:06 +0200 (CEST) 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 B91C928BB95 for ; Tue, 4 Aug 2015 23:55:33 +0200 (CEST) X-policyd-weight: using cached result; rate: -7.6 Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 4 Aug 2015 23:55:19 +0200 (CEST) Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id E969F140838; Tue, 4 Aug 2015 21:55:52 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id DC43314083A; Tue, 4 Aug 2015 21:55:52 +0000 (UTC) Received: from mathieu-linux.qualcomm.com (qf-scl1nat.qualcomm.com [207.114.132.30]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mathieu@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5A7781405C3; Tue, 4 Aug 2015 21:55:51 +0000 (UTC) From: Mathieu Olivari To: nbd@openwrt.org, jogo@openwrt.org, blogic@openwrt.org Date: Tue, 4 Aug 2015 14:55:30 -0700 Message-Id: <1438725332-19984-2-git-send-email-mathieu@codeaurora.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1438725332-19984-1-git-send-email-mathieu@codeaurora.org> References: <1438725332-19984-1-git-send-email-mathieu@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH 2/4] ipq806x: add support for non-dt enabled ap148 bootloader 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" Certain AP148 platforms (and derivative) use bootloaders which did not have DT enabled. In order to support these old platforms, we'll now make the following modifications: *explicitely add the memory node in the AP148 DT: this used to be added by new u-boot through a run-time patch mechanism. We'll now add it explicitely so it works on boots which don't support that feature. New boots will have the node twice, the second one will be ignored. *add the zImage generation next to the FIT image for AP148. Other platforms using non-DT enabled bootloaders may want to leverage this zImage code to generate their own firmare as well. Signed-off-by: Mathieu Olivari --- target/linux/ipq806x/image/Makefile | 10 ++++++++++ .../ipq806x/patches-3.18/024-ap148-add-memory-node.patch | 14 ++++++++++++++ .../ipq806x/patches-4.1/024-ap148-add-memory-node.patch | 14 ++++++++++++++ ...-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch | 4 ++-- ...-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch | 4 ++-- .../707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch | 6 +++--- ...-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch | 4 ++-- 7 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 target/linux/ipq806x/patches-3.18/024-ap148-add-memory-node.patch create mode 100644 target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index 9a1bad8..99e9811 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -8,6 +8,15 @@ UBINIZE_OPTS = -m 2048 -p 128KiB E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024))) +define Image/BuildKernel/zImage + cat $(KDIR)/zImage $(LINUX_DIR)/arch/arm/boot/dts/$(1).dtb > $(KDIR)/zImage-$(1) + $(CP) $(KDIR)/zImage-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-zImage +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + cat $(KDIR)/zImage-initramfs $(LINUX_DIR)/arch/arm/boot/dts/$(1).dtb > $(KDIR)/zImage-initramfs-$(1) + $(CP) $(KDIR)/zImage-initramfs-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-zImage-initramfs +endif +endef + define Image/BuildKernel/FIT gzip -9n -c $(KDIR)/Image > $(KDIR)/Image.gz $(call CompressLzma,$(KDIR)/Image,$(KDIR)/Image.gz) @@ -26,6 +35,7 @@ endef define Image/BuildKernel $(CP) $(KDIR)/$(IMG_PREFIX)-vmlinux.elf $(BIN_DIR) $(call Image/BuildKernel/FIT,qcom-ipq8064-ap148) + $(call Image/BuildKernel/zImage,qcom-ipq8064-ap148) $(call Image/BuildKernel/FIT,qcom-ipq8064-db149) endef diff --git a/target/linux/ipq806x/patches-3.18/024-ap148-add-memory-node.patch b/target/linux/ipq806x/patches-3.18/024-ap148-add-memory-node.patch new file mode 100644 index 0000000..f026ed9 --- /dev/null +++ b/target/linux/ipq806x/patches-3.18/024-ap148-add-memory-node.patch @@ -0,0 +1,14 @@ +--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts ++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts +@@ -4,6 +4,11 @@ + model = "Qualcomm IPQ8064/AP148"; + compatible = "qcom,ipq8064-ap148", "qcom,ipq8064"; + ++ memory@0 { ++ reg = <0x42000000 0x1e000000>; ++ device_type = "memory"; ++ }; ++ + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; diff --git a/target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch b/target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch new file mode 100644 index 0000000..f026ed9 --- /dev/null +++ b/target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch @@ -0,0 +1,14 @@ +--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts ++++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts +@@ -4,6 +4,11 @@ + model = "Qualcomm IPQ8064/AP148"; + compatible = "qcom,ipq8064-ap148", "qcom,ipq8064"; + ++ memory@0 { ++ reg = <0x42000000 0x1e000000>; ++ device_type = "memory"; ++ }; ++ + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; diff --git a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch index e7de2bb..e494d32 100644 --- a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch +++ b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch @@ -15,7 +15,7 @@ Signed-off-by: Mathieu Olivari --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts -@@ -30,6 +30,22 @@ +@@ -35,6 +35,22 @@ bias-disable; }; @@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari spi_pins: spi_pins { mux { pins = "gpio18", "gpio19", "gpio21"; -@@ -109,5 +125,19 @@ +@@ -114,5 +130,19 @@ sata@29000000 { status = "ok"; }; diff --git a/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch b/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch index 46feec3..9435de6 100644 --- a/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch +++ b/target/linux/ipq806x/patches-4.1/144-ARM-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch @@ -37,7 +37,7 @@ }; }; -@@ -195,6 +213,46 @@ +@@ -72,6 +90,46 @@ }; }; @@ -84,7 +84,7 @@ soc: soc { #address-cells = <1>; #size-cells = <1>; -@@ -310,11 +368,13 @@ +@@ -187,11 +245,13 @@ acc0: clock-controller@2088000 { compatible = "qcom,kpss-acc-v1"; reg = <0x02088000 0x1000>, <0x02008000 0x1000>; diff --git a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch index 20d8502..846f738 100644 --- a/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch +++ b/target/linux/ipq806x/patches-4.1/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch @@ -11,7 +11,7 @@ Signed-off-by: Mathieu Olivari --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts -@@ -14,8 +14,9 @@ +@@ -19,8 +19,9 @@ }; }; @@ -22,7 +22,7 @@ Signed-off-by: Mathieu Olivari }; chosen { -@@ -54,6 +55,15 @@ +@@ -59,6 +60,15 @@ bias-none; }; }; @@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari }; gsbi@16300000 { -@@ -139,5 +149,33 @@ +@@ -144,5 +154,33 @@ pinctrl-0 = <&pcie2_pins>; pinctrl-names = "default"; }; diff --git a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch index de68678..8019713 100644 --- a/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch +++ b/target/linux/ipq806x/patches-4.1/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch @@ -12,7 +12,7 @@ Signed-off-by: Mathieu Olivari --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts -@@ -64,6 +64,16 @@ +@@ -69,6 +69,16 @@ bias-disable; }; }; @@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari }; gsbi@16300000 { -@@ -177,5 +187,26 @@ +@@ -182,5 +192,26 @@ reg = <4>; }; };