[PATCH 3/3] [PATCH 3/3] ramips: add support for Dragonglass DGR7

Ivan Lee ivanlee2014 at 163.com
Sat Jun 20 01:35:05 PDT 2026


From 8caba6e68210b46b93b42c88cb3b1b6ae6273b07 Mon Sep 17 00:00:00 2001
From: Ivan Lee <ivanlee2014 at 163.com>
Date: Sat, 20 Jun 2026 15:45:00 +0800
Subject: [PATCH 3/3] ramips: add support for Dragonglass DGR7

Dragonglass DGR7 is an MT7621 based dual-band router.

Specifications:
- SoC: MediaTek MT7621A (880 MHz)
- RAM: 128 MB DDR2
- Flash: 16 MB SPI NOR (XM25QH128A)
- WiFi: MT7603E (2.4 GHz) + MT7612E (5 GHz, AC1200)
- Ethernet: 5x 1GbE via MT7530 DSA switch
  (port 0-3 = LAN, port 4 = WAN)
- LED: green status (GPIO 15, active low)
- Button: reset (GPIO 18, active low)
- Serial: 57600 8N1
- Flash layout: kernel uImage at 0xa0000

Installation:
- Boot the initramfs image over U-Boot TFTP
- Run sysupgrade with the squashfs sysupgrade image

The on-flash XM25QH128A needs the XMC SPI-NOR block protection
support added in the preceding commit so that sysupgrade is able
to erase the firmware partition.

Signed-off-by: Ivan Lee <ivanlee2014 at 163.com>
---
 .../uboot-tools/uboot-envtools/files/ramips   |   3 +-
 .../ramips/dts/mt7621_dragonglass_dgr7.dts    | 183 ++++++++++++++++++
 target/linux/ramips/image/mt7621.mk           |  15 ++
 .../mt7621/base-files/etc/board.d/02_network  |   3 +-
 4 files changed, 202 insertions(+), 2 deletions(-)
 create mode 100644 target/linux/ramips/dts/mt7621_dragonglass_dgr7.dts

diff --git a/package/boot/uboot-tools/uboot-envtools/files/ramips b/package/boot/uboot-tools/uboot-envtools/files/ramips
index 7fade5a173..7b218a54ac 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/ramips
+++ b/package/boot/uboot-tools/uboot-envtools/files/ramips
@@ -36,7 +36,8 @@ plasmacloud,pax1800-lite|\
 yuncore,ax820)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
 	;;
-dragonglass,dgx25)
+dragonglass,dgx25|\
+dragonglass,dgr7)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
 	;;
 dragonglass,dgx25-nand)
diff --git a/target/linux/ramips/dts/mt7621_dragonglass_dgr7.dts b/target/linux/ramips/dts/mt7621_dragonglass_dgr7.dts
new file mode 100644
index 0000000000..5827293665
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_dragonglass_dgr7.dts
@@ -0,0 +1,183 @@
+// 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 = "dragonglass,dgr7", "mediatek,mt7621-soc";
+	model = "Dragonglass DGR7";
+
+	aliases {
+		led-boot = &led_status;
+		led-failsafe = &led_status;
+		led-running = &led_status;
+		led-upgrade = &led_status;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,57600";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_status: status {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <50000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0 0x30000>;
+				read-only;
+			};
+
+			partition at 30000 {
+				label = "config";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "factory";
+				reg = <0x40000 0x10000>;
+				read-only;
+
+				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 = "permanent_config";
+				reg = <0x50000 0x50000>;
+				read-only;
+			};
+
+			partition at a0000 {
+				label = "firmware";
+				reg = <0xa0000 0x760000>;
+				compatible = "denx,uimage";
+			};
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&eeprom_factory_8000>;
+		nvmem-cell-names = "eeprom";
+	};
+};
+
+&pcie1 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&eeprom_factory_0>;
+		nvmem-cell-names = "eeprom";
+	};
+};
+
+&gmac0 {
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+	status = "okay";
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "lan1";
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "lan2";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan3";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan4";
+		};
+
+		port at 4 {
+			status = "okay";
+			label = "wan";
+			nvmem-cells = <&macaddr_factory_e006>;
+			nvmem-cell-names = "mac-address";
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "i2c", "uart2", "uart3", "jtag", "wdt";
+		function = "gpio";
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 6331ad9940..ee5a849b10 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1189,6 +1189,21 @@ define Device/dragonglass_dgx25-nand
 endef
 TARGET_DEVICES += dragonglass_dgx25-nand
 
+define Device/dragonglass_dgr7
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := Dragonglass
+  DEVICE_MODEL := DGR7
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2
+  KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
+  IMAGE_SIZE := 7552k
+  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
+	check-size | append-metadata
+  IMAGE/factory.bin := $$(KERNEL) | pad-to $$(IMAGE_SIZE)
+  SUPPORTED_DEVICES += dragonglass,dgr7
+endef
+TARGET_DEVICES += dragonglass_dgr7
+
 define Device/dual-q_h721
   $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
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 30827c9a4d..61887f43c7 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
@@ -197,7 +197,8 @@ ramips_setup_interfaces()
 		ucidef_set_interfaces_lan_wan "lan3 lan2 lan1" "wan"
 		;;
 	dragonglass,dgx25|\
-	dragonglass,dgx25-nand)
+	dragonglass,dgx25-nand|\
+	dragonglass,dgr7)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
 		;;
 	*)
-- 
2.25.1



More information about the openwrt-devel mailing list