]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
kernel: tune 24kc instead of 34kc for mips32r2 22703/head
authorShiji Yang <yangshiji66@outlook.com>
Tue, 31 Mar 2026 00:10:30 +0000 (08:10 +0800)
committerRobert Marko <robimarko@gmail.com>
Wed, 1 Apr 2026 12:05:56 +0000 (14:05 +0200)
GCC generates the same code for 24kc and 34kc. Since we have
converted all 34kc targets to the 24kc, it's better to switch
kernel -mtune to 24kc to avoid confusing developers.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/22703
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/generic/pending-6.12/308-mips32r2_tune.patch
target/linux/generic/pending-6.18/308-mips32r2_tune.patch
target/linux/realtek/patches-6.12/308-tune-switch-4kec.patch
target/linux/realtek/patches-6.18/308-tune-switch-4kec.patch

index b9bd6104a4265d9b277e3d00c9282b8f8a96ecd3..97c02cc1a8c61fa8781765fbcdbf25e8d5a213c0 100644 (file)
@@ -1,5 +1,5 @@
 From: Felix Fietkau <nbd@nbd.name>
-Subject: kernel: add -mtune=34kc to MIPS CFLAGS when building for mips32r2
+Subject: kernel: add -mtune=24kc to MIPS CFLAGS when building for mips32r2
 
 This provides a good tradeoff across at least 24Kc-74Kc, while also
 producing smaller code.
@@ -16,7 +16,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  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 -Wa,--trap
-+cflags-$(CONFIG_CPU_MIPS32_R2)        += -march=mips32r2 -mtune=34kc -Wa,--trap
++cflags-$(CONFIG_CPU_MIPS32_R2)        += -march=mips32r2 -mtune=24kc -Wa,--trap
  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
index 19a716c9de00024ad081a0bc4d7da1bbcfca20c5..b5af003c4c355fb8f278d68c2b87c1da2d3150ad 100644 (file)
@@ -1,5 +1,5 @@
 From: Felix Fietkau <nbd@nbd.name>
-Subject: kernel: add -mtune=34kc to MIPS CFLAGS when building for mips32r2
+Subject: kernel: add -mtune=24kc to MIPS CFLAGS when building for mips32r2
 
 This provides a good tradeoff across at least 24Kc-74Kc, while also
 producing smaller code.
@@ -16,7 +16,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  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 -Wa,--trap
-+cflags-$(CONFIG_CPU_MIPS32_R2)        += -march=mips32r2 -mtune=34kc -Wa,--trap
++cflags-$(CONFIG_CPU_MIPS32_R2)        += -march=mips32r2 -mtune=24kc -Wa,--trap
  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
index 87cd76d462880ac6125376eab7ba5490b50eb4c3..c474ad53bf4f3b17999b59db7f2642ddd61fb50d 100644 (file)
@@ -2,7 +2,7 @@ From: Markus Stockhausen <markus.stockhausen@gmx.de>
 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 
+Generic patches will always force the gcc kernel tuning to 24kc. With RTL838x 
 being only 4kec this does not harm but is not right. Match the tuning properly.
 
 Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
@@ -13,10 +13,10 @@ Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
 @@ -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
+ cflags-$(CONFIG_CPU_MIPS32_R2)        += -march=mips32r2 -mtune=24kc -Wa,--trap
 +
 +#ifdef CONFIG_RTL838X
-+cflags-$(CONFIG_CPU_MIPS32_R2) := $(subst 34kc,4kec,$(cflags-$(CONFIG_CPU_MIPS32_R2)))
++cflags-$(CONFIG_CPU_MIPS32_R2) := $(subst 24kc,4kec,$(cflags-$(CONFIG_CPU_MIPS32_R2)))
 +#endif
 +
  cflags-$(CONFIG_CPU_MIPS32_R5)        += -march=mips32r5 -Wa,--trap -modd-spreg
index f8cc4d7240785a7fbb54d094642013a8e34b404e..6422e9226223bdb21c4cf3df819f246097b64ee7 100644 (file)
@@ -2,7 +2,7 @@ From: Markus Stockhausen <markus.stockhausen@gmx.de>
 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 
+Generic patches will always force the gcc kernel tuning to 24kc. With RTL838x 
 being only 4kec this does not harm but is not right. Match the tuning properly.
 
 Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
@@ -13,10 +13,10 @@ Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
 @@ -160,6 +160,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
+ cflags-$(CONFIG_CPU_MIPS32_R2)        += -march=mips32r2 -mtune=24kc -Wa,--trap
 +
 +#ifdef CONFIG_RTL838X
-+cflags-$(CONFIG_CPU_MIPS32_R2) := $(subst 34kc,4kec,$(cflags-$(CONFIG_CPU_MIPS32_R2)))
++cflags-$(CONFIG_CPU_MIPS32_R2) := $(subst 24kc,4kec,$(cflags-$(CONFIG_CPU_MIPS32_R2)))
 +#endif
 +
  cflags-$(CONFIG_CPU_MIPS32_R5)        += -march=mips32r5 -Wa,--trap -modd-spreg