[openwrt/openwrt] ath79: add support for Senao Engenius ECB1200
LEDE Commits
lede-commits at lists.infradead.org
Tue Dec 22 13:13:37 EST 2020
ynezz pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f244143609adcccc978d3c15884be6b98bc9789b
commit f244143609adcccc978d3c15884be6b98bc9789b
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Sat Oct 31 21:23:33 2020 -0400
ath79: add support for Senao Engenius ECB1200
FCC ID: A8J-ECB1200
Engenius ECB1200 is an indoor wireless access point with a GbE port,
2.4 GHz and 5 GHz wireless, external antennas, and 802.3af PoE.
**Specification:**
- QCA9557 SOC MIPS, 2.4 GHz (2x2)
- QCA9882 WLAN PCIe card, 5 GHz (2x2)
- AR8035-A switch RGMII, GbE with 802.3af PoE, 25 MHz clock
- 40 MHz reference clock
- 16 MB FLASH 25L12845EMI-10G
- 2x 64 MB RAM 1538ZFZ V59C1512164QEJ25
- UART at JP1 (unpopulated, RX shorted to ground)
- 4 external antennas
- 4 LEDs, 1 button (power, eth, wifi2g, wifi5g) (reset)
**MAC addresses:**
MAC Addresses are labeled as ETH and 5GHZ
U-boot environment has the vendor MAC addresses
MAC addresses in ART do not match vendor
eth0 ETH *:5c u-boot-env ethaddr
phy0 5GHZ *:5d u-boot-env athaddr
---- ---- ???? art 0x0/0x6
**Installation:**
Method 1: Firmware upgrade page:
OEM webpage at 192.168.1.1
username and password "admin"
Navigate to "Firmware" page from left pane
Click Browse and select the factory.bin image
Upload and verify checksum
Click Continue to confirm and wait 3 minutes
Method 2: Serial to load Failsafe webpage:
After connecting to serial console and rebooting...
Interrupt uboot with any key pressed rapidly
(see TFTP recovery)
perform a sysupgrade
**Serial Access:**
the RX line on the board for UART is shorted to ground by resistor R176
therefore it must be removed to use the console
but it is not necessary to remove to view boot log
optionally, R175 can be replaced with a solder bridge short
the resistors R175 and R176 are next to the UART pinout at JP1
**Return to OEM:**
If you have a serial cable, see Serial Failsafe instructions
Unlike most Engenius boards, this does not have a 'failsafe' image
the only way to return to OEM is TFTP or serial access to u-boot
**TFTP recovery:**
Unlike most Engenius boards, TFTP is reliable here
rename initramfs-kernel.bin to 'ap.bin'
make the file available on a TFTP server at 192.168.1.10
power board while holding or pressing reset button repeatedly
or with serial access:
run `tftpboot` or `run factory_boot` with initramfs-kernel.bin
then `bootm` with the load address
**Format of OEM firmware image:**
The OEM software of ECB1200 is a heavily modified version
of Openwrt Altitude Adjustment 12.09.
This Engenius board, like ECB1750, uses a proprietary header
with a unique Product ID. The header for factory.bin is
generated by the mksenaofw program included in openwrt.
**Note on PLL-data cells:**
The default PLL register values will not work
because of the AR8035 switch between
the SOC and the ethernet port.
For QCA955x series, the PLL registers for eth0 and eth1
can be see in the DTSI as 0x28 and 0x48 respectively.
Therefore the PLL registers can be read from uboot
for each link speed after attempting tftpboot
or another network action using that link speed
with `md 0x18050028 1` and `md 0x18050048 1`.
However the registers that u-boot sets are not ideal and sometimes wrong...
the at803x driver supports setting the RGMII clock/data delay on the PHY side.
This way the pll-data register only needs to handle invert and phase.
for this board clock invert is needed on the MAC side
all link speeds functional
Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
package/boot/uboot-envtools/files/ath79 | 1 +
.../linux/ath79/dts/qca9557_engenius_ecb1200.dts | 140 +++++++++++++++++++++
.../generic/base-files/etc/board.d/02_network | 2 +
.../etc/hotplug.d/firmware/10-ath9k-eeprom | 1 +
.../etc/hotplug.d/firmware/11-ath10k-caldata | 1 +
target/linux/ath79/image/generic.mk | 13 ++
6 files changed, 158 insertions(+)
diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79
index 259c52c770..dd8c2d36d7 100644
--- a/package/boot/uboot-envtools/files/ath79
+++ b/package/boot/uboot-envtools/files/ath79
@@ -24,6 +24,7 @@ arduino,yun|\
buffalo,bhr-4grv2|\
devolo,magic-2-wifi|\
engenius,eap300-v2|\
+engenius,ecb1200|\
engenius,ecb1750|\
engenius,enh202-v1|\
engenius,ens202ext-v1|\
diff --git a/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts b/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts
new file mode 100644
index 0000000000..ee46cd79e7
--- /dev/null
+++ b/target/linux/ath79/dts/qca9557_engenius_ecb1200.dts
@@ -0,0 +1,140 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca955x.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ compatible = "engenius,ecb1200", "qca,qca9557";
+ model = "EnGenius ECB1200";
+
+ aliases {
+ led-boot = &led_power;
+ led-failsafe = &led_power;
+ led-running = &led_power;
+ led-upgrade = &led_power;
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ debounce-interval = <60>;
+ gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_power: power {
+ label = "amber:power";
+ gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+ default-state = "on";
+ };
+
+ wifi2g {
+ label = "blue:wifi2g";
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "phy1tpt";
+ };
+
+ wifi5g {
+ label = "blue:wifi5g";
+ gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "phy0tpt";
+ };
+ };
+};
+
+&uart {
+ status = "okay";
+};
+
+&spi {
+ status = "okay";
+
+ flash at 0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <40000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition at 0 {
+ label = "u-boot";
+ reg = <0x000000 0x040000>;
+ read-only;
+ };
+
+ partition at 40000 {
+ label = "u-boot-env";
+ reg = <0x040000 0x010000>;
+ };
+
+ partition at 50000 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x050000 0xf50000>;
+ };
+
+ partition at fa0000 {
+ label = "userconfig";
+ reg = <0xfa0000 0x050000>;
+ read-only;
+ };
+
+ partition at ff0000 {
+ label = "art";
+ reg = <0xff0000 0x010000>;
+ read-only;
+ };
+ };
+ };
+};
+
+&mdio0 {
+ status = "okay";
+
+ phy5: ethernet-phy at 5 {
+ reg = <5>;
+ eee-broken-100tx;
+ eee-broken-1000t;
+ };
+};
+
+ð0 {
+ status = "okay";
+
+ phy-handle = <&phy5>;
+ phy-mode = "rgmii-id";
+
+ pll-data = <0x82000000 0x80000101 0x80001313>;
+
+ gmac-config {
+ device = <&gmac>;
+ rgmii-enabled = <1>;
+ };
+};
+
+&pcie0 {
+ status = "okay";
+
+ wifi at 0,0,0 {
+ compatible = "qcom,ath10k";
+ reg = <0x0 0 0 0 0>;
+ qca,no-eeprom;
+ };
+};
+
+&wmac {
+ status = "okay";
+
+ qca,no-eeprom;
+};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index 866d74fae4..b712154eb1 100755
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -29,6 +29,7 @@ ath79_setup_interfaces()
dlink,dap-1365-a1|\
dlink,dir-505|\
engenius,eap300-v2|\
+ engenius,ecb1200|\
engenius,ecb1750|\
enterasys,ws-ap3705i|\
glinet,gl-ar300m-lite|\
@@ -500,6 +501,7 @@ ath79_setup_macs()
elecom,wrc-300ghbk2-i)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary art 0x1002)" -2)
;;
+ engenius,ecb1200|\
engenius,ecb1750)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
label_mac=$(mtd_get_mac_ascii u-boot-env athaddr)
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 194df74292..5d5e25b401 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -37,6 +37,7 @@ case "$FIRMWARE" in
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")
;;
+ engenius,ecb1200|\
engenius,ecb1750)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env "athaddr") +1)
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 0d09cd3140..5a38e7f421 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -62,6 +62,7 @@ case "$FIRMWARE" in
elecom,wrc-1750ghbk2-i)
caldata_extract "art" 0x5000 0x844
;;
+ engenius,ecb1200|\
engenius,ecb1750)
caldata_extract "art" 0x5000 0x844
ath10k_patch_mac $(mtd_get_mac_ascii u-boot-env athaddr)
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 4d181245a6..a7f1a76e11 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -942,6 +942,19 @@ define Device/engenius_eap300-v2
endef
TARGET_DEVICES += engenius_eap300-v2
+define Device/engenius_ecb1200
+ SOC := qca9557
+ DEVICE_VENDOR := EnGenius
+ DEVICE_MODEL := ECB1200
+ DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
+ IMAGE_SIZE := 15680k
+ IMAGES += factory.bin
+ IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+ append-rootfs | pad-rootfs | check-size | \
+ senao-header -r 0x101 -p 0x6e -t 2
+endef
+TARGET_DEVICES += engenius_ecb1200
+
define Device/engenius_ecb1750
SOC := qca9558
DEVICE_VENDOR := EnGenius
More information about the lede-commits
mailing list