]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ramips: mt7621: add support for Maginon MC-1200AC 17671/head
authorSimon Etzlstorfer <simon@etzi.at>
Mon, 10 Mar 2025 16:25:42 +0000 (17:25 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 16 Mar 2025 17:24:08 +0000 (18:24 +0100)
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@etzi.at>
Link: https://github.com/openwrt/openwrt/pull/17671
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/ramips/dts/mt7621_maginon_mc-1200ac.dts [new file with mode: 0644]
target/linux/ramips/image/mt7621.mk
target/linux/ramips/mt7621/base-files/etc/board.d/02_network

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 (file)
index 0000000..4f8a90b
--- /dev/null
@@ -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@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@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@0 {
+                       status = "okay";
+                       label = "lan";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       nvmem-cells = <&macaddr_factory_e006>;
+                       nvmem-cell-names = "mac-address";
+               };
+       };
+};
+
+&spi0 {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <25000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "Bootloader";
+                               reg = <0x00 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "Config";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@40000 {
+                               label = "Factory";
+                               reg = <0x40000 0x10000>;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_factory_0: eeprom@0 {
+                                               reg = <0x0 0x400>;
+                                       };
+
+                                       eeprom_factory_8000: eeprom@8000 {
+                                               reg = <0x8000 0x4da8>;
+                                       };
+
+                                       macaddr_factory_e000: macaddr@e000 {
+                                               reg = <0xe000 0x6>;
+                                       };
+
+                                       macaddr_factory_e006: macaddr@e006 {
+                                               reg = <0xe006 0x6>;
+                                       };
+                               };
+                       };
+
+                       partition@50000 {
+                               label = "firmware";
+                               reg = <0x50000 0xf30000>;
+                               compatible = "denx,fit";
+                       };
+
+                       partition@f80000 {
+                               label = "vendor";
+                               reg = <0xf80000 0x80000>;
+                       };
+               };
+       };
+};
+
+&state_default {
+       gpio {
+               groups = "jtag", "wdt";
+               function = "gpio";
+       };
+};
index a6ac4e39ac9d7be2fa80c4f252a45891e4b4d343..f957033db3814c181d65bfbe9652cb84e2c85cf9 100755 (executable)
@@ -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
index ab31beb4a8e14365d5e138be3ce13c2e492957f0..2a4d1e6ce35cbfa0534abf4597fca37c4f5fb99b 100644 (file)
@@ -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|\