ramips: Add support for ZTE ZXECS EBG3130 aka BDCOM WAP2100-SK
authorPetr Štetiar <ynezz@true.cz>
Tue, 13 Nov 2018 12:10:40 +0000 (13:10 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 18 Dec 2018 16:48:15 +0000 (17:48 +0100)
On the bottom sticker it's branded as ZTE ZXECS EBG3130 device, but in factory
OpenWrt image it's referenced as BDCOM WAP2100-SK device.

Specifications:

- SoC: MediaTek MT7620A
- RAM: 128 MB
- Flash: 16 MB
- Ethernet: 5 FE ports
- Wireless radio: 2T2R 2.4 GHz and 1T1R 5 GHz (MT7610EN, unsupported)
- UART: 1 x UART on PCB marked as J2 (R=RX, T=TX, G=GND) with 115200 8N1 config
- LEDs: Power, FE ports 1-5, WPS, USB, RF 2.4G, RF 5G
- Other: USB port, SD card slot and 2x external antennas (non-detachable)

Flashing instructions:

A) The U-Boot has HTTP based firmware upgrade

  A1) Flashing notes

  We've identified so far two different batches of units, unfortunately
  each batch has different U-Boot bootloader flashed with different
  default environment variables, thus each batch has different IP address
  for accessing web based firmware updater.

  * First batch has web based bootloader IP address 1.1.1.1
  * Second batch has web based bootloader IP address 192.168.1.250

  In case you can't connect to either of those IPs, you can try to get
  the default IP address via two methods:

  A1.1) Serial console, then the IP address is visible during the boot

   ...
   HTTP server is starting at IP: 1.1.1.1
   raspi_read: from:40004 len:6
   HTTP server is ready!
   ...

  A1.2) Over telnet/SSH using this command:

   root@bdcom:/# grep ipaddr= /dev/mtd0
   ipaddr=1.1.1.1

  A2) Flashing with browser

  * Change IP address of PC to 1.1.1.2 with 255.255.255.0 netmask
  * Reboot the device and try to reach web based bootloader in the
    browser with the following URL http://1.1.1.1

  * Quickly select the firmware sysupgrade file and click on the
    `Update firmware` button, this all has to be done within 10 seconds,
    bootloader doesn't wait any longer

   If done correctly, the web page should show UPDATE IN PROGRESS page
   with progress indicator. Once the flashing completes (it takes roughly
   around 1 minute), the device will reboot to the OpenWrt firmware

  A3) Flashing with curl

   sudo ip addr add 1.1.1.2/24 dev eth0
   curl \
      --verbose \
      --retry 3 \
      --retry-delay 1 \
      --retry-max-time 30 \
      --connect-timeout 30 \
      --form "firmware=@openwrt-ramips-mt7620-BDCOM-WAP2100-SK-squashfs-sysupgrade.bin" \
      http://1.1.1.1

   Now power on the router.

B) The U-boot is based on Ralink SDK so we can flash the firmware using UART.

   1. Configure PC with a static IP address and setup an TFTP server.
   2. Put the firmware into the tftp directory.
   3. Connect the UART line as described on the PCB (G=GND, R=RX, T=TX)
   4. Power up the device and press 2, follow the instruction to set device and
      tftp server IP address and input the firmware file name. U-boot will then load
      the firmware and write it into the flash.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(backported from 16b950c981c91bcd2dde8bd1c4ed10bf3a6b1763)

target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/dts/BDCOM-WAP2100-SK.dts [new file with mode: 0644]
target/linux/ramips/image/mt7620.mk

index 825a65b1d1eb0377a339cdb4954a9128eadee557..29d3c31275a9a46568d2857d8ea0ad45f9f30b9b 100755 (executable)
@@ -367,6 +367,10 @@ vocore-16M)
 w502u)
        set_wifi_led "rt2800pci-phy0::radio"
        ;;
+wap2100-sk)
+       set_usb_led "$boardname:green:usb"
+       set_wifi_led "$boardname:green:wlan2g"
+       ;;
 we1026-5g-16m)
        ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0"
        set_wifi_led "we1026-5g:green:wifi"
index 9b189b3b9e2581239dfa9929135ce3e6dd2f764c..6d5db45c50490552581f39be7c953dc1eae6e9ae 100755 (executable)
@@ -223,6 +223,7 @@ ramips_setup_interfaces()
        ubnt-erx|\
        ubnt-erx-sfp|\
        ur-326n4g|\
+       wap2100-sk|\
        wrtnode|\
        wrtnode2p | \
        wrtnode2r | \
index 249533f06eec6f6fb398bb56fbe0405a2b8b62f4..28d5073525ceae57b2e3340de273acfb3a041fa2 100755 (executable)
@@ -556,6 +556,9 @@ ramips_board_detect() {
        *"W502U")
                name="w502u"
                ;;
+       *"WAP2100-SK")
+               name="wap2100-sk"
+               ;;
        *"WCR-1166DS")
                name="wcr-1166ds"
                ;;
index 7fb17743cdcd06fe24fb7c426dde2d81bf4d1d17..f54f2fbe77023f6fb08fb30281df3b6ed6af1fe7 100755 (executable)
@@ -186,6 +186,8 @@ platform_check_image() {
        widora,neo-32m|\
        mqmaker,witi-256m|\
        mqmaker,witi-512m|\
+       wap2100-sk|\
+       we1026-5g-16m|\
        wizfi630a|\
        wl-330n|\
        wl-330n3g|\
@@ -217,7 +219,6 @@ platform_check_image() {
        y1|\
        y1s|\
        youhua,wr1200js|\
-       we1026-5g-16m|\
        zbt-ape522ii|\
        zbt-cpe102|\
        zbt-wa05|\
diff --git a/target/linux/ramips/dts/BDCOM-WAP2100-SK.dts b/target/linux/ramips/dts/BDCOM-WAP2100-SK.dts
new file mode 100644 (file)
index 0000000..7f9cbe7
--- /dev/null
@@ -0,0 +1,130 @@
+/dts-v1/;
+
+#include "mt7620a.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       compatible = "bdcom,bdcom-wap2100-sk", "ralink,mt7620a-soc";
+       model = "BDCOM WAP2100-SK";
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               usb {
+                       label = "wap2100-sk:green:usb";
+                       gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
+               };
+
+               wps {
+                       label = "wap2100-sk:green:wps";
+                       gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
+               };
+
+               wlan2g {
+                       label = "wap2100-sk:green:wlan2g";
+                       gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               wps {
+                       label = "wps";
+                       gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+       };
+};
+
+&spi0 {
+       status = "okay";
+
+       en25q128@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+
+               partition@0 {
+                       label = "u-boot";
+                       reg = <0x0 0x30000>;
+                       read-only;
+               };
+
+               partition@30000 {
+                       label = "u-boot-env";
+                       reg = <0x30000 0x10000>;
+                       read-only;
+               };
+
+               factory: partition@40000 {
+                       label = "factory";
+                       reg = <0x40000 0x10000>;
+                       read-only;
+               };
+
+               firmware: partition@50000 {
+                       label = "firmware";
+                       reg = <0x50000 0xf70000>;
+               };
+       };
+};
+
+&gpio0 {
+       status = "okay";
+};
+
+&gpio1 {
+       status = "okay";
+};
+
+&gpio3 {
+       status = "okay";
+};
+
+&sdhci {
+       status = "okay";
+};
+
+&ehci {
+       status = "okay";
+};
+
+&ohci {
+       status = "okay";
+};
+
+&ethernet {
+       mtd-mac-address = <&factory 0x4>;
+       mediatek,portmap = "llllw";
+};
+
+&wmac {
+       ralink,mtd-eeprom = <&factory 0>;
+};
+
+&pinctrl {
+       state_default: pinctrl0 {
+               default {
+                       ralink,group = "wdt", "mdio", "spi refclk", "uartf", "wled";
+                       ralink,function = "gpio";
+               };
+       };
+};
index b5d73f60c7e804239eae84c880984812ee570393..61a6e56937a565351407041fae7f9a5a8679ef6e 100644 (file)
@@ -80,6 +80,15 @@ define Device/ArcherMR200
 endef
 TARGET_DEVICES += ArcherMR200
 
+define Device/BDCOM-WAP2100-SK
+  DTS := BDCOM-WAP2100-SK
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  SUPPORTED_DEVICES += wap2100-sk
+  DEVICE_TITLE := BDCOM WAP2100-SK (ZTE ZXECS EBG3130)
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76 kmod-sdhci-mt7620
+endef
+TARGET_DEVICES += BDCOM-WAP2100-SK
+
 define Device/bocco
   DTS := BOCCO
   DEVICE_TITLE := YUKAI Engineering BOCCO