diff --git a/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl-otto/mach-rtl-otto.h b/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl-otto/mach-rtl-otto.h index aa917c2ef7..f85dee6591 100644 --- a/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl-otto/mach-rtl-otto.h +++ b/target/linux/realtek/files-6.12/arch/mips/include/asm/mach-rtl-otto/mach-rtl-otto.h @@ -28,6 +28,7 @@ #define RTL838X_INT_RW_CTRL (0x0058) #define RTL838X_EXT_VERSION (0x00D0) +#define RTL838X_PLL_CML_CTRL (0x0ff8) #define RTL931X_LED_GLB_CTRL (0x0600) #define RTL931X_MAC_L2_GLOBAL_CTRL2 (0x1358) diff --git a/target/linux/realtek/files-6.12/arch/mips/rtl-otto/prom.c b/target/linux/realtek/files-6.12/arch/mips/rtl-otto/prom.c index b0975c51ae..2ec2b3f0dd 100644 --- a/target/linux/realtek/files-6.12/arch/mips/rtl-otto/prom.c +++ b/target/linux/realtek/files-6.12/arch/mips/rtl-otto/prom.c @@ -101,9 +101,21 @@ static int rtlsmp_register(void) static void __init apply_early_quirks(void) { - /* Open up write protected registers. Never mess with this elsewhere */ - if (soc_info.family == RTL8380_FAMILY_ID) + if (soc_info.family == RTL8380_FAMILY_ID) { + /* + * Open up write protected registers. SDK opens/closes this whenever needed. For + * simplicity always work with an "open" register set. + */ sw_w32(0x3, RTL838X_INT_RW_CTRL); + /* + * Disable 4 byte address mode of flash controller. If this bit is not cleared + * the watchdog cannot reset the SoC. The SDK changes this short before restart. + * Until this quirk was implemented all RTL838x devices ran with this disabled + * because of a coding error. As no issues were detected keep the behaviour + * until more details are known. + */ + sw_w32_mask(BIT(30), 0, RTL838X_PLL_CML_CTRL); + } } static void __init apply_dts_quirks(void)