aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/chrp
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 /arch/powerpc/platforms/chrp
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 'arch/powerpc/platforms/chrp')
-rw-r--r--arch/powerpc/platforms/chrp/setup.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 9c718bb2305e..23a201718704 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -292,6 +292,10 @@ void __init chrp_setup_arch(void)
292 292
293 pci_create_OF_bus_map(); 293 pci_create_OF_bus_map();
294 294
295#ifdef CONFIG_SMP
296 smp_ops = &chrp_smp_ops;
297#endif /* CONFIG_SMP */
298
295 /* 299 /*
296 * Print the banner, then scroll down so boot progress 300 * Print the banner, then scroll down so boot progress
297 * can be printed. -- Cort 301 * can be printed. -- Cort
@@ -506,8 +510,15 @@ chrp_init2(void)
506 ppc_md.progress(" Have fun! ", 0x7777); 510 ppc_md.progress(" Have fun! ", 0x7777);
507} 511}
508 512
509void __init chrp_init(void) 513static int __init chrp_probe(void)
510{ 514{
515 char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(),
516 "device_type", NULL);
517 if (dtype == NULL)
518 return 0;
519 if (strcmp(dtype, "chrp"))
520 return 0;
521
511 ISA_DMA_THRESHOLD = ~0L; 522 ISA_DMA_THRESHOLD = ~0L;
512 DMA_MODE_READ = 0x44; 523 DMA_MODE_READ = 0x44;
513 DMA_MODE_WRITE = 0x48; 524 DMA_MODE_WRITE = 0x48;