diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-03-28 07:15:54 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-28 07:15:54 -0500 |
commit | e8222502ee6157e2713da9e0792c21f4ad458d50 (patch) | |
tree | 0f970fb99912c257a7e5254f863a53f79d22ab14 /arch/powerpc/kernel/traps.c | |
parent | 056cb48a2fb6fb31debf665695a9f97b45cfb8ec (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 'arch/powerpc/kernel/traps.c')
-rw-r--r-- | arch/powerpc/kernel/traps.c | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 98660aedeeb7..27600c9432bc 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -97,7 +97,6 @@ static DEFINE_SPINLOCK(die_lock); | |||
97 | int die(const char *str, struct pt_regs *regs, long err) | 97 | int die(const char *str, struct pt_regs *regs, long err) |
98 | { | 98 | { |
99 | static int die_counter, crash_dump_start = 0; | 99 | static int die_counter, crash_dump_start = 0; |
100 | int nl = 0; | ||
101 | 100 | ||
102 | if (debugger(regs)) | 101 | if (debugger(regs)) |
103 | return 1; | 102 | return 1; |
@@ -106,7 +105,7 @@ int die(const char *str, struct pt_regs *regs, long err) | |||
106 | spin_lock_irq(&die_lock); | 105 | spin_lock_irq(&die_lock); |
107 | bust_spinlocks(1); | 106 | bust_spinlocks(1); |
108 | #ifdef CONFIG_PMAC_BACKLIGHT | 107 | #ifdef CONFIG_PMAC_BACKLIGHT |
109 | if (_machine == _MACH_Pmac) { | 108 | if (machine_is(powermac)) { |
110 | set_backlight_enable(1); | 109 | set_backlight_enable(1); |
111 | set_backlight_level(BACKLIGHT_MAX); | 110 | set_backlight_level(BACKLIGHT_MAX); |
112 | } | 111 | } |
@@ -114,46 +113,18 @@ int die(const char *str, struct pt_regs *regs, long err) | |||
114 | printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); | 113 | printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); |
115 | #ifdef CONFIG_PREEMPT | 114 | #ifdef CONFIG_PREEMPT |
116 | printk("PREEMPT "); | 115 | printk("PREEMPT "); |
117 | nl = 1; | ||
118 | #endif | 116 | #endif |
119 | #ifdef CONFIG_SMP | 117 | #ifdef CONFIG_SMP |
120 | printk("SMP NR_CPUS=%d ", NR_CPUS); | 118 | printk("SMP NR_CPUS=%d ", NR_CPUS); |
121 | nl = 1; | ||
122 | #endif | 119 | #endif |
123 | #ifdef CONFIG_DEBUG_PAGEALLOC | 120 | #ifdef CONFIG_DEBUG_PAGEALLOC |
124 | printk("DEBUG_PAGEALLOC "); | 121 | printk("DEBUG_PAGEALLOC "); |
125 | nl = 1; | ||
126 | #endif | 122 | #endif |
127 | #ifdef CONFIG_NUMA | 123 | #ifdef CONFIG_NUMA |
128 | printk("NUMA "); | 124 | printk("NUMA "); |
129 | nl = 1; | ||
130 | #endif | 125 | #endif |
131 | #ifdef CONFIG_PPC64 | 126 | printk("%s\n", ppc_md.name ? "" : ppc_md.name); |
132 | switch (_machine) { | 127 | |
133 | case PLATFORM_PSERIES: | ||
134 | printk("PSERIES "); | ||
135 | nl = 1; | ||
136 | break; | ||
137 | case PLATFORM_PSERIES_LPAR: | ||
138 | printk("PSERIES LPAR "); | ||
139 | nl = 1; | ||
140 | break; | ||
141 | case PLATFORM_ISERIES_LPAR: | ||
142 | printk("ISERIES LPAR "); | ||
143 | nl = 1; | ||
144 | break; | ||
145 | case PLATFORM_POWERMAC: | ||
146 | printk("POWERMAC "); | ||
147 | nl = 1; | ||
148 | break; | ||
149 | case PLATFORM_CELL: | ||
150 | printk("CELL "); | ||
151 | nl = 1; | ||
152 | break; | ||
153 | } | ||
154 | #endif | ||
155 | if (nl) | ||
156 | printk("\n"); | ||
157 | print_modules(); | 128 | print_modules(); |
158 | show_regs(regs); | 129 | show_regs(regs); |
159 | bust_spinlocks(0); | 130 | bust_spinlocks(0); |