[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:

committed by
Paul Mackerras

parent
056cb48a2f
commit
e8222502ee
@@ -33,6 +33,7 @@
|
||||
#include <asm/machdep.h>
|
||||
#include <asm/cputable.h>
|
||||
#include <asm/sections.h>
|
||||
#include <asm/firmware.h>
|
||||
#include <asm/vdso.h>
|
||||
#include <asm/vdso_datapage.h>
|
||||
|
||||
@@ -667,7 +668,13 @@ void __init vdso_init(void)
|
||||
vdso_data->version.major = SYSTEMCFG_MAJOR;
|
||||
vdso_data->version.minor = SYSTEMCFG_MINOR;
|
||||
vdso_data->processor = mfspr(SPRN_PVR);
|
||||
vdso_data->platform = _machine;
|
||||
/*
|
||||
* Fake the old platform number for pSeries and iSeries and add
|
||||
* in LPAR bit if necessary
|
||||
*/
|
||||
vdso_data->platform = machine_is(iseries) ? 0x200 : 0x100;
|
||||
if (firmware_has_feature(FW_FEATURE_LPAR))
|
||||
vdso_data->platform |= 1;
|
||||
vdso_data->physicalMemorySize = lmb_phys_mem_size();
|
||||
vdso_data->dcache_size = ppc64_caches.dsize;
|
||||
vdso_data->dcache_line_size = ppc64_caches.dline_size;
|
||||
|
Reference in New Issue
Block a user