aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtarget/linux/ramips/base-files/etc/board.d/01_leds3
-rwxr-xr-xtarget/linux/ramips/base-files/etc/board.d/02_network4
-rw-r--r--target/linux/ramips/base-files/etc/diag.sh3
-rwxr-xr-xtarget/linux/ramips/base-files/lib/ramips.sh3
-rwxr-xr-xtarget/linux/ramips/base-files/lib/upgrade/platform.sh1
-rw-r--r--target/linux/ramips/dts/GL-MT300N-V2.dts133
-rw-r--r--target/linux/ramips/image/mt7628.mk8
7 files changed, 155 insertions, 0 deletions
diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 2a35fc4bc2..b08f35268b 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -189,6 +189,9 @@ gl-mt300n|\
gl-mt750)
set_wifi_led "$board:wlan"
;;
+gl-mt300n-v2)
+ set_wifi_led "$board:red:wlan"
+ ;;
hc5661|\
hc5661a)
ucidef_set_led_default "system" "system" "$board:blue:system" "1"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 6d93f2ccaa..9dd5823639 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -180,6 +180,10 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
;;
+ gl-mt300n-v2)
+ ucidef_add_switch "switch0" \
+ "1:lan" "0:wan" "6@eth0"
+ ;;
awapn2403)
ucidef_add_switch "switch0" \
"0:lan" "1:wan" "6@eth0"
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index e37f9cfda4..26d7f627cd 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -166,6 +166,9 @@ get_status_led() {
miwifi-nano)
status_led="$board:blue:status"
;;
+ gl-mt300n-v2)
+ status_led="$board:red:wlan"
+ ;;
m4-4M|\
m4-8M)
status_led="m4:blue:status"
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 4213159378..4b60a07ee0 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -217,6 +217,9 @@ ramips_board_detect() {
*"GL-MT750")
name="gl-mt750"
;;
+ *"GL-MT300N-V2")
+ name="gl-mt300n-v2"
+ ;;
*"HC5661")
name="hc5661"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 32bc453497..6aad4c9601 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -65,6 +65,7 @@ platform_check_image() {
gl-mt300a|\
gl-mt300n|\
gl-mt750|\
+ gl-mt300n-v2|\
hc5*61|\
hc5661a|\
hg255d|\
diff --git a/target/linux/ramips/dts/GL-MT300N-V2.dts b/target/linux/ramips/dts/GL-MT300N-V2.dts
new file mode 100644
index 0000000000..e40c4cf7df
--- /dev/null
+++ b/target/linux/ramips/dts/GL-MT300N-V2.dts
@@ -0,0 +1,133 @@
+/dts-v1/;
+
+#include "mt7628an.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/{
+ compatible = "gl-inet,gl-mt300n-v2", "ralink,mt7620an-soc";
+ model = "GL-MT300N-V2";
+
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ };
+
+ memory@0 {
+ device_type = "memory";
+ reg = <0x0 0x8000000>;
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ wan {
+ label = "gl-mt300n-v2:blue:wan";
+ gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
+ };
+
+ wlan {
+ label = "gl-mt300n-v2:red:wlan";
+ gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ gpio-keys {
+ 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>;
+ };
+
+ BTN_0 {
+ label = "BTN_0";
+ gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
+ linux,code = <BTN_0>;
+ };
+
+ BTN_1 {
+ label = "BTN_1";
+ gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
+ linux,code = <BTN_1>;
+ };
+ };
+
+ gpio_export {
+ compatible = "gpio-export";
+ #size-cells = <0>;
+
+ usb {
+ gpio-export,name = "usb";
+ gpio-export,output = <1>;
+ gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+};
+
+&pinctrl {
+ state_default: pinctrl0 {
+ gpio {
+ ralink,group = "wdt", "gpio", "wled_an", "p0led_an", "i2s";
+ ralink,function = "gpio";
+ };
+ };
+};
+
+&ethernet {
+ mtd-mac-address = <&factory 0x4000>;
+};
+
+&wmac {
+ status = "okay";
+ ralink,mtd-eeprom = <&factory 0x0>;
+};
+
+&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>;
+ };
+ };
+};
+
+&ehci {
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
diff --git a/target/linux/ramips/image/mt7628.mk b/target/linux/ramips/image/mt7628.mk
index 6bb04ea38c..f8bd2c18b2 100644
--- a/target/linux/ramips/image/mt7628.mk
+++ b/target/linux/ramips/image/mt7628.mk
@@ -26,6 +26,14 @@ define Device/miwifi-nano
endef
TARGET_DEVICES += miwifi-nano
+define Device/gl-mt300n-v2
+ DTS := GL-MT300N-V2
+ IMAGE_SIZE := 16064k
+ DEVICE_TITLE := GL-iNet GL-MT300N-V2
+ DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
+endef
+TARGET_DEVICES += gl-mt300n-v2
+
define Device/vocore2
DTS := VOCORE2
IMAGE_SIZE := $(ralink_default_fw_size_16M)