diff options
Diffstat (limited to 'arch/x86/boot')
-rw-r--r-- | arch/x86/boot/Makefile | 1 | ||||
-rw-r--r-- | arch/x86/boot/a20.c | 79 | ||||
-rw-r--r-- | arch/x86/boot/boot.h | 3 | ||||
-rw-r--r-- | arch/x86/boot/compressed/head_32.S | 8 | ||||
-rw-r--r-- | arch/x86/boot/compressed/head_64.S | 10 | ||||
-rw-r--r-- | arch/x86/boot/copy.S | 40 | ||||
-rw-r--r-- | arch/x86/boot/header.S | 2 | ||||
-rw-r--r-- | arch/x86/boot/main.c | 5 | ||||
-rw-r--r-- | arch/x86/boot/pmjump.S | 16 | ||||
-rw-r--r-- | arch/x86/boot/voyager.c | 40 |
10 files changed, 68 insertions, 136 deletions
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index cd48c721001..c70eff69a1f 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile | |||
@@ -32,7 +32,6 @@ setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o | |||
32 | setup-y += header.o main.o mca.o memory.o pm.o pmjump.o | 32 | setup-y += header.o main.o mca.o memory.o pm.o pmjump.o |
33 | setup-y += printf.o string.o tty.o video.o video-mode.o version.o | 33 | setup-y += printf.o string.o tty.o video.o video-mode.o version.o |
34 | setup-$(CONFIG_X86_APM_BOOT) += apm.o | 34 | setup-$(CONFIG_X86_APM_BOOT) += apm.o |
35 | setup-$(CONFIG_X86_VOYAGER) += voyager.o | ||
36 | 35 | ||
37 | # The link order of the video-*.o modules can matter. In particular, | 36 | # The link order of the video-*.o modules can matter. In particular, |
38 | # video-vga.o *must* be listed first, followed by video-vesa.o. | 37 | # 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 4063d630def..7c19ce8c244 100644 --- a/arch/x86/boot/a20.c +++ b/arch/x86/boot/a20.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * | 2 | * |
3 | * Copyright (C) 1991, 1992 Linus Torvalds | 3 | * Copyright (C) 1991, 1992 Linus Torvalds |
4 | * Copyright 2007-2008 rPath, Inc. - All Rights Reserved | 4 | * Copyright 2007-2008 rPath, Inc. - All Rights Reserved |
5 | * Copyright 2009 Intel Corporation | ||
5 | * | 6 | * |
6 | * This file is part of the Linux kernel, and is made available under | 7 | * This file is part of the Linux kernel, and is made available under |
7 | * the terms of the GNU General Public License version 2. | 8 | * the terms of the GNU General Public License version 2. |
@@ -15,16 +16,23 @@ | |||
15 | #include "boot.h" | 16 | #include "boot.h" |
16 | 17 | ||
17 | #define MAX_8042_LOOPS 100000 | 18 | #define MAX_8042_LOOPS 100000 |
19 | #define MAX_8042_FF 32 | ||
18 | 20 | ||
19 | static int empty_8042(void) | 21 | static int empty_8042(void) |
20 | { | 22 | { |
21 | u8 status; | 23 | u8 status; |
22 | int loops = MAX_8042_LOOPS; | 24 | int loops = MAX_8042_LOOPS; |
25 | int ffs = MAX_8042_FF; | ||
23 | 26 | ||
24 | while (loops--) { | 27 | while (loops--) { |
25 | io_delay(); | 28 | io_delay(); |
26 | 29 | ||
27 | status = inb(0x64); | 30 | status = inb(0x64); |
31 | if (status == 0xff) { | ||
32 | /* FF is a plausible, but very unlikely status */ | ||
33 | if (!--ffs) | ||
34 | return -1; /* Assume no KBC present */ | ||
35 | } | ||
28 | if (status & 1) { | 36 | if (status & 1) { |
29 | /* Read and discard input data */ | 37 | /* Read and discard input data */ |
30 | io_delay(); | 38 | io_delay(); |
@@ -118,44 +126,37 @@ static void enable_a20_fast(void) | |||
118 | 126 | ||
119 | int enable_a20(void) | 127 | int enable_a20(void) |
120 | { | 128 | { |
121 | #if defined(CONFIG_X86_ELAN) | ||
122 | /* Elan croaks if we try to touch the KBC */ | ||
123 | enable_a20_fast(); | ||
124 | while (!a20_test_long()) | ||
125 | ; | ||
126 | return 0; | ||
127 | #elif defined(CONFIG_X86_VOYAGER) | ||
128 | /* On Voyager, a20_test() is unsafe? */ | ||
129 | enable_a20_kbc(); | ||
130 | return 0; | ||
131 | #else | ||
132 | int loops = A20_ENABLE_LOOPS; | 129 | int loops = A20_ENABLE_LOOPS; |
133 | while (loops--) { | 130 | int kbc_err; |
134 | /* First, check to see if A20 is already enabled | 131 | |
135 | (legacy free, etc.) */ | 132 | while (loops--) { |
136 | if (a20_test_short()) | 133 | /* First, check to see if A20 is already enabled |
137 | return 0; | 134 | (legacy free, etc.) */ |
138 | 135 | if (a20_test_short()) | |
139 | /* Next, try the BIOS (INT 0x15, AX=0x2401) */ | 136 | return 0; |
140 | enable_a20_bios(); | 137 | |
141 | if (a20_test_short()) | 138 | /* Next, try the BIOS (INT 0x15, AX=0x2401) */ |
142 | return 0; | 139 | enable_a20_bios(); |
143 | 140 | if (a20_test_short()) | |
144 | /* Try enabling A20 through the keyboard controller */ | 141 | return 0; |
145 | empty_8042(); | 142 | |
146 | if (a20_test_short()) | 143 | /* Try enabling A20 through the keyboard controller */ |
147 | return 0; /* BIOS worked, but with delayed reaction */ | 144 | kbc_err = empty_8042(); |
148 | 145 | ||
149 | enable_a20_kbc(); | 146 | if (a20_test_short()) |
150 | if (a20_test_long()) | 147 | return 0; /* BIOS worked, but with delayed reaction */ |
151 | return 0; | 148 | |
152 | 149 | if (!kbc_err) { | |
153 | /* Finally, try enabling the "fast A20 gate" */ | 150 | enable_a20_kbc(); |
154 | enable_a20_fast(); | 151 | if (a20_test_long()) |
155 | if (a20_test_long()) | 152 | return 0; |
156 | return 0; | 153 | } |
157 | } | 154 | |
158 | 155 | /* Finally, try enabling the "fast A20 gate" */ | |
159 | return -1; | 156 | enable_a20_fast(); |
160 | #endif | 157 | if (a20_test_long()) |
158 | return 0; | ||
159 | } | ||
160 | |||
161 | return -1; | ||
161 | } | 162 | } |
diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h index cc0ef13fba7..7b2692e897e 100644 --- a/arch/x86/boot/boot.h +++ b/arch/x86/boot/boot.h | |||
@@ -302,9 +302,6 @@ void probe_cards(int unsafe); | |||
302 | /* video-vesa.c */ | 302 | /* video-vesa.c */ |
303 | void vesa_store_edid(void); | 303 | void vesa_store_edid(void); |
304 | 304 | ||
305 | /* voyager.c */ | ||
306 | int query_voyager(void); | ||
307 | |||
308 | #endif /* __ASSEMBLY__ */ | 305 | #endif /* __ASSEMBLY__ */ |
309 | 306 | ||
310 | #endif /* BOOT_BOOT_H */ | 307 | #endif /* BOOT_BOOT_H */ |
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index 29c5fbf0839..3a8a866fb2e 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S | |||
@@ -25,14 +25,12 @@ | |||
25 | 25 | ||
26 | #include <linux/linkage.h> | 26 | #include <linux/linkage.h> |
27 | #include <asm/segment.h> | 27 | #include <asm/segment.h> |
28 | #include <asm/page.h> | 28 | #include <asm/page_types.h> |
29 | #include <asm/boot.h> | 29 | #include <asm/boot.h> |
30 | #include <asm/asm-offsets.h> | 30 | #include <asm/asm-offsets.h> |
31 | 31 | ||
32 | .section ".text.head","ax",@progbits | 32 | .section ".text.head","ax",@progbits |
33 | .globl startup_32 | 33 | ENTRY(startup_32) |
34 | |||
35 | startup_32: | ||
36 | cld | 34 | cld |
37 | /* test KEEP_SEGMENTS flag to see if the bootloader is asking | 35 | /* test KEEP_SEGMENTS flag to see if the bootloader is asking |
38 | * us to not reload segments */ | 36 | * us to not reload segments */ |
@@ -113,6 +111,8 @@ startup_32: | |||
113 | */ | 111 | */ |
114 | leal relocated(%ebx), %eax | 112 | leal relocated(%ebx), %eax |
115 | jmp *%eax | 113 | jmp *%eax |
114 | ENDPROC(startup_32) | ||
115 | |||
116 | .section ".text" | 116 | .section ".text" |
117 | relocated: | 117 | relocated: |
118 | 118 | ||
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 1d5dff4123e..ed4a8294800 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S | |||
@@ -26,8 +26,8 @@ | |||
26 | 26 | ||
27 | #include <linux/linkage.h> | 27 | #include <linux/linkage.h> |
28 | #include <asm/segment.h> | 28 | #include <asm/segment.h> |
29 | #include <asm/pgtable.h> | 29 | #include <asm/pgtable_types.h> |
30 | #include <asm/page.h> | 30 | #include <asm/page_types.h> |
31 | #include <asm/boot.h> | 31 | #include <asm/boot.h> |
32 | #include <asm/msr.h> | 32 | #include <asm/msr.h> |
33 | #include <asm/processor-flags.h> | 33 | #include <asm/processor-flags.h> |
@@ -35,9 +35,7 @@ | |||
35 | 35 | ||
36 | .section ".text.head" | 36 | .section ".text.head" |
37 | .code32 | 37 | .code32 |
38 | .globl startup_32 | 38 | ENTRY(startup_32) |
39 | |||
40 | startup_32: | ||
41 | cld | 39 | cld |
42 | /* test KEEP_SEGMENTS flag to see if the bootloader is asking | 40 | /* test KEEP_SEGMENTS flag to see if the bootloader is asking |
43 | * us to not reload segments */ | 41 | * us to not reload segments */ |
@@ -176,6 +174,7 @@ startup_32: | |||
176 | 174 | ||
177 | /* Jump from 32bit compatibility mode into 64bit mode. */ | 175 | /* Jump from 32bit compatibility mode into 64bit mode. */ |
178 | lret | 176 | lret |
177 | ENDPROC(startup_32) | ||
179 | 178 | ||
180 | no_longmode: | 179 | no_longmode: |
181 | /* This isn't an x86-64 CPU so hang */ | 180 | /* This isn't an x86-64 CPU so hang */ |
@@ -295,7 +294,6 @@ relocated: | |||
295 | call decompress_kernel | 294 | call decompress_kernel |
296 | popq %rsi | 295 | popq %rsi |
297 | 296 | ||
298 | |||
299 | /* | 297 | /* |
300 | * Jump to the decompressed kernel. | 298 | * Jump to the decompressed kernel. |
301 | */ | 299 | */ |
diff --git a/arch/x86/boot/copy.S b/arch/x86/boot/copy.S index ef50c84e8b4..11f272c6f5e 100644 --- a/arch/x86/boot/copy.S +++ b/arch/x86/boot/copy.S | |||
@@ -8,6 +8,8 @@ | |||
8 | * | 8 | * |
9 | * ----------------------------------------------------------------------- */ | 9 | * ----------------------------------------------------------------------- */ |
10 | 10 | ||
11 | #include <linux/linkage.h> | ||
12 | |||
11 | /* | 13 | /* |
12 | * Memory copy routines | 14 | * Memory copy routines |
13 | */ | 15 | */ |
@@ -15,9 +17,7 @@ | |||
15 | .code16gcc | 17 | .code16gcc |
16 | .text | 18 | .text |
17 | 19 | ||
18 | .globl memcpy | 20 | GLOBAL(memcpy) |
19 | .type memcpy, @function | ||
20 | memcpy: | ||
21 | pushw %si | 21 | pushw %si |
22 | pushw %di | 22 | pushw %di |
23 | movw %ax, %di | 23 | movw %ax, %di |
@@ -31,11 +31,9 @@ memcpy: | |||
31 | popw %di | 31 | popw %di |
32 | popw %si | 32 | popw %si |
33 | ret | 33 | ret |
34 | .size memcpy, .-memcpy | 34 | ENDPROC(memcpy) |
35 | 35 | ||
36 | .globl memset | 36 | GLOBAL(memset) |
37 | .type memset, @function | ||
38 | memset: | ||
39 | pushw %di | 37 | pushw %di |
40 | movw %ax, %di | 38 | movw %ax, %di |
41 | movzbl %dl, %eax | 39 | movzbl %dl, %eax |
@@ -48,52 +46,42 @@ memset: | |||
48 | rep; stosb | 46 | rep; stosb |
49 | popw %di | 47 | popw %di |
50 | ret | 48 | ret |
51 | .size memset, .-memset | 49 | ENDPROC(memset) |
52 | 50 | ||
53 | .globl copy_from_fs | 51 | GLOBAL(copy_from_fs) |
54 | .type copy_from_fs, @function | ||
55 | copy_from_fs: | ||
56 | pushw %ds | 52 | pushw %ds |
57 | pushw %fs | 53 | pushw %fs |
58 | popw %ds | 54 | popw %ds |
59 | call memcpy | 55 | call memcpy |
60 | popw %ds | 56 | popw %ds |
61 | ret | 57 | ret |
62 | .size copy_from_fs, .-copy_from_fs | 58 | ENDPROC(copy_from_fs) |
63 | 59 | ||
64 | .globl copy_to_fs | 60 | GLOBAL(copy_to_fs) |
65 | .type copy_to_fs, @function | ||
66 | copy_to_fs: | ||
67 | pushw %es | 61 | pushw %es |
68 | pushw %fs | 62 | pushw %fs |
69 | popw %es | 63 | popw %es |
70 | call memcpy | 64 | call memcpy |
71 | popw %es | 65 | popw %es |
72 | ret | 66 | ret |
73 | .size copy_to_fs, .-copy_to_fs | 67 | ENDPROC(copy_to_fs) |
74 | 68 | ||
75 | #if 0 /* Not currently used, but can be enabled as needed */ | 69 | #if 0 /* Not currently used, but can be enabled as needed */ |
76 | 70 | GLOBAL(copy_from_gs) | |
77 | .globl copy_from_gs | ||
78 | .type copy_from_gs, @function | ||
79 | copy_from_gs: | ||
80 | pushw %ds | 71 | pushw %ds |
81 | pushw %gs | 72 | pushw %gs |
82 | popw %ds | 73 | popw %ds |
83 | call memcpy | 74 | call memcpy |
84 | popw %ds | 75 | popw %ds |
85 | ret | 76 | ret |
86 | .size copy_from_gs, .-copy_from_gs | 77 | ENDPROC(copy_from_gs) |
87 | .globl copy_to_gs | ||
88 | 78 | ||
89 | .type copy_to_gs, @function | 79 | GLOBAL(copy_to_gs) |
90 | copy_to_gs: | ||
91 | pushw %es | 80 | pushw %es |
92 | pushw %gs | 81 | pushw %gs |
93 | popw %es | 82 | popw %es |
94 | call memcpy | 83 | call memcpy |
95 | popw %es | 84 | popw %es |
96 | ret | 85 | ret |
97 | .size copy_to_gs, .-copy_to_gs | 86 | ENDPROC(copy_to_gs) |
98 | |||
99 | #endif | 87 | #endif |
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index b993062e9a5..7ccff4884a2 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/utsrelease.h> | 19 | #include <linux/utsrelease.h> |
20 | #include <asm/boot.h> | 20 | #include <asm/boot.h> |
21 | #include <asm/e820.h> | 21 | #include <asm/e820.h> |
22 | #include <asm/page.h> | 22 | #include <asm/page_types.h> |
23 | #include <asm/setup.h> | 23 | #include <asm/setup.h> |
24 | #include "boot.h" | 24 | #include "boot.h" |
25 | #include "offsets.h" | 25 | #include "offsets.h" |
diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c index 197421db1af..58f0415d3ae 100644 --- a/arch/x86/boot/main.c +++ b/arch/x86/boot/main.c | |||
@@ -149,11 +149,6 @@ void main(void) | |||
149 | /* Query MCA information */ | 149 | /* Query MCA information */ |
150 | query_mca(); | 150 | query_mca(); |
151 | 151 | ||
152 | /* Voyager */ | ||
153 | #ifdef CONFIG_X86_VOYAGER | ||
154 | query_voyager(); | ||
155 | #endif | ||
156 | |||
157 | /* Query Intel SpeedStep (IST) information */ | 152 | /* Query Intel SpeedStep (IST) information */ |
158 | query_ist(); | 153 | query_ist(); |
159 | 154 | ||
diff --git a/arch/x86/boot/pmjump.S b/arch/x86/boot/pmjump.S index 141b6e20ed3..019c17a7585 100644 --- a/arch/x86/boot/pmjump.S +++ b/arch/x86/boot/pmjump.S | |||
@@ -15,18 +15,15 @@ | |||
15 | #include <asm/boot.h> | 15 | #include <asm/boot.h> |
16 | #include <asm/processor-flags.h> | 16 | #include <asm/processor-flags.h> |
17 | #include <asm/segment.h> | 17 | #include <asm/segment.h> |
18 | #include <linux/linkage.h> | ||
18 | 19 | ||
19 | .text | 20 | .text |
20 | |||
21 | .globl protected_mode_jump | ||
22 | .type protected_mode_jump, @function | ||
23 | |||
24 | .code16 | 21 | .code16 |
25 | 22 | ||
26 | /* | 23 | /* |
27 | * void protected_mode_jump(u32 entrypoint, u32 bootparams); | 24 | * void protected_mode_jump(u32 entrypoint, u32 bootparams); |
28 | */ | 25 | */ |
29 | protected_mode_jump: | 26 | GLOBAL(protected_mode_jump) |
30 | movl %edx, %esi # Pointer to boot_params table | 27 | movl %edx, %esi # Pointer to boot_params table |
31 | 28 | ||
32 | xorl %ebx, %ebx | 29 | xorl %ebx, %ebx |
@@ -47,12 +44,10 @@ protected_mode_jump: | |||
47 | .byte 0x66, 0xea # ljmpl opcode | 44 | .byte 0x66, 0xea # ljmpl opcode |
48 | 2: .long in_pm32 # offset | 45 | 2: .long in_pm32 # offset |
49 | .word __BOOT_CS # segment | 46 | .word __BOOT_CS # segment |
50 | 47 | ENDPROC(protected_mode_jump) | |
51 | .size protected_mode_jump, .-protected_mode_jump | ||
52 | 48 | ||
53 | .code32 | 49 | .code32 |
54 | .type in_pm32, @function | 50 | GLOBAL(in_pm32) |
55 | in_pm32: | ||
56 | # Set up data segments for flat 32-bit mode | 51 | # Set up data segments for flat 32-bit mode |
57 | movl %ecx, %ds | 52 | movl %ecx, %ds |
58 | movl %ecx, %es | 53 | movl %ecx, %es |
@@ -78,5 +73,4 @@ in_pm32: | |||
78 | lldt %cx | 73 | lldt %cx |
79 | 74 | ||
80 | jmpl *%eax # Jump to the 32-bit entrypoint | 75 | jmpl *%eax # Jump to the 32-bit entrypoint |
81 | 76 | ENDPROC(in_pm32) | |
82 | .size in_pm32, .-in_pm32 | ||
diff --git a/arch/x86/boot/voyager.c b/arch/x86/boot/voyager.c deleted file mode 100644 index 433909d61e5..00000000000 --- a/arch/x86/boot/voyager.c +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* -*- linux-c -*- ------------------------------------------------------- * | ||
2 | * | ||
3 | * Copyright (C) 1991, 1992 Linus Torvalds | ||
4 | * Copyright 2007 rPath, Inc. - All Rights Reserved | ||
5 | * | ||
6 | * This file is part of the Linux kernel, and is made available under | ||
7 | * the terms of the GNU General Public License version 2. | ||
8 | * | ||
9 | * ----------------------------------------------------------------------- */ | ||
10 | |||
11 | /* | ||
12 | * Get the Voyager config information | ||
13 | */ | ||
14 | |||
15 | #include "boot.h" | ||
16 | |||
17 | int query_voyager(void) | ||
18 | { | ||
19 | u8 err; | ||
20 | u16 es, di; | ||
21 | /* Abuse the apm_bios_info area for this */ | ||
22 | u8 *data_ptr = (u8 *)&boot_params.apm_bios_info; | ||
23 | |||
24 | data_ptr[0] = 0xff; /* Flag on config not found(?) */ | ||
25 | |||
26 | asm("pushw %%es ; " | ||
27 | "int $0x15 ; " | ||
28 | "setc %0 ; " | ||
29 | "movw %%es, %1 ; " | ||
30 | "popw %%es" | ||
31 | : "=q" (err), "=r" (es), "=D" (di) | ||
32 | : "a" (0xffc0)); | ||
33 | |||
34 | if (err) | ||
35 | return -1; /* Not Voyager */ | ||
36 | |||
37 | set_fs(es); | ||
38 | copy_from_fs(data_ptr, di, 7); /* Table is 7 bytes apparently */ | ||
39 | return 0; | ||
40 | } | ||