diff --git a/target/linux/ramips/dts/mt7628an_nradio_wt6285.dts b/target/linux/ramips/dts/mt7628an_nradio_wt6285.dts new file mode 100644 index 000000000..3a3a98a0f --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_nradio_wt6285.dts @@ -0,0 +1,136 @@ +// Copyright By Zy143L + +#include "mt7628an.dtsi" +#include +#include + +/ { + compatible = "nradio,wt6285", "mediatek,mt7628an-soc"; + model = "NRadio WT6285"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "red:system"; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + + led_internet { + label = "green:internet"; + gpios = <&gpio 37 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + cpepower { + gpio-export,name = "cpe-pwr"; + gpio-export,output = <0>; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + }; + + cpesel0 { + gpio-export,name = "cpe-sel0"; + gpio-export,output = <1>; + gpios = <&gpio 40 GPIO_ACTIVE_HIGH>; + }; + + cpesel1 { + gpio-export,name = "cpe-sel1"; + gpio-export,output = <1>; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ðernet { + mtd-mac-address = <&bdinfo 0x9>; +}; + +&wmac { + status = "okay"; +}; + +&state_default { + gpio { + groups = "i2c", "refclk", "wdt", "wled_an", "p2led_an", "p3led_an"; + function = "gpio"; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <80000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "kpanic"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xf70000>; + }; + + bdinfo: partition@fe0000 { + label = "bdinfo"; + reg = <0xfe0000 0x10000>; + read-only; + }; + + partition@ff0000 { + label = "reserve"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index f6d32af66..4213d0848 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -325,6 +325,15 @@ define Device/netgear_r6120 endef TARGET_DEVICES += netgear_r6120 +define Device/nradio_wt6285 + IMAGE_SIZE := 15808k + DEVICE_VENDOR := NRadio + DEVICE_MODEL := WT6285 + DEVICE_PACKAGES := kmod-usb-net-cdc-ether kmod-usb-serial-option usb-modeswitch + SUPPORTED_DEVICES += wt6285 +endef +TARGET_DEVICES += nradio_wt6285 + define Device/onion_omega2 IMAGE_SIZE := 16064k DEVICE_VENDOR := Onion diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index d3091550e..9b48f919c 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -49,6 +49,9 @@ hiwifi,hc5761a) mediatek,linkit-smart-7688) ucidef_set_led_wlan "wifi" "wifi" "orange:wifi" "phy0tpt" ;; +nradio,wt6285) + ucidef_set_led_netdev "internet" "internet" "green:internet" "br-lan" "tx rx" + ;; rakwireless,rak633) ucidef_set_led_netdev "wifi_led" "wifi" "blue:wifi" "wlan0" ;; diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 549bfb452..981e8a1f0 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -110,6 +110,11 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "6@eth0" ;; + nradio,wt6285) + ucidef_add_switch "switch0" \ + "0:lan" "6@eth0" + ucidef_set_interface_wan "usb0" + ;; netgear,r6020|\ netgear,r6080|\ netgear,r6120) diff --git a/target/linux/ramips/patches-5.4/0999-mt76x8-ec200a.patch b/target/linux/ramips/patches-5.4/0999-mt76x8-ec200a.patch new file mode 100644 index 000000000..b8e150d25 --- /dev/null +++ b/target/linux/ramips/patches-5.4/0999-mt76x8-ec200a.patch @@ -0,0 +1,36 @@ +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -267,6 +267,7 @@ + #define QUECTEL_PRODUCT_EC200U 0x0901 + #define QUECTEL_PRODUCT_EC200S_CN 0x6002 + #define QUECTEL_PRODUCT_EC200T 0x6026 ++#define QUECTEL_PRODUCT_EC200A_CN 0x6005 + #define QUECTEL_PRODUCT_RM500K 0x7001 + + #define CMOTECH_VENDOR_ID 0x16d8 +@@ -1208,6 +1209,7 @@ + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200U, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200A_CN, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) }, + + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, + +--- a/drivers/usb/serial/usb_wwan.c ++++ b/drivers/usb/serial/usb_wwan.c +@@ -478,6 +478,14 @@ + usb_sndbulkpipe(serial->dev, endpoint) | dir, + buf, len, callback, ctx); + ++ #if 1 //Added by Quectel for Zero Packet ++ if (dir == USB_DIR_OUT) { ++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) ++ urb->transfer_flags |= URB_ZERO_PACKET; ++ } ++ #endif ++ ++ + if (intfdata->use_zlp && dir == USB_DIR_OUT) + urb->transfer_flags |= URB_ZERO_PACKET; +