From patchwork Sun Oct 15 18:32:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Yeryomin X-Patchwork-Id: 826036 X-Patchwork-Delegate: openwrt@kresin.me Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pMgwUlep"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 3yFVV94H3Cz9sP1 for ; Mon, 16 Oct 2017 05:34:25 +1100 (AEDT) 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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id:Date:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=sz2MtoG4YXqcxW1thzOmKSI3ZaOGUYcieZ6oSkghmZs=; b=pMgwUlepWRNYhu 33Qa46g+PSYTSDAiqrTWT5H65QE0zpV9zdzw8i4pol3imj0rr1gna4S3id7avNOvPlxMHEwHG3kSX PA/Ld615AwsNiFPh7WUlaGlm1EGoDZsi140xEK0UxptUfGii+ENEW3k5AqOhMm1m3k1ruqeeCSC6t 6/ThlcYYO7LwlZfDQzlHxTxzefEkCX+tJrH1lLVsCsv0VPrjGtsHUaA8qXlN3qvlAxhVyiueKVkm/ mXbNUARF+boCkgExiq3uoF8tWdaFw08FUBbSsSaqab2yDHiHHD1XjsW7Q+Ei38oAvq4zOFTbHAT6C DIQ9KkuQh9nDXTCZRecA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e3njn-00017o-AK; Sun, 15 Oct 2017 18:34:11 +0000 Received: from [213.175.92.62] (helo=mail.pbx.lv) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e3njM-0000yQ-Gj for lede-dev@lists.infradead.org; Sun, 15 Oct 2017 18:33:47 +0000 Received: from localhost.localdomain (unknown [213.175.92.61]) by mail.pbx.lv (MailSystem) with ESMTPSA id 84795191A77 for ; Sun, 15 Oct 2017 21:33:18 +0300 (EEST) From: Roman Yeryomin To: LEDE Development List Date: Sun, 15 Oct 2017 21:32:47 +0300 Message-Id: <1508092367-15189-1-git-send-email-roman@advem.lv> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171015_113345_021647_923A657E X-CRM114-Status: UNSURE ( 9.85 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.1 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS Subject: [LEDE-DEV] [PATCH] ipq806x: add ap.dk01.1 board support X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org - add partitions - enable wifi and ethernet - set max cpu speed to 710MHz - set memory size to 256MB - add image generation - extract pre-cal data from ART partition Wirespeed NAT can be achieved with spreading rx interrupts over different cores. Wifi needs love -- too slow. Could be that latest ath10k helps, didn't test yet. Signed-off-by: Roman Yeryomin --- .../etc/hotplug.d/firmware/11-ath10k-caldata | 6 ++ target/linux/ipq806x/base-files/lib/ipq806x.sh | 3 + target/linux/ipq806x/image/Makefile | 18 ++++- ...s-ipq4019-ap.dk01.1-add-256MB-memory-node.patch | 14 ++++ ...2-dts-ipq4019-ap.dk01.1-fix-max-cpu-speed.patch | 15 ++++ ...4-03-dts-ipq4019-ap.dk01.1-add-partitions.patch | 72 ++++++++++++++++++ ...pq4019-ap.dk01.1-enable-wifi-and-ethernet.patch | 87 ++++++++++++++++++++++ 7 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 target/linux/ipq806x/patches-4.9/864-01-dts-ipq4019-ap.dk01.1-add-256MB-memory-node.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-02-dts-ipq4019-ap.dk01.1-fix-max-cpu-speed.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-03-dts-ipq4019-ap.dk01.1-add-partitions.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-04-dts-ipq4019-ap.dk01.1-enable-wifi-and-ethernet.patch diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 39757eb..271667f 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -50,6 +50,9 @@ case "$FIRMWARE" in fritz4040) /usr/bin/fritz_cal_extract -i 1 -s 0x400 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader_config") ;; + ap-dk01.1-c1) + ath10kcal_extract "ART" 4096 12064 + ;; esac ;; "ath10k/pre-cal-ahb-a800000.wifi.bin") @@ -57,6 +60,9 @@ case "$FIRMWARE" in fritz4040) /usr/bin/fritz_cal_extract -i 1 -s 0x400 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader_config") ;; + ap-dk01.1-c1) + ath10kcal_extract "ART" 20480 12064 + ;; esac ;; diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh b/target/linux/ipq806x/base-files/lib/ipq806x.sh index e8ff7ea..940c7ef 100644 --- a/target/linux/ipq806x/base-files/lib/ipq806x.sh +++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh @@ -14,6 +14,9 @@ ipq806x_board_detect() { machine=$(cat /proc/device-tree/model) case "$machine" in + *"AP-DK01.1-C1") + name="ap-dk01.1-c1" + ;; *"AP148") name="ap148" ;; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index 3a76c7f..60b3a71 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -264,7 +264,23 @@ define Device/AP-DK04.1-C1 DEVICE_TITLE := QCA AP-DK04.1-C1 endef +define Device/AP-DK01.1-C1 + PROFILES += $$(DEVICE_NAME) + DEVICE_TITLE := QCA AP-DK01.1-C1 + BOARD_NAME := ap-dk01.1-c1 + DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1 + KERNEL_LOADADDR := 0x80208000 + KERNEL_INSTALL := 1 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 26624k + FILESYSTEMS := squashfs + $(call Device/FitImage) + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca4019 +endef + TARGET_DEVICES += AP148 AP148-legacy C2600 D7800 DB149 EA8500 FRITZ4040 R7500 \ - R7500v2 R7800 NBG6817 VR2600v AP-DK04.1-C1 + R7500v2 R7800 NBG6817 VR2600v AP-DK04.1-C1 AP-DK01.1-C1 $(eval $(call BuildImage)) diff --git a/target/linux/ipq806x/patches-4.9/864-01-dts-ipq4019-ap.dk01.1-add-256MB-memory-node.patch b/target/linux/ipq806x/patches-4.9/864-01-dts-ipq4019-ap.dk01.1-add-256MB-memory-node.patch new file mode 100644 index 0000000..8a80979 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-01-dts-ipq4019-ap.dk01.1-add-256MB-memory-node.patch @@ -0,0 +1,14 @@ +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi +@@ -20,6 +20,11 @@ + model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK01.1"; + compatible = "qcom,ipq4019"; + ++ memory { ++ device_type = "memory"; ++ reg = <0x80000000 0x10000000>; ++ }; ++ + clocks { + xo: xo { + compatible = "fixed-clock"; diff --git a/target/linux/ipq806x/patches-4.9/864-02-dts-ipq4019-ap.dk01.1-fix-max-cpu-speed.patch b/target/linux/ipq806x/patches-4.9/864-02-dts-ipq4019-ap.dk01.1-fix-max-cpu-speed.patch new file mode 100644 index 0000000..e9540f4 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-02-dts-ipq4019-ap.dk01.1-fix-max-cpu-speed.patch @@ -0,0 +1,15 @@ +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi +@@ -135,3 +135,12 @@ + }; + }; + }; ++ ++&cpu0_opp_table { ++ /delete-node/ opp@666000000; ++ ++ opp@710000000 { ++ opp-hz = /bits/ 64 <710000000>; ++ clock-latency-ns = <256000>; ++ }; ++}; diff --git a/target/linux/ipq806x/patches-4.9/864-03-dts-ipq4019-ap.dk01.1-add-partitions.patch b/target/linux/ipq806x/patches-4.9/864-03-dts-ipq4019-ap.dk01.1-add-partitions.patch new file mode 100644 index 0000000..a7861cd --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-03-dts-ipq4019-ap.dk01.1-add-partitions.patch @@ -0,0 +1,72 @@ +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi +@@ -93,6 +93,69 @@ + reg = <0>; + compatible = "mx25l25635e"; + spi-max-frequency = <24000000>; ++ ++ SBL1@0 { ++ label = "SBL1"; ++ reg = <0x0 0x40000>; ++ read-only; ++ }; ++ ++ MIBIB@40000 { ++ label = "MIBIB"; ++ reg = <0x40000 0x20000>; ++ read-only; ++ }; ++ ++ QSEE@60000 { ++ label = "QSEE"; ++ reg = <0x60000 0x60000>; ++ read-only; ++ }; ++ ++ CDT@c0000 { ++ label = "CDT"; ++ reg = <0xc0000 0x10000>; ++ read-only; ++ }; ++ ++ DDRPARAMS@d0000 { ++ label = "DDRPARAMS"; ++ reg = <0xd0000 0x10000>; ++ read-only; ++ }; ++ ++ APPSBLENV@e0000 { ++ label = "APPSBLENV"; ++ reg = <0xe0000 0x10000>; ++ read-only; ++ }; ++ ++ APPSBL@f0000 { ++ label = "APPSBL"; ++ reg = <0xf0000 0x80000>; ++ read-only; ++ }; ++ ++ ART@170000 { ++ label = "ART"; ++ reg = <0x170000 0x10000>; ++ read-only; ++ }; ++ ++ kernel@180000 { ++ label = "kernel"; ++ reg = <0x180000 0x400000>; ++ }; ++ ++ rootfs@580000 { ++ label = "rootfs"; ++ reg = <0x580000 0x1600000>; ++ }; ++ ++ firmware@180000 { ++ label = "firmware"; ++ reg = <0x180000 0x1a00000>; ++ }; + }; + }; + diff --git a/target/linux/ipq806x/patches-4.9/864-04-dts-ipq4019-ap.dk01.1-enable-wifi-and-ethernet.patch b/target/linux/ipq806x/patches-4.9/864-04-dts-ipq4019-ap.dk01.1-enable-wifi-and-ethernet.patch new file mode 100644 index 0000000..cc90475 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-04-dts-ipq4019-ap.dk01.1-enable-wifi-and-ethernet.patch @@ -0,0 +1,87 @@ +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi +@@ -15,6 +15,7 @@ + */ + + #include "qcom-ipq4019.dtsi" ++#include + + / { + model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK01.1"; +@@ -25,6 +26,27 @@ + reg = <0x80000000 0x10000000>; + }; + ++ reserved-memory { ++ #address-cells = <0x1>; ++ #size-cells = <0x1>; ++ ranges; ++ ++ rsvd1@87000000 { ++ reg = <0x87000000 0x0500000>; ++ no-map; ++ }; ++ ++ wifi_dump@87500000 { ++ reg = <0x87500000 0x600000>; ++ no-map; ++ }; ++ ++ rsvd2@87B00000 { ++ reg = <0x87b00000 0x500000>; ++ no-map; ++ }; ++ }; ++ + clocks { + xo: xo { + compatible = "fixed-clock"; +@@ -196,6 +218,48 @@ + usb2: usb2@60f8800 { + status = "ok"; + }; ++ ++ wifi@a000000 { ++ status = "okay"; ++ }; ++ ++ wifi@a800000 { ++ status = "okay"; ++ }; ++ ++ ess-switch@c000000 { ++ status = "okay"; ++ }; ++ ++ ess-psgmii@98000 { ++ status = "okay"; ++ }; ++ ++ edma@c080000 { ++ status = "okay"; ++ }; ++ ++ mdio@90000 { ++ status = "okay"; ++ }; ++ ++ ess_tcsr@1953000 { ++ compatible = "qcom,tcsr"; ++ reg = <0x1953000 0x1000>; ++ qcom,ess-interface-select = ; ++ }; ++ ++ tcsr@1949000 { ++ compatible = "qcom,tcsr"; ++ reg = <0x1949000 0x100>; ++ qcom,wifi_glb_cfg = ; ++ }; ++ ++ tcsr@1957000 { ++ compatible = "qcom,tcsr"; ++ reg = <0x1957000 0x100>; ++ qcom,wifi_noc_memtype_m0_m2 = ; ++ }; + }; + }; +