ramips: add support for Planex VR500.
authorYuheiOKAWA <tochiro.srchack@gmail.com>
Mon, 10 Oct 2016 01:24:42 +0000 (10:24 +0900)
committerJohn Crispin <john@phrozen.org>
Sat, 15 Oct 2016 09:36:51 +0000 (11:36 +0200)
SOC: MT7621A
RAM: 256MiB
NOR: MX25L51245G

Non Wireless Router.

Issue: soft reboot problem. SPI Flash do not exit 4byte address mode.

Signed-off-by: Yuhei Okawa <tochiro.srchack@gmail.com>
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/VR500.dts [new file with mode: 0644]
target/linux/ramips/image/mt7621.mk

index e14448e3f27012b926fa2a073ab392617f090cdf..4b66694ed972ced02a8563b8392117fa3eff0e35 100755 (executable)
@@ -146,7 +146,8 @@ mzk-ex300np)
        ;;
 dir-810l|\
 mzk-750dhp|\
-mzk-dp150n)
+mzk-dp150n|\
+vr500)
        ucidef_set_led_default "power" "power" "$board:green:power" "1"
        ;;
 dir-860l-b1)
index 0400e58cdac404668d005e214c0154e3b5dc2e3f..99c90e4590b55b457a5e92787c8ba964eacbfe0f 100755 (executable)
@@ -85,6 +85,7 @@ ramips_setup_interfaces()
        psg1218|\
        sap-g3200u3|\
        sk-wb8|\
+       vr500|\
        wf-2881|\
        whr-300hp2|\
        whr-600d|\
@@ -354,6 +355,10 @@ ramips_setup_macs()
                lan_mac=$(mtd_get_mac_ascii u-boot-env LAN_MAC_ADDR)
                wan_mac=$(mtd_get_mac_ascii u-boot-env WAN_MAC_ADDR)
                ;;
+       vr500)
+               lan_mac=$(mtd_get_mac_binary factory 57344)
+               wan_mac=$(mtd_get_mac_binary factory 57350)
+               ;;
        w306r-v20)
                lan_mac=$(cat /sys/class/net/eth0/address)
                wan_mac=$(macaddr_add "$lan_mac" 5)
index 67dcf99a00230b4e183325440852f8337a6f29bc..84459a5c0147b16ad184b0488db8456167cbb0fe 100644 (file)
@@ -29,6 +29,7 @@ get_status_led() {
        nbg-419n|\
        nbg-419n2|\
        pwh2004|\
+       vr500|\
        wnce2001|\
        wndr3700v5|\
        x5|\
index d57c1cf92223fb0ee8318c168e124501b72fde6f..526a5ae669794c85a5782a2a846b937decb60f4f 100755 (executable)
@@ -442,6 +442,9 @@ ramips_board_detect() {
        *"VoCore")
                name="vocore"
                ;;
+       *"VR500")
+               name="vr500"
+               ;;
        *"W150M")
                name="w150m"
                ;;
index 806c1a0e8c909b407adcff3057e84d6c1362cc9c..9c49c8070d9d38346e3d5fbef3803b9f089e2d27 100755 (executable)
@@ -128,6 +128,7 @@ platform_check_image() {
        ur-336un|\
        v22rw-2x2|\
        vocore|\
+       vr500|\
        w150m|\
        w306r-v20|\
        w502u|\
diff --git a/target/linux/ramips/dts/VR500.dts b/target/linux/ramips/dts/VR500.dts
new file mode 100644 (file)
index 0000000..3cddce6
--- /dev/null
@@ -0,0 +1,92 @@
+/dts-v1/;
+
+#include "mt7621.dtsi"
+
+/ {
+       compatible = "ralink,mt7621-eval-board", "ralink,mt7621-soc";
+       model = "Planex VR500";
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x10000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,57600";
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               power {
+                       label = "vr500:green:power";
+                       gpios = <&gpio1 13 1>;
+               };
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio1 15 1>;
+                       linux,code = <0x198>;
+               };
+       };
+};
+
+&xhci {
+       status = "okay";
+};
+
+&spi0 {
+       status = "okay";
+
+       m25p80@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               linux,modalias = "m25p80";
+               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 0x3fb0000>;
+               };
+       };
+};
+
+&pinctrl {
+       state_default: pinctrl0 {
+               gpio {
+                       ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
+                       ralink,function = "gpio";
+               };
+       };
+};
+
+&pcie {
+       status = "disabled";
+};
index 323f08ddbcec367d3ccfab8e1305e14360e43804..acaafc0a735e7c8dd3abb05bf1d1229ed41be261 100644 (file)
@@ -182,6 +182,14 @@ define Device/sk-wb8
 endef
 TARGET_DEVICES += sk-wb8
 
+define Device/vr500
+  DTS := VR500
+  IMAGE_SIZE := 66453504
+  DEVICE_TITLE := Planex VR500
+  DEVICE_PACKAGES := kmod-usb3
+endef
+TARGET_DEVICES += vr500
+
 # FIXME: is this still needed?
 define Image/Prepare
 #define Build/Compile