aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/processor.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2006-03-28 07:15:54 -0500
committerPaul Mackerras <paulus@samba.org>2006-03-28 07:15:54 -0500
commite8222502ee6157e2713da9e0792c21f4ad458d50 (patch)
tree0f970fb99912c257a7e5254f863a53f79d22ab14 /include/asm-powerpc/processor.h
parent056cb48a2fb6fb31debf665695a9f97b45cfb8ec (diff)
[PATCH] powerpc: Kill _machine and hard-coded platform numbers
This removes statically assigned platform numbers and reworks the powerpc platform probe code to use a better mechanism. With this, board support files can simply declare a new machine type with a macro, and implement a probe() function that uses the flattened device-tree to detect if they apply for a given machine. We now have a machine_is() macro that replaces the comparisons of _machine with the various PLATFORM_* constants. This commit also changes various drivers to use the new macro instead of looking at _machine. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/processor.h')
-rw-r--r--include/asm-powerpc/processor.h37
1 files changed, 7 insertions, 30 deletions
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h
index 57643b5b782f..93f83efeb310 100644
--- a/include/asm-powerpc/processor.h
+++ b/include/asm-powerpc/processor.h
@@ -22,22 +22,6 @@
22 * -- BenH. 22 * -- BenH.
23 */ 23 */
24 24
25/* Platforms codes (to be obsoleted) */
26#define PLATFORM_PSERIES 0x0100
27#define PLATFORM_PSERIES_LPAR 0x0101
28#define PLATFORM_ISERIES_LPAR 0x0201
29#define PLATFORM_LPAR 0x0001
30#define PLATFORM_POWERMAC 0x0400
31#define PLATFORM_MAPLE 0x0500
32#define PLATFORM_PREP 0x0600
33#define PLATFORM_CHRP 0x0700
34#define PLATFORM_CELL 0x1000
35
36/* Compat platform codes for 32 bits */
37#define _MACH_prep PLATFORM_PREP
38#define _MACH_Pmac PLATFORM_POWERMAC
39#define _MACH_chrp PLATFORM_CHRP
40
41/* PREP sub-platform types see residual.h for these */ 25/* PREP sub-platform types see residual.h for these */
42#define _PREP_Motorola 0x01 /* motorola prep */ 26#define _PREP_Motorola 0x01 /* motorola prep */
43#define _PREP_Firm 0x02 /* firmworks prep */ 27#define _PREP_Firm 0x02 /* firmworks prep */
@@ -49,15 +33,14 @@
49#define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */ 33#define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */
50#define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */ 34#define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */
51 35
52#ifdef __KERNEL__ 36#if defined(__KERNEL__) && defined(CONFIG_PPC32)
53#define platform_is_pseries() (_machine == PLATFORM_PSERIES || \ 37
54 _machine == PLATFORM_PSERIES_LPAR) 38extern int _chrp_type;
55 39
56#ifdef CONFIG_PPC_PREP 40#ifdef CONFIG_PPC_PREP
57 41
58/* what kind of prep workstation we are */ 42/* what kind of prep workstation we are */
59extern int _prep_type; 43extern int _prep_type;
60extern int _chrp_type;
61 44
62/* 45/*
63 * This is used to identify the board type from a given PReP board 46 * This is used to identify the board type from a given PReP board
@@ -69,18 +52,12 @@ extern unsigned char ucBoardRevMaj, ucBoardRevMin;
69 52
70#endif /* CONFIG_PPC_PREP */ 53#endif /* CONFIG_PPC_PREP */
71 54
72#if defined(CONFIG_PPC_MULTIPLATFORM) 55#ifndef CONFIG_PPC_MULTIPLATFORM
73extern int _machine;
74
75#elif defined(CONFIG_PPC_ISERIES)
76/*
77 * iSeries is soon to become MULTIPLATFORM hopefully ...
78 */
79#define _machine PLATFORM_ISERIES_LPAR
80#else
81#define _machine 0 56#define _machine 0
82#endif /* CONFIG_PPC_MULTIPLATFORM */ 57#endif /* CONFIG_PPC_MULTIPLATFORM */
83#endif /* __KERNEL__ */ 58
59#endif /* defined(__KERNEL__) && defined(CONFIG_PPC32) */
60
84/* 61/*
85 * Default implementation of macro that returns current 62 * Default implementation of macro that returns current
86 * instruction pointer ("program counter"). 63 * instruction pointer ("program counter").