[PATCH] ramips: add support for Dragonglass DGR7
Ivan Lee
ivanlee2014 at 163.com
Fri Jun 12 23:30:42 PDT 2026
From 2b64df9fa1514bb59d1faf3dc1edb7557bde1630 Mon Sep 17 00:00:00 2001
From: Ivan Lee <ivanlee2014 at 163.com>
Date: Sat, 13 Jun 2026 14:27:54 +0800
Subject: [PATCH] ramips: add support for Dragonglass DGR7
Specifications:
- SoC: MediaTek MT7621A
- RAM: 128MB DDR3
- Flash: 16MB SPI NOR (Winbond W25Q128JV)
- WiFi: MT7603E (2.4GHz) + MT7612E (5GHz, AC1200)
- Ethernet: 4x LAN + 1x WAN (MT7530 DSA)
- LED: Green status LED (GPIO 15, active-low)
- Button: Reset (GPIO 18, active-low)
Signed-off-by: Ivan Lee <ivanlee2014 at 163.com>
---
.../uboot-tools/uboot-envtools/files/ramips | 3 +-
.../ramips/dts/mt7621_dragonglass_dgr7.dts | 174 ++++++++++++++++++
target/linux/ramips/image/mt7621.mk | 13 ++
.../mt7621/base-files/etc/board.d/02_network | 3 +-
.../mt7621/base-files/lib/upgrade/platform.sh | 3 +-
5 files changed, 193 insertions(+), 3 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..a7e3b52b2b
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_dragonglass_dgr7.dts
@@ -0,0 +1,174 @@
+// 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,115200";
+ };
+
+ 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 {
+ compatible = "mac-base";
+ reg = <0xe000 0x6>;
+ #nvmem-cell-cells = <1>;
+ };
+ };
+ };
+
+ partition at 50000 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+};
+
+&pcie0 {
+ wifi at 0,0 {
+ compatible = "mediatek,mt76";
+ reg = <0x0000 0 0 0 0>;
+ nvmem-cells = <&eeprom_factory_0>;
+ nvmem-cell-names = "eeprom";
+ };
+};
+
+&pcie1 {
+ wifi at 0,0 {
+ compatible = "mediatek,mt76";
+ reg = <0x0000 0 0 0 0>;
+ nvmem-cells = <&eeprom_factory_8000>;
+ nvmem-cell-names = "eeprom";
+ };
+};
+
+&gmac0 {
+ nvmem-cells = <&macaddr_factory_e000 0>;
+ nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+ status = "okay";
+ label = "wan";
+ phy-handle = <ðphy0>;
+
+ nvmem-cells = <&macaddr_factory_e000 1>;
+ nvmem-cell-names = "mac-address";
+};
+
+ðphy0 {
+ /delete-property/ interrupts;
+};
+
+&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";
+ };
+ };
+};
+
+&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..ea9f175615 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1189,6 +1189,19 @@ 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 | pad-to 64k
+ IMAGE_SIZE := 7872k
+ IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+ 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"
;;
*)
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index 608603774c..f7e41de272 100644
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -165,7 +165,8 @@ platform_do_upgrade() {
dragonglass,dgx25-nand)
nand_do_upgrade "$1"
;;
- dragonglass,dgx25)
+ dragonglass,dgx25|\
+ dragonglass,dgr7)
# NOR SPI flash: extract kernel+root from sysupgrade tar
# and pipe to mtd (default_do_upgrade not available in initramfs)
local board_dir=$(tar tf "$1" | grep -m 1 '^sysupgrade-.*/$')
--
2.25.1
More information about the openwrt-devel
mailing list