linux-mips
[Top] [All Lists]

Re: [PATCH v2] MIPS: mm: c-r4k: Detect instruction cache aliases

To: Markos Chandras <markos.chandras@imgtec.com>, linux-mips@linux-mips.org
Subject: Re: [PATCH v2] MIPS: mm: c-r4k: Detect instruction cache aliases
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Thu, 30 Jan 2014 21:33:15 +0300
In-reply-to: <1391102489-1403-1-git-send-email-markos.chandras@imgtec.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Organization: Cogent Embedded
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <52E93795.8000205@imgtec.com> <1391102489-1403-1-git-send-email-markos.chandras@imgtec.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
Hello.

On 01/30/2014 08:21 PM, Markos Chandras wrote:

The *Aptiv cores can use the CONF7/IAR bit to detect if the core
has hardware support to remove instruction cache aliasing.

This also defines the CONF7/AR bit in order to avoid using
the '16' magic number.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
[...]

diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 13b549a..8017f6e 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -1110,7 +1110,10 @@ static void probe_pcache(void)
        case CPU_PROAPTIV:
                if (current_cpu_type() == CPU_74K)
                        alias_74k_erratum(c);
-               if ((read_c0_config7() & (1 << 16))) {
+               if (!(read_c0_config7() & MIPS_CONF7_IAR) &&
+                   (c->icache.waysize > PAGE_SIZE))
+                               c->icache.flags |= MIPS_CACHE_ALIASES;

    Sigh, you forgot to "outdent" this statement by a tab... :-(

WBR, Sergei


<Prev in Thread] Current Thread [Next in Thread>