Re: [PATCH] MIPS: BMIPS: Disable pref 30 for buggy CPUs

From: Florian Fainelli
Date: Fri Jul 31 2020 - 18:49:41 EST


On 7/31/20 3:34 AM, Jiaxun Yang wrote:
>
>
> å 2020/7/31 äå12:24, Florian Fainelli åé:
>> Disable pref 30 by utilizing the standard quirk method and matching the
>> affected SoCs: 7344, 7346, 7425.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
>> ---
>> Â 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");
>> +}
> Hi,
>
> Is there any toolchain issue blocking read_c0_**** family helpers being
> used?
>
> Use .word looks unreasonable.

Yes, the assembler would be choking on the custom $22 selector, however
this patch should not be necessary given that the boot loader (CFE)
should have long been updated by now to disable pref 30.

Thanks
--
Florian