[openwrt/openwrt] ramips: add support for Cudy WR1300 v2

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 12 09:30:21 PST 2022


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/62efb34071cff2e15bff85b00040520dad7d6097

commit 62efb34071cff2e15bff85b00040520dad7d6097
Author: Óscar García Amor <ogarcia at connectical.com>
AuthorDate: Tue Sep 20 13:24:43 2022 +0200

    ramips: add support for Cudy WR1300 v2
    
    Specifications:
     - SoC: MediaTek MT7621AT
     - RAM: 128 MB (DDR3)
     - Flash: 16 MB (SPI NOR)
     - WiFi: MediaTek MT7603E, MediaTek MT7613BE
     - Switch: 1 WAN, 4 LAN (Gigabit)
     - Ports: 1 USB 3.0
     - Buttons: Reset, WPS
     - LEDs: System, Wan, Lan 1-4, WiFi 2.4G, WiFi 5G, WPS
     - Power: DC 12V 1A tip positive
    
    Download and flash the manufacturer's built OpenWRT image available at
    http://www.cudytech.com/openwrt_software_download
    Install the new OpenWRT image via luci (System -> Backup/Flash firmware)
    Be sure to NOT keep settings. The force upgrade may need to be checked
    due to differences in router naming conventions.
    
    Recovery:
     - Loads only signed manufacture firmware due to bootloader RSA verification
     - serve tftp-recovery image as /recovery.bin on 192.168.1.88/24
     - connect to any lan ethernet port
     - power on the device while holding the reset button
     - wait at least 8 seconds before releasing reset button for image to
       download
     - See http://www.cudytech.com/newsinfo/547425.html
    
    Signed-off-by: Óscar García Amor <ogarcia at connectical.com>
---
 ...1_cudy_wr1300.dts => mt7621_cudy_wr1300-v1.dts} |  4 +--
 ...1_cudy_wr1300.dts => mt7621_cudy_wr1300-v2.dts} | 34 +++++-----------------
 target/linux/ramips/image/mt7621.mk                | 17 +++++++++--
 3 files changed, 25 insertions(+), 30 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts
similarity index 97%
copy from target/linux/ramips/dts/mt7621_cudy_wr1300.dts
copy to target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts
index 2398612847..4062c46e3e 100644
--- a/target/linux/ramips/dts/mt7621_cudy_wr1300.dts
+++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts
@@ -6,8 +6,8 @@
 #include <dt-bindings/gpio/gpio.h>
 
 / {
-	compatible = "cudy,wr1300", "mediatek,mt7621-soc";
-	model = "Cudy WR1300";
+	compatible = "cudy,wr1300-v1", "mediatek,mt7621-soc";
+	model = "Cudy WR1300 v1";
 
 	aliases {
 		led-boot = &led_sys;
diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts
similarity index 83%
rename from target/linux/ramips/dts/mt7621_cudy_wr1300.dts
rename to target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts
index 2398612847..5c8b047e76 100644
--- a/target/linux/ramips/dts/mt7621_cudy_wr1300.dts
+++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts
@@ -6,8 +6,8 @@
 #include <dt-bindings/gpio/gpio.h>
 
 / {
-	compatible = "cudy,wr1300", "mediatek,mt7621-soc";
-	model = "Cudy WR1300";
+	compatible = "cudy,wr1300-v2", "mediatek,mt7621-soc";
+	model = "Cudy WR1300 v2";
 
 	aliases {
 		led-boot = &led_sys;
@@ -32,7 +32,7 @@
 
 		wps {
 			label = "wps";
-			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+			gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
 			linux,code = <KEY_WPS_BUTTON>;
 		};
 	};
@@ -42,14 +42,7 @@
 
 		led_sys: sys {
 			label = "green:sys";
-			gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
-		};
-
-		usb {
-			label = "green:usb";
-			gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
-			trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
-			linux,default-trigger = "usbport";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
 		};
 
 		wps {
@@ -122,35 +115,24 @@
 	status = "okay";
 };
 
-&pcie0 {
+&pcie1 {
 	wifi at 0,0 {
-		compatible = "pci14c3,7603";
+		compatible = "mediatek,mt76";
 		reg = <0x0000 0 0 0 0>;
 		mediatek,mtd-eeprom = <&factory 0x0000>;
 		nvmem-cells = <&macaddr_bdinfo_de00>;
 		nvmem-cell-names = "mac-address";
-		ieee80211-freq-limit = <2400000 2500000>;
-
-		led {
-			led-active-low;
-		};
 	};
 };
 
-&pcie1 {
+&pcie0 {
 	wifi at 0,0 {
-		compatible = "pci14c3,7662";
+		compatible = "mediatek,mt76";
 		reg = <0x0000 0 0 0 0>;
 		mediatek,mtd-eeprom = <&factory 0x8000>;
 		nvmem-cells = <&macaddr_bdinfo_de00>;
 		nvmem-cell-names = "mac-address";
 		mac-address-increment = <2>;
-		ieee80211-freq-limit = <5000000 6000000>;
-
-		led {
-			led-sources = <2>;
-			led-active-low;
-		};
 	};
 };
 
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 2e7d0689be..de10da7cb6 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -444,15 +444,28 @@ define Device/bolt_arion
 endef
 TARGET_DEVICES += bolt_arion
 
-define Device/cudy_wr1300
+define Device/cudy_wr1300-v1
   $(Device/dsa-migration)
   IMAGE_SIZE := 15872k
   DEVICE_VENDOR := Cudy
   DEVICE_MODEL := WR1300
+  DEVICE_VARIANT := v1
   DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb2 kmod-usb3 \
 	kmod-usb-ledtrig-usbport
+  SUPPORTED_DEVICES += cudy,wr1300 R10
+endef
+TARGET_DEVICES += cudy_wr1300-v1
+
+define Device/cudy_wr1300-v2
+  $(Device/dsa-migration)
+  IMAGE_SIZE := 15872k
+  DEVICE_VENDOR := Cudy
+  DEVICE_MODEL := WR1300
+  DEVICE_VARIANT := v2
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap
+  SUPPORTED_DEVICES += cudy,wr1300 R23
 endef
-TARGET_DEVICES += cudy_wr1300
+TARGET_DEVICES += cudy_wr1300-v2
 
 define Device/cudy_wr2100
   $(Device/dsa-migration)




More information about the lede-commits mailing list