diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 893b8e51c..a59d5fc8d 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -21,6 +21,8 @@
 #include <linux/gpio/consumer.h>
 #include <linux/gpio/driver.h>
 #include <net/dsa.h>
+#include <linux/debugfs.h>
+#include <linux/seq_file.h>
 
 #include "mt7530.h"
 
@@ -3257,6 +3259,124 @@ const struct mt753x_info mt753x_table[] = {
 };
 EXPORT_SYMBOL_GPL(mt753x_table);
 
+/* 原来的寄存器 dump 函数 */
+static void dump_ports_debug(struct mt7530_priv *priv, struct seq_file *s)
+{
+	int i;
+	u32 pmcr, pcr, pvc;
+
+	seq_puts(s, "==== MT753x Ports Debug Dump ====\n");
+
+	for (i = 0; i < MT7530_NUM_PORTS; i++) {
+		mutex_lock(&priv->reg_mutex);
+
+		printk("dump cmq priv=%lx %x\n", (unsigned long)priv, MT753X_PMCR_P(i));
+
+		pmcr = mt7530_read(priv, MT753X_PMCR_P(i));
+		pcr  = mt7530_read(priv, MT7530_PCR_P(i));
+		pvc  = mt7530_read(priv, MT7530_PVC_P(i));
+
+		mutex_unlock(&priv->reg_mutex);
+
+		seq_printf(s, "Port %d: PMCR(0x%08x)=0x%08x, PCR(0x%08x)=0x%08x, PVC(0x%08x)=0x%08x\n",
+			   i, MT753X_PMCR_P(i), pmcr, MT7530_PCR_P(i), pcr, MT7530_PVC_P(i), pvc);
+	}
+
+	seq_puts(s, "==== End of MT753x Ports Debug ====\n");
+}
+
+/* seq_file 接口 */
+static int ports_dump_show(struct seq_file *s, void *unused)
+{
+	struct mt7530_priv *priv = s->private;
+
+	dump_ports_debug(priv, s);
+	return 0;
+}
+
+static int ports_dump_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, ports_dump_show, inode->i_private);
+}
+
+static const struct file_operations ports_dump_fops = {
+	.owner   = THIS_MODULE,
+	.open    = ports_dump_open,
+	.read    = seq_read,
+	.llseek  = seq_lseek,
+	.release = single_release,
+};
+
+static u32 dbg_last_reg; /* 记录最近一次 echo 输入的寄存器地址 */
+
+/* 读：打印最近一次设置的寄存器值 */
+static ssize_t reg_access_read(struct file *file, char __user *buf,
+                               size_t count, loff_t *ppos)
+{
+    struct mt7530_priv *priv = file->private_data;
+    char tmp[64];
+    u32 val;
+    int len;
+
+    if (*ppos > 0)
+        return 0;
+
+    mutex_lock(&priv->reg_mutex);
+    val = mt7530_read(priv, dbg_last_reg);
+    mutex_unlock(&priv->reg_mutex);
+
+    len = snprintf(tmp, sizeof(tmp),
+                   "reg[0x%08x] = 0x%08x\n", dbg_last_reg, val);
+
+    return simple_read_from_buffer(buf, count, ppos, tmp, len);
+}
+
+/* 写：支持 echo <reg> 或 echo <reg> <val> */
+static ssize_t reg_access_write(struct file *file, const char __user *buf,
+                                size_t count, loff_t *ppos)
+{
+    struct mt7530_priv *priv = file->private_data;
+    char kbuf[64];
+    unsigned int reg, val;
+    int ret;
+
+    if (count >= sizeof(kbuf))
+        return -EINVAL;
+
+    if (copy_from_user(kbuf, buf, count))
+        return -EFAULT;
+
+    kbuf[count] = '\0';
+
+    /* 两种格式: <reg> 或 <reg> <val> */
+    ret = sscanf(kbuf, "%x %x", &reg, &val);
+
+    if (ret == 1) {
+        dbg_last_reg = reg;
+        pr_info("mt753x: set debugfs reg = 0x%08x (read mode)\n", reg);
+    } else if (ret == 2) {
+        dbg_last_reg = reg;
+        mutex_lock(&priv->reg_mutex);
+        mt7530_write(priv, reg, val);
+        mutex_unlock(&priv->reg_mutex);
+        pr_info("mt753x: write reg 0x%08x = 0x%08x\n", reg, val);
+    } else {
+        return -EINVAL;
+    }
+
+    return count;
+}
+
+static const struct file_operations reg_access_fops = {
+    .owner   = THIS_MODULE,
+    .open    = simple_open,
+    .read    = reg_access_read,
+    .write   = reg_access_write,
+    .llseek  = default_llseek,
+};
+
+static struct dentry *dbgfs_dir = NULL;
+
 int
 mt7530_probe_common(struct mt7530_priv *priv)
 {
@@ -3284,6 +3404,17 @@ mt7530_probe_common(struct mt7530_priv *priv)
 	mutex_init(&priv->reg_mutex);
 	dev_set_drvdata(dev, priv);
 
+	if (!dbgfs_dir) {
+		dbgfs_dir = debugfs_create_dir("mt753x", NULL);
+		if (dbgfs_dir) {
+			printk("probe cmq priv=%lx\n", (unsigned long)priv);
+			debugfs_create_file("ports_dump", 0444, dbgfs_dir,
+					priv, &ports_dump_fops);
+			debugfs_create_file("reg_access", 0644, dbgfs_dir,
+					priv, &reg_access_fops);
+		}
+	}
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(mt7530_probe_common);
@@ -3291,6 +3422,11 @@ EXPORT_SYMBOL_GPL(mt7530_probe_common);
 void
 mt7530_remove_common(struct mt7530_priv *priv)
 {
+	if (dbgfs_dir) {
+		debugfs_remove_recursive(dbgfs_dir);
+		dbgfs_dir = NULL;
+	}
+
 	if (priv->irq)
 		mt7530_free_irq(priv);
 
