edac: cpc925 MC platform device setup
Fix up the number of cells for the values of CPC925 Memory Controller, and setup related platform device during system booting up, against which CPC925 Memory Controller EDAC driver would be matched. Signed-off-by: Harry Ciao <qingtao.cao@windriver.com> Cc: Doug Thompson <norsk5@yahoo.com> Cc: Michael Ellerman <michael@ellerman.id.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Kumar Gala <galak@gate.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
1dc9b70d7d
commit
8f101a051e
@@ -1947,8 +1947,47 @@ static void __init fixup_device_tree_maple(void)
|
||||
prom_setprop(isa, name, "ranges",
|
||||
isa_ranges, sizeof(isa_ranges));
|
||||
}
|
||||
|
||||
#define CPC925_MC_START 0xf8000000
|
||||
#define CPC925_MC_LENGTH 0x1000000
|
||||
/* The values for memory-controller don't have right number of cells */
|
||||
static void __init fixup_device_tree_maple_memory_controller(void)
|
||||
{
|
||||
phandle mc;
|
||||
u32 mc_reg[4];
|
||||
char *name = "/hostbridge@f8000000";
|
||||
struct prom_t *_prom = &RELOC(prom);
|
||||
u32 ac, sc;
|
||||
|
||||
mc = call_prom("finddevice", 1, 1, ADDR(name));
|
||||
if (!PHANDLE_VALID(mc))
|
||||
return;
|
||||
|
||||
if (prom_getproplen(mc, "reg") != 8)
|
||||
return;
|
||||
|
||||
prom_getprop(_prom->root, "#address-cells", &ac, sizeof(ac));
|
||||
prom_getprop(_prom->root, "#size-cells", &sc, sizeof(sc));
|
||||
if ((ac != 2) || (sc != 2))
|
||||
return;
|
||||
|
||||
if (prom_getprop(mc, "reg", mc_reg, sizeof(mc_reg)) == PROM_ERROR)
|
||||
return;
|
||||
|
||||
if (mc_reg[0] != CPC925_MC_START || mc_reg[1] != CPC925_MC_LENGTH)
|
||||
return;
|
||||
|
||||
prom_printf("Fixing up bogus hostbridge on Maple...\n");
|
||||
|
||||
mc_reg[0] = 0x0;
|
||||
mc_reg[1] = CPC925_MC_START;
|
||||
mc_reg[2] = 0x0;
|
||||
mc_reg[3] = CPC925_MC_LENGTH;
|
||||
prom_setprop(mc, name, "reg", mc_reg, sizeof(mc_reg));
|
||||
}
|
||||
#else
|
||||
#define fixup_device_tree_maple()
|
||||
#define fixup_device_tree_maple_memory_controller()
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PPC_CHRP
|
||||
@@ -2189,6 +2228,7 @@ static void __init fixup_device_tree_efika(void)
|
||||
static void __init fixup_device_tree(void)
|
||||
{
|
||||
fixup_device_tree_maple();
|
||||
fixup_device_tree_maple_memory_controller();
|
||||
fixup_device_tree_chrp();
|
||||
fixup_device_tree_pmac();
|
||||
fixup_device_tree_efika();
|
||||
|
Reference in New Issue
Block a user