From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753865AbZCHQuY (ORCPT ); Sun, 8 Mar 2009 12:50:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753356AbZCHQsp (ORCPT ); Sun, 8 Mar 2009 12:48:45 -0400 Received: from accolon.hansenpartnership.com ([76.243.235.52]:37630 "EHLO accolon.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753173AbZCHQsn (ORCPT ); Sun, 8 Mar 2009 12:48:43 -0400 From: James Bottomley To: LKML Cc: Thomas Gleixner , "H. Peter Anvin" , Ingo Molnar , James Bottomley Subject: [PATCH 05/13] [VOYAGER] x86/voyager: Move voyager detection to a new bootparam area Date: Sun, 8 Mar 2009 11:48:18 -0500 Message-Id: <1236530906-7175-6-git-send-email-James.Bottomley@HansenPartnership.com> X-Mailer: git-send-email 1.6.1.3 In-Reply-To: <1236530906-7175-5-git-send-email-James.Bottomley@HansenPartnership.com> References: <1236530906-7175-1-git-send-email-James.Bottomley@HansenPartnership.com> <1236530906-7175-2-git-send-email-James.Bottomley@HansenPartnership.com> <1236530906-7175-3-git-send-email-James.Bottomley@HansenPartnership.com> <1236530906-7175-4-git-send-email-James.Bottomley@HansenPartnership.com> <1236530906-7175-5-git-send-email-James.Bottomley@HansenPartnership.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For voyager to be detected in arbitrary configurations, it can no longer hijack the apm_bios area and must have a bios area of its own, which this patch implements. Since the a20 test can't be done on voyager because of VIC incompatibilities, the voyager detection must come first so the a20 test can do a runtime check of voyager presence. The runtime check in is_voyager() relies on boot_params, so move this outside of the _SETUP include guard in asm/setup.h and remove the separate definition from boot/boot.h. Also added is an early printk if voyager is detected to aid in debugging problems as they arise. Signed-off-by: James Bottomley --- arch/x86/boot/Makefile | 4 +++- arch/x86/boot/a20.c | 13 +++++++------ arch/x86/boot/boot.h | 2 +- arch/x86/boot/voyager.c | 5 +++-- arch/x86/include/asm/bootparam.h | 5 ++++- arch/x86/include/asm/setup.h | 4 ++-- arch/x86/include/asm/voyager.h | 13 +++---------- arch/x86/include/asm/voyager_bios.h | 21 +++++++++++++++++++++ arch/x86/include/asm/voyager_boot.h | 27 +++++++++++++++++++++++++++ arch/x86/mach-voyager/voyager_basic.c | 2 +- 10 files changed, 72 insertions(+), 24 deletions(-) create mode 100644 arch/x86/include/asm/voyager_bios.h create mode 100644 arch/x86/include/asm/voyager_boot.h diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index cd48c72..7bc64fa 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile @@ -28,11 +28,13 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA targets := vmlinux.bin setup.bin setup.elf zImage bzImage subdir- := compressed +# Voyager must come first because there's a condition in a20.c +# that depends on voyager detection +setup-$(CONFIG_X86_VOYAGER) += voyager.o setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o setup-y += header.o main.o mca.o memory.o pm.o pmjump.o setup-y += printf.o string.o tty.o video.o video-mode.o version.o setup-$(CONFIG_X86_APM_BOOT) += apm.o -setup-$(CONFIG_X86_VOYAGER) += voyager.o # The link order of the video-*.o modules can matter. In particular, # video-vga.o *must* be listed first, followed by video-vesa.o. diff --git a/arch/x86/boot/a20.c b/arch/x86/boot/a20.c index fba8e9c..ecd9561 100644 --- a/arch/x86/boot/a20.c +++ b/arch/x86/boot/a20.c @@ -126,11 +126,13 @@ static void enable_a20_fast(void) int enable_a20(void) { -#ifdef CONFIG_X86_VOYAGER - /* On Voyager, a20_test() is unsafe? */ - enable_a20_kbc(); - return 0; -#else + if (is_voyager()) { + /* On Voyager, a20_test() is unsafe becuase it pokes + * about in areas that are VIC specific and causes + * a crash */ + enable_a20_kbc(); + return 0; + } int loops = A20_ENABLE_LOOPS; int kbc_err; @@ -164,5 +166,4 @@ int enable_a20(void) } return -1; -#endif } diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h index cc0ef13..d70323d 100644 --- a/arch/x86/boot/boot.h +++ b/arch/x86/boot/boot.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "bitops.h" #include @@ -33,7 +34,6 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) extern struct setup_header hdr; -extern struct boot_params boot_params; /* Basic port I/O */ static inline void outb(u8 v, u16 port) diff --git a/arch/x86/boot/voyager.c b/arch/x86/boot/voyager.c index 433909d..c599ff7 100644 --- a/arch/x86/boot/voyager.c +++ b/arch/x86/boot/voyager.c @@ -19,9 +19,9 @@ int query_voyager(void) u8 err; u16 es, di; /* Abuse the apm_bios_info area for this */ - u8 *data_ptr = (u8 *)&boot_params.apm_bios_info; + u8 *data_ptr = (u8 *)&boot_params.voyager_bios_info; - data_ptr[0] = 0xff; /* Flag on config not found(?) */ + data_ptr[0] = NOT_VOYAGER_BIOS_SIG; asm("pushw %%es ; " "int $0x15 ; " @@ -33,6 +33,7 @@ int query_voyager(void) if (err) return -1; /* Not Voyager */ + printf("Voyager detected\n"); set_fs(es); copy_from_fs(data_ptr, di, 7); /* Table is 7 bytes apparently */ diff --git a/arch/x86/include/asm/bootparam.h b/arch/x86/include/asm/bootparam.h index 433adae..2a388a5 100644 --- a/arch/x86/include/asm/bootparam.h +++ b/arch/x86/include/asm/bootparam.h @@ -7,6 +7,7 @@ #include #include #include +#include #include