20 #include <linux/errno.h>
21 #include <linux/sched.h>
22 #include <linux/kernel.h>
24 #include <linux/stddef.h>
26 #include <linux/ptrace.h>
27 #include <linux/slab.h>
28 #include <linux/tty.h>
35 #include <linux/serial.h>
40 #include <linux/device.h>
43 #include <asm/segment.h>
44 #include <asm/pgtable.h>
45 #include <asm/types.h>
46 #include <asm/setup.h>
48 #include <asm/cpuinfo.h>
49 #include <asm/delay.h>
57 unsigned long bootmap_size;
58 unsigned long ram_start_pfn;
59 unsigned long free_ram_start_pfn;
60 unsigned long ram_end_pfn;
62 struct memblock_region *
region;
64 memory_end = memory_start = 0;
67 for_each_memblock(
memory, region) {
68 memory_start = region->base;
69 memory_end = region->base + region->size;
71 memory_start, memory_end);
78 ram_start_pfn =
PFN_UP(memory_start);
93 ram_end_pfn - ram_start_pfn);
95 (ram_end_pfn - free_ram_start_pfn) <<
PAGE_SHIFT);
99 for_each_memblock(
reserved, region) {
101 (
u32) region->base, (
u32) region->size);
110 static void print_cpuinfo(
void)
125 "-- no UPR register... unable to detect configuration\n");
131 "-- dcache: %4d bytes total, %2d bytes/line, %d way(s)\n",
137 "-- icache: %4d bytes total, %2d bytes/line, %d way(s)\n",
169 unsigned long iccfgr, dccfgr;
170 unsigned long cache_set_size, cache_ways;
174 panic(
"No compatible CPU found in device tree...\n");
190 if (of_property_read_u32(cpu,
"clock-frequency",
193 "Device tree missing CPU 'clock-frequency' parameter."
194 "Assuming frequency 25MHZ"
195 "This is probably not what you want.");
223 static int __init openrisc_device_probe(
void)
232 static inline unsigned long extract_value_bits(
unsigned long reg,
233 short bit_nr,
short width)
235 return (reg >> bit_nr) & (0 <<
width);
238 static inline unsigned long extract_value(
unsigned long reg,
unsigned long mask)
240 while (!(mask & 0x1)) {
277 panic(
"no cpu 'clock-frequency' parameter in device tree");
279 pr_cont(
"%lu.%02lu BogoMIPS (lpj=%lu)\n",
288 unflatten_device_tree();
298 #ifdef CONFIG_BLK_DEV_INITRD
314 #if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
334 "cpu\t\t: OpenRISC-%x\n"
337 "dcache size\t: %d bytes\n"
338 "dcache block size\t: %d bytes\n"
339 "icache size\t: %d bytes\n"
340 "icache block size\t: %d bytes\n"
341 "immu\t\t: %d entries, %lu ways\n"
342 "dmmu\t\t: %d entries, %lu ways\n"
343 "bogomips\t: %lu.%02lu\n",
362 return *pos < 1 ? (
void *)1 :
NULL;
365 static void *c_next(
struct seq_file *m,
void *v, loff_t *
pos)
371 static void c_stop(
struct seq_file *m,
void *v)