9 #include <linux/kernel.h>
10 #include <linux/sched.h>
13 #include <linux/bitops.h>
18 #include <asm/bootinfo.h>
20 #include <asm/cpu-features.h>
22 #include <asm/pgtable.h>
24 #include <asm/traps.h>
25 #include <asm/mmu_context.h>
38 static void octeon_flush_data_cache_page(
unsigned long addr)
43 static inline void octeon_local_flush_icache(
void)
45 asm volatile (
"synci 0($0)");
51 static void local_octeon_flush_icache_range(
unsigned long start,
54 octeon_local_flush_icache();
63 static void octeon_flush_icache_all_cores(
struct vm_area_struct *vma)
72 octeon_local_flush_icache();
82 mask = *mm_cpumask(vma->
vm_mm);
85 cpumask_clear_cpu(cpu, &mask);
97 static void octeon_flush_icache_all(
void)
99 octeon_flush_icache_all_cores(
NULL);
109 static void octeon_flush_cache_mm(
struct mm_struct *mm)
122 static void octeon_flush_icache_range(
unsigned long start,
unsigned long end)
124 octeon_flush_icache_all_cores(
NULL);
134 static void octeon_flush_cache_sigtramp(
unsigned long addr)
139 octeon_flush_icache_all_cores(vma);
151 unsigned long start,
unsigned long end)
154 octeon_flush_icache_all_cores(vma);
166 unsigned long page,
unsigned long pfn)
169 octeon_flush_icache_all_cores(vma);
172 static void octeon_flush_kernel_vmap_range(
unsigned long vaddr,
int size)
183 unsigned long icache_size;
184 unsigned long dcache_size;
185 unsigned int config1;
192 c->
icache.linesz = 2 << ((config1 >> 19) & 7);
193 c->
icache.sets = 64 << ((config1 >> 22) & 7);
194 c->
icache.ways = 1 + ((config1 >> 16) & 7);
212 c->
icache.linesz = 2 << ((config1 >> 19) & 7);
226 panic(
"Unsupported Cavium Networks CPU type");
238 pr_notice(
"Primary instruction cache %ldkB, %s, %d way, "
239 "%d sets, linesize %d bytes.\n",
242 "virtually tagged" :
"physically tagged",
245 pr_notice(
"Primary data cache %ldkB, %d-way, %d sets, "
246 "linesize %d bytes.\n",
247 dcache_size >> 10, c->
dcache.ways,
252 static void __cpuinit octeon_cache_error_setup(
void)
254 extern char except_vec2_octeon;
291 static void cache_parity_error_octeon(
int non_recoverable)
293 unsigned long coreid = cvmx_get_core_num();
296 pr_err(
"Cache error exception:\n");
298 if (icache_err & 1) {
299 pr_err(
"CacheErr (Icache) == %llx\n",
300 (
unsigned long long)icache_err);
304 pr_err(
"CacheErr (Dcache) == %llx\n",
310 panic(
"Can't handle cache error: nested exception");
319 cache_parity_error_octeon(0);
328 cache_parity_error_octeon(1);