[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>
这个提交包含在:
Benjamin Herrenschmidt
2006-03-28 23:15:54 +11:00
提交者 Paul Mackerras
父节点 056cb48a2f
当前提交 e8222502ee
修改 63 个文件,包含 559 行新增542 行删除

查看文件

@@ -292,6 +292,10 @@ void __init chrp_setup_arch(void)
pci_create_OF_bus_map();
#ifdef CONFIG_SMP
smp_ops = &chrp_smp_ops;
#endif /* CONFIG_SMP */
/*
* Print the banner, then scroll down so boot progress
* can be printed. -- Cort
@@ -506,8 +510,15 @@ chrp_init2(void)
ppc_md.progress(" Have fun! ", 0x7777);
}
void __init chrp_init(void)
static int __init chrp_probe(void)
{
char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(),
"device_type", NULL);
if (dtype == NULL)
return 0;
if (strcmp(dtype, "chrp"))
return 0;
ISA_DMA_THRESHOLD = ~0L;
DMA_MODE_READ = 0x44;
DMA_MODE_WRITE = 0x48;