9 #include <linux/device.h>
12 #include <linux/module.h>
15 #include <linux/errno.h>
18 #include <asm/setup.h>
23 #ifdef CONFIG_PERFORMANCE_COUNTERS
35 return sprintf(buf,
"0x%lx\n", (pccr >> 12) & 0x3f);
45 if (endp == buf || val > 0x3f)
57 return sprintf(buf,
"%lu\n", pcnt0);
61 const char *buf,
size_t count)
80 return sprintf(buf,
"0x%lx\n", (pccr >> 18) & 0x3f);
90 if (endp == buf || val > 0x3f)
102 return sprintf(buf,
"%lu\n", pcnt1);
125 return sprintf(buf,
"%lu\n", pccnt);
148 return sprintf(buf,
"%c\n", (pccr & 1)?
'1':
'0');
154 unsigned long pccr,
val;
164 pccr = (pccr & ~1
UL) | val;
170 static DEVICE_ATTR(pc0event, 0600, show_pc0event, store_pc0event);
171 static DEVICE_ATTR(pc0count, 0600, show_pc0count, store_pc0count);
172 static DEVICE_ATTR(pc1event, 0600, show_pc1event, store_pc1event);
173 static DEVICE_ATTR(pc1count, 0600, show_pc1count, store_pc1count);
174 static DEVICE_ATTR(pccycles, 0600, show_pccycles, store_pccycles);
175 static DEVICE_ATTR(pcenable, 0600, show_pcenable, store_pcenable);
179 static int __init topology_init(
void)
184 struct cpu *
c = &
per_cpu(cpu_devices, cpu);
188 #ifdef CONFIG_PERFORMANCE_COUNTERS
210 { .mid = 0x1f, .pn = 0x1e82, .name =
"AT32AP700x" },
212 #define NR_CHIP_NAMES ARRAY_SIZE(chip_names)
214 static const char *cpu_names[] = {
218 #define NR_CPU_NAMES ARRAY_SIZE(cpu_names)
220 static const char *arch_names[] = {
224 #define NR_ARCH_NAMES ARRAY_SIZE(arch_names)
226 static const char *mmu_types[] = {
233 static const char *cpu_feature_flags[] = {
234 "rmw",
"dsp",
"simd",
"ocd",
"perfctr",
"java",
"fpu",
240 unsigned int mid = avr32_get_manufacturer_id(cpu);
241 unsigned int pn = avr32_get_product_number(cpu);
244 if (chip_names[i].mid == mid && chip_names[i].pn == pn)
245 return chip_names[
i].
name;
253 unsigned long config0, config1;
291 printk (
"Unknown CPU configuration (ID %02x, arch %02x), "
292 "continuing anyway...\n",
299 printk (
"CPU: %s [%02x] core revision %d (%s arch revision %d)\n",
300 cpu_names[cpu_id], cpu_id, cpu_rev,
301 arch_names[arch_id], arch_rev);
302 printk (
"CPU: MMU configuration: %s\n", mmu_types[mmu_type]);
304 printk (
"CPU: features:");
321 for (i = 0; i <
ARRAY_SIZE(cpu_feature_flags); i++)
322 if (features & (1 << i))
323 printk(
" %s", cpu_feature_flags[i]);
329 #ifdef CONFIG_PROC_FS
330 static int c_show(
struct seq_file *
m,
void *
v)
332 unsigned int icache_size, dcache_size;
346 seq_printf(m,
"chip type\t: %s revision %c\n",
359 seq_printf(m,
"cpu MHz\t\t: %u.%03u\n", freq / 1000, freq % 1000);
361 seq_printf(m,
"i-cache\t\t: %dK (%u ways x %u sets x %u)\n",
366 seq_printf(m,
"d-cache\t\t: %dK (%u ways x %u sets x %u)\n",
373 for (i = 0; i <
ARRAY_SIZE(cpu_feature_flags); i++)
386 return *pos < 1 ? (
void *)1 :
NULL;
389 static void *c_next(
struct seq_file *m,
void *v, loff_t *
pos)
395 static void c_stop(
struct seq_file *m,
void *v)