diff options
author | Jeremy Fitzhardinge <jeremy@xensource.com> | 2006-06-25 08:46:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:00:55 -0400 |
commit | e75eac33b5c7f797e4b2ddcb39183cf268e26822 (patch) | |
tree | 3c87328055c5975ca9d69df56dcc4a1d9066352c /include/asm-i386/mach-voyager | |
parent | e6a1530d692d6a60cdf15dfbcfea07f5324d7b9f (diff) |
[PATCH] Clean up and refactor i386 sub-architecture setup
Clean up and refactor i386 sub-architecture setup.
This change moves all the code from the
asm-i386/mach-*/setup_arch_pre/post.h headers, into
arch/i386/mach-*/setup.c. mach-*/setup_arch_pre.h is renamed to
setup_arch.h, and contains only things which should be in header files. It
is purely code-motion; there should be no functional changes at all.
Several functions in arch/i386/kernel/setup.c needed to be made non-static
so that they're visible to the code in mach-*/setup.c. asm-i386/setup.h is
used to hold the prototypes for these functions.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Cc: Zachary Amsden <zach@vmware.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Cc: Martin Bligh <mbligh@google.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Andrey Panin <pazke@donpac.ru>
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-i386/mach-voyager')
-rw-r--r-- | include/asm-i386/mach-voyager/setup_arch.h (renamed from include/asm-i386/mach-voyager/setup_arch_pre.h) | 2 | ||||
-rw-r--r-- | include/asm-i386/mach-voyager/setup_arch_post.h | 73 |
2 files changed, 1 insertions, 74 deletions
diff --git a/include/asm-i386/mach-voyager/setup_arch_pre.h b/include/asm-i386/mach-voyager/setup_arch.h index 48f7e6ff49a5..84d01ad33459 100644 --- a/include/asm-i386/mach-voyager/setup_arch_pre.h +++ b/include/asm-i386/mach-voyager/setup_arch.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | /* Hook to call BIOS initialisation function */ | 4 | /* Hook to call BIOS initialisation function */ |
5 | 5 | ||
6 | /* for voyager, pass the voyager BIOS/SUS info area to the detection | 6 | /* for voyager, pass the voyager BIOS/SUS info area to the detection |
7 | * routines */ | 7 | * routines */ |
8 | 8 | ||
9 | #define ARCH_SETUP voyager_detect(VOYAGER_BIOS_INFO); | 9 | #define ARCH_SETUP voyager_detect(VOYAGER_BIOS_INFO); |
diff --git a/include/asm-i386/mach-voyager/setup_arch_post.h b/include/asm-i386/mach-voyager/setup_arch_post.h deleted file mode 100644 index f6f6c2cbc75c..000000000000 --- a/include/asm-i386/mach-voyager/setup_arch_post.h +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | /* Hook for machine specific memory setup. | ||
2 | * | ||
3 | * This is included late in kernel/setup.c so that it can make use of all of | ||
4 | * the static functions. */ | ||
5 | |||
6 | static char * __init machine_specific_memory_setup(void) | ||
7 | { | ||
8 | char *who; | ||
9 | |||
10 | who = "NOT VOYAGER"; | ||
11 | |||
12 | if(voyager_level == 5) { | ||
13 | __u32 addr, length; | ||
14 | int i; | ||
15 | |||
16 | who = "Voyager-SUS"; | ||
17 | |||
18 | e820.nr_map = 0; | ||
19 | for(i=0; voyager_memory_detect(i, &addr, &length); i++) { | ||
20 | add_memory_region(addr, length, E820_RAM); | ||
21 | } | ||
22 | return who; | ||
23 | } else if(voyager_level == 4) { | ||
24 | __u32 tom; | ||
25 | __u16 catbase = inb(VOYAGER_SSPB_RELOCATION_PORT)<<8; | ||
26 | /* select the DINO config space */ | ||
27 | outb(VOYAGER_DINO, VOYAGER_CAT_CONFIG_PORT); | ||
28 | /* Read DINO top of memory register */ | ||
29 | tom = ((inb(catbase + 0x4) & 0xf0) << 16) | ||
30 | + ((inb(catbase + 0x5) & 0x7f) << 24); | ||
31 | |||
32 | if(inb(catbase) != VOYAGER_DINO) { | ||
33 | printk(KERN_ERR "Voyager: Failed to get DINO for L4, setting tom to EXT_MEM_K\n"); | ||
34 | tom = (EXT_MEM_K)<<10; | ||
35 | } | ||
36 | who = "Voyager-TOM"; | ||
37 | add_memory_region(0, 0x9f000, E820_RAM); | ||
38 | /* map from 1M to top of memory */ | ||
39 | add_memory_region(1*1024*1024, tom - 1*1024*1024, E820_RAM); | ||
40 | /* FIXME: Should check the ASICs to see if I need to | ||
41 | * take out the 8M window. Just do it at the moment | ||
42 | * */ | ||
43 | add_memory_region(8*1024*1024, 8*1024*1024, E820_RESERVED); | ||
44 | return who; | ||
45 | } | ||
46 | |||
47 | who = "BIOS-e820"; | ||
48 | |||
49 | /* | ||
50 | * Try to copy the BIOS-supplied E820-map. | ||
51 | * | ||
52 | * Otherwise fake a memory map; one section from 0k->640k, | ||
53 | * the next section from 1mb->appropriate_mem_k | ||
54 | */ | ||
55 | sanitize_e820_map(E820_MAP, &E820_MAP_NR); | ||
56 | if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) { | ||
57 | unsigned long mem_size; | ||
58 | |||
59 | /* compare results from other methods and take the greater */ | ||
60 | if (ALT_MEM_K < EXT_MEM_K) { | ||
61 | mem_size = EXT_MEM_K; | ||
62 | who = "BIOS-88"; | ||
63 | } else { | ||
64 | mem_size = ALT_MEM_K; | ||
65 | who = "BIOS-e801"; | ||
66 | } | ||
67 | |||
68 | e820.nr_map = 0; | ||
69 | add_memory_region(0, LOWMEMSIZE(), E820_RAM); | ||
70 | add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM); | ||
71 | } | ||
72 | return who; | ||
73 | } | ||