lkml.org 
[lkml]   [2019]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/2] MIPS: Ingenic: Disable abandoned HPTLB function.
    Date
    JZ4760/JZ4770/JZ4775/X1000/X1500 has an abandoned huge page
    tlb, write 0xa9000000 to cp0 config5 sel4 to disable this
    function to prevent getting stuck. Confirmed by Ingenic,
    this operation will not adversely affect processors
    without HPTLB function.

    Signed-off-by: Zhou Yanjie <zhouyanjie@zoho.com>
    ---
    arch/mips/kernel/cpu-probe.c | 16 ++++++++++++++--
    1 file changed, 14 insertions(+), 2 deletions(-)

    diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
    index 16033a4..cfebf8c 100644
    --- a/arch/mips/kernel/cpu-probe.c
    +++ b/arch/mips/kernel/cpu-probe.c
    @@ -1966,11 +1966,23 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
    }

    /*
    - * The config0 register in the Xburst CPUs with a processor ID of
    + * The config0 register in the XBurst CPUs with a processor ID of
    + * PRID_COMP_INGENIC_D1 has an abandoned huge page tlb, write
    + * 0xa9000000 to cp0 config5 sel4 to disable this function to
    + * prevent getting stuck.
    + */
    + if ((c->processor_id & PRID_COMP_MASK) == PRID_COMP_INGENIC_D1) {
    + __asm__ (
    + "li $2, 0xa9000000 \n\t"
    + "mtc0 $2, $5, 4 \n\t"
    + "nop \n\t"
    + ::"r"(2));
    + /*
    + * The config0 register in the XBurst CPUs with a processor ID of
    * PRID_COMP_INGENIC_D0 report themselves as MIPS32r2 compatible,
    * but they don't actually support this ISA.
    */
    - if ((c->processor_id & PRID_COMP_MASK) == PRID_COMP_INGENIC_D0)
    + } else if ((c->processor_id & PRID_COMP_MASK) == PRID_COMP_INGENIC_D0)
    c->isa_level &= ~MIPS_CPU_ISA_M32R2;
    }

    --
    2.7.4

    \
     
     \ /
      Last update: 2019-10-24 11:31    [W:2.738 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site