[openwrt/openwrt] realtek: rtl931x: Sync family parameters with RTL930x

LEDE Commits lede-commits at lists.infradead.org
Thu Aug 7 09:42:02 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/56499702a3c8a0057568ea69442a53de80386fad

commit 56499702a3c8a0057568ea69442a53de80386fad
Author: Harshal Gohel <hg at simonwunderlich.de>
AuthorDate: Mon Jul 14 11:11:47 2025 +0200

    realtek: rtl931x: Sync family parameters with RTL930x
    
    Some of the parameters added to RTL9300_FAMILY_ID are missing for
    RTL9310_FAMILY_ID. Simply add the missing ones to keep sharing code between
    the two SoCs.
    
    Signed-off-by: Harshal Gohel <hg at simonwunderlich.de>
    Signed-off-by: Sharadanand Karanjkar <sk at simonwunderlich.de>
    Link: https://github.com/openwrt/openwrt/pull/19574
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c  | 10 ++++++++++
 .../linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h |  1 +
 2 files changed, 11 insertions(+)

diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
index 069faf7ed9..2dd93de552 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
@@ -1536,6 +1536,9 @@ static int __init rtl83xx_sw_probe(struct platform_device *pdev)
 		priv->r = &rtl930x_reg;
 		priv->ds->num_ports = 29;
 		priv->fib_entries = 16384;
+		/* TODO A version based on CHIP_INFO and MODEL_NAME_INFO should
+		 * be constructed. For now, just set it to a static 'A'
+		 */
 		priv->version = RTL8390_VERSION_A;
 		priv->n_lags = 16;
 		sw_w32(1, RTL930X_ST_CTRL);
@@ -1553,9 +1556,16 @@ static int __init rtl83xx_sw_probe(struct platform_device *pdev)
 		priv->r = &rtl931x_reg;
 		priv->ds->num_ports = 57;
 		priv->fib_entries = 16384;
+		/* TODO A version based on CHIP_INFO and MODEL_NAME_INFO should
+		 * be constructed. For now, just set it to a static 'A'
+		 */
 		priv->version = RTL8390_VERSION_A;
 		priv->n_lags = 16;
+		sw_w32(1, RTL931x_ST_CTRL);
 		priv->l2_bucket_size = 8;
+		priv->n_pie_blocks = 16;
+		priv->port_ignore = 0x3f;
+		priv->n_counters = 2048;
 		break;
 	}
 	pr_debug("Chip version %c\n", priv->version);
diff --git a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
index 18405bdc02..b8f543bd9e 100644
--- a/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
+++ b/target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h
@@ -276,6 +276,7 @@
 #define MV_ACT_COPY2CPU				3
 
 #define RTL930X_ST_CTRL				(0x8798)
+#define RTL931x_ST_CTRL				(0x8000)
 
 #define RTL930X_L2_PORT_SABLK_CTRL		(0x905c)
 #define RTL930X_L2_PORT_DABLK_CTRL		(0x9060)




More information about the lede-commits mailing list