diff options
author | Anton Vorontsov <cbouatmailru@gmail.com> | 2008-07-29 18:05:23 -0400 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2008-07-29 18:05:23 -0400 |
commit | 9fec6060d9e48ed7db0dac0e16d0f0f0e615b7f6 (patch) | |
tree | 74b41f31a08f6500ff3dfcf64ba21e2d9a8e87e5 /arch/sh/kernel/setup.c | |
parent | fece418418f51e92dd7e67e17c5e3fe5a28d3279 (diff) | |
parent | 6e86841d05f371b5b9b86ce76c02aaee83352298 (diff) |
Merge branch 'master' of /home/cbou/linux-2.6
Conflicts:
drivers/power/Kconfig
drivers/power/Makefile
Diffstat (limited to 'arch/sh/kernel/setup.c')
-rw-r--r-- | arch/sh/kernel/setup.c | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 284f66f1ebbe..6339d0c95715 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
@@ -53,6 +53,7 @@ EXPORT_SYMBOL(cpu_data); | |||
53 | * sh_mv= on the command line, prior to .machvec.init teardown. | 53 | * sh_mv= on the command line, prior to .machvec.init teardown. |
54 | */ | 54 | */ |
55 | struct sh_machine_vector sh_mv = { .mv_name = "generic", }; | 55 | struct sh_machine_vector sh_mv = { .mv_name = "generic", }; |
56 | EXPORT_SYMBOL(sh_mv); | ||
56 | 57 | ||
57 | #ifdef CONFIG_VT | 58 | #ifdef CONFIG_VT |
58 | struct screen_info screen_info; | 59 | struct screen_info screen_info; |
@@ -76,11 +77,18 @@ static struct resource data_resource = { | |||
76 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM, | 77 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM, |
77 | }; | 78 | }; |
78 | 79 | ||
80 | static struct resource bss_resource = { | ||
81 | .name = "Kernel bss", | ||
82 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM, | ||
83 | }; | ||
84 | |||
79 | unsigned long memory_start; | 85 | unsigned long memory_start; |
80 | EXPORT_SYMBOL(memory_start); | 86 | EXPORT_SYMBOL(memory_start); |
81 | unsigned long memory_end = 0; | 87 | unsigned long memory_end = 0; |
82 | EXPORT_SYMBOL(memory_end); | 88 | EXPORT_SYMBOL(memory_end); |
83 | 89 | ||
90 | static struct resource mem_resources[MAX_NUMNODES]; | ||
91 | |||
84 | int l1i_cache_shape, l1d_cache_shape, l2_cache_shape; | 92 | int l1i_cache_shape, l1d_cache_shape, l2_cache_shape; |
85 | 93 | ||
86 | static int __init early_parse_mem(char *p) | 94 | static int __init early_parse_mem(char *p) |
@@ -169,6 +177,40 @@ static inline void __init reserve_crashkernel(void) | |||
169 | {} | 177 | {} |
170 | #endif | 178 | #endif |
171 | 179 | ||
180 | void __init __add_active_range(unsigned int nid, unsigned long start_pfn, | ||
181 | unsigned long end_pfn) | ||
182 | { | ||
183 | struct resource *res = &mem_resources[nid]; | ||
184 | |||
185 | WARN_ON(res->name); /* max one active range per node for now */ | ||
186 | |||
187 | res->name = "System RAM"; | ||
188 | res->start = start_pfn << PAGE_SHIFT; | ||
189 | res->end = (end_pfn << PAGE_SHIFT) - 1; | ||
190 | res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; | ||
191 | if (request_resource(&iomem_resource, res)) { | ||
192 | pr_err("unable to request memory_resource 0x%lx 0x%lx\n", | ||
193 | start_pfn, end_pfn); | ||
194 | return; | ||
195 | } | ||
196 | |||
197 | /* | ||
198 | * We don't know which RAM region contains kernel data, | ||
199 | * so we try it repeatedly and let the resource manager | ||
200 | * test it. | ||
201 | */ | ||
202 | request_resource(res, &code_resource); | ||
203 | request_resource(res, &data_resource); | ||
204 | request_resource(res, &bss_resource); | ||
205 | |||
206 | #ifdef CONFIG_KEXEC | ||
207 | if (crashk_res.start != crashk_res.end) | ||
208 | request_resource(res, &crashk_res); | ||
209 | #endif | ||
210 | |||
211 | add_active_range(nid, start_pfn, end_pfn); | ||
212 | } | ||
213 | |||
172 | void __init setup_bootmem_allocator(unsigned long free_pfn) | 214 | void __init setup_bootmem_allocator(unsigned long free_pfn) |
173 | { | 215 | { |
174 | unsigned long bootmap_size; | 216 | unsigned long bootmap_size; |
@@ -181,7 +223,7 @@ void __init setup_bootmem_allocator(unsigned long free_pfn) | |||
181 | bootmap_size = init_bootmem_node(NODE_DATA(0), free_pfn, | 223 | bootmap_size = init_bootmem_node(NODE_DATA(0), free_pfn, |
182 | min_low_pfn, max_low_pfn); | 224 | min_low_pfn, max_low_pfn); |
183 | 225 | ||
184 | add_active_range(0, min_low_pfn, max_low_pfn); | 226 | __add_active_range(0, min_low_pfn, max_low_pfn); |
185 | register_bootmem_low_pages(); | 227 | register_bootmem_low_pages(); |
186 | 228 | ||
187 | node_set_online(0); | 229 | node_set_online(0); |
@@ -250,6 +292,17 @@ void __init setup_arch(char **cmdline_p) | |||
250 | 292 | ||
251 | ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); | 293 | ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); |
252 | 294 | ||
295 | printk(KERN_NOTICE "Boot params:\n" | ||
296 | "... MOUNT_ROOT_RDONLY - %08lx\n" | ||
297 | "... RAMDISK_FLAGS - %08lx\n" | ||
298 | "... ORIG_ROOT_DEV - %08lx\n" | ||
299 | "... LOADER_TYPE - %08lx\n" | ||
300 | "... INITRD_START - %08lx\n" | ||
301 | "... INITRD_SIZE - %08lx\n", | ||
302 | MOUNT_ROOT_RDONLY, RAMDISK_FLAGS, | ||
303 | ORIG_ROOT_DEV, LOADER_TYPE, | ||
304 | INITRD_START, INITRD_SIZE); | ||
305 | |||
253 | #ifdef CONFIG_BLK_DEV_RAM | 306 | #ifdef CONFIG_BLK_DEV_RAM |
254 | rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; | 307 | rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; |
255 | rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0); | 308 | rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0); |
@@ -267,6 +320,8 @@ void __init setup_arch(char **cmdline_p) | |||
267 | code_resource.end = virt_to_phys(_etext)-1; | 320 | code_resource.end = virt_to_phys(_etext)-1; |
268 | data_resource.start = virt_to_phys(_etext); | 321 | data_resource.start = virt_to_phys(_etext); |
269 | data_resource.end = virt_to_phys(_edata)-1; | 322 | data_resource.end = virt_to_phys(_edata)-1; |
323 | bss_resource.start = virt_to_phys(__bss_start); | ||
324 | bss_resource.end = virt_to_phys(_ebss)-1; | ||
270 | 325 | ||
271 | memory_start = (unsigned long)__va(__MEMORY_START); | 326 | memory_start = (unsigned long)__va(__MEMORY_START); |
272 | if (!memory_end) | 327 | if (!memory_end) |
@@ -343,6 +398,7 @@ const char *get_cpu_subtype(struct sh_cpuinfo *c) | |||
343 | { | 398 | { |
344 | return cpu_name[c->type]; | 399 | return cpu_name[c->type]; |
345 | } | 400 | } |
401 | EXPORT_SYMBOL(get_cpu_subtype); | ||
346 | 402 | ||
347 | #ifdef CONFIG_PROC_FS | 403 | #ifdef CONFIG_PROC_FS |
348 | /* Symbolic CPU flags, keep in sync with asm/cpu-features.h */ | 404 | /* Symbolic CPU flags, keep in sync with asm/cpu-features.h */ |
@@ -397,6 +453,12 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
397 | seq_printf(m, "processor\t: %d\n", cpu); | 453 | seq_printf(m, "processor\t: %d\n", cpu); |
398 | seq_printf(m, "cpu family\t: %s\n", init_utsname()->machine); | 454 | seq_printf(m, "cpu family\t: %s\n", init_utsname()->machine); |
399 | seq_printf(m, "cpu type\t: %s\n", get_cpu_subtype(c)); | 455 | seq_printf(m, "cpu type\t: %s\n", get_cpu_subtype(c)); |
456 | if (c->cut_major == -1) | ||
457 | seq_printf(m, "cut\t\t: unknown\n"); | ||
458 | else if (c->cut_minor == -1) | ||
459 | seq_printf(m, "cut\t\t: %d.x\n", c->cut_major); | ||
460 | else | ||
461 | seq_printf(m, "cut\t\t: %d.%d\n", c->cut_major, c->cut_minor); | ||
400 | 462 | ||
401 | show_cpuflags(m, c); | 463 | show_cpuflags(m, c); |
402 | 464 | ||