ramips: rt305x: keep the kernel code out of the first 32 KiB

The 24KEc of the RT5350 shows the same EPC fault as the MT7620's,
measured from user space: about 38 wrong EPCs a second with J and with
JAL from 0x20003f90 to 0x22e70040, none with JALR. rt305x also links
the kernel at 0x80000000, so turn RALINK_PAD_FIRST_32K on for
SOC_RT305X too. The
padding is freed again as on mt7620, and the module allocator already
keeps module code out of it on every 24K core.

Signed-off-by: Marco Martins <marcomartins86@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/26650
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Marco MartinsandClaude Opus 5.5 authored and Robert Marko committed 2026-11-17 21:10:55 +01:00
1 parent d1f05be244
commit 6569251835
2 files changed
+4 -3

No files matched your search

@@ -75,13 +75,13 @@ Signed-off-by: Marco Martins <marcomartins86@gmail.com>
+config RALINK_PAD_FIRST_32K
+ bool
+ default y if SOC_MT7620 && !PINCTRL_MT76X8
+ default y if (SOC_MT7620 && !PINCTRL_MT76X8) || SOC_RT305X
+ help
+ Some 24K cores can save an EPC with wrong top four bits for an
+ interrupt at the target of a J or JAL in the first 32 KiB of a
+ 256 MiB segment, and the kernel is linked at 0x80000000.
+ Needed on the MT7620, not on the MT7628 and MT7688, whose kernels
+ build the MT76x8 pin controller.
+ Needed on the MT7620 and RT305x, not on the MT7628 and MT7688,
+ whose kernels build the MT76x8 pin controller.
+
config IRQ_INTC
bool
+1
View File
@@ -160,6 +160,7 @@ CONFIG_PINCTRL_RT305X=y
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
CONFIG_RALINK=y
# CONFIG_RALINK_ILL_ACC is not set
CONFIG_RALINK_PAD_FIRST_32K=y
CONFIG_RALINK_TIMER=y
CONFIG_RALINK_WDT=y
CONFIG_RANDSTRUCT_NONE=y