linux-mips
[Top] [All Lists]

[PATCH 05/14] MIPS: Octeon: Handle Octeon II caches.

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 05/14] MIPS: Octeon: Handle Octeon II caches.
From: David Daney <ddaney@caviumnetworks.com>
Date: Thu, 7 Oct 2010 16:03:44 -0700
Cc: David Daney <ddaney@caviumnetworks.com>
In-reply-to: <1286492633-26885-1-git-send-email-ddaney@caviumnetworks.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1286492633-26885-1-git-send-email-ddaney@caviumnetworks.com>
Sender: linux-mips-bounce@linux-mips.org
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
 arch/mips/mm/c-octeon.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c
index 0f9c488..16c4d25 100644
--- a/arch/mips/mm/c-octeon.c
+++ b/arch/mips/mm/c-octeon.c
@@ -181,10 +181,10 @@ static void __cpuinit probe_octeon(void)
        unsigned int config1;
        struct cpuinfo_mips *c = &current_cpu_data;
 
+       config1 = read_c0_config1();
        switch (c->cputype) {
        case CPU_CAVIUM_OCTEON:
        case CPU_CAVIUM_OCTEON_PLUS:
-               config1 = read_c0_config1();
                c->icache.linesz = 2 << ((config1 >> 19) & 7);
                c->icache.sets = 64 << ((config1 >> 22) & 7);
                c->icache.ways = 1 + ((config1 >> 16) & 7);
@@ -204,6 +204,20 @@ static void __cpuinit probe_octeon(void)
                c->options |= MIPS_CPU_PREFETCH;
                break;
 
+       case CPU_CAVIUM_OCTEON2:
+               c->icache.linesz = 2 << ((config1 >> 19) & 7);
+               c->icache.sets = 8;
+               c->icache.ways = 37;
+               c->icache.flags |= MIPS_CACHE_VTAG;
+               icache_size = c->icache.sets * c->icache.ways * 
c->icache.linesz;
+
+               c->dcache.linesz = 128;
+               c->dcache.ways = 32;
+               c->dcache.sets = 8;
+               dcache_size = c->dcache.sets * c->dcache.ways * 
c->dcache.linesz;
+               c->options |= MIPS_CPU_PREFETCH;
+               break;
+
        default:
                panic("Unsupported Cavium Networks CPU type\n");
                break;
-- 
1.7.2.3


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