ipq40xx: improve cm520-79f support

This commit is contained in:
AmadeusGhost 2020-03-16 09:35:02 +08:00
parent d99694cd92
commit 22f79f0c7b
11 changed files with 224 additions and 177 deletions

View File

@ -33,9 +33,9 @@ ALLWIFIBOARDS:= \
engenius_emd1 \
ezviz_cs-w3-wd1200g-eup \
linksys_ea8300 \
mobipromo_cm520-79f \
p2w_r619ac \
qxwlan_e2600ac \
canbox_cm520-79f
qxwlan_e2600ac
ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
@ -104,8 +104,8 @@ $(eval $(call generate-ipq-wifi-package,engenius_eap2200,EnGenius EAP2200))
$(eval $(call generate-ipq-wifi-package,engenius_emd1,EnGenius EMD1))
$(eval $(call generate-ipq-wifi-package,ezviz_cs-w3-wd1200g-eup,EZVIZ CS-W3-WD1200G EUP))
$(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
$(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F))
$(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))))

View File

@ -43,6 +43,11 @@ engenius,ens620ext)
ucidef_set_led_netdev "lan1" "LAN1" "${boardname}:green:lan1" "eth0"
ucidef_set_led_netdev "lan2" "LAN2" "${boardname}:green:lan2" "eth1"
;;
mobipromo,cm520-79f)
ucidef_set_led_netdev "wan" "WAN" "${boardname}:blue:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "${boardname}:blue:lan1" "switch0" "0x10"
ucidef_set_led_switch "lan2" "LAN2" "${boardname}:blue:lan2" "switch0" "0x08"
;;
netgear,ex6100v2 |\
netgear,ex6150v2)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "ex61x0v2:green:router" "phy0tpt"

View File

@ -75,10 +75,10 @@ ipq40xx_setup_interfaces()
ucidef_add_switch "switch0" \
"0u@eth0" "3:lan" "4:lan"
;;
canbox,cm520-79f)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
mobipromo,cm520-79f)
ucidef_add_switch "switch0" \
"0u@eth0" "3:lan" "4:lan"
"0u@eth0" "3:lan:2" "4:lan:1"
ucidef_set_interface_wan "eth1"
;;
qxwlan,e2600ac-c1 |\
qxwlan,e2600ac-c2)

View File

@ -43,10 +43,6 @@ case "$FIRMWARE" in
openmesh,a62)
caldata_extract "0:ART" 0x9000 0x2f20
;;
p2w,r619ac |\
p2w,r619ac-128m)
ath10kcal_extract "ART" 36864 12064
;;
esac
;;
"ath10k/pre-cal-ahb-a000000.wifi.bin")
@ -57,8 +53,8 @@ case "$FIRMWARE" in
cilab,meshpoint-one |\
ezviz,cs-w3-wd1200g-eup |\
glinet,gl-b1300 |\
canbox,cm520-79f |\
linksys,ea6350v3 |\
mobipromo,cm520-79f |\
p2w,r619ac |\
p2w,r619ac-128m |\
qcom,ap-dk01.1-c1)
@ -142,7 +138,7 @@ case "$FIRMWARE" in
ezviz,cs-w3-wd1200g-eup |\
glinet,gl-b1300 |\
linksys,ea6350v3 |\
canbox,cm520-79f |\
mobipromo,cm520-79f |\
p2w,r619ac |\
p2w,r619ac-128m |\
qcom,ap-dk01.1-c1)

View File

@ -54,7 +54,7 @@ platform_do_upgrade() {
avm,fritzrepeater-3000 |\
cilab,meshpoint-one |\
engenius,eap2200 |\
canbox,cm520-79f |\
mobipromo,cm520-79f |\
qxwlan,e2600ac-c2)
nand_do_upgrade "$1"
;;

View File

@ -1,65 +1,23 @@
// 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 <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/soc/qcom,tcsr.h>
/ {
model = "CanBox CM520-79F";
compatible = "canbox,cm520-79f";
chosen {
bootargs-append = " ubi.block=0,1 root=/dev/ubiblock0_1";
};
model = "MobiPromo CM520-79F";
compatible = "mobipromo,cm520-79f";
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 = <KEY_RESTART>;
gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
};
};
memory {
device_type = "memory";
reg = <0x80000000 0x20000000>;
chosen {
bootargs-append = " ubi.block=0,1 root=/dev/ubiblock0_1";
};
soc {
@ -72,7 +30,7 @@
pinctrl-0 = <&mdio_pins>;
pinctrl-names = "default";
reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>;
reset-delay-us = <5000>;
reset-delay-us = <1000>;
};
ess-psgmii@98000 {
@ -152,8 +110,79 @@
status = "okay";
};
};
};
led_spi {
compatible = "spi-gpio";
#address-cells = <1>;
ranges;
sck-gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>;
mosi-gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>;
num-chipselects = <0>;
led_gpio: led_gpio@0 {
compatible = "fairchild,74hc595";
reg = <0>;
gpio-controller;
#gpio-cells = <2>;
registers-number = <1>;
spi-max-frequency = <1000000>;
};
};
leds {
compatible = "gpio-leds";
led_usb: usb {
label = "cm520-79f:blue:usb";
gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "usbport";
trigger-sources = <&usb3_port1>, <&usb3_port2>, <&usb2_port1>;
};
led_sys: can {
label = "cm520-79f:blue:can";
gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>;
};
wan {
label = "cm520-79f:blue:wan";
gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>;
};
lan1 {
label = "cm520-79f:blue:lan1";
gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>;
};
lan2 {
label = "cm520-79f:blue:lan2";
gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "cm520-79f:blue:wlan2g";
gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
wlan5g {
label = "cm520-79f:blue:wlan5g";
gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
&blsp_dma {
status = "okay";
@ -161,20 +190,28 @@
&blsp1_uart1 {
status = "okay";
pinctrl-0 = <&serial_0_pins>;
pinctrl-names = "default";
};
&blsp1_uart2 {
status = "okay";
};
&cryptobam {
status = "okay";
};
&nand {
status = "okay";
&gmac0 {
mtd-mac-address = <&art 0x1006>;
};
&gmac1 {
mtd-mac-address = <&art 0x5006>;
};
&nand {
pinctrl-0 = <&nand_pins>;
pinctrl-names = "default";
status = "okay";
nand@0 {
partitions {
@ -206,12 +243,6 @@
};
&tlmm {
serial_0_pins: serial0-pinmux {
pins = "gpio16", "gpio17";
function = "blsp_uart0";
bias-disable;
};
mdio_pins: mdio_pinmux {
mux_1 {
pins = "gpio6";
@ -228,25 +259,25 @@
nand_pins: nand_pins {
pullups {
pins = "gpio53", "gpio58", "gpio59";
pins = "gpio52", "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";
pins = "gpio54", "gpio55", "gpio56",
"gpio57", "gpio60", "gpio61",
"gpio62", "gpio63", "gpio64",
"gpio65", "gpio66", "gpio67",
"gpio68", "gpio69";
function = "qpic";
bias-pull-down;
};
};
};
&usb2_hs_phy {
&usb3_ss_phy {
status = "okay";
};
@ -254,18 +285,10 @@
status = "okay";
};
&usb3_ss_phy {
&usb2_hs_phy {
status = "okay";
};
&gmac0 {
mtd-mac-address = <&art 0x1006>;
};
&gmac1 {
mtd-mac-address = <&art 0x5006>;
};
&wifi0 {
status = "okay";
qcom,ath10k-calibration-variant = "CM520-79F";

View File

@ -1,65 +1,23 @@
// 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 <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/soc/qcom,tcsr.h>
/ {
model = "CanBox CM520-79F";
compatible = "canbox,cm520-79f";
chosen {
bootargs-append = " ubi.block=0,1 root=/dev/ubiblock0_1";
};
model = "MobiPromo CM520-79F";
compatible = "mobipromo,cm520-79f";
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 = <KEY_RESTART>;
gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
};
};
memory {
device_type = "memory";
reg = <0x80000000 0x20000000>;
chosen {
bootargs-append = " ubi.block=0,1 root=/dev/ubiblock0_1";
};
soc {
@ -72,7 +30,7 @@
pinctrl-0 = <&mdio_pins>;
pinctrl-names = "default";
reset-gpios = <&tlmm 47 GPIO_ACTIVE_LOW>;
reset-delay-us = <5000>;
reset-delay-us = <1000>;
};
ess-psgmii@98000 {
@ -152,8 +110,79 @@
status = "okay";
};
};
};
led_spi {
compatible = "spi-gpio";
#address-cells = <1>;
ranges;
sck-gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>;
mosi-gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>;
num-chipselects = <0>;
led_gpio: led_gpio@0 {
compatible = "fairchild,74hc595";
reg = <0>;
gpio-controller;
#gpio-cells = <2>;
registers-number = <1>;
spi-max-frequency = <1000000>;
};
};
leds {
compatible = "gpio-leds";
led_usb: usb {
label = "cm520-79f:blue:usb";
gpios = <&tlmm 10 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "usbport";
trigger-sources = <&usb3_port1>, <&usb3_port2>, <&usb2_port1>;
};
led_sys: can {
label = "cm520-79f:blue:can";
gpios = <&tlmm 11 GPIO_ACTIVE_HIGH>;
};
wan {
label = "cm520-79f:blue:wan";
gpios = <&led_gpio 0 GPIO_ACTIVE_LOW>;
};
lan1 {
label = "cm520-79f:blue:lan1";
gpios = <&led_gpio 1 GPIO_ACTIVE_LOW>;
};
lan2 {
label = "cm520-79f:blue:lan2";
gpios = <&led_gpio 2 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "cm520-79f:blue:wlan2g";
gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
wlan5g {
label = "cm520-79f:blue:wlan5g";
gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
&blsp_dma {
status = "okay";
@ -161,20 +190,28 @@
&blsp1_uart1 {
status = "okay";
pinctrl-0 = <&serial_0_pins>;
pinctrl-names = "default";
};
&blsp1_uart2 {
status = "okay";
};
&cryptobam {
status = "okay";
};
&nand {
status = "okay";
&gmac0 {
mtd-mac-address = <&art 0x1006>;
};
&gmac1 {
mtd-mac-address = <&art 0x5006>;
};
&nand {
pinctrl-0 = <&nand_pins>;
pinctrl-names = "default";
status = "okay";
nand@0 {
partitions {
@ -206,12 +243,6 @@
};
&tlmm {
serial_0_pins: serial0-pinmux {
pins = "gpio16", "gpio17";
function = "blsp_uart0";
bias-disable;
};
mdio_pins: mdio_pinmux {
mux_1 {
pins = "gpio6";
@ -228,25 +259,25 @@
nand_pins: nand_pins {
pullups {
pins = "gpio53", "gpio58", "gpio59";
pins = "gpio52", "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";
pins = "gpio54", "gpio55", "gpio56",
"gpio57", "gpio60", "gpio61",
"gpio62", "gpio63", "gpio64",
"gpio65", "gpio66", "gpio67",
"gpio68", "gpio69";
function = "qpic";
bias-pull-down;
};
};
};
&usb2_hs_phy {
&usb3_ss_phy {
status = "okay";
};
@ -254,18 +285,10 @@
status = "okay";
};
&usb3_ss_phy {
&usb2_hs_phy {
status = "okay";
};
&gmac0 {
mtd-mac-address = <&art 0x1006>;
};
&gmac1 {
mtd-mac-address = <&art 0x5006>;
};
&wifi0 {
status = "okay";
qcom,ath10k-calibration-variant = "CM520-79F";

View File

@ -440,6 +440,18 @@ define Device/linksys_ea8300
endef
TARGET_DEVICES += linksys_ea8300
define Device/mobipromo_cm520-79f
$(call Device/FitzImage)
$(call Device/UbiFit)
DEVICE_VENDOR := MobiPromo
DEVICE_MODEL := CM520-79F
SOC := qcom-ipq4019
BLOCKSIZE := 128k
PAGESIZE := 2048
DEVICE_PACKAGES := ipq-wifi-mobipromo_cm520-79f kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += mobipromo_cm520-79f
define Device/meraki_mr33
$(call Device/FitImage)
DEVICE_VENDOR := Cisco Meraki
@ -570,18 +582,6 @@ 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

View File

@ -36,8 +36,8 @@ Signed-off-by: John Crispin <john@phrozen.org>
qcom-ipq4019-ap.dk07.1-c1.dtb \
qcom-ipq4019-ap.dk07.1-c2.dtb \
+ qcom-ipq4019-a62.dtb \
+ qcom-ipq4019-cm520-79f.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 \

View File

@ -36,9 +36,9 @@ Signed-off-by: John Crispin <john@phrozen.org>
qcom-ipq4019-ap.dk07.1-c1.dtb \
qcom-ipq4019-ap.dk07.1-c2.dtb \
+ qcom-ipq4019-a62.dtb \
+ qcom-ipq4019-cm520-79f.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 \