[openwrt/openwrt] realtek: add NAND targets for RTL93xx

LEDE Commits lede-commits at lists.infradead.org
Sun Aug 10 02:46:57 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7cf7f7c6b9091cd70024ee8cf680b970a21bf91c

commit 7cf7f7c6b9091cd70024ee8cf680b970a21bf91c
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Thu Aug 7 02:11:51 2025 -0400

    realtek: add NAND targets for RTL93xx
    
    Some known RTL93xx devices like the Linksys LGS328C or LGS352C are
    NAND based. These require additional drivers and packages (e.g. UBI).
    The current subtargets are already taylored down for devices with
    only 16MB flash. Adding features that are not used will only make
    the storage situation more complicated.
    
    Add two new subtargets for RTL93xx that include the basic NAND, UBI
    and MTD features. To achieve this do the following:
    
    - Create new subtarget folders
    - Copy the existing config and makefiles over
    - Add the basic additional features
    - Mark them as SOURCE-ONLY
    - Add empty image makefiles
    - Remove unneded NAND/MTD features from existing configs
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/19700
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/realtek/Makefile                              |  4 ++--
 target/linux/realtek/image/rtl930x_nand.mk                 |  1 +
 target/linux/realtek/image/rtl931x_nand.mk                 |  1 +
 target/linux/realtek/rtl930x/config-6.12                   |  4 ++--
 target/linux/realtek/{rtl930x => rtl930x_nand}/config-6.12 |  5 +++++
 target/linux/realtek/rtl930x_nand/target.mk                | 11 +++++++++++
 target/linux/realtek/rtl931x/config-6.12                   |  4 ++--
 target/linux/realtek/{rtl931x => rtl931x_nand}/config-6.12 |  5 +++++
 target/linux/realtek/rtl931x_nand/target.mk                | 11 +++++++++++
 9 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/target/linux/realtek/Makefile b/target/linux/realtek/Makefile
index 5cd62e7c04..c9bfb880a3 100644
--- a/target/linux/realtek/Makefile
+++ b/target/linux/realtek/Makefile
@@ -7,12 +7,12 @@ BOARD:=realtek
 BOARDNAME:=Realtek MIPS
 DEVICE_TYPE:=basic
 FEATURES:=ramdisk squashfs
-SUBTARGETS:=rtl838x rtl839x rtl930x rtl931x
+SUBTARGETS:=rtl838x rtl839x rtl930x rtl930x_nand rtl931x rtl931x_nand
 
 KERNEL_PATCHVER:=6.12
 
 define Target/Description
-	Build firmware images for Realtek RTL83xx based boards.
+	Build firmware images for Realtek RTL83xx/RTL93xx based boards.
 endef
 
 include $(INCLUDE_DIR)/target.mk
diff --git a/target/linux/realtek/image/rtl930x_nand.mk b/target/linux/realtek/image/rtl930x_nand.mk
new file mode 100644
index 0000000000..a4e40e534e
--- /dev/null
+++ b/target/linux/realtek/image/rtl930x_nand.mk
@@ -0,0 +1 @@
+# SPDX-License-Identifier: GPL-2.0-only
diff --git a/target/linux/realtek/image/rtl931x_nand.mk b/target/linux/realtek/image/rtl931x_nand.mk
new file mode 100644
index 0000000000..a4e40e534e
--- /dev/null
+++ b/target/linux/realtek/image/rtl931x_nand.mk
@@ -0,0 +1 @@
+# SPDX-License-Identifier: GPL-2.0-only
diff --git a/target/linux/realtek/rtl930x/config-6.12 b/target/linux/realtek/rtl930x/config-6.12
index 76f1907503..47779f151d 100644
--- a/target/linux/realtek/rtl930x/config-6.12
+++ b/target/linux/realtek/rtl930x/config-6.12
@@ -143,7 +143,7 @@ CONFIG_MTD_CFI_ADV_OPTIONS=y
 CONFIG_MTD_CFI_GEOMETRY=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_JEDECPROBE=y
-CONFIG_MTD_SPI_NAND=y
+# CONFIG_MTD_SPI_NAND is not set
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_BRNIMAGE_FW=y
 CONFIG_MTD_SPLIT_EVA_FW=y
@@ -219,7 +219,7 @@ CONFIG_SMP_UP=y
 CONFIG_SPI=y
 CONFIG_SPI_MASTER=y
 CONFIG_SPI_MEM=y
-CONFIG_SPI_REALTEK_SNAND=y
+# CONFIG_SPI_REALTEK_SNAND is not set
 CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
 CONFIG_SWPHY=y
 CONFIG_SYNC_R4K=y
diff --git a/target/linux/realtek/rtl930x/config-6.12 b/target/linux/realtek/rtl930x_nand/config-6.12
similarity index 98%
copy from target/linux/realtek/rtl930x/config-6.12
copy to target/linux/realtek/rtl930x_nand/config-6.12
index 76f1907503..0f4294ac30 100644
--- a/target/linux/realtek/rtl930x/config-6.12
+++ b/target/linux/realtek/rtl930x_nand/config-6.12
@@ -150,6 +150,10 @@ CONFIG_MTD_SPLIT_EVA_FW=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_TPLINK_FW=y
 CONFIG_MTD_SPLIT_UIMAGE_FW=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+CONFIG_MTD_UBI_BLOCK=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NET_DEVLINK=y
@@ -248,6 +252,7 @@ CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_TIMER_OF=y
 CONFIG_TIMER_PROBE=y
 CONFIG_TINY_SRCU=y
+CONFIG_UBIFS_FS=y
 CONFIG_USE_GENERIC_EARLY_PRINTK_8250=y
 CONFIG_USE_OF=y
 CONFIG_WATCHDOG_CORE=y
diff --git a/target/linux/realtek/rtl930x_nand/target.mk b/target/linux/realtek/rtl930x_nand/target.mk
new file mode 100644
index 0000000000..2ca02dd28d
--- /dev/null
+++ b/target/linux/realtek/rtl930x_nand/target.mk
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0-only
+ARCH:=mips
+SUBTARGET:=rtl930x_nand
+CPU_TYPE:=24kc
+BOARD:=realtek
+BOARDNAME:=Realtek MIPS RTL930X (NAND)
+FEATURES+=nand source-only
+
+define Target/Description
+	Build firmware images for Realtek RTL930x based boards.
+endef
diff --git a/target/linux/realtek/rtl931x/config-6.12 b/target/linux/realtek/rtl931x/config-6.12
index 8d2a3553b4..5762ca139d 100644
--- a/target/linux/realtek/rtl931x/config-6.12
+++ b/target/linux/realtek/rtl931x/config-6.12
@@ -153,7 +153,7 @@ CONFIG_MTD_CFI_ADV_OPTIONS=y
 CONFIG_MTD_CFI_GEOMETRY=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_JEDECPROBE=y
-CONFIG_MTD_SPI_NAND=y
+# CONFIG_MTD_SPI_NAND is not set
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_BRNIMAGE_FW=y
 CONFIG_MTD_SPLIT_EVA_FW=y
@@ -228,7 +228,7 @@ CONFIG_SOCK_RX_QUEUE_MAPPING=y
 CONFIG_SPI=y
 CONFIG_SPI_MASTER=y
 CONFIG_SPI_MEM=y
-CONFIG_SPI_REALTEK_SNAND=y
+# CONFIG_SPI_REALTEK_SNAND is not set
 CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
 CONFIG_SWPHY=y
 CONFIG_SYNC_R4K=y
diff --git a/target/linux/realtek/rtl931x/config-6.12 b/target/linux/realtek/rtl931x_nand/config-6.12
similarity index 98%
copy from target/linux/realtek/rtl931x/config-6.12
copy to target/linux/realtek/rtl931x_nand/config-6.12
index 8d2a3553b4..df7505522a 100644
--- a/target/linux/realtek/rtl931x/config-6.12
+++ b/target/linux/realtek/rtl931x_nand/config-6.12
@@ -160,6 +160,10 @@ CONFIG_MTD_SPLIT_EVA_FW=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_TPLINK_FW=y
 CONFIG_MTD_SPLIT_UIMAGE_FW=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+CONFIG_MTD_UBI_BLOCK=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_SRCU_NMI_SAFE=y
 CONFIG_NET_DEVLINK=y
@@ -253,6 +257,7 @@ CONFIG_TIMER_OF=y
 CONFIG_TIMER_PROBE=y
 CONFIG_TREE_RCU=y
 CONFIG_TREE_SRCU=y
+CONFIG_UBIFS_FS=y
 CONFIG_USE_GENERIC_EARLY_PRINTK_8250=y
 CONFIG_USE_OF=y
 CONFIG_WATCHDOG_CORE=y
diff --git a/target/linux/realtek/rtl931x_nand/target.mk b/target/linux/realtek/rtl931x_nand/target.mk
new file mode 100644
index 0000000000..ba2c3f2b8d
--- /dev/null
+++ b/target/linux/realtek/rtl931x_nand/target.mk
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0-only
+ARCH:=mips
+SUBTARGET:=rtl931x_nand
+CPU_TYPE:=24kc
+BOARD:=realtek
+BOARDNAME:=Realtek MIPS RTL931X (NAND)
+FEATURES+=nand source-only
+
+define Target/Description
+	Build firmware images for Realtek RTL931x based boards.
+endef




More information about the lede-commits mailing list