From c5c41be820a7f12db80f17e9a5123de7cc8cde63 Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Wed, 25 Jul 2007 13:16:28 -0600 Subject: [PATCH] [IA64] Fix Linux VGA autodetection This patch re-orders setup_arch in xenlinux slightly. This allows us to check if conswitchp was setup early by the HCDP code to point to a VGA console. Also fix a bug w/ zero'ing the preferred console name string. Signed-off-by: Alex Williamson --- arch/ia64/kernel/setup.c | 49 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 71bf7574..f2450330 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c @@ -526,22 +526,6 @@ setup_arch (char **cmdline_p) acpi_boot_init(); #endif -#ifdef CONFIG_VT - if (!conswitchp) { -# if defined(CONFIG_DUMMY_CONSOLE) - conswitchp = &dummy_con; -# endif -# if defined(CONFIG_VGA_CONSOLE) - /* - * Non-legacy systems may route legacy VGA MMIO range to system - * memory. vga_con probes the MMIO hole, so memory looks like - * a VGA device to it. The EFI memory map can tell us if it's - * memory so we can avoid this problem. - */ - if (efi_mem_type(0xA0000) != EFI_CONVENTIONAL_MEMORY) - conswitchp = &vga_con; -# endif - } #ifdef CONFIG_XEN if (is_running_on_xen()) { shared_info_t *s = HYPERVISOR_shared_info; @@ -552,12 +536,6 @@ setup_arch (char **cmdline_p) "flags=0x%x\n", s->arch.start_info_pfn, xen_start_info->nr_pages, xen_start_info->flags); - if (!is_initial_xendomain()) { -#if !defined(CONFIG_VT) || !defined(CONFIG_DUMMY_CONSOLE) - conswitchp = NULL; -#endif - } - /* * If a console= is NOT specified, we assume using the * xencons console is desired. By default, this is ttyS0 @@ -567,7 +545,8 @@ setup_arch (char **cmdline_p) char *p, *q, name[5]; int offset = 0; - if (is_initial_xendomain()) + memset(name, 0, sizeof(name)); + if (is_initial_xendomain() && conswitchp != &vga_con) strncpy(name, "ttyS", 4); else strncpy(name, "tty", 3); @@ -599,13 +578,33 @@ setup_arch (char **cmdline_p) } xencons_early_setup(); #endif -#endif +#ifdef CONFIG_VT + if (!conswitchp) { +# if defined(CONFIG_DUMMY_CONSOLE) + conswitchp = &dummy_con; +# endif +# if defined(CONFIG_VGA_CONSOLE) + /* + * Non-legacy systems may route legacy VGA MMIO range to system + * memory. vga_con probes the MMIO hole, so memory looks like + * a VGA device to it. The EFI memory map can tell us if it's + * memory so we can avoid this problem. + */ + if (efi_mem_type(0xA0000) != EFI_CONVENTIONAL_MEMORY) + conswitchp = &vga_con; +# endif + } +#endif /* enable IA-64 Machine Check Abort Handling unless disabled */ #ifdef CONFIG_XEN - if (is_running_on_xen() && !is_initial_xendomain()) + if (is_running_on_xen() && !is_initial_xendomain()) { nomca = 1; +#if !defined(CONFIG_VT) || !defined(CONFIG_DUMMY_CONSOLE) + conswitchp = NULL; +#endif + } #endif if (!nomca) ia64_mca_init(); -- 2.39.5