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/platforms/iseries | |
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/platforms/iseries')
-rw-r--r-- | arch/powerpc/platforms/iseries/setup.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index 155aa690e4bb..6ce8a404ba6b 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c | |||
@@ -675,9 +675,10 @@ static void iseries_dedicated_idle(void) | |||
675 | void __init iSeries_init_IRQ(void) { } | 675 | void __init iSeries_init_IRQ(void) { } |
676 | #endif | 676 | #endif |
677 | 677 | ||
678 | static int __init iseries_probe(int platform) | 678 | static int __init iseries_probe(void) |
679 | { | 679 | { |
680 | if (PLATFORM_ISERIES_LPAR != platform) | 680 | unsigned long root = of_get_flat_dt_root(); |
681 | if (!of_flat_dt_is_compatible(root, "IBM,iSeries")) | ||
681 | return 0; | 682 | return 0; |
682 | 683 | ||
683 | powerpc_firmware_features |= FW_FEATURE_ISERIES; | 684 | powerpc_firmware_features |= FW_FEATURE_ISERIES; |
@@ -686,7 +687,8 @@ static int __init iseries_probe(int platform) | |||
686 | return 1; | 687 | return 1; |
687 | } | 688 | } |
688 | 689 | ||
689 | struct machdep_calls __initdata iseries_md = { | 690 | define_machine(iseries) { |
691 | .name = "iSeries", | ||
690 | .setup_arch = iSeries_setup_arch, | 692 | .setup_arch = iSeries_setup_arch, |
691 | .show_cpuinfo = iSeries_show_cpuinfo, | 693 | .show_cpuinfo = iSeries_show_cpuinfo, |
692 | .init_IRQ = iSeries_init_IRQ, | 694 | .init_IRQ = iSeries_init_IRQ, |
@@ -930,7 +932,6 @@ void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size) | |||
930 | 932 | ||
931 | /* /chosen */ | 933 | /* /chosen */ |
932 | dt_start_node(dt, "chosen"); | 934 | dt_start_node(dt, "chosen"); |
933 | dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR); | ||
934 | dt_prop_str(dt, "bootargs", cmd_line); | 935 | dt_prop_str(dt, "bootargs", cmd_line); |
935 | if (cmd_mem_limit) | 936 | if (cmd_mem_limit) |
936 | dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit); | 937 | dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit); |