Skip to content

Commit

Permalink
realtek: Create 4 different Realtek Platforms
Browse files Browse the repository at this point in the history
Creates RTL83XX as a basic kernel config parameter for the
RTL838X, RTL839x, RTL930X and RTL931X platforms with respective
configurations for the SoCs, which are introduced in addition.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
  • Loading branch information
Birger Koblitz authored and dangowrt committed Feb 17, 2022
1 parent 0d7cace commit fce11f6
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 19 deletions.
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
config NET_DSA_RTL83XX
tristate "Realtek RTL838x/RTL839x switch support"
depends on RTL838X
depends on RTL83XX
select NET_DSA_TAG_TRAILER
help
This driver adds support for Realtek RTL83xx series switching.
Expand Down
Expand Up @@ -4,25 +4,24 @@
platform-$(CONFIG_MACH_PISTACHIO) += pistachio/
platform-$(CONFIG_RALINK) += ralink/
platform-$(CONFIG_MIKROTIK_RB532) += rb532/
+platform-$(CONFIG_RTL838X) += rtl838x/
+platform-$(CONFIG_RTL83XX) += rtl838x/
platform-$(CONFIG_SGI_IP22) += sgi-ip22/
platform-$(CONFIG_SGI_IP27) += sgi-ip27/
platform-$(CONFIG_SGI_IP28) += sgi-ip22/
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -632,6 +632,26 @@ config RALINK
select ARCH_HAS_RESET_CONTROLLER
select RESET_CONTROLLER
@@ -1037,8 +1037,58 @@ config NLM_XLP_BOARD
This board is based on Netlogic XLP Processor.
Say Y here if you have a XLP based board.

+config RTL838X
+config RTL83XX
+ bool "Realtek based platforms"
+ select DMA_NONCOHERENT
+ select IRQ_MIPS_CPU
+ select CSRC_R4K
+ select CEVT_R4K
+ select SYS_HAS_CPU_MIPS32_R1
+ select SYS_HAS_CPU_MIPS32_R2
+ select SYS_SUPPORTS_BIG_ENDIAN
+ select SYS_SUPPORTS_HIGHMEM
+ select SYS_SUPPORTS_32BIT_KERNEL
+ select SYS_SUPPORTS_MIPS16
+ select SYS_HAS_EARLY_PRINTK
Expand All @@ -34,6 +33,49 @@
+ select RESET_CONTROLLER
+ select USE_OF
+
config SGI_IP22
bool "SGI IP22 (Indy/Indigo2)"
select ARC_MEMORY
endchoice

+config RTL838X
+ bool "Realtek RTL838X based platforms"
+ depends on RTL83XX
+ select CSRC_R4K
+ select CEVT_R4K
+
+config RTL839X
+ bool "Realtek RTL839X based platforms"
+ depends on RTL83XX
+ select CSRC_R4K
+ select CEVT_R4K
+ select SYS_SUPPORTS_MULTITHREADING
+
+config RTL930X
+ bool "Realtek RTL839X based platforms"
+ depends on RTL83XX
+ select MIPS_CPU_SCACHE
+ select CSRC_R4K
+ select CEVT_RTL9300
+ select SYS_SUPPORTS_MULTITHREADING
+
+config RTL931X
+ bool "Realtek RTL931X based platforms"
+ depends on RTL930X
+ select MIPS_GIC
+ select COMMON_CLK
+ select CLKSRC_MIPS_GIC
+ select SYS_SUPPORTS_VPE_LOADER
+ select SYS_SUPPORTS_SMP
+ select SYS_SUPPORTS_MIPS_CPS
+
source "arch/mips/alchemy/Kconfig"
source "arch/mips/ath25/Kconfig"
source "arch/mips/ath79/Kconfig"
@@ -1097,6 +1147,9 @@ config CEVT_GT641XX
config CEVT_R4K
bool

+config CEVT_RTL9300
+ bool
+
config CEVT_SB1250
bool

Expand Up @@ -6,7 +6,7 @@

+config GPIO_RTL8231
+ tristate "RTL8231 GPIO"
+ depends on RTL838X
+ depends on RTL83XX
+ help
+ Say yes here to support Realtek RTL8231 GPIO expansion chips.
+
Expand Down
Expand Up @@ -6,7 +6,7 @@
tristate "Realtek Otto GPIO support"
- depends on MACH_REALTEK_RTL
- default MACH_REALTEK_RTL
+ depends on RTL838X
+ depends on RTL83XX
+ default RTL838X
select GPIO_GENERIC
select GPIOLIB_IRQCHIP
Expand Down
Expand Up @@ -5,7 +5,7 @@
obj-$(CONFIG_SPI_ROCKCHIP) += spi-rockchip.o
obj-$(CONFIG_SPI_RB4XX) += spi-rb4xx.o
-obj-$(CONFIG_MACH_REALTEK_RTL) += spi-realtek-rtl.o
+obj-$(CONFIG_RTL838X) += spi-realtek-rtl.o
+obj-$(CONFIG_RTL83XX) += spi-realtek-rtl.o
obj-$(CONFIG_SPI_RPCIF) += spi-rpc-if.o
obj-$(CONFIG_SPI_RSPI) += spi-rspi.o
obj-$(CONFIG_SPI_S3C24XX) += spi-s3c24xx-hw.o
Expand Up @@ -5,4 +5,4 @@
obj-$(CONFIG_MST_IRQ) += irq-mst-intc.o
obj-$(CONFIG_SL28CPLD_INTC) += irq-sl28cpld.o
-obj-$(CONFIG_MACH_REALTEK_RTL) += irq-realtek-rtl.o
+obj-$(CONFIG_RTL838X) += irq-realtek-rtl.o
+obj-$(CONFIG_RTL83XX) += irq-realtek-rtl.o
Expand Up @@ -5,11 +5,11 @@
config REALTEK_OTTO_WDT
tristate "Realtek Otto MIPS watchdog support"
- depends on MACH_REALTEK_RTL || COMPILE_TEST
+ depends on RTL838X
+ depends on RTL83XX
depends on COMMON_CLK
select WATCHDOG_CORE
- default MACH_REALTEK_RTL
+ default RTL838X
+ default RTL83XX
help
Say Y here to include support for the watchdog timer on Realtek
RTL838x, RTL839x, RTL930x SoCs. This watchdog has pretimeout
Expand Up @@ -7,7 +7,7 @@
+
+config NET_RTL838X
+ tristate "Realtek rtl838x Ethernet MAC support"
+ depends on RTL838X
+ depends on RTL83XX
+ help
+ Say Y here if you want to use the Realtek rtl838x Gbps Ethernet MAC.
+
Expand Down
2 changes: 1 addition & 1 deletion target/linux/realtek/patches-5.10/705-add-rtl-phy.patch
Expand Up @@ -6,7 +6,7 @@

+config REALTEK_SOC_PHY
+ tristate "Realtek SoC PHYs"
+ depends on RTL838X
+ depends on RTL83XX
+ help
+ Supports the PHYs found in combination with Realtek Switch SoCs
+
Expand Down
4 changes: 4 additions & 0 deletions target/linux/realtek/rtl838x/config-5.10
Expand Up @@ -168,7 +168,11 @@ CONFIG_REALTEK_SOC_PHY=y
CONFIG_REGMAP=y
CONFIG_REGMAP_MMIO=y
CONFIG_RESET_CONTROLLER=y
CONFIG_RTL83XX=y
CONFIG_RTL838X=y
# CONFIG_RTL839X is not set
# CONFIG_RTL930X is not set
# CONFIG_RTL931X is not set
CONFIG_RTL9300_TIMER=y
CONFIG_SERIAL_MCTRL_GPIO=y
CONFIG_SERIAL_OF_PLATFORM=y
Expand Down

0 comments on commit fce11f6

Please sign in to comment.