ramips: add support for Afoundry EW-1200
authorFrancois Goudal <francois@goudal.net>
Mon, 27 Feb 2017 20:59:50 +0000 (21:59 +0100)
committerMathias Kresin <dev@kresin.me>
Wed, 1 Mar 2017 21:29:50 +0000 (22:29 +0100)
This device features both a 2.4 and 5Ghz radio, and supports
802.11a/b/g/n/ac modes.
It has 5 Gb-Ethernet ports and a USB 3.0 host port.

It is powered by the Mediatek MT7621 SoC, and the MT7602E and MT7612E wifi
chipsets, together with 128MB of RAM and 16 MB of SPI Flash.

The stock firmware is in fact based on some openwrt barrier breaker, with a
mediatek SDK kernel, and an afoundry custom made web interface (not LuCI
based).
Firmware update page on the stock web interface can not accept sysupgrade
images, it bricks the device.
At this point, the only working solution I found was to connect to the
serial console port (available on J4 header) and to use opkg to install
dropbear.
Then scp the sysupgrade file in the device's /tmp and run sysupgrade from
console without preserving configuration files.

Signed-off-by: Francois Goudal <francois@goudal.net>
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/etc/diag.sh
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/dts/EW1200.dts [new file with mode: 0644]
target/linux/ramips/image/mt7621.mk

index be3306d..e01ba5f 100755 (executable)
@@ -19,6 +19,7 @@ board_config_update
 case $board in
 11acnas|\
 all0239-3g|\
+ew1200|\
 hw550-3g|\
 mofi3500-3gn|\
 sap-g3200u3|\
index cfad1ff..c67f3d5 100755 (executable)
@@ -78,6 +78,7 @@ ramips_setup_interfaces()
        dir-320-b1|\
        dir-610-a1|\
        dir-615-h1|\
+       ew1200|\
        firewrt|\
        hc5661a|\
        hc5962|\
index 3f22117..5496137 100644 (file)
@@ -88,6 +88,7 @@ get_status_led() {
                status_led="$board:blue:wlan"
                ;;
        atp-52b|\
+       ew1200|\
        ip2202)
                status_led="$board:green:run"
                ;;
index 8e53848..91ce5fb 100755 (executable)
@@ -184,6 +184,9 @@ ramips_board_detect() {
        *"ESR-9753")
                name="esr-9753"
                ;;
+       *"EW1200")
+               name="ew1200"
+               ;;
        *"EX2700")
                name="ex2700";
                ;;
index e5e5eb0..3245e2c 100755 (executable)
@@ -53,6 +53,7 @@ platform_check_image() {
        dwr-512-b|\
        e1700|\
        esr-9753|\
+       ew1200|\
        ex2700|\
        f7c027|\
        firewrt|\
diff --git a/target/linux/ramips/dts/EW1200.dts b/target/linux/ramips/dts/EW1200.dts
new file mode 100644 (file)
index 0000000..73c5395
--- /dev/null
@@ -0,0 +1,127 @@
+/dts-v1/;
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       model = "EW1200";
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x8000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,57600";
+       };
+
+       palmbus: palmbus@1E000000 {
+               i2c@900 {
+                       status = "okay";
+               };
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 18 1>;
+                       linux,code = <KEY_RESTART>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               status {
+                       label = "ew1200:green:run";
+                       gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
+               };
+
+               usb {
+                       label = "ew1200:green:usb";
+                       gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&sdhci {
+       status = "okay";
+};
+
+&spi0 {
+       status = "okay";
+
+       m25p80@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+               m25p,chunked-io = <32>;
+
+               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;
+               };
+
+               partition@50000 {
+                       label = "firmware";
+                       reg = <0x50000 0xfb0000>;
+               };
+       };
+};
+
+&pcie {
+       status = "okay";
+
+       pcie0 {
+               mt76@0,0 {
+                       reg = <0x0000 0 0 0 0>;
+                       device_type = "pci";
+                       mediatek,mtd-eeprom = <&factory 0x8000>;
+                       ieee80211-freq-limit = <5000000 6000000>;
+               };
+       };
+
+       pcie1 {
+               mt76@1,0 {
+                       reg = <0x0000 0 0 0 0>;
+                       device_type = "pci";
+                       mediatek,mtd-eeprom = <&factory 0x0000>;
+                       ieee80211-freq-limit = <2400000 2500000>;
+               };
+       };
+};
+
+&ethernet {
+       mtd-mac-address = <&factory 0xe000>;
+};
+
+&pinctrl {
+       state_default: pinctrl0 {
+               gpio {
+                       ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio";
+                       ralink,function = "gpio";
+               };
+       };
+};
index d40c185..6704f84 100644 (file)
@@ -63,6 +63,14 @@ define Device/dir-860l-b1
 endef
 TARGET_DEVICES += dir-860l-b1
 
+define Device/ew1200
+  DTS := EW1200
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  DEVICE_TITLE := AFOUNDRY EW1200
+  DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci
+endef
+TARGET_DEVICES += ew1200
+
 define Device/firewrt
   DTS := FIREWRT
   IMAGE_SIZE := $(ralink_default_fw_size_16M)