From: Kyson Lok Date: Sat, 21 Jul 2018 03:35:53 +0000 (+0800) Subject: ramips: add support for GL-iNet GL-MT300N-V3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af02e97407cbb0983ecf26c168fffdc492284779;p=thirdparty%2Fopenwrt.git ramips: add support for GL-iNet GL-MT300N-V3 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 --- 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 54504c6ee8b..873fcfc34ff 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -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" 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 76b6fe9f50c..151f9b697d0 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -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" diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 2f51add331f..8fe2e409765 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -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" diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 5741cbd2ee1..4b8481057e9 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-MT300N-V2") name="gl-mt300n-v2" ;; + *"GL-MT300N-V3") + name="gl-mt300n-v3" + ;; *"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 ffdc5e73e0e..f6bba97d988 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -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 index 00000000000..c156e1e7602 --- /dev/null +++ b/target/linux/ramips/dts/GL-MT300N-V3.dts @@ -0,0 +1,106 @@ +/dts-v1/; + +#include "mt7628an.dtsi" + +#include +#include + +/{ + 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 = ; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "wdt", "wled_an", "p1led_an"; + ralink,function = "gpio"; + }; + }; +}; + +ðernet { + 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"; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 21c5357a089..1592f81a060 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -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)