diff options
author | Paul Mackerras <paulus@samba.org> | 2005-11-09 21:37:51 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-09 21:37:51 -0500 |
commit | 799d6046d3fb557006e6d7c9767fdb96479b0e0a (patch) | |
tree | fff321e3c0c0e6d1192f453aab23ad204f350851 /include/asm-powerpc | |
parent | 3ddfbcf19b15ccd25a0b4b2dc2e38000e08de739 (diff) |
[PATCH] powerpc: merge code values for identifying platforms
This patch merges platform codes. systemcfg->platform is no longer used,
systemcfg use in general is deprecated as much as possible (and renamed
_systemcfg before it gets completely moved elsewhere in a future patch),
_machine is now used on ppc64 along as ppc32. Platform codes aren't gone
yet but we are getting a step closer. A bunch of asm code in head[_64].S
is also turned into C code.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/firmware.h | 6 | ||||
-rw-r--r-- | include/asm-powerpc/processor.h | 71 | ||||
-rw-r--r-- | include/asm-powerpc/reg.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/systemcfg.h | 64 |
4 files changed, 111 insertions, 31 deletions
diff --git a/include/asm-powerpc/firmware.h b/include/asm-powerpc/firmware.h index 806c142ae9ea..12fabbcb04f0 100644 --- a/include/asm-powerpc/firmware.h +++ b/include/asm-powerpc/firmware.h | |||
@@ -43,6 +43,7 @@ | |||
43 | #define FW_FEATURE_ISERIES (1UL<<21) | 43 | #define FW_FEATURE_ISERIES (1UL<<21) |
44 | 44 | ||
45 | enum { | 45 | enum { |
46 | #ifdef CONFIG_PPC64 | ||
46 | FW_FEATURE_PSERIES_POSSIBLE = FW_FEATURE_PFT | FW_FEATURE_TCE | | 47 | FW_FEATURE_PSERIES_POSSIBLE = FW_FEATURE_PFT | FW_FEATURE_TCE | |
47 | FW_FEATURE_SPRG0 | FW_FEATURE_DABR | FW_FEATURE_COPY | | 48 | FW_FEATURE_SPRG0 | FW_FEATURE_DABR | FW_FEATURE_COPY | |
48 | FW_FEATURE_ASR | FW_FEATURE_DEBUG | FW_FEATURE_TERM | | 49 | FW_FEATURE_ASR | FW_FEATURE_DEBUG | FW_FEATURE_TERM | |
@@ -70,6 +71,11 @@ enum { | |||
70 | FW_FEATURE_ISERIES_ALWAYS & | 71 | FW_FEATURE_ISERIES_ALWAYS & |
71 | #endif | 72 | #endif |
72 | FW_FEATURE_POSSIBLE, | 73 | FW_FEATURE_POSSIBLE, |
74 | |||
75 | #else /* CONFIG_PPC64 */ | ||
76 | FW_FEATURE_POSSIBLE = 0, | ||
77 | FW_FEATURE_ALWAYS = 0, | ||
78 | #endif | ||
73 | }; | 79 | }; |
74 | 80 | ||
75 | /* This is used to identify firmware features which are available | 81 | /* This is used to identify firmware features which are available |
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h index 1dc4bf7b52b3..82e3f4e6550d 100644 --- a/include/asm-powerpc/processor.h +++ b/include/asm-powerpc/processor.h | |||
@@ -17,65 +17,74 @@ | |||
17 | #include <linux/compiler.h> | 17 | #include <linux/compiler.h> |
18 | #include <asm/ptrace.h> | 18 | #include <asm/ptrace.h> |
19 | #include <asm/types.h> | 19 | #include <asm/types.h> |
20 | #ifdef CONFIG_PPC64 | ||
21 | #include <asm/systemcfg.h> | ||
22 | #endif | ||
23 | 20 | ||
24 | #ifdef CONFIG_PPC32 | 21 | /* We do _not_ want to define new machine types at all, those must die |
25 | /* 32-bit platform types */ | 22 | * in favor of using the device-tree |
26 | /* We only need to define a new _MACH_xxx for machines which are part of | 23 | * -- BenH. |
27 | * a configuration which supports more than one type of different machine. | ||
28 | * This is currently limited to CONFIG_PPC_MULTIPLATFORM and CHRP/PReP/PMac. | ||
29 | * -- Tom | ||
30 | */ | 24 | */ |
31 | #define _MACH_prep 0x00000001 | ||
32 | #define _MACH_Pmac 0x00000002 /* pmac or pmac clone (non-chrp) */ | ||
33 | #define _MACH_chrp 0x00000004 /* chrp machine */ | ||
34 | 25 | ||
35 | /* see residual.h for these */ | 26 | /* Platforms codes (to be obsoleted) */ |
27 | #define PLATFORM_PSERIES 0x0100 | ||
28 | #define PLATFORM_PSERIES_LPAR 0x0101 | ||
29 | #define PLATFORM_ISERIES_LPAR 0x0201 | ||
30 | #define PLATFORM_LPAR 0x0001 | ||
31 | #define PLATFORM_POWERMAC 0x0400 | ||
32 | #define PLATFORM_MAPLE 0x0500 | ||
33 | #define PLATFORM_PREP 0x0600 | ||
34 | #define PLATFORM_CHRP 0x0700 | ||
35 | #define PLATFORM_CELL 0x1000 | ||
36 | |||
37 | /* Compat platform codes for 32 bits */ | ||
38 | #define _MACH_prep PLATFORM_PREP | ||
39 | #define _MACH_Pmac PLATFORM_POWERMAC | ||
40 | #define _MACH_chrp PLATFORM_CHRP | ||
41 | |||
42 | /* PREP sub-platform types see residual.h for these */ | ||
36 | #define _PREP_Motorola 0x01 /* motorola prep */ | 43 | #define _PREP_Motorola 0x01 /* motorola prep */ |
37 | #define _PREP_Firm 0x02 /* firmworks prep */ | 44 | #define _PREP_Firm 0x02 /* firmworks prep */ |
38 | #define _PREP_IBM 0x00 /* ibm prep */ | 45 | #define _PREP_IBM 0x00 /* ibm prep */ |
39 | #define _PREP_Bull 0x03 /* bull prep */ | 46 | #define _PREP_Bull 0x03 /* bull prep */ |
40 | 47 | ||
41 | /* these are arbitrary */ | 48 | /* CHRP sub-platform types. These are arbitrary */ |
42 | #define _CHRP_Motorola 0x04 /* motorola chrp, the cobra */ | 49 | #define _CHRP_Motorola 0x04 /* motorola chrp, the cobra */ |
43 | #define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */ | 50 | #define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */ |
44 | #define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */ | 51 | #define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */ |
45 | 52 | ||
46 | #ifdef CONFIG_PPC_MULTIPLATFORM | 53 | #define platform_is_pseries() (_machine == PLATFORM_PSERIES || \ |
54 | _machine == PLATFORM_PSERIES_LPAR) | ||
55 | #define platform_is_lpar() (!!(_machine & PLATFORM_LPAR)) | ||
56 | |||
57 | #if defined(CONFIG_PPC_MULTIPLATFORM) | ||
47 | extern int _machine; | 58 | extern int _machine; |
48 | 59 | ||
60 | #ifdef CONFIG_PPC32 | ||
61 | |||
49 | /* what kind of prep workstation we are */ | 62 | /* what kind of prep workstation we are */ |
50 | extern int _prep_type; | 63 | extern int _prep_type; |
51 | extern int _chrp_type; | 64 | extern int _chrp_type; |
52 | 65 | ||
53 | /* | 66 | /* |
54 | * This is used to identify the board type from a given PReP board | 67 | * This is used to identify the board type from a given PReP board |
55 | * vendor. Board revision is also made available. | 68 | * vendor. Board revision is also made available. This will be moved |
69 | * elsewhere soon | ||
56 | */ | 70 | */ |
57 | extern unsigned char ucSystemType; | 71 | extern unsigned char ucSystemType; |
58 | extern unsigned char ucBoardRev; | 72 | extern unsigned char ucBoardRev; |
59 | extern unsigned char ucBoardRevMaj, ucBoardRevMin; | 73 | extern unsigned char ucBoardRevMaj, ucBoardRevMin; |
74 | |||
75 | #endif /* CONFIG_PPC32 */ | ||
76 | |||
77 | #elif defined(CONFIG_PPC_ISERIES) | ||
78 | /* | ||
79 | * iSeries is soon to become MULTIPLATFORM hopefully ... | ||
80 | */ | ||
81 | #define _machine CONFIG_PPC_ISERIES_LPAR | ||
60 | #else | 82 | #else |
61 | #define _machine 0 | 83 | #define _machine 0 |
62 | #endif /* CONFIG_PPC_MULTIPLATFORM */ | 84 | #endif /* CONFIG_PPC_MULTIPLATFORM */ |
63 | #endif /* CONFIG_PPC32 */ | ||
64 | 85 | ||
65 | #ifdef CONFIG_PPC64 | 86 | |
66 | /* Platforms supported by PPC64 */ | 87 | |
67 | #define PLATFORM_PSERIES 0x0100 | ||
68 | #define PLATFORM_PSERIES_LPAR 0x0101 | ||
69 | #define PLATFORM_ISERIES_LPAR 0x0201 | ||
70 | #define PLATFORM_LPAR 0x0001 | ||
71 | #define PLATFORM_POWERMAC 0x0400 | ||
72 | #define PLATFORM_MAPLE 0x0500 | ||
73 | #define PLATFORM_CELL 0x1000 | ||
74 | |||
75 | /* Compatibility with drivers coming from PPC32 world */ | ||
76 | #define _machine (systemcfg->platform) | ||
77 | #define _MACH_Pmac PLATFORM_POWERMAC | ||
78 | #endif | ||
79 | 88 | ||
80 | /* | 89 | /* |
81 | * Default implementation of macro that returns current | 90 | * Default implementation of macro that returns current |
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h index ef121f4f0bab..eb392d038ed7 100644 --- a/include/asm-powerpc/reg.h +++ b/include/asm-powerpc/reg.h | |||
@@ -363,6 +363,7 @@ | |||
363 | #define SPRN_RPA 0x3D6 /* Required Physical Address Register */ | 363 | #define SPRN_RPA 0x3D6 /* Required Physical Address Register */ |
364 | #define SPRN_SDA 0x3BF /* Sampled Data Address Register */ | 364 | #define SPRN_SDA 0x3BF /* Sampled Data Address Register */ |
365 | #define SPRN_SDR1 0x019 /* MMU Hash Base Register */ | 365 | #define SPRN_SDR1 0x019 /* MMU Hash Base Register */ |
366 | #define SPRN_ASR 0x118 /* Address Space Register */ | ||
366 | #define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */ | 367 | #define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */ |
367 | #define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */ | 368 | #define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */ |
368 | #define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */ | 369 | #define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */ |
diff --git a/include/asm-powerpc/systemcfg.h b/include/asm-powerpc/systemcfg.h new file mode 100644 index 000000000000..36b5cbe466f1 --- /dev/null +++ b/include/asm-powerpc/systemcfg.h | |||
@@ -0,0 +1,64 @@ | |||
1 | #ifndef _SYSTEMCFG_H | ||
2 | #define _SYSTEMCFG_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2002 Peter Bergner <bergner@vnet.ibm.com>, IBM | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | ||
12 | |||
13 | /* Change Activity: | ||
14 | * 2002/09/30 : bergner : Created | ||
15 | * End Change Activity | ||
16 | */ | ||
17 | |||
18 | /* | ||
19 | * If the major version changes we are incompatible. | ||
20 | * Minor version changes are a hint. | ||
21 | */ | ||
22 | #define SYSTEMCFG_MAJOR 1 | ||
23 | #define SYSTEMCFG_MINOR 1 | ||
24 | |||
25 | #ifndef __ASSEMBLY__ | ||
26 | |||
27 | #include <linux/unistd.h> | ||
28 | |||
29 | #define SYSCALL_MAP_SIZE ((__NR_syscalls + 31) / 32) | ||
30 | |||
31 | struct systemcfg { | ||
32 | __u8 eye_catcher[16]; /* Eyecatcher: SYSTEMCFG:PPC64 0x00 */ | ||
33 | struct { /* Systemcfg version numbers */ | ||
34 | __u32 major; /* Major number 0x10 */ | ||
35 | __u32 minor; /* Minor number 0x14 */ | ||
36 | } version; | ||
37 | |||
38 | __u32 platform; /* Platform flags 0x18 */ | ||
39 | __u32 processor; /* Processor type 0x1C */ | ||
40 | __u64 processorCount; /* # of physical processors 0x20 */ | ||
41 | __u64 physicalMemorySize; /* Size of real memory(B) 0x28 */ | ||
42 | __u64 tb_orig_stamp; /* Timebase at boot 0x30 */ | ||
43 | __u64 tb_ticks_per_sec; /* Timebase tics / sec 0x38 */ | ||
44 | __u64 tb_to_xs; /* Inverse of TB to 2^20 0x40 */ | ||
45 | __u64 stamp_xsec; /* 0x48 */ | ||
46 | __u64 tb_update_count; /* Timebase atomicity ctr 0x50 */ | ||
47 | __u32 tz_minuteswest; /* Minutes west of Greenwich 0x58 */ | ||
48 | __u32 tz_dsttime; /* Type of dst correction 0x5C */ | ||
49 | /* next four are no longer used except to be exported to /proc */ | ||
50 | __u32 dcache_size; /* L1 d-cache size 0x60 */ | ||
51 | __u32 dcache_line_size; /* L1 d-cache line size 0x64 */ | ||
52 | __u32 icache_size; /* L1 i-cache size 0x68 */ | ||
53 | __u32 icache_line_size; /* L1 i-cache line size 0x6C */ | ||
54 | __u32 syscall_map_64[SYSCALL_MAP_SIZE]; /* map of available syscalls 0x70 */ | ||
55 | __u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of available syscalls */ | ||
56 | }; | ||
57 | |||
58 | #ifdef __KERNEL__ | ||
59 | extern struct systemcfg *_systemcfg; /* to be renamed */ | ||
60 | #endif | ||
61 | |||
62 | #endif /* __ASSEMBLY__ */ | ||
63 | |||
64 | #endif /* _SYSTEMCFG_H */ | ||