aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/kernel/setup.c
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2008-01-28 10:39:00 -0500
committerJesper Nilsson <jesper.nilsson@axis.com>2008-02-08 05:06:37 -0500
commit60dead5a8c909a650ade5f92f2649db292486af1 (patch)
tree8d7e8af81fe161624414dce9523cf8da380181ec /arch/cris/kernel/setup.c
parent3ae8d8baab1dd571b934001c595d5ab81214304f (diff)
CRIS: Register cpus in kernel/setup.c
Also, fix some white space errors, and constify cpuinfo_op.
Diffstat (limited to 'arch/cris/kernel/setup.c')
-rw-r--r--arch/cris/kernel/setup.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/arch/cris/kernel/setup.c b/arch/cris/kernel/setup.c
index 4da042e100a0..04d48dd91ddf 100644
--- a/arch/cris/kernel/setup.c
+++ b/arch/cris/kernel/setup.c
@@ -18,7 +18,7 @@
18#include <linux/screen_info.h> 18#include <linux/screen_info.h>
19#include <linux/utsname.h> 19#include <linux/utsname.h>
20#include <linux/pfn.h> 20#include <linux/pfn.h>
21 21#include <linux/cpu.h>
22#include <asm/setup.h> 22#include <asm/setup.h>
23 23
24/* 24/*
@@ -36,6 +36,8 @@ extern unsigned long dram_start, dram_end;
36 36
37extern unsigned long romfs_start, romfs_length, romfs_in_flash; /* from head.S */ 37extern unsigned long romfs_start, romfs_length, romfs_in_flash; /* from head.S */
38 38
39static struct cpu cpu_devices[NR_CPUS];
40
39extern void show_etrax_copyright(void); /* arch-vX/kernel/setup.c */ 41extern void show_etrax_copyright(void); /* arch-vX/kernel/setup.c */
40 42
41/* This mainly sets up the memory area, and can be really confusing. 43/* This mainly sets up the memory area, and can be really confusing.
@@ -45,24 +47,23 @@ extern void show_etrax_copyright(void); /* arch-vX/kernel/setup.c */
45 * given by the macro __pa(). 47 * given by the macro __pa().
46 * 48 *
47 * In this DRAM, the kernel code and data is loaded, in the beginning. 49 * In this DRAM, the kernel code and data is loaded, in the beginning.
48 * It really starts at c0004000 to make room for some special pages - 50 * It really starts at c0004000 to make room for some special pages -
49 * the start address is text_start. The kernel data ends at _end. After 51 * the start address is text_start. The kernel data ends at _end. After
50 * this the ROM filesystem is appended (if there is any). 52 * this the ROM filesystem is appended (if there is any).
51 * 53 *
52 * Between this address and dram_end, we have RAM pages usable to the 54 * Between this address and dram_end, we have RAM pages usable to the
53 * boot code and the system. 55 * boot code and the system.
54 * 56 *
55 */ 57 */
56 58
57void __init 59void __init setup_arch(char **cmdline_p)
58setup_arch(char **cmdline_p)
59{ 60{
60 extern void init_etrax_debug(void); 61 extern void init_etrax_debug(void);
61 unsigned long bootmap_size; 62 unsigned long bootmap_size;
62 unsigned long start_pfn, max_pfn; 63 unsigned long start_pfn, max_pfn;
63 unsigned long memory_start; 64 unsigned long memory_start;
64 65
65 /* register an initial console printing routine for printk's */ 66 /* register an initial console printing routine for printk's */
66 67
67 init_etrax_debug(); 68 init_etrax_debug();
68 69
@@ -121,7 +122,7 @@ setup_arch(char **cmdline_p)
121 min_low_pfn = PAGE_OFFSET >> PAGE_SHIFT; 122 min_low_pfn = PAGE_OFFSET >> PAGE_SHIFT;
122 123
123 bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, 124 bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn,
124 min_low_pfn, 125 min_low_pfn,
125 max_low_pfn); 126 max_low_pfn);
126 127
127 /* And free all memory not belonging to the kernel (addr, size) */ 128 /* And free all memory not belonging to the kernel (addr, size) */
@@ -180,11 +181,23 @@ static void c_stop(struct seq_file *m, void *v)
180 181
181extern int show_cpuinfo(struct seq_file *m, void *v); 182extern int show_cpuinfo(struct seq_file *m, void *v);
182 183
183struct seq_operations cpuinfo_op = { 184const struct seq_operations cpuinfo_op = {
184 .start = c_start, 185 .start = c_start,
185 .next = c_next, 186 .next = c_next,
186 .stop = c_stop, 187 .stop = c_stop,
187 .show = show_cpuinfo, 188 .show = show_cpuinfo,
188}; 189};
189 190
191static int __init topology_init(void)
192{
193 int i;
194
195 for_each_possible_cpu(i) {
196 return register_cpu(&cpu_devices[i], i);
197 }
198
199 return 0;
200}
201
202subsys_initcall(topology_init);
190 203