Files
wlan-ap/patches/0017-ipq40xx-TP-Link-EC420-support.patch
John Crispin 7ae17f821b ipq807x: update kernel patches and add new boards
Signed-off-by: John Crispin <john@phrozen.org>
2021-01-18 08:03:29 +01:00

420 lines
11 KiB
Diff

From 53477e0b86c24528083f21272b13a4426575b063 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Wed, 22 Jul 2020 14:29:55 +0200
Subject: [PATCH 17/40] ipq40xx: TP-Link EC420 support
Signed-off-by: John Crispin <john@phrozen.org>
---
package/firmware/ipq-wifi/Makefile | 4 +-
.../ipq40xx/base-files/etc/board.d/02_network | 3 +
.../etc/hotplug.d/firmware/11-ath10k-caldata | 6 +-
.../base-files/lib/upgrade/platform.sh | 3 +-
.../dts/qcom-ipq4019-tp-link-ec420-g1.dts | 276 ++++++++++++++++++
target/linux/ipq40xx/image/Makefile | 14 +
.../patches-4.14/998-tp-link-ec420-g1.patch | 12 +
7 files changed, 314 insertions(+), 4 deletions(-)
create mode 100755 target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4019-tp-link-ec420-g1.dts
create mode 100644 target/linux/ipq40xx/patches-4.14/998-tp-link-ec420-g1.patch
diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index 4ca6adf324..e295bd5728 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -36,7 +36,8 @@ ALLWIFIBOARDS:= \
linksys_ea6350v3 \
linksys_ea8300 \
qxwlan_e2600ac \
- tp-link_ap2220
+ tp-link_ap2220 \
+ tp-link_ec420-g1
ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
@@ -112,5 +113,6 @@ $(eval $(call generate-ipq-wifi-package,linksys_ea6350v3,Linksys EA6350v3))
$(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
$(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC))
$(eval $(call generate-ipq-wifi-package,tp-link_ap2220,tp-link AP2220))
+$(eval $(call generate-ipq-wifi-package,tp-link_ec420-g1,tp-link EC420-G1))
$(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))
diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index c191812191..0238549a48 100755
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -49,6 +49,9 @@ ipq40xx_setup_interfaces()
zyxel,wre6606)
ucidef_set_interface_lan "eth0"
;;
+ tp-link,ec420-g1)
+ ucidef_set_interface_wan "eth0"
+ ;;
avm,fritzrepeater-3000|\
compex,wpj428)
ucidef_set_interface_lan "eth0 eth1"
diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 9b11674b02..d2bdb5bf63 100644
--- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -124,7 +124,8 @@ case "$FIRMWARE" in
ath10kcal_patch_mac_crc $(macaddr_setbit_la $(macaddr_add "$(cat /sys/class/net/eth0/address)" 4))
;;
openmesh,a62 |\
- tp-link,ap2220)
+ tp-link,ap2220 |\
+ tp-link,ec420-g1)
ath10kcal_extract "0:ART" 36864 12064
;;
esac
@@ -165,7 +166,8 @@ case "$FIRMWARE" in
openmesh,a62 |\
qxwlan,e2600ac-c1 |\
qxwlan,e2600ac-c2 |\
- tp-link,ap2220)
+ tp-link,ap2220 |\
+ tp-link,ec420-g1)
ath10kcal_extract "0:ART" 4096 12064
;;
engenius,ens620ext)
diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
index e0a9301fe0..4078166066 100644
--- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
@@ -52,7 +52,8 @@ platform_do_upgrade() {
avm,fritzrepeater-1200 |\
avm,fritzrepeater-3000 |\
edgecore,ecw5211 |\
- qxwlan,e2600ac-c2)
+ qxwlan,e2600ac-c2 |\
+ tp-link,ec420-g1)
nand_do_upgrade "$1"
;;
asus,map-ac2200)
diff --git a/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4019-tp-link-ec420-g1.dts b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4019-tp-link-ec420-g1.dts
new file mode 100755
index 0000000000..e2062e7cd0
--- /dev/null
+++ b/target/linux/ipq40xx/files-4.14/arch/arm/boot/dts/qcom-ipq4019-tp-link-ec420-g1.dts
@@ -0,0 +1,276 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qcom-ipq4019.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/soc/qcom,tcsr.h>
+
+/ {
+ model = "tp-link EC420 G1";
+ compatible = "tp-link,ec420-g1";
+
+ aliases {
+ led-boot = &led_green;
+ led-failsafe = &led_green;
+ led-running = &led_green;
+ led-upgrade = &led_green;
+ };
+
+ soc {
+ mdio@90000 {
+ status = "okay";
+ };
+
+ ess-psgmii@98000 {
+ status = "okay";
+ };
+
+ tcsr@1949000 {
+ compatible = "qcom,tcsr";
+ reg = <0x1949000 0x100>;
+ qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
+ };
+
+ ess_tcsr@1953000 {
+ compatible = "qcom,tcsr";
+ reg = <0x1953000 0x1000>;
+ qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
+ };
+
+ tcsr@1957000 {
+ compatible = "qcom,tcsr";
+ reg = <0x1957000 0x100>;
+ qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
+ };
+
+ crypto@8e3a000 {
+ status = "okay";
+ };
+
+ watchdog@b017000 {
+ status = "okay";
+ };
+
+ ess-switch@c000000 {
+ status = "okay";
+ switch_mac_mode = <0x0>; /* mac mode for RGMII RMII */
+ switch_initvlas = <0x0007c 0x54>; /* port0 status */
+ switch_lan_bmp = <0x10>;
+ };
+
+ edma@c080000 {
+ status = "okay";
+ };
+ };
+
+ key {
+ compatible = "gpio-keys";
+
+ button@1 {
+ label = "reset";
+ linux,code = <KEY_RESTART>;
+ gpios = <&tlmm 10 GPIO_ACTIVE_LOW>;
+ linux,input-type = <1>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_red {
+ label = "ec420:red:status";
+ gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>;
+ };
+
+ led_green: power {
+ label = "ec420:green:status";
+ gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
+ };
+
+ led_blue {
+ label = "ec420:blue:status";
+ gpios = <&tlmm 24 GPIO_ACTIVE_HIGH>;
+ };
+ };
+};
+
+&tlmm {
+ serial_0_pins: serial_pinmux {
+ mux {
+ pins = "gpio16", "gpio17";
+ function = "blsp_uart0";
+ bias-disable;
+ };
+ };
+
+spi_0_pins: spi_0_pinmux {
+ pinmux {
+ function = "blsp_spi0";
+ pins = "gpio13", "gpio14", "gpio15";
+ drive-strength = <12>;
+ bias-disable;
+ };
+
+ pinmux_cs {
+ function = "gpio";
+ pins = "gpio12";
+ drive-strength = <2>;
+ bias-disable;
+ output-high;
+ };
+};
+
+nand_pins: nand_pins {
+ pullups {
+ pins = "gpio53", "gpio58", "gpio59";
+ function = "qpic";
+ bias-pull-up;
+ };
+
+ pulldowns {
+ pins = "gpio54", "gpio55", "gpio56",
+ "gpio57", "gpio60", "gpio61",
+ "gpio62", "gpio63", "gpio64",
+ "gpio65", "gpio66", "gpio67",
+ "gpio68", "gpio69";
+ function = "qpic";
+ bias-pull-down;
+ };
+ };
+};
+
+&cryptobam {
+ status = "okay";
+};
+
+&blsp1_spi1 {
+ pinctrl-0 = <&spi_0_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+ cs-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
+
+ flash@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "gd25q256";
+ spi-max-frequency = <24000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition0@0 {
+ label = "0:SBL1";
+ reg = <0x00000000 0x00040000>;
+ read-only;
+ };
+ partition1@40000 {
+ label = "0:MIBIB";
+ reg = <0x00040000 0x00020000>;
+ read-only;
+ };
+ partition2@60000 {
+ label = "0:QSEE";
+ reg = <0x00060000 0x00060000>;
+ read-only;
+ };
+ partition3@c0000 {
+ label = "0:CDT";
+ reg = <0x000c0000 0x00010000>;
+ read-only;
+ };
+ partition4@d0000 {
+ label = "0:DDRPARAMS";
+ reg = <0x000d0000 0x00010000>;
+ read-only;
+ };
+ partition5@e0000 {
+ label = "0:APPSBLENV";
+ reg = <0x000e0000 0x00010000>;
+ read-only;
+ };
+ partition6@f0000 {
+ label = "0:APPSBL";
+ reg = <0x000f0000 0x00080000>;
+ read-only;
+ };
+ partition7@170000 {
+ label = "0:ART";
+ reg = <0x00170000 0x00010000>;
+ read-only;
+ };
+ partition8@180000 {
+ label = "product_info";
+ reg = <0x00180000 0x00010000>;
+ };
+ partition9@190000 {
+ label = "factory_fw";
+ reg = <0x00190000 0x01e70000>;
+ };
+ };
+ };
+};
+
+&nand {
+ pinctrl-0 = <&nand_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+
+ nand@0 {
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "ubi";
+ reg = <0x00000000 0x10000000>;
+ };
+ };
+ };
+};
+
+&blsp_dma {
+ status = "okay";
+};
+
+&blsp1_uart1 {
+ pinctrl-0 = <&serial_0_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+};
+
+&qpic_bam {
+ status = "okay";
+};
+
+&wifi0 {
+ status = "okay";
+};
+
+&wifi1 {
+ status = "disabled";
+};
+
+&pcie0 {
+ status = "okay";
+ perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>;
+ wake-gpio = <&tlmm 40 GPIO_ACTIVE_LOW>;
+
+ bridge@0,0 {
+ reg = <0x00000000 0 0 0 0>;
+ #address-cells = <3>;
+ #size-cells = <2>;
+ ranges;
+
+ wifi2: wifi@1,0 {
+ compatible = "qcom,ath10k";
+ status = "okay";
+ reg = <0x00010000 0 0 0 0>;
+ };
+ };
+};
+
diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile
index 10ba4dcbab..5426acad5a 100644
--- a/target/linux/ipq40xx/image/Makefile
+++ b/target/linux/ipq40xx/image/Makefile
@@ -412,6 +412,20 @@ define Device/tp-link_ap2220
endef
TARGET_DEVICES += tp-link_ap2220
+define Device/tp-link_ec420_g1
+ $(call Device/FitImage)
+ DEVICE_TITLE := tp-link EC420 G1
+ BOARD_NAME := ec420_g1
+ DEVICE_DTS := qcom-ipq4019-tp-link-ec420-g1
+ KERNEL_SIZE := 4096k
+ IMAGE_SIZE := 26624k
+ IMAGES := sysupgrade.bin
+ SUPPORTED_DEVICES := tp-link,ec420-g1
+ IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+ DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-tp-link_ec420-g1
+endef
+TARGET_DEVICES += tp-link_ec420_g1
+
define Device/zyxel_nbg6617
$(call Device/FitImageLzma)
DEVICE_DTS := qcom-ipq4018-nbg6617
diff --git a/target/linux/ipq40xx/patches-4.14/998-tp-link-ec420-g1.patch b/target/linux/ipq40xx/patches-4.14/998-tp-link-ec420-g1.patch
new file mode 100644
index 0000000000..52cffc8812
--- /dev/null
+++ b/target/linux/ipq40xx/patches-4.14/998-tp-link-ec420-g1.patch
@@ -0,0 +1,12 @@
+Index: linux-4.14.187/arch/arm/boot/dts/Makefile
+===================================================================
+--- linux-4.14.187.orig/arch/arm/boot/dts/Makefile
++++ linux-4.14.187/arch/arm/boot/dts/Makefile
+@@ -717,6 +717,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
+ qcom-ipq4019-fritzrepeater-1200.dtb \
+ qcom-ipq4019-fritzrepeater-3000.dtb \
+ qcom-ipq4019-tp-link-ap2220.dtb \
++ qcom-ipq4019-tp-link-ec420-g1.dtb \
+ qcom-ipq4019-linksys_ea8300.dtb \
+ qcom-ipq4019-map-ac2200.dtb \
+ qcom-ipq4019-qxwlan-e2600ac-c1.dtb \
--
2.25.1