ramips: add support for WeVO W2914NS v2
authorperillamint <perillamint@gentoo.moe>
Fri, 18 Nov 2016 11:46:27 +0000 (20:46 +0900)
committerJohn Crispin <john@phrozen.org>
Mon, 21 Nov 2016 09:13:17 +0000 (10:13 +0100)
Signed-off-by: Yong-hyu Ban <perillamint@gentoo.moe>
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/11ACNAS.dts [new file with mode: 0644]
target/linux/ramips/dts/W2914NSV2.dts [new file with mode: 0644]
target/linux/ramips/dts/W2914NSV2.dtsi [new file with mode: 0644]
target/linux/ramips/image/mt7621.mk

index ed51555d38c9c2036ea437d43a6478ce19eb2f78..f6dbf30a58772d743f715709fc8ccf885d3286d2 100755 (executable)
@@ -303,6 +303,9 @@ vocore)
        ucidef_set_led_netdev "eth" "ETH" "$board:orange:eth" "eth0"
        set_wifi_led "$board:green:status"
        ;;
+w2914nsv2)
+       set_usb_led "$board:green:usb"
+       ;;
 w502u)
        set_usb_led "$board:blue:usb"
        set_wifi_led "rt2800pci-phy0::radio"
index 5ae6413fcf87340646965511bd12e069ab1f09b7..e3e65506a9649ae3ee6689186b17a16e9136890a 100755 (executable)
@@ -87,6 +87,7 @@ ramips_setup_interfaces()
        sap-g3200u3|\
        sk-wb8|\
        vr500|\
+       w2914nsv2|\
        wf-2881|\
        witi|\
        wl-wn575a3|\
index 4a4204bc24047fa74ca089a65b56d8446547dcac..5c821884065d1949c61f2ad526de6742c0734a3d 100755 (executable)
@@ -13,6 +13,9 @@ ramips_board_detect() {
        machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
 
        case "$machine" in
+       *"11AC NAS Router")
+               name="w2914nsv2"
+               ;;
        *"3G150B")
                name="3g150b"
                ;;
@@ -454,6 +457,9 @@ ramips_board_detect() {
        *"W150M")
                name="w150m"
                ;;
+       *"W2914NS v2")
+               name="w2914nsv2"
+               ;;
        *"W306R V2.0")
                name="w306r-v20"
                ;;
index a7e9e19fa54f890ee0ead752fb97986c87af8d94..7c63c1cf3b10379b0215e6331dc974ff5f33a5fb 100755 (executable)
@@ -133,6 +133,7 @@ platform_check_image() {
        vocore|\
        vr500|\
        w150m|\
+       w2914nsv2|\
        w306r-v20|\
        w502u|\
        wf-2881|\
diff --git a/target/linux/ramips/dts/11ACNAS.dts b/target/linux/ramips/dts/11ACNAS.dts
new file mode 100644 (file)
index 0000000..55678f5
--- /dev/null
@@ -0,0 +1,12 @@
+/dts-v1/;
+
+#include "W2914NSV2.dtsi"
+
+/ {
+       model = "WeVO 11AC NAS Router";
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x10000000>;
+       };
+};
diff --git a/target/linux/ramips/dts/W2914NSV2.dts b/target/linux/ramips/dts/W2914NSV2.dts
new file mode 100644 (file)
index 0000000..37afffd
--- /dev/null
@@ -0,0 +1,12 @@
+/dts-v1/;
+
+#include "W2914NSV2.dtsi"
+
+/ {
+       model = "WeVO W2914NS v2";
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x8000000>;
+       };
+};
diff --git a/target/linux/ramips/dts/W2914NSV2.dtsi b/target/linux/ramips/dts/W2914NSV2.dtsi
new file mode 100644 (file)
index 0000000..c842b00
--- /dev/null
@@ -0,0 +1,117 @@
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       chosen {
+               bootargs = "console=ttyS0,57600";
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+
+               wps {
+                       label = "wps";
+                       gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               // Only USB LED is connected to GPIO.
+               // All of other LEDs are connected directly to
+               // switch, WiFi chip, Vcc, so they are not controllable
+               // via GPIO
+
+               usb {
+                       label = "w2914nsv2:green:usb";
+                       gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&xhci {
+       status = "okay";
+};
+
+&spi0 {
+       status = "okay";
+
+       m25p80@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;
+               };
+
+               partition@50000 {
+                       label = "firmware";
+                       reg = <0x50000 0xfb0000>;
+               };
+       };
+};
+
+&pcie {
+       status = "okay";
+
+       pcie0 {
+               wifi@14c3,7662 {
+                       compatible = "pci14c3,7662";
+                       reg = <0x0000 0 0 0 0>;
+                       mediatek,mtd-eeprom = <&factory 0x0000>;
+                       mediatek,5ghz = <0>;
+               };
+       };
+
+       pcie1 {
+               wifi@14c3,7603 {
+                       compatible = "pci14c3,7603";
+                       reg = <0x0000 0 0 0 0>;
+                       mediatek,mtd-eeprom = <&factory 0x8000>;
+                       mediatek,2ghz = <0>;
+               };
+       };
+};
+
+&ethernet {
+       mtd-mac-address = <&factory 0xe000>;
+};
+
+&pinctrl {
+       state_default: pinctrl0 {
+               gpio {
+                       ralink,group = "wdt", "rgmii2", "jtag", "mdio";
+                       ralink,function = "gpio";
+               };
+       };
+};
index 647df7a12ed00aacac565cffb54e1e9866b20a98..3518c8d9442fac78dc0e0e5db3ab9c71611e496f 100644 (file)
@@ -207,6 +207,22 @@ define Device/rb750gr3
 endef
 TARGET_DEVICES += rb750gr3
 
+define Device/w2914nsv2
+  DTS := W2914NSV2
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  DEVICE_TITLE := WeVO W2914NS v2
+  DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-i2c-mt7621 kmod-mt76
+endef
+TARGET_DEVICES += w2914nsv2
+
+define Device/11acnas
+  DTS := 11ACNAS
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  DEVICE_TITLE := WeVO 11AC NAS Router
+  DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-i2c-mt7621 kmod-mt76
+endef
+TARGET_DEVICES += 11acnas
+
 # FIXME: is this still needed?
 define Image/Prepare
 #define Build/Compile