[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>
This commit is contained in:
Benjamin Herrenschmidt
2006-03-28 23:15:54 +11:00
committed by Paul Mackerras
parent 056cb48a2f
commit e8222502ee
63 changed files with 559 additions and 542 deletions

View File

@@ -97,7 +97,6 @@ static DEFINE_SPINLOCK(die_lock);
int die(const char *str, struct pt_regs *regs, long err)
{
static int die_counter, crash_dump_start = 0;
int nl = 0;
if (debugger(regs))
return 1;
@@ -106,7 +105,7 @@ int die(const char *str, struct pt_regs *regs, long err)
spin_lock_irq(&die_lock);
bust_spinlocks(1);
#ifdef CONFIG_PMAC_BACKLIGHT
if (_machine == _MACH_Pmac) {
if (machine_is(powermac)) {
set_backlight_enable(1);
set_backlight_level(BACKLIGHT_MAX);
}
@@ -114,46 +113,18 @@ int die(const char *str, struct pt_regs *regs, long err)
printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
#ifdef CONFIG_PREEMPT
printk("PREEMPT ");
nl = 1;
#endif
#ifdef CONFIG_SMP
printk("SMP NR_CPUS=%d ", NR_CPUS);
nl = 1;
#endif
#ifdef CONFIG_DEBUG_PAGEALLOC
printk("DEBUG_PAGEALLOC ");
nl = 1;
#endif
#ifdef CONFIG_NUMA
printk("NUMA ");
nl = 1;
#endif
#ifdef CONFIG_PPC64
switch (_machine) {
case PLATFORM_PSERIES:
printk("PSERIES ");
nl = 1;
break;
case PLATFORM_PSERIES_LPAR:
printk("PSERIES LPAR ");
nl = 1;
break;
case PLATFORM_ISERIES_LPAR:
printk("ISERIES LPAR ");
nl = 1;
break;
case PLATFORM_POWERMAC:
printk("POWERMAC ");
nl = 1;
break;
case PLATFORM_CELL:
printk("CELL ");
nl = 1;
break;
}
#endif
if (nl)
printk("\n");
printk("%s\n", ppc_md.name ? "" : ppc_md.name);
print_modules();
show_regs(regs);
bust_spinlocks(0);