[openwrt/openwrt] ramips: mt7621: add support for Maginon MC-1200AC

LEDE Commits lede-commits at lists.infradead.org
Sun Mar 16 10:26:15 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/06142cc1e72b9cc0d8474e614a28aef474e8141c

commit 06142cc1e72b9cc0d8474e614a28aef474e8141c
Author: Simon Etzlstorfer <simon at etzi.at>
AuthorDate: Mon Mar 10 17:25:42 2025 +0100

    ramips: mt7621: add support for Maginon MC-1200AC
    
    This commit adds support for Maginon MC-1200AC.
    
    Hardware specifications:
    
    SoC: MediaTek MT7621
    Flash: 16 MB SPI Flash
    RAM: 128 MB RAM
    Ethernet:
    2x 1G RJ45 ports
    WLAN:
    2.4GHz: MediaTek MT7603E
    5GHz: MediaTek MT7613BE
    LEDs: Red and blue status lights
    Power: 12V DC
    UART: 3.3V, 115200 baud, 8N1, like printed on silkscreen (GND,TX,RX,3.3V)
    
    MAC addresses
    -------------
    +---------+-------------------+
    |         | MAC example       |
    +---------+-------------------+
    | LAN     | 80:3F:5D:xx:xx:72 |
    | WAN     | 80:3F:5D:xx:xx:73 |
    | WLAN 2g | 80:3F:5D:xx:xx:74 |
    | WLAN 5g | 80:3F:5D:xx:xx:75 |
    +---------+-------------------+
    
    Installation:
    
    The firmware can be flashed via the U-Boot recovery web interface.
    To access it, hold the reset button while powering on the device.
    U-Boot recovery web interface is then avaiable at 192.168.10.1.
    
    Alternatively, the image can be loaded using the U-Boot serial interface and TFTP.
    
    Signed-off-by: Simon Etzlstorfer <simon at etzi.at>
    Link: https://github.com/openwrt/openwrt/pull/17671
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../linux/ramips/dts/mt7621_maginon_mc-1200ac.dts  | 180 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  14 ++
 .../mt7621/base-files/etc/board.d/02_network       |   1 +
 3 files changed, 195 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_maginon_mc-1200ac.dts b/target/linux/ramips/dts/mt7621_maginon_mc-1200ac.dts
new file mode 100644
index 0000000000..4f8a90ba6e
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_maginon_mc-1200ac.dts
@@ -0,0 +1,180 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	compatible = "maginon,mc-1200ac", "mediatek,mt7621-soc";
+	model = "Maginon MC-1200AC";
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8";
+	};
+
+	aliases {
+		led-running = &led_blue_top;
+		led-boot = &led_red_top;
+		led-failsafe = &led_red_top;
+		led-upgrade = &led_red_top;
+		label-mac-device = &gmac0;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_blue_top: led_blue {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_red_top: led_red {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+			label = "reset";
+		};
+
+		touch {
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_0>;
+			label = "touch";
+		};
+
+		pair {
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_1>;
+			label = "pair";
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		ieee80211-freq-limit = <2400000 2500000>;
+		nvmem-cells = <&eeprom_factory_0>;
+		nvmem-cell-names = "eeprom";
+	};
+};
+
+&pcie1 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		ieee80211-freq-limit = <5000000 6000000>;
+		nvmem-cells = <&eeprom_factory_8000>;
+		nvmem-cell-names = "eeprom";
+	};
+};
+
+&gmac0 {
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "lan";
+		};
+
+		port at 4 {
+			status = "okay";
+			label = "wan";
+			nvmem-cells = <&macaddr_factory_e006>;
+			nvmem-cell-names = "mac-address";
+		};
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <25000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "Bootloader";
+				reg = <0x00 0x30000>;
+				read-only;
+			};
+
+			partition at 30000 {
+				label = "Config";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "Factory";
+				reg = <0x40000 0x10000>;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					eeprom_factory_0: eeprom at 0 {
+						reg = <0x0 0x400>;
+					};
+
+					eeprom_factory_8000: eeprom at 8000 {
+						reg = <0x8000 0x4da8>;
+					};
+
+					macaddr_factory_e000: macaddr at e000 {
+						reg = <0xe000 0x6>;
+					};
+
+					macaddr_factory_e006: macaddr at e006 {
+						reg = <0xe006 0x6>;
+					};
+				};
+			};
+
+			partition at 50000 {
+				label = "firmware";
+				reg = <0x50000 0xf30000>;
+				compatible = "denx,fit";
+			};
+
+			partition at f80000 {
+				label = "vendor";
+				reg = <0xf80000 0x80000>;
+			};
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "jtag", "wdt";
+		function = "gpio";
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index a6ac4e39ac..f957033db3 100755
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1984,6 +1984,20 @@ define Device/linksys_re7000
 endef
 TARGET_DEVICES += linksys_re7000
 
+define Device/maginon_mc-1200ac
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := Maginon
+  DEVICE_MODEL := MC-1200AC
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap kmod-usb3 -uboot-envtools
+  KERNEL_LOADADDR := 0x82000000
+  KERNEL := kernel-bin | relocate-kernel $(loadaddr-y) | lzma | \
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
+  IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+	append-rootfs | pad-rootfs | check-size | append-metadata
+  IMAGE_SIZE := 15552k
+endef
+TARGET_DEVICES += maginon_mc-1200ac
+
 define Device/mediatek_ap-mt7621a-v60
   $(Device/dsa-migration)
   IMAGE_SIZE := 7872k
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index ab31beb4a8..2a4d1e6ce3 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -76,6 +76,7 @@ ramips_setup_interfaces()
 	genexis,pulse-ex400|\
 	humax,e10|\
 	keenetic,kn-3510|\
+	maginon,mc-1200ac|\
 	meig,slt866|\
 	openfi,5pro|\
 	wavlink,ws-wn572hp3-4g|\




More information about the lede-commits mailing list