]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ramips: add support for GL-iNet GL-MT300N-V3
authorKyson Lok <kysonlok@gmail.com>
Sat, 21 Jul 2018 03:35:53 +0000 (11:35 +0800)
committerKyson Lok <kysonlok@gmail.com>
Sat, 21 Jul 2018 04:12:58 +0000 (12:12 +0800)
GL-iNet GL-MT300N-V3 is a portable wireless router, which a is simplified version
of GL-MT300N-V2.

Specification:

- MT7628N/N (580 MHz)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH
- 2T2R 2.4 GHz
- 1x 10/100 Mbps Ethernet
- 2x LED, 1x button

Flash instruction:

Original firmware is based on OpenWrt.
Use sysupgrade image directly in vendor GUI.

Signed-off-by: Kyson Lok <kysonlok@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/GL-MT300N-V3.dts [new file with mode: 0644]
target/linux/ramips/image/mt76x8.mk

index 54504c6ee8bb45db0ffa371ec68c3a8fd7e4d673..873fcfc34ffd71eb85880ebe0e2bda8ed0bd19e5 100755 (executable)
@@ -211,6 +211,9 @@ gl-mt750)
 gl-mt300n-v2)
        set_wifi_led "$boardname:red:wlan"
        ;;
+gl-mt300n-v3)
+       set_wifi_led "$boardname:white:wlan"
+       ;;
 hc5661|\
 hc5661a)
        ucidef_set_led_default "system" "system" "$boardname:blue:system" "1"
index 76b6fe9f50c2b1caa57b8bcbda793a81dc850f2b..151f9b697d0565c114578cbe00f124fd2298747f 100755 (executable)
@@ -241,6 +241,9 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "1:lan" "0:wan" "6@eth0"
                ;;
+       gl-mt300n-v3)
+               ucidef_set_interface_lan "eth0"
+               ;;
        awapn2403)
                ucidef_add_switch "switch0" \
                        "0:lan" "1:wan" "6@eth0"
index 2f51add331fef4693e997433a4ab0e665da80e02..8fe2e4097650df5cbfb90ec437c5d6efab4a36b9 100644 (file)
@@ -204,6 +204,9 @@ get_status_led() {
        gl-mt300n-v2)
                status_led="$boardname:green:power"
                ;;
+       gl-mt300n-v3)
+               status_led="$boardname:blue:power"
+               ;;
        m4-4M|\
        m4-8M)
                status_led="m4:blue:status"
index 5741cbd2ee13f309dc5cc93f1d48f5a97e0da970..4b8481057e957ab94ccf14f09b002d86ab3c61a5 100755 (executable)
@@ -217,6 +217,9 @@ ramips_board_detect() {
        *"GL-MT300N-V2")
                name="gl-mt300n-v2"
                ;;
+       *"GL-MT300N-V3")
+               name="gl-mt300n-v3"
+               ;;
        *"HC5661")
                name="hc5661"
                ;;
index ffdc5e73e0ede286c10396810954a230c8ea32fc..f6bba97d988a81264b6750997aaec0af65c28ee0 100755 (executable)
@@ -69,6 +69,7 @@ platform_check_image() {
        gl-mt300n|\
        gl-mt750|\
        gl-mt300n-v2|\
+       gl-mt300n-v3|\
        hc5*61|\
        hc5661a|\
        hg255d|\
diff --git a/target/linux/ramips/dts/GL-MT300N-V3.dts b/target/linux/ramips/dts/GL-MT300N-V3.dts
new file mode 100644 (file)
index 0000000..c156e1e
--- /dev/null
@@ -0,0 +1,106 @@
+/dts-v1/;
+
+#include "mt7628an.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/{
+       compatible = "glinet,gl-mt300n-v3", "mediatek,mt7628an-soc";
+       model = "GL-iNet GL-MT300N-V3";
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x4000000>;
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               power {
+                       label = "gl-mt300n-v3:blue:power";
+                       default-state = "on";
+                       gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
+               };
+
+               wlan {
+                       label = "gl-mt300n-v3:white:wlan";
+                       gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+       };
+};
+
+&pinctrl {
+       state_default: pinctrl0 {
+               gpio {
+                       ralink,group = "wdt", "wled_an", "p1led_an";
+                       ralink,function = "gpio";
+               };
+       };
+};
+
+&ethernet {
+       mtd-mac-address = <&factory 0x4>;
+};
+
+&wmac {
+       status = "okay";
+       ralink,mtd-eeprom = <&factory 0x4>;
+};
+
+&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 0x7b0000>;
+               };
+       };
+};
+
+&uart1 {
+       status = "okay";
+};
index 21c5357a089fdd0675afa6f131ff5b34a9a8f54d..1592f81a060b49f10656ae805a31ad565514e65f 100644 (file)
@@ -50,6 +50,13 @@ define Device/gl-mt300n-v2
 endef
 TARGET_DEVICES += gl-mt300n-v2
 
+define Device/gl-mt300n-v3
+  DTS := GL-MT300N-V3
+  IMAGE_SIZE := $(ralink_default_fw_size_8M)
+  DEVICE_TITLE := GL-iNet GL-MT300N-V3
+endef
+TARGET_DEVICES += gl-mt300n-v3
+
 define Device/hc5661a
   DTS := HC5661A
   IMAGE_SIZE := $(ralink_default_fw_size_16M)