[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200731042401.22871-1-f.fainelli@gmail.com>
Date: Thu, 30 Jul 2020 21:24:01 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: linux-mips@...ux-mips.org
Cc: Florian Fainelli <f.fainelli@...il.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
bcm-kernel-feedback-list@...adcom.com (open list:BROADCOM BMIPS MIPS
ARCHITECTURE),
linux-mips@...r.kernel.org (open list:BROADCOM BMIPS MIPS ARCHITECTURE),
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH] MIPS: BMIPS: Disable pref 30 for buggy CPUs
Disable pref 30 by utilizing the standard quirk method and matching the
affected SoCs: 7344, 7346, 7425.
Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
---
arch/mips/bmips/setup.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c
index 19308df5f577..df0efea12611 100644
--- a/arch/mips/bmips/setup.c
+++ b/arch/mips/bmips/setup.c
@@ -110,6 +110,20 @@ static void bcm6368_quirks(void)
bcm63xx_fixup_cpu1();
}
+static void bmips5000_pref30_quirk(void)
+{
+ __asm__ __volatile__(
+ " li $8, 0x5a455048\n"
+ " .word 0x4088b00f\n" /* mtc0 $8, $22, 15 */
+ " nop; nop; nop\n"
+ " .word 0x4008b008\n" /* mfc0 $8, $22, 8 */
+ /* disable "pref 30" on buggy CPUs */
+ " lui $9, 0x0800\n"
+ " or $8, $9\n"
+ " .word 0x4088b008\n" /* mtc0 $8, $22, 8 */
+ : : : "$8", "$9");
+}
+
static const struct bmips_quirk bmips_quirk_list[] = {
{ "brcm,bcm3368", &bcm6358_quirks },
{ "brcm,bcm3384-viper", &bcm3384_viper_quirks },
@@ -120,6 +134,9 @@ static const struct bmips_quirk bmips_quirk_list[] = {
{ "brcm,bcm6368", &bcm6368_quirks },
{ "brcm,bcm63168", &bcm6368_quirks },
{ "brcm,bcm63268", &bcm6368_quirks },
+ { "brcm,bcm7344", &bmips5000_pref30_quirk },
+ { "brcm,bcm7346", &bmips5000_pref30_quirk },
+ { "brcm,bcm7425", &bmips5000_pref30_quirk },
{ },
};
--
2.25.1
Powered by blists - more mailing lists