Skip to content

Commit 52f1959

Browse files
committed
Merge tag 'mips-fixes_6.3_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
Pull MIPS fix from Thomas Bogendoerfer: "Fix to avoid crash on BCM6358 platforms" * tag 'mips-fixes_6.3_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: mips: bmips: BCM6358: disable RAC flush for TP1
2 parents 62bad54 + ab327f8 commit 52f1959

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

arch/mips/bmips/dma.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <asm/bmips.h>
66
#include <asm/io.h>
77

8+
bool bmips_rac_flush_disable;
9+
810
void arch_sync_dma_for_cpu_all(void)
911
{
1012
void __iomem *cbr = BMIPS_GET_CBR();
@@ -15,6 +17,9 @@ void arch_sync_dma_for_cpu_all(void)
1517
boot_cpu_type() != CPU_BMIPS4380)
1618
return;
1719

20+
if (unlikely(bmips_rac_flush_disable))
21+
return;
22+
1823
/* Flush stale data out of the readahead cache */
1924
cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
2025
__raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);

arch/mips/bmips/setup.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#define REG_BCM6328_OTP ((void __iomem *)CKSEG1ADDR(0x1000062c))
3636
#define BCM6328_TP1_DISABLED BIT(9)
3737

38+
extern bool bmips_rac_flush_disable;
39+
3840
static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000;
3941

4042
struct bmips_quirk {
@@ -104,6 +106,12 @@ static void bcm6358_quirks(void)
104106
* disable SMP for now
105107
*/
106108
bmips_smp_enabled = 0;
109+
110+
/*
111+
* RAC flush causes kernel panics on BCM6358 when booting from TP1
112+
* because the bootloader is not initializing it properly.
113+
*/
114+
bmips_rac_flush_disable = !!(read_c0_brcm_cmt_local() & (1 << 31));
107115
}
108116

109117
static void bcm6368_quirks(void)

0 commit comments

Comments
 (0)