aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/setup.c
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-10-31 13:51:57 -0500
committerTony Luck <tony.luck@intel.com>2005-10-31 13:51:57 -0500
commitc7fb577e2a6cb04732541f2dc402bd46747f7558 (patch)
treedf3b1a1922ed13bfbcc45d08650c38beeb1a7bd1 /arch/ia64/kernel/setup.c
parent9cec58dc138d6fcad9f447a19c8ff69f6540e667 (diff)
parent581c1b14394aee60aff46ea67d05483261ed6527 (diff)
manual update from upstream:
Applied Al's change 06a544971fad0992fe8b92c5647538d573089dd4 to new location of swiotlb.c Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/setup.c')
-rw-r--r--arch/ia64/kernel/setup.c63
1 files changed, 49 insertions, 14 deletions
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 1f5c26dbe705..fc56ca2da358 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -78,6 +78,19 @@ struct screen_info screen_info;
78unsigned long vga_console_iobase; 78unsigned long vga_console_iobase;
79unsigned long vga_console_membase; 79unsigned long vga_console_membase;
80 80
81static struct resource data_resource = {
82 .name = "Kernel data",
83 .flags = IORESOURCE_BUSY | IORESOURCE_MEM
84};
85
86static struct resource code_resource = {
87 .name = "Kernel code",
88 .flags = IORESOURCE_BUSY | IORESOURCE_MEM
89};
90extern void efi_initialize_iomem_resources(struct resource *,
91 struct resource *);
92extern char _text[], _end[], _etext[];
93
81unsigned long ia64_max_cacheline_size; 94unsigned long ia64_max_cacheline_size;
82unsigned long ia64_iobase; /* virtual address for I/O accesses */ 95unsigned long ia64_iobase; /* virtual address for I/O accesses */
83EXPORT_SYMBOL(ia64_iobase); 96EXPORT_SYMBOL(ia64_iobase);
@@ -171,6 +184,22 @@ sort_regions (struct rsvd_region *rsvd_region, int max)
171 } 184 }
172} 185}
173 186
187/*
188 * Request address space for all standard resources
189 */
190static int __init register_memory(void)
191{
192 code_resource.start = ia64_tpa(_text);
193 code_resource.end = ia64_tpa(_etext) - 1;
194 data_resource.start = ia64_tpa(_etext);
195 data_resource.end = ia64_tpa(_end) - 1;
196 efi_initialize_iomem_resources(&code_resource, &data_resource);
197
198 return 0;
199}
200
201__initcall(register_memory);
202
174/** 203/**
175 * reserve_memory - setup reserved memory areas 204 * reserve_memory - setup reserved memory areas
176 * 205 *
@@ -211,6 +240,9 @@ reserve_memory (void)
211 } 240 }
212#endif 241#endif
213 242
243 efi_memmap_init(&rsvd_region[n].start, &rsvd_region[n].end);
244 n++;
245
214 /* end of memory marker */ 246 /* end of memory marker */
215 rsvd_region[n].start = ~0UL; 247 rsvd_region[n].start = ~0UL;
216 rsvd_region[n].end = ~0UL; 248 rsvd_region[n].end = ~0UL;
@@ -244,28 +276,31 @@ find_initrd (void)
244static void __init 276static void __init
245io_port_init (void) 277io_port_init (void)
246{ 278{
247 extern unsigned long ia64_iobase;
248 unsigned long phys_iobase; 279 unsigned long phys_iobase;
249 280
250 /* 281 /*
251 * Set `iobase' to the appropriate address in region 6 (uncached access range). 282 * Set `iobase' based on the EFI memory map or, failing that, the
283 * value firmware left in ar.k0.
252 * 284 *
253 * The EFI memory map is the "preferred" location to get the I/O port space base, 285 * 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 286 * 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 287 * user virtual address. But in ia64 mode, glibc uses the
256 * found in the memory map. 288 * *physical* address in ar.k0 to mmap the appropriate area from
289 * /dev/mem, and the inX()/outX() interfaces use MMIO. In both
290 * cases, user-mode can only use the legacy 0-64K I/O port space.
291 *
292 * ar.k0 is not involved in kernel I/O port accesses, which can use
293 * any of the I/O port spaces and are done via MMIO using the
294 * virtual mmio_base from the appropriate io_space[].
257 */ 295 */
258 phys_iobase = efi_get_iobase(); 296 phys_iobase = efi_get_iobase();
259 if (phys_iobase) 297 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); 298 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 " 299 printk(KERN_INFO "No I/O port range found in EFI memory map, "
265 "to AR.KR0\n"); 300 "falling back to AR.KR0 (0x%lx)\n", phys_iobase);
266 printk(KERN_INFO "I/O port base = 0x%lx\n", phys_iobase);
267 } 301 }
268 ia64_iobase = (unsigned long) ioremap(phys_iobase, 0); 302 ia64_iobase = (unsigned long) ioremap(phys_iobase, 0);
303 ia64_set_kr(IA64_KR_IO_BASE, __pa(ia64_iobase));
269 304
270 /* setup legacy IO port space */ 305 /* setup legacy IO port space */
271 io_space[0].mmio_base = ia64_iobase; 306 io_space[0].mmio_base = ia64_iobase;
@@ -526,7 +561,7 @@ show_cpuinfo (struct seq_file *m, void *v)
526 c->itc_freq / 1000000, c->itc_freq % 1000000, 561 c->itc_freq / 1000000, c->itc_freq % 1000000,
527 lpj*HZ/500000, (lpj*HZ/5000) % 100); 562 lpj*HZ/500000, (lpj*HZ/5000) % 100);
528#ifdef CONFIG_SMP 563#ifdef CONFIG_SMP
529 seq_printf(m, "siblings : %u\n", c->num_log); 564 seq_printf(m, "siblings : %u\n", cpus_weight(cpu_core_map[cpunum]));
530 if (c->threads_per_core > 1 || c->cores_per_socket > 1) 565 if (c->threads_per_core > 1 || c->cores_per_socket > 1)
531 seq_printf(m, 566 seq_printf(m,
532 "physical id: %u\n" 567 "physical id: %u\n"