diff --git a/target/linux/realtek/patches-6.12/308-tune-switch-4kec.patch b/target/linux/realtek/patches-6.12/308-tune-switch-4kec.patch new file mode 100644 index 0000000000..87cd76d462 --- /dev/null +++ b/target/linux/realtek/patches-6.12/308-tune-switch-4kec.patch @@ -0,0 +1,24 @@ +From: Markus Stockhausen +Date: Fri, 13 Jun 2025 20:25:37 +0100 +Subject: [PATCH] realtek: set mtune 4kec for RTL838x targets + +Generic patches will always force the gcc kernel tuning to 34kc. With RTL838x +being only 4kec this does not harm but is not right. Match the tuning properly. + +Signed-off-by: Markus Stockhausen +--- + +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -164,6 +164,11 @@ cflags-$(CONFIG_CPU_R4X00) += $(call cc- + cflags-$(CONFIG_CPU_TX49XX) += $(call cc-option,-march=r4600,-march=mips3) -Wa,--trap + cflags-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,--trap + cflags-$(CONFIG_CPU_MIPS32_R2) += -march=mips32r2 -mtune=34kc -Wa,--trap ++ ++#ifdef CONFIG_RTL838X ++cflags-$(CONFIG_CPU_MIPS32_R2) := $(subst 34kc,4kec,$(cflags-$(CONFIG_CPU_MIPS32_R2))) ++#endif ++ + cflags-$(CONFIG_CPU_MIPS32_R5) += -march=mips32r5 -Wa,--trap -modd-spreg + cflags-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,--trap -modd-spreg + cflags-$(CONFIG_CPU_MIPS64_R1) += -march=mips64 -Wa,--trap diff --git a/target/linux/realtek/rtl838x/target.mk b/target/linux/realtek/rtl838x/target.mk index e776676f66..508298c327 100644 --- a/target/linux/realtek/rtl838x/target.mk +++ b/target/linux/realtek/rtl838x/target.mk @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only ARCH:=mips SUBTARGET:=rtl838x -CPU_TYPE:=4kec +CPU_TYPE:=24kc BOARD:=realtek BOARDNAME:=Realtek MIPS RTL838X