aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2009-10-14 05:12:50 -0400
committerMichal Simek <monstr@monstr.eu>2009-12-14 02:44:58 -0500
commite051af576a414b6fcfe6589e99b2357522718050 (patch)
treeabf2fcf3152485cb95ba7dedbcec6cc5f9187b31
parent44e4e196a9b3a703ebe273ffe3fb6cda326fe5d3 (diff)
microblaze: Extend cpuinfo for support write-back caches
There is missing checking agains PVR but this is not important for now. There are some missing checking too. Signed-off-by: Michal Simek <monstr@monstr.eu>
-rw-r--r--arch/microblaze/include/asm/cpuinfo.h1
-rw-r--r--arch/microblaze/kernel/cpu/cpuinfo-static.c1
-rw-r--r--arch/microblaze/kernel/cpu/mb.c8
3 files changed, 8 insertions, 2 deletions
diff --git a/arch/microblaze/include/asm/cpuinfo.h b/arch/microblaze/include/asm/cpuinfo.h
index aadf7a899d4..b4f5ca33aeb 100644
--- a/arch/microblaze/include/asm/cpuinfo.h
+++ b/arch/microblaze/include/asm/cpuinfo.h
@@ -53,6 +53,7 @@ struct cpuinfo {
53 u32 dcache_write; 53 u32 dcache_write;
54 u32 dcache_line_length; 54 u32 dcache_line_length;
55 u32 dcache_size; 55 u32 dcache_size;
56 u32 dcache_wb;
56 unsigned long dcache_base; 57 unsigned long dcache_base;
57 unsigned long dcache_high; 58 unsigned long dcache_high;
58 59
diff --git a/arch/microblaze/kernel/cpu/cpuinfo-static.c b/arch/microblaze/kernel/cpu/cpuinfo-static.c
index 6558429eb97..6095aa6b5c8 100644
--- a/arch/microblaze/kernel/cpu/cpuinfo-static.c
+++ b/arch/microblaze/kernel/cpu/cpuinfo-static.c
@@ -96,6 +96,7 @@ void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu)
96 ci->dcache_size = fcpu(cpu, "d-cache-size"); 96 ci->dcache_size = fcpu(cpu, "d-cache-size");
97 ci->dcache_base = fcpu(cpu, "d-cache-baseaddr"); 97 ci->dcache_base = fcpu(cpu, "d-cache-baseaddr");
98 ci->dcache_high = fcpu(cpu, "d-cache-highaddr"); 98 ci->dcache_high = fcpu(cpu, "d-cache-highaddr");
99 ci->dcache_wb = fcpu(cpu, "xlnx,dcache-use-writeback");
99 100
100 ci->use_dopb = fcpu(cpu, "xlnx,d-opb"); 101 ci->use_dopb = fcpu(cpu, "xlnx,d-opb");
101 ci->use_iopb = fcpu(cpu, "xlnx,i-opb"); 102 ci->use_iopb = fcpu(cpu, "xlnx,i-opb");
diff --git a/arch/microblaze/kernel/cpu/mb.c b/arch/microblaze/kernel/cpu/mb.c
index 4dcfccdbc36..0c912b2a8e0 100644
--- a/arch/microblaze/kernel/cpu/mb.c
+++ b/arch/microblaze/kernel/cpu/mb.c
@@ -103,11 +103,15 @@ static int show_cpuinfo(struct seq_file *m, void *v)
103 else 103 else
104 count += seq_printf(m, "Icache:\t\tno\n"); 104 count += seq_printf(m, "Icache:\t\tno\n");
105 105
106 if (cpuinfo.use_dcache) 106 if (cpuinfo.use_dcache) {
107 count += seq_printf(m, 107 count += seq_printf(m,
108 "Dcache:\t\t%ukB\n", 108 "Dcache:\t\t%ukB\n",
109 cpuinfo.dcache_size >> 10); 109 cpuinfo.dcache_size >> 10);
110 else 110 if (cpuinfo.dcache_wb)
111 count += seq_printf(m, "\t\twrite-back\n");
112 else
113 count += seq_printf(m, "\t\twrite-through\n");
114 } else
111 count += seq_printf(m, "Dcache:\t\tno\n"); 115 count += seq_printf(m, "Dcache:\t\tno\n");
112 116
113 count += seq_printf(m, 117 count += seq_printf(m,