* [PATCH] init IO port space, IO accessors earlier
@ 2004-03-17 20:06 Bjorn Helgaas
2004-03-17 20:42 ` Matthew Wilcox
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2004-03-17 20:06 UTC (permalink / raw)
To: linux-ia64
This is a minor patch to get things setup so consoles can
work earlier. (No change to consoles here, I just split this
out to make the diff easier to read.)
(io_port_init): New function, same old code to setup ia64_iobase
and legacy IO port space.
(setup_arch): Call io_port_init() and machvec_init() as early as
possible so consoles can work earlier.
=== arch/ia64/kernel/setup.c 1.69 vs edited ==--- 1.69/arch/ia64/kernel/setup.c Mon Mar 15 07:20:19 2004
+++ edited/arch/ia64/kernel/setup.c Wed Mar 17 12:46:59 2004
@@ -229,6 +229,38 @@
#endif
}
+static void __init
+io_port_init (void)
+{
+ extern unsigned long ia64_iobase;
+ unsigned long phys_iobase;
+
+ /*
+ * Set `iobase' to the appropriate address in region 6 (uncached access range).
+ *
+ * The EFI memory map is the "preferred" location to get the I/O port space base,
+ * rather the relying on AR.KR0. This should become more clear in future SAL
+ * specs. We'll fall back to getting it out of AR.KR0 if no appropriate entry is
+ * found in the memory map.
+ */
+ phys_iobase = efi_get_iobase();
+ if (phys_iobase)
+ /* set AR.KR0 since this is all we use it for anyway */
+ ia64_set_kr(IA64_KR_IO_BASE, phys_iobase);
+ else {
+ phys_iobase = ia64_get_kr(IA64_KR_IO_BASE);
+ printk(KERN_INFO "No I/O port range found in EFI memory map, falling back "
+ "to AR.KR0\n");
+ printk(KERN_INFO "I/O port base = 0x%lx\n", phys_iobase);
+ }
+ ia64_iobase = (unsigned long) ioremap(phys_iobase, 0);
+
+ /* setup legacy IO port space */
+ io_space[0].mmio_base = ia64_iobase;
+ io_space[0].sparse = 1;
+ num_io_spaces = 1;
+}
+
#ifdef CONFIG_SERIAL_8250_CONSOLE
static void __init
setup_serial_legacy (void)
@@ -251,9 +283,6 @@
void __init
setup_arch (char **cmdline_p)
{
- extern unsigned long ia64_iobase;
- unsigned long phys_iobase;
-
unw_init();
ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
@@ -262,6 +291,11 @@
strlcpy(saved_command_line, *cmdline_p, sizeof(saved_command_line));
efi_init();
+ io_port_init();
+
+#ifdef CONFIG_IA64_GENERIC
+ machvec_init(acpi_get_sysname());
+#endif
#ifdef CONFIG_ACPI_BOOT
/* Initialize the ACPI boot-time table parser */
@@ -279,35 +313,6 @@
/* process SAL system table: */
ia64_sal_init(efi.sal_systab);
-
-#ifdef CONFIG_IA64_GENERIC
- machvec_init(acpi_get_sysname());
-#endif
-
- /*
- * Set `iobase' to the appropriate address in region 6 (uncached access range).
- *
- * The EFI memory map is the "preferred" location to get the I/O port space base,
- * rather the relying on AR.KR0. This should become more clear in future SAL
- * specs. We'll fall back to getting it out of AR.KR0 if no appropriate entry is
- * found in the memory map.
- */
- phys_iobase = efi_get_iobase();
- if (phys_iobase)
- /* set AR.KR0 since this is all we use it for anyway */
- ia64_set_kr(IA64_KR_IO_BASE, phys_iobase);
- else {
- phys_iobase = ia64_get_kr(IA64_KR_IO_BASE);
- printk(KERN_INFO "No I/O port range found in EFI memory map, falling back "
- "to AR.KR0\n");
- printk(KERN_INFO "I/O port base = 0x%lx\n", phys_iobase);
- }
- ia64_iobase = (unsigned long) ioremap(phys_iobase, 0);
-
- /* setup legacy IO port space */
- io_space[0].mmio_base = ia64_iobase;
- io_space[0].sparse = 1;
- num_io_spaces = 1;
#ifdef CONFIG_SMP
cpu_physical_id(0) = hard_smp_processor_id();
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] init IO port space, IO accessors earlier
2004-03-17 20:06 [PATCH] init IO port space, IO accessors earlier Bjorn Helgaas
@ 2004-03-17 20:42 ` Matthew Wilcox
2004-03-17 20:49 ` Bjorn Helgaas
2004-03-17 20:57 ` David Mosberger
2 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2004-03-17 20:42 UTC (permalink / raw)
To: linux-ia64
On Wed, Mar 17, 2004 at 01:06:01PM -0700, Bjorn Helgaas wrote:
> +io_port_init (void)
> +{
> + extern unsigned long ia64_iobase;
> + unsigned long phys_iobase;
> +
> + /*
> + * Set `iobase' to the appropriate address in region 6 (uncached access range).
> + *
> + * The EFI memory map is the "preferred" location to get the I/O port space base,
> + * rather the relying on AR.KR0. This should become more clear in future SAL
> + * specs. We'll fall back to getting it out of AR.KR0 if no appropriate entry is
> + * found in the memory map.
> + */
I see you're only moving code here, but could you wrap this comment at
80 columns?
/*
* Set `iobase' to the appropriate address in region 6 (uncached
* access range). The EFI memory map is the "preferred" location
* to get the I/O port space base, rather the relying on AR.KR0.
* This should become more clear in future SAL specs. We'll fall
* back to getting it out of AR.KR0 if no appropriate entry is
* found in the memory map.
*/
> + phys_iobase = efi_get_iobase();
> + if (phys_iobase)
> + /* set AR.KR0 since this is all we use it for anyway */
> + ia64_set_kr(IA64_KR_IO_BASE, phys_iobase);
> + else {
> + phys_iobase = ia64_get_kr(IA64_KR_IO_BASE);
> + printk(KERN_INFO "No I/O port range found in EFI memory map, falling back "
> + "to AR.KR0\n");
This printk could also be wrapped:
printk(KERN_INFO "No I/O port range found in EFI memory map, "
"falling back to AR.KR0\n");
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] init IO port space, IO accessors earlier
2004-03-17 20:06 [PATCH] init IO port space, IO accessors earlier Bjorn Helgaas
2004-03-17 20:42 ` Matthew Wilcox
@ 2004-03-17 20:49 ` Bjorn Helgaas
2004-03-17 20:57 ` David Mosberger
2 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2004-03-17 20:49 UTC (permalink / raw)
To: linux-ia64
On Wednesday 17 March 2004 1:42 pm, Matthew Wilcox wrote:
> I see you're only moving code here, but could you wrap this comment at
> 80 columns?
Here's a wrapped version, pick your favorite ;-)
(io_port_init): New function, same old code to setup ia64_iobase
and legacy IO port space.
(setup_arch): Call io_port_init() and machvec_init() as early as
possible so consoles can work earlier.
=== arch/ia64/kernel/setup.c 1.69 vs edited ==--- 1.69/arch/ia64/kernel/setup.c Mon Mar 15 07:20:19 2004
+++ edited/arch/ia64/kernel/setup.c Wed Mar 17 13:47:00 2004
@@ -229,6 +229,38 @@
#endif
}
+static void __init
+io_port_init (void)
+{
+ extern unsigned long ia64_iobase;
+ unsigned long phys_iobase;
+
+ /*
+ * Set `iobase' to the appropriate address in region 6 (uncached
+ * access range). The EFI memory map is the "preferred" location
+ * to get the I/O port space base, rather than relying on AR.KR0.
+ * This should become more clear in future SAL specs. We'll fall
+ * back to getting it out of AR.KR0 if no appropriate entry is
+ * found in the memory map.
+ */
+ phys_iobase = efi_get_iobase();
+ if (phys_iobase)
+ /* set AR.KR0 since this is all we use it for anyway */
+ ia64_set_kr(IA64_KR_IO_BASE, phys_iobase);
+ else {
+ phys_iobase = ia64_get_kr(IA64_KR_IO_BASE);
+ printk(KERN_INFO "No I/O port range found in EFI memory map, "
+ "falling back to AR.KR0\n");
+ printk(KERN_INFO "I/O port base = 0x%lx\n", phys_iobase);
+ }
+ ia64_iobase = (unsigned long) ioremap(phys_iobase, 0);
+
+ /* setup legacy IO port space */
+ io_space[0].mmio_base = ia64_iobase;
+ io_space[0].sparse = 1;
+ num_io_spaces = 1;
+}
+
#ifdef CONFIG_SERIAL_8250_CONSOLE
static void __init
setup_serial_legacy (void)
@@ -251,9 +283,6 @@
void __init
setup_arch (char **cmdline_p)
{
- extern unsigned long ia64_iobase;
- unsigned long phys_iobase;
-
unw_init();
ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
@@ -262,6 +291,11 @@
strlcpy(saved_command_line, *cmdline_p, sizeof(saved_command_line));
efi_init();
+ io_port_init();
+
+#ifdef CONFIG_IA64_GENERIC
+ machvec_init(acpi_get_sysname());
+#endif
#ifdef CONFIG_ACPI_BOOT
/* Initialize the ACPI boot-time table parser */
@@ -279,35 +313,6 @@
/* process SAL system table: */
ia64_sal_init(efi.sal_systab);
-
-#ifdef CONFIG_IA64_GENERIC
- machvec_init(acpi_get_sysname());
-#endif
-
- /*
- * Set `iobase' to the appropriate address in region 6 (uncached access range).
- *
- * The EFI memory map is the "preferred" location to get the I/O port space base,
- * rather the relying on AR.KR0. This should become more clear in future SAL
- * specs. We'll fall back to getting it out of AR.KR0 if no appropriate entry is
- * found in the memory map.
- */
- phys_iobase = efi_get_iobase();
- if (phys_iobase)
- /* set AR.KR0 since this is all we use it for anyway */
- ia64_set_kr(IA64_KR_IO_BASE, phys_iobase);
- else {
- phys_iobase = ia64_get_kr(IA64_KR_IO_BASE);
- printk(KERN_INFO "No I/O port range found in EFI memory map, falling back "
- "to AR.KR0\n");
- printk(KERN_INFO "I/O port base = 0x%lx\n", phys_iobase);
- }
- ia64_iobase = (unsigned long) ioremap(phys_iobase, 0);
-
- /* setup legacy IO port space */
- io_space[0].mmio_base = ia64_iobase;
- io_space[0].sparse = 1;
- num_io_spaces = 1;
#ifdef CONFIG_SMP
cpu_physical_id(0) = hard_smp_processor_id();
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] init IO port space, IO accessors earlier
2004-03-17 20:06 [PATCH] init IO port space, IO accessors earlier Bjorn Helgaas
2004-03-17 20:42 ` Matthew Wilcox
2004-03-17 20:49 ` Bjorn Helgaas
@ 2004-03-17 20:57 ` David Mosberger
2 siblings, 0 replies; 4+ messages in thread
From: David Mosberger @ 2004-03-17 20:57 UTC (permalink / raw)
To: linux-ia64
>>>>> On Wed, 17 Mar 2004 13:49:20 -0700, Bjorn Helgaas <bjorn.helgaas@hp.com> said:
Bjorn> Here's a wrapped version, pick your favorite ;-)
I already applied your earlier patch.
--david
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-03-17 20:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-17 20:06 [PATCH] init IO port space, IO accessors earlier Bjorn Helgaas
2004-03-17 20:42 ` Matthew Wilcox
2004-03-17 20:49 ` Bjorn Helgaas
2004-03-17 20:57 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox