aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorRobert Marko <robert.marko@sartura.hr>2020-09-07 12:43:37 +0200
committerJohn Crispin <john@phrozen.org>2020-09-17 08:42:17 +0200
commit59f0a0fd839e239987ca14dcefe19717aaa71cd0 (patch)
tree681ba64eaec54f2b468e6cdf1c4142e39178ee9d /target
parent43a53891ce8f141e11960bc7b4ad369588ac341d (diff)
downloadupstream-59f0a0fd839e239987ca14dcefe19717aaa71cd0.tar.gz
upstream-59f0a0fd839e239987ca14dcefe19717aaa71cd0.tar.bz2
upstream-59f0a0fd839e239987ca14dcefe19717aaa71cd0.zip
ipq806x: add Edgecore ECW5410 support
This patch adds support for the Edgecore ECW5410 indoor AP. Specification: - SoC: Qualcomm Atheros IPQ8068 ARMv7 2x Cortex A-15 - RAM: 256MB(225 usable) DDR3 - NOR Flash: 16MB SPI NOR - NAND Flash: 128MB S34MS01G2 Parallel NAND - Ethernet: 2 x 1G via 2x AR8033 PHY-s connected directly to GMAC2 and GMAC3 via SGMII (802.3af POE IN on eth0) - USB: 1 x USB 3.0 SuperSpeed - WLAN: 2x QCA9994 AC Wawe 2 (1x 2GHz bgn, 1x 5GHz acn) - CC2540 BLE - UART console on RJ45 next to ethernet ports exposed. Its Cisco pin compatible, 115200 8n1 baud. Installation instructions: Through stock firmware or initramfs. 1.Connect to console 2. Login with root account, if password is unknown then interrupt the boot with f and reset it in failsafe. 3. Transfer factory image 4. Flash the image with ubiformat /dev/mtd1 -y -f <your factory image path> This will replace the rootfs2 with OpenWrt, if you are currently running from rootfs2 then simply change /dev/mtd1 to /dev/mtd0 Note Initramfs: 1. Connect to console 2. Transfer the image from TFTP server with tftpboot, or by using DHCP advertised image with dhcp command. 3. bootm 4. Run ubiformat /dev/mtd1 You need to interrupt the bootloader after rebooting and run: run altbootcmd This will switch your active rootfs partition to one you wrote to and boot from it. So if rootfs1 is active, then it will change it to rootfs2. This will format the rootfs2 partition, if your active partition is 2 then simply change /dev/mtd1 with /dev/mtd0 If you dont format the partition you will be writing too, then sysupgrade will find existing UBI rootfs and kernel volumes and update those. This will result in wrong ordering and OpenWrt will panic on boot. 5. Transfer sysupgrade image 6. Flash with sysupgrade -n. Note that sysupgrade will write the image to rootfs partition that is not currently in use. Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Diffstat (limited to 'target')
-rwxr-xr-xtarget/linux/ipq806x/base-files/etc/board.d/01_leds4
-rwxr-xr-xtarget/linux/ipq806x/base-files/etc/board.d/02_network5
-rw-r--r--target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata10
-rwxr-xr-xtarget/linux/ipq806x/base-files/etc/init.d/bootcount3
-rw-r--r--target/linux/ipq806x/base-files/lib/upgrade/platform.sh11
-rw-r--r--target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts400
-rw-r--r--target/linux/ipq806x/image/Makefile12
-rw-r--r--target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch3
8 files changed, 447 insertions, 1 deletions
diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds
index f8b6c32358..ffefb9e01c 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
+++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
@@ -19,6 +19,10 @@ compex,wpq864)
ucidef_set_led_usbport "usb" "USB" "wpq864:green:usb" "usb1-port1" "usb2-port1"
ucidef_set_led_usbport "pcie-usb" "PCIe USB" "wpq864:green:usb-pcie" "usb3-port1"
;;
+edgecore,ecw5410)
+ ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:green:wlan2g" "phy1tpt"
+ ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:green:wlan5g" "phy0tpt"
+ ;;
nec,wg2600hp)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:green:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:green:wlan5g" "phy0tpt"
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network
index 529a8d9f39..0dbc49840a 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -22,6 +22,11 @@ tplink,vr2600v)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
;;
+edgecore,ecw5410)
+ ucidef_set_interfaces_lan_wan "eth1" "eth0"
+ ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary "0:ART" 0x6)"
+ ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary "0:ART" 0x0)"
+ ;;
qcom,ipq8064-ap161)
ucidef_set_interface_lan "eth1 eth2"
ucidef_add_switch "switch0" \
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 8b4942dee1..f4572d038c 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
@@ -13,6 +13,9 @@ case "$FIRMWARE" in
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary ART 0x1e)
;;
+ edgecore,ecw5410)
+ ath10kcal_extract "0:ART" 4096 12064
+ ;;
linksys,ea7500-v1 |\
linksys,ea8500)
caldata_extract "art" 0x1000 0x2f20
@@ -77,6 +80,13 @@ case "$FIRMWARE" in
;;
esac
;;
+"ath10k/pre-cal-pci-0002:01:00.0.bin")
+ case $board in
+ edgecore,ecw5410)
+ ath10kcal_extract "0:ART" 20480 12064
+ ;;
+ esac
+ ;;
*)
exit 1
;;
diff --git a/target/linux/ipq806x/base-files/etc/init.d/bootcount b/target/linux/ipq806x/base-files/etc/init.d/bootcount
index 6e57c72e51..77965e647b 100755
--- a/target/linux/ipq806x/base-files/etc/init.d/bootcount
+++ b/target/linux/ipq806x/base-files/etc/init.d/bootcount
@@ -4,6 +4,9 @@ START=99
boot() {
case $(board_name) in
+ edgecore,ecw5410)
+ fw_setenv bootcount 0
+ ;;
linksys,ea7500-v1 |\
linksys,ea8500)
mtd resetbc s_env || true
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index 560e64af3a..91cc4548f5 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -27,6 +27,17 @@ platform_do_upgrade() {
zyxel,nbg6817)
zyxel_do_upgrade "$1"
;;
+ edgecore,ecw5410)
+ part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')"
+ if [ "$part" = "rootfs1" ]; then
+ fw_setenv active 2 || exit 1
+ CI_UBIPART="rootfs2"
+ else
+ fw_setenv active 1 || exit 1
+ CI_UBIPART="rootfs1"
+ fi
+ nand_do_upgrade "$1"
+ ;;
linksys,ea7500-v1 |\
linksys,ea8500)
platform_do_upgrade_linksys "$1"
diff --git a/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts
new file mode 100644
index 0000000000..6d216bd85e
--- /dev/null
+++ b/target/linux/ipq806x/files-5.4/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts
@@ -0,0 +1,400 @@
+#include "qcom-ipq8064-v2.0.dtsi"
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/soc/qcom,tcsr.h>
+
+/ {
+ model = "Edgecore ECW5410";
+ compatible = "edgecore,ecw5410", "qcom,ipq8064";
+
+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ nss@40000000 {
+ reg = <0x40000000 0x1000000>;
+ no-map;
+ };
+
+ smem: smem@41000000 {
+ reg = <0x41000000 0x200000>;
+ no-map;
+ };
+
+ wifi_dump@44000000 {
+ reg = <0x44000000 0x600000>;
+ no-map;
+ };
+
+ rsvd@41200000 {
+ reg = <0x41200000 0x300000>;
+ no-map;
+ };
+ };
+
+ cpus {
+ idle-states {
+ CPU_SPC: spc {
+ status = "disabled";
+ };
+ };
+ };
+
+ aliases {
+ serial0 = &gsbi4_serial;
+ serial1 = &gsbi1_serial;
+ mdio-gpio0 = &mdio0;
+ ethernet0 = &gmac3;
+ ethernet1 = &gmac2;
+
+ led-boot = &power_green;
+ led-failsafe = &power_red;
+ led-running = &power_green;
+ led-upgrade = &power_green;
+ };
+
+ chosen {
+ bootargs-append = " console=ttyMSM0,115200n8 root=/dev/ubiblock0_1";
+ stdout-path = "serial0:115200n8";
+ };
+
+ keys {
+ compatible = "gpio-keys";
+ pinctrl-0 = <&button_pins>;
+ pinctrl-names = "default";
+
+ reset {
+ label = "reset";
+ gpios = <&qcom_pinmux 25 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+ pinctrl-0 = <&led_pins>;
+ pinctrl-names = "default";
+
+ power_green: power_green {
+ label = "ecw5410:green:power";
+ gpios = <&qcom_pinmux 16 GPIO_ACTIVE_HIGH>;
+ };
+
+ wlan2g_green {
+ label = "ecw5410:green:wlan2g";
+ gpios = <&qcom_pinmux 23 GPIO_ACTIVE_LOW>;
+ };
+
+ wlan2g_yellow {
+ label = "ecw5410:yellow:wlan2g";
+ gpios = <&qcom_pinmux 24 GPIO_ACTIVE_LOW>;
+ };
+
+ wlan5g_green {
+ label = "ecw5410:green:wlan5g";
+ gpios = <&qcom_pinmux 26 GPIO_ACTIVE_LOW>;
+ };
+
+ power_red: power_red {
+ label = "ecw5410:red:power";
+ gpios = <&qcom_pinmux 28 GPIO_ACTIVE_LOW>;
+ };
+
+ wlan5g_yellow {
+ label = "ecw5410:yellow:wlan5g";
+ gpios = <&qcom_pinmux 59 GPIO_ACTIVE_LOW>;
+ };
+ };
+};
+
+
+&qcom_pinmux {
+ spi_pins: spi_pins {
+ mux {
+ pins = "gpio18", "gpio19";
+ function = "gsbi5";
+ drive-strength = <10>;
+ bias-pull-down;
+ };
+
+ clk {
+ pins = "gpio21";
+ function = "gsbi5";
+ drive-strength = <12>;
+ bias-pull-down;
+ };
+
+ cs {
+ pins = "gpio20";
+ function = "gpio";
+ drive-strength = <10>;
+ bias-pull-up;
+ };
+ };
+
+ nand_pins: nand_pins {
+ disable {
+ pins = "gpio34", "gpio35", "gpio36", "gpio37",
+ "gpio38";
+ function = "nand";
+ drive-strength = <10>;
+ bias-disable;
+ };
+
+ pullups {
+ pins = "gpio39";
+ function = "nand";
+ drive-strength = <10>;
+ bias-pull-up;
+ };
+
+ hold {
+ pins = "gpio40", "gpio41", "gpio42", "gpio43",
+ "gpio44", "gpio45", "gpio46", "gpio47";
+ function = "nand";
+ drive-strength = <10>;
+ bias-bus-hold;
+ };
+ };
+
+ mdio0_pins: mdio0_pins {
+ mux {
+ pins = "gpio0", "gpio1";
+ function = "gpio";
+ drive-strength = <8>;
+ bias-disable;
+ };
+ };
+
+ led_pins: led_pins {
+ mux {
+ pins = "gpio16", "gpio23", "gpio24", "gpio26",
+ "gpio28", "gpio59";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+ };
+
+ button_pins: button_pins {
+ mux {
+ pins = "gpio25";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+ };
+
+ uart1_pins: uart1_pins {
+ mux {
+ pins = "gpio51", "gpio52", "gpio53", "gpio54";
+ function = "gsbi1";
+ drive-strength = <12>;
+ bias-none;
+ };
+ };
+};
+
+&gsbi1 {
+ qcom,mode = <GSBI_PROT_UART_W_FC>;
+ status = "okay";
+
+ serial@12450000 {
+ status = "okay";
+
+ pinctrl-0 = <&uart1_pins>;
+ pinctrl-names = "default";
+ };
+};
+
+&gsbi4 {
+ qcom,mode = <GSBI_PROT_I2C_UART>;
+ status = "okay";
+
+ serial@16340000 {
+ status = "okay";
+ };
+
+ /*
+ * The i2c device on gsbi4 should not be enabled.
+ * On ipq806x designs gsbi4 i2c is meant for exclusive
+ * RPM usage. Turning this on in kernel manifests as
+ * i2c failure for the RPM.
+ */
+};
+
+&gsbi5 {
+ qcom,mode = <GSBI_PROT_SPI>;
+ status = "okay";
+
+ spi4: spi@1a280000 {
+ status = "okay";
+ spi-max-frequency = <50000000>;
+
+ pinctrl-0 = <&spi_pins>;
+ pinctrl-names = "default";
+
+ cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
+
+ m25p80@0 {
+ compatible = "jedec,spi-nor";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ spi-max-frequency = <50000000>;
+ reg = <0>;
+
+ partitions {
+ compatible = "qcom,smem";
+ };
+ };
+ };
+};
+
+&hs_phy_0 { /* USB3 port 0 HS phy */
+ status = "okay";
+};
+
+&hs_phy_1 { /* USB3 port 1 HS phy */
+ status = "okay";
+};
+
+&ss_phy_0 { /* USB3 port 0 SS phy */
+ status = "okay";
+};
+
+&ss_phy_1 { /* USB3 port 1 SS phy */
+ status = "okay";
+};
+
+&usb3_0 {
+ status = "okay";
+};
+
+&usb3_1 {
+ status = "okay";
+};
+
+&pcie1 {
+ status = "okay";
+
+ /delete-property/ pinctrl-0;
+ /delete-property/ pinctrl-names;
+ /delete-property/ perst-gpios;
+
+ bridge@0,0 {
+ reg = <0x00000000 0 0 0 0>;
+ #address-cells = <3>;
+ #size-cells = <2>;
+ ranges;
+
+ wifi@1,0 {
+ compatible = "qcom,ath10k";
+ status = "okay";
+ reg = <0x00010000 0 0 0 0>;
+ qcom,ath10k-calibration-variant = "Edgecore-ECW5410-L";
+ };
+ };
+};
+
+&pcie2 {
+ status = "okay";
+
+ /delete-property/ pinctrl-0;
+ /delete-property/ pinctrl-names;
+ /delete-property/ perst-gpios;
+
+ bridge@0,0 {
+ reg = <0x00000000 0 0 0 0>;
+ #address-cells = <3>;
+ #size-cells = <2>;
+ ranges;
+
+ wifi@1,0 {
+ compatible = "qcom,ath10k";
+ status = "okay";
+ reg = <0x00010000 0 0 0 0>;
+ qcom,ath10k-calibration-variant = "Edgecore-ECW5410-L";
+ };
+ };
+};
+
+&soc {
+ nand@1ac00000 {
+ status = "okay";
+
+ pinctrl-0 = <&nand_pins>;
+ pinctrl-names = "default";
+
+ nand@0 {
+ compatible = "qcom,nandcs";
+
+ reg = <0>;
+
+ nand-ecc-strength = <4>;
+ nand-bus-width = <8>;
+ nand-ecc-step-size = <512>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ rootfs1@0 {
+ label = "rootfs1";
+ reg = <0x0000000 0x4000000>;
+ };
+
+ rootfs2@4000000 {
+ label = "rootfs2";
+ reg = <0x4000000 0x4000000>;
+ };
+ };
+ };
+ };
+
+ mdio1: mdio {
+ compatible = "virtual,mdio-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ status = "okay";
+
+ pinctrl-0 = <&mdio0_pins>;
+ pinctrl-names = "default";
+
+ gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH &qcom_pinmux 0 GPIO_ACTIVE_HIGH>;
+
+ phy0: ethernet-phy@0 {
+ reg = <0>;
+ };
+
+ phy1: ethernet-phy@1 {
+ reg = <1>;
+ };
+ };
+};
+
+&gmac2 {
+ status = "okay";
+
+ qcom,id = <2>;
+ mdiobus = <&mdio0>;
+
+ phy-mode = "sgmii";
+ phy-handle = <&phy1>;
+};
+
+&gmac3 {
+ status = "okay";
+
+ qcom,id = <3>;
+ mdiobus = <&mdio1>;
+
+ phy-mode = "sgmii";
+ phy-handle = <&phy0>;
+};
+
+&adm_dma {
+ status = "okay";
+};
diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index 5cc66daa21..3b86760a19 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -126,6 +126,18 @@ define Device/linksys_ea7500-v1
endef
TARGET_DEVICES += linksys_ea7500-v1
+define Device/edgecore_ecw5410
+ $(call Device/FitImage)
+ $(call Device/UbiFit)
+ DEVICE_TITLE := Edgecore ECW5410
+ BLOCKSIZE := 128k
+ PAGESIZE := 2048
+ DEVICE_DTS := qcom-ipq8068-ecw5410
+ DEVICE_DTS_CONFIG := config@v2.0-ap160
+ DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-edgecore_ecw5410
+endef
+TARGET_DEVICES += edgecore_ecw5410
+
define Device/linksys_ea8500
$(call Device/LegacyImage)
DEVICE_VENDOR := Linksys
diff --git a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch
index 8cdd198c29..7e15b87e39 100644
--- a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch
+++ b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch
@@ -10,7 +10,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
-@@ -843,6 +843,19 @@ dtb-$(CONFIG_ARCH_QCOM) += \
+@@ -843,6 +843,20 @@ dtb-$(CONFIG_ARCH_QCOM) += \
qcom-ipq4019-ap.dk07.1-c1.dtb \
qcom-ipq4019-ap.dk07.1-c2.dtb \
qcom-ipq8064-ap148.dtb \
@@ -27,6 +27,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
+ qcom-ipq8064-wxr-2533dhp.dtb \
+ qcom-ipq8065-nbg6817.dtb \
+ qcom-ipq8065-r7800.dtb \
++ qcom-ipq8068-ecw5410.dtb \
qcom-msm8660-surf.dtb \
qcom-msm8960-cdp.dtb \
qcom-msm8974-fairphone-fp2.dtb \