diff options
Diffstat (limited to 'arch/ia64/kernel/setup.c')
-rw-r--r-- | arch/ia64/kernel/setup.c | 71 |
1 files changed, 57 insertions, 14 deletions
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 1f5c26dbe705..5add0bcf87a7 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -78,7 +78,27 @@ struct screen_info screen_info; | |||
78 | unsigned long vga_console_iobase; | 78 | unsigned long vga_console_iobase; |
79 | unsigned long vga_console_membase; | 79 | unsigned long vga_console_membase; |
80 | 80 | ||
81 | static struct resource data_resource = { | ||
82 | .name = "Kernel data", | ||
83 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | ||
84 | }; | ||
85 | |||
86 | static struct resource code_resource = { | ||
87 | .name = "Kernel code", | ||
88 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | ||
89 | }; | ||
90 | extern void efi_initialize_iomem_resources(struct resource *, | ||
91 | struct resource *); | ||
92 | extern char _text[], _end[], _etext[]; | ||
93 | |||
81 | unsigned long ia64_max_cacheline_size; | 94 | unsigned long ia64_max_cacheline_size; |
95 | |||
96 | int dma_get_cache_alignment(void) | ||
97 | { | ||
98 | return ia64_max_cacheline_size; | ||
99 | } | ||
100 | EXPORT_SYMBOL(dma_get_cache_alignment); | ||
101 | |||
82 | unsigned long ia64_iobase; /* virtual address for I/O accesses */ | 102 | unsigned long ia64_iobase; /* virtual address for I/O accesses */ |
83 | EXPORT_SYMBOL(ia64_iobase); | 103 | EXPORT_SYMBOL(ia64_iobase); |
84 | struct io_space io_space[MAX_IO_SPACES]; | 104 | struct io_space io_space[MAX_IO_SPACES]; |
@@ -171,6 +191,22 @@ sort_regions (struct rsvd_region *rsvd_region, int max) | |||
171 | } | 191 | } |
172 | } | 192 | } |
173 | 193 | ||
194 | /* | ||
195 | * Request address space for all standard resources | ||
196 | */ | ||
197 | static int __init register_memory(void) | ||
198 | { | ||
199 | code_resource.start = ia64_tpa(_text); | ||
200 | code_resource.end = ia64_tpa(_etext) - 1; | ||
201 | data_resource.start = ia64_tpa(_etext); | ||
202 | data_resource.end = ia64_tpa(_end) - 1; | ||
203 | efi_initialize_iomem_resources(&code_resource, &data_resource); | ||
204 | |||
205 | return 0; | ||
206 | } | ||
207 | |||
208 | __initcall(register_memory); | ||
209 | |||
174 | /** | 210 | /** |
175 | * reserve_memory - setup reserved memory areas | 211 | * reserve_memory - setup reserved memory areas |
176 | * | 212 | * |
@@ -211,6 +247,9 @@ reserve_memory (void) | |||
211 | } | 247 | } |
212 | #endif | 248 | #endif |
213 | 249 | ||
250 | efi_memmap_init(&rsvd_region[n].start, &rsvd_region[n].end); | ||
251 | n++; | ||
252 | |||
214 | /* end of memory marker */ | 253 | /* end of memory marker */ |
215 | rsvd_region[n].start = ~0UL; | 254 | rsvd_region[n].start = ~0UL; |
216 | rsvd_region[n].end = ~0UL; | 255 | rsvd_region[n].end = ~0UL; |
@@ -244,28 +283,31 @@ find_initrd (void) | |||
244 | static void __init | 283 | static void __init |
245 | io_port_init (void) | 284 | io_port_init (void) |
246 | { | 285 | { |
247 | extern unsigned long ia64_iobase; | ||
248 | unsigned long phys_iobase; | 286 | unsigned long phys_iobase; |
249 | 287 | ||
250 | /* | 288 | /* |
251 | * Set `iobase' to the appropriate address in region 6 (uncached access range). | 289 | * Set `iobase' based on the EFI memory map or, failing that, the |
290 | * value firmware left in ar.k0. | ||
252 | * | 291 | * |
253 | * The EFI memory map is the "preferred" location to get the I/O port space base, | 292 | * Note that in ia32 mode, IN/OUT instructions use ar.k0 to compute |
254 | * rather the relying on AR.KR0. This should become more clear in future SAL | 293 | * the port's virtual address, so ia32_load_state() loads it with a |
255 | * specs. We'll fall back to getting it out of AR.KR0 if no appropriate entry is | 294 | * user virtual address. But in ia64 mode, glibc uses the |
256 | * found in the memory map. | 295 | * *physical* address in ar.k0 to mmap the appropriate area from |
296 | * /dev/mem, and the inX()/outX() interfaces use MMIO. In both | ||
297 | * cases, user-mode can only use the legacy 0-64K I/O port space. | ||
298 | * | ||
299 | * ar.k0 is not involved in kernel I/O port accesses, which can use | ||
300 | * any of the I/O port spaces and are done via MMIO using the | ||
301 | * virtual mmio_base from the appropriate io_space[]. | ||
257 | */ | 302 | */ |
258 | phys_iobase = efi_get_iobase(); | 303 | phys_iobase = efi_get_iobase(); |
259 | if (phys_iobase) | 304 | if (!phys_iobase) { |
260 | /* set AR.KR0 since this is all we use it for anyway */ | ||
261 | ia64_set_kr(IA64_KR_IO_BASE, phys_iobase); | ||
262 | else { | ||
263 | phys_iobase = ia64_get_kr(IA64_KR_IO_BASE); | 305 | phys_iobase = ia64_get_kr(IA64_KR_IO_BASE); |
264 | printk(KERN_INFO "No I/O port range found in EFI memory map, falling back " | 306 | printk(KERN_INFO "No I/O port range found in EFI memory map, " |
265 | "to AR.KR0\n"); | 307 | "falling back to AR.KR0 (0x%lx)\n", phys_iobase); |
266 | printk(KERN_INFO "I/O port base = 0x%lx\n", phys_iobase); | ||
267 | } | 308 | } |
268 | ia64_iobase = (unsigned long) ioremap(phys_iobase, 0); | 309 | ia64_iobase = (unsigned long) ioremap(phys_iobase, 0); |
310 | ia64_set_kr(IA64_KR_IO_BASE, __pa(ia64_iobase)); | ||
269 | 311 | ||
270 | /* setup legacy IO port space */ | 312 | /* setup legacy IO port space */ |
271 | io_space[0].mmio_base = ia64_iobase; | 313 | io_space[0].mmio_base = ia64_iobase; |
@@ -419,6 +461,7 @@ setup_arch (char **cmdline_p) | |||
419 | #endif | 461 | #endif |
420 | 462 | ||
421 | cpu_init(); /* initialize the bootstrap CPU */ | 463 | cpu_init(); /* initialize the bootstrap CPU */ |
464 | mmu_context_init(); /* initialize context_id bitmap */ | ||
422 | 465 | ||
423 | #ifdef CONFIG_ACPI | 466 | #ifdef CONFIG_ACPI |
424 | acpi_boot_init(); | 467 | acpi_boot_init(); |
@@ -526,7 +569,7 @@ show_cpuinfo (struct seq_file *m, void *v) | |||
526 | c->itc_freq / 1000000, c->itc_freq % 1000000, | 569 | c->itc_freq / 1000000, c->itc_freq % 1000000, |
527 | lpj*HZ/500000, (lpj*HZ/5000) % 100); | 570 | lpj*HZ/500000, (lpj*HZ/5000) % 100); |
528 | #ifdef CONFIG_SMP | 571 | #ifdef CONFIG_SMP |
529 | seq_printf(m, "siblings : %u\n", c->num_log); | 572 | seq_printf(m, "siblings : %u\n", cpus_weight(cpu_core_map[cpunum])); |
530 | if (c->threads_per_core > 1 || c->cores_per_socket > 1) | 573 | if (c->threads_per_core > 1 || c->cores_per_socket > 1) |
531 | seq_printf(m, | 574 | seq_printf(m, |
532 | "physical id: %u\n" | 575 | "physical id: %u\n" |