diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 770afd58b8..2e0291b5dc 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -34,7 +34,8 @@ ALLWIFIBOARDS:= \ ezviz_cs-w3-wd1200g-eup \ linksys_ea8300 \ p2w_r619ac \ - qxwlan_e2600ac + qxwlan_e2600ac \ + canbox_cm520-79f ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD)) @@ -105,5 +106,6 @@ $(eval $(call generate-ipq-wifi-package,ezviz_cs-w3-wd1200g-eup,EZVIZ CS-W3-WD12 $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300)) $(eval $(call generate-ipq-wifi-package,p2w_r619ac,P&W R619AC)) $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC)) +$(eval $(call generate-ipq-wifi-package,canbox_cm520-79f,CanBox CM520-79F)) $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE)))) diff --git a/package/firmware/ipq-wifi/board-canbox_cm520-79f.qca4019 b/package/firmware/ipq-wifi/board-canbox_cm520-79f.qca4019 new file mode 100644 index 0000000000..d717af12fe Binary files /dev/null and b/package/firmware/ipq-wifi/board-canbox_cm520-79f.qca4019 differ diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile index 7c31bad45f..c95be28d95 100644 --- a/target/linux/ipq40xx/Makefile +++ b/target/linux/ipq40xx/Makefile @@ -19,6 +19,8 @@ DEFAULT_PACKAGES += \ kmod-usb-dwc3-qcom \ kmod-leds-gpio kmod-gpio-button-hotplug swconfig \ kmod-ath10k-ct wpad-basic \ - kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct + kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct \ + automount \ + ca-certificates htop fdisk e2fsprogs $(eval $(call BuildTarget)) 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 026802206f..32fee7d51d 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -75,6 +75,11 @@ ipq40xx_setup_interfaces() ucidef_add_switch "switch0" \ "0u@eth0" "3:lan" "4:lan" ;; + canbox,cm520-79f) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ucidef_add_switch "switch0" \ + "0u@eth0" "3:lan" "4:lan" + ;; qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2) ucidef_set_interfaces_lan_wan "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 e23591ba45..d0d1b0a18a 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 @@ -57,6 +57,7 @@ case "$FIRMWARE" in cilab,meshpoint-one |\ ezviz,cs-w3-wd1200g-eup |\ glinet,gl-b1300 |\ + canbox,cm520-79f |\ linksys,ea6350v3 |\ p2w,r619ac |\ p2w,r619ac-128m |\ @@ -141,6 +142,7 @@ case "$FIRMWARE" in ezviz,cs-w3-wd1200g-eup |\ glinet,gl-b1300 |\ linksys,ea6350v3 |\ + canbox,cm520-79f |\ p2w,r619ac |\ p2w,r619ac-128m |\ qcom,ap-dk01.1-c1) diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index a9e039fad5..6fab26cc7c 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -54,6 +54,7 @@ platform_do_upgrade() { avm,fritzrepeater-3000 |\ cilab,meshpoint-one |\ engenius,eap2200 |\ + canbox,cm520-79f |\ qxwlan,e2600ac-c2) nand_do_upgrade "$1" ;; diff --git a/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-canbox-cm520-79f.dts b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-canbox-cm520-79f.dts new file mode 100644 index 0000000000..b1017145d2 --- /dev/null +++ b/target/linux/ipq40xx/files-4.19/arch/arm/boot/dts/qcom-ipq4019-canbox-cm520-79f.dts @@ -0,0 +1,277 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/* + * Device Tree Source for CanBox CM520-79F + * + * Copyright (C) 2020 Mleaf + * + */ + +/dts-v1/; + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "CanBox CM520-79F"; + compatible = "canbox,cm520-79f"; + + chosen { + bootargs-append = " ubi.block=0,1 root=/dev/ubiblock0_1"; + }; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + serial0 = &blsp1_uart1; + }; + + + leds { + compatible = "gpio-leds"; + + led_usb: usb { + label = "cm520-79f:red:usb"; + gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "usbport"; + trigger-sources = <&usb3_port1>, <&usb3_port2>, <&usb2_port1>; + }; + + led_sys: sys { + label = "cm520-79f:red:sys"; + gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + button@0 { + label = "reset"; + linux,code = ; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + }; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x20000000>; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>; + reset-delay-us = <5000>; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + + dwc3@6000000 { + #address-cells = <1>; + #size-cells = <0>; + + usb2_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + }; + }; + + usb3@8af8800 { + status = "okay"; + + dwc3@8a00000 { + #address-cells = <1>; + #size-cells = <0>; + + usb3_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + usb3_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; +}; + + +&blsp_dma { + status = "okay"; +}; + +&blsp1_uart1 { + status = "okay"; + pinctrl-0 = <&serial_0_pins>; + pinctrl-names = "default"; + +}; + +&cryptobam { + status = "okay"; +}; + +&nand { + status = "okay"; + + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0xb00000>; + }; + + art: partition@b00000 { + label = "ART"; + reg = <0xb00000 0x80000>; + read-only; + }; + + partition@b80000 { + label = "rootfs"; + reg = <0xb80000 0x7480000>; + }; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + serial_0_pins: serial0-pinmux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + nand_pins: nand_pins { + pullups { + pins = "gpio53", "gpio58", "gpio59"; + function = "qpic"; + bias-pull-up; + }; + + // gpio61 controls led_usb + + pulldowns { + pins = "gpio55", "gpio56", "gpio57", + "gpio60", "gpio62", "gpio63", + "gpio64", "gpio65", "gpio66", + "gpio67", "gpio68", "gpio69"; + function = "qpic"; + bias-pull-down; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&gmac0 { + mtd-mac-address = <&art 0x1006>; +}; + +&gmac1 { + mtd-mac-address = <&art 0x5006>; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "CM520-79F"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "CM520-79F"; +}; diff --git a/target/linux/ipq40xx/files-5.4/arch/arm/boot/dts/qcom-ipq4019-canbox-cm520-79f.dts b/target/linux/ipq40xx/files-5.4/arch/arm/boot/dts/qcom-ipq4019-canbox-cm520-79f.dts new file mode 100644 index 0000000000..b1017145d2 --- /dev/null +++ b/target/linux/ipq40xx/files-5.4/arch/arm/boot/dts/qcom-ipq4019-canbox-cm520-79f.dts @@ -0,0 +1,277 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/* + * Device Tree Source for CanBox CM520-79F + * + * Copyright (C) 2020 Mleaf + * + */ + +/dts-v1/; + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "CanBox CM520-79F"; + compatible = "canbox,cm520-79f"; + + chosen { + bootargs-append = " ubi.block=0,1 root=/dev/ubiblock0_1"; + }; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + serial0 = &blsp1_uart1; + }; + + + leds { + compatible = "gpio-leds"; + + led_usb: usb { + label = "cm520-79f:red:usb"; + gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "usbport"; + trigger-sources = <&usb3_port1>, <&usb3_port2>, <&usb2_port1>; + }; + + led_sys: sys { + label = "cm520-79f:red:sys"; + gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + button@0 { + label = "reset"; + linux,code = ; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + }; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x20000000>; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>; + reset-delay-us = <5000>; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb2@60f8800 { + status = "okay"; + + dwc3@6000000 { + #address-cells = <1>; + #size-cells = <0>; + + usb2_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + }; + }; + + usb3@8af8800 { + status = "okay"; + + dwc3@8a00000 { + #address-cells = <1>; + #size-cells = <0>; + + usb3_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + usb3_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; +}; + + +&blsp_dma { + status = "okay"; +}; + +&blsp1_uart1 { + status = "okay"; + pinctrl-0 = <&serial_0_pins>; + pinctrl-names = "default"; + +}; + +&cryptobam { + status = "okay"; +}; + +&nand { + status = "okay"; + + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + + nand@0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0xb00000>; + }; + + art: partition@b00000 { + label = "ART"; + reg = <0xb00000 0x80000>; + read-only; + }; + + partition@b80000 { + label = "rootfs"; + reg = <0xb80000 0x7480000>; + }; + }; + }; +}; + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + serial_0_pins: serial0-pinmux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + nand_pins: nand_pins { + pullups { + pins = "gpio53", "gpio58", "gpio59"; + function = "qpic"; + bias-pull-up; + }; + + // gpio61 controls led_usb + + pulldowns { + pins = "gpio55", "gpio56", "gpio57", + "gpio60", "gpio62", "gpio63", + "gpio64", "gpio65", "gpio66", + "gpio67", "gpio68", "gpio69"; + function = "qpic"; + bias-pull-down; + }; + }; +}; + +&usb2_hs_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&gmac0 { + mtd-mac-address = <&art 0x1006>; +}; + +&gmac1 { + mtd-mac-address = <&art 0x5006>; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "CM520-79F"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "CM520-79F"; +}; diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index 99d4aa8f51..666040df78 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -570,6 +570,18 @@ define Device/qcom_ap-dk04.1-c1 endef TARGET_DEVICES += qcom_ap-dk04.1-c1 +define Device/canbox_cm520-79f + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_TITLE := CanBox CM520-79F + BOARD_NAME := cm520-79f + DEVICE_DTS := qcom-ipq4019-canbox-cm520-79f + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_PACKAGES := ipq-wifi-canbox_cm520-79f +endef +TARGET_DEVICES += canbox_cm520-79f + define Device/qxwlan_e2600ac-c1 $(call Device/FitImage) DEVICE_VENDOR := Qxwlan diff --git a/target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch index 420cc12d90..3803d5060d 100644 --- a/target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-4.19/901-arm-boot-add-dts-files.patch @@ -37,6 +37,7 @@ Signed-off-by: John Crispin qcom-ipq4019-ap.dk07.1-c2.dtb \ + qcom-ipq4019-a62.dtb \ + qcom-ipq4019-eap2200.dtb \ ++ qcom-ipq4019-canbox-cm520-79f.dtb \ + qcom-ipq4019-fritzbox-7530.dtb \ + qcom-ipq4019-fritzrepeater-1200.dtb \ + qcom-ipq4019-fritzrepeater-3000.dtb \ diff --git a/target/linux/ipq40xx/patches-5.4/854-add-sdhci-reset-implementation.patch b/target/linux/ipq40xx/patches-5.4/854-add-sdhci-reset-implementation.patch deleted file mode 100644 index 58803df191..0000000000 --- a/target/linux/ipq40xx/patches-5.4/854-add-sdhci-reset-implementation.patch +++ /dev/null @@ -1,56 +0,0 @@ -From: Georgi Djakov -Date: Mon, 28 Nov 2016 19:39:20 +0200 -Subject: [PATCH v2] mmc: sdhci-msm: Add sdhci_reset() implementation - -Signed-off-by: Georgi Djakov ---- - -drivers/mmc/host/sdhci-msm.c | 29 ++++++++++++++++++++++++++++- -1 file changed, 28 insertions(+), 1 deletion(-) - -diff -urN a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c ---- a/drivers/mmc/host/sdhci-msm.c 2020-01-23 15:20:37.000000000 +0800 -+++ b/drivers/mmc/host/sdhci-msm.c 2020-02-10 13:37:03.577363800 +0800 -@@ -1117,6 +1117,33 @@ - __sdhci_msm_set_clock(host, clock); - } - -+void sdhci_msm_reset(struct sdhci_host *host, u8 mask) -+{ -+ unsigned long timeout = 100; -+ -+ sdhci_writeb(host, mask, SDHCI_SOFTWARE_RESET); -+ -+ if (mask & SDHCI_RESET_ALL) { -+ host->clock = 0; -+ -+ /* -+ * SDHCI_RESET_ALL triggers the PWR IRQ -+ * and we need to handle it here. -+ */ -+ sdhci_msm_voltage_switch(host); -+ } -+ -+ while (sdhci_readb(host, SDHCI_SOFTWARE_RESET) & mask) { -+ if (timeout == 0) { -+ pr_err("%s: Reset 0x%x never completed.\n", -+ mmc_hostname(host->mmc), (int)mask); -+ return; -+ } -+ timeout--; -+ mdelay(1); -+ } -+} -+ - static void sdhci_msm_write_w(struct sdhci_host *host, u16 val, int reg) - { - struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); -@@ -1148,7 +1175,7 @@ - MODULE_DEVICE_TABLE(of, sdhci_msm_dt_match); - - static const struct sdhci_ops sdhci_msm_ops = { -- .reset = sdhci_reset, -+ .reset = sdhci_msm_reset, - .set_clock = sdhci_msm_set_clock, - .get_min_clock = sdhci_msm_get_min_clock, - .get_max_clock = sdhci_msm_get_max_clock, diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index 594d80c9b4..8ffdc895f8 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -5,12 +5,12 @@ Subject: [PATCH] arm: boot: add dts files Signed-off-by: John Crispin --- - arch/arm/boot/dts/Makefile | 24 ++++++++++++++++++++++++ - 1 file changed, 24 insertions(+) + arch/arm/boot/dts/Makefile | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,46 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,47 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -38,6 +38,7 @@ Signed-off-by: John Crispin + qcom-ipq4019-a62.dtb \ + qcom-ipq4019-ea8300.dtb \ + qcom-ipq4019-eap2200.dtb \ ++ qcom-ipq4019-canbox-cm520-79f.dtb \ + qcom-ipq4019-fritzbox-7530.dtb \ + qcom-ipq4019-fritzrepeater-1200.dtb \ + qcom-ipq4019-fritzrepeater-3000.dtb \