Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 980a6513 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Paul Mackerras
Browse files

[POWERPC] Fix booting on Momentum "Apache" board (a Maple derivative)



This extends the maple device-tree workarounds to work on the
Apache board as well, and extends the maple platform probing code
to recognize the Apache board.

Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent ab134466
Loading
Loading
Loading
Loading
+15 −5
Original line number Original line Diff line number Diff line
@@ -1990,12 +1990,22 @@ static void __init flatten_device_tree(void)
static void __init fixup_device_tree_maple(void)
static void __init fixup_device_tree_maple(void)
{
{
	phandle isa;
	phandle isa;
	u32 rloc = 0x01002000; /* IO space; PCI device = 4 */
	u32 isa_ranges[6];
	u32 isa_ranges[6];
	char *name;


	isa = call_prom("finddevice", 1, 1, ADDR("/ht@0/isa@4"));
	name = "/ht@0/isa@4";
	isa = call_prom("finddevice", 1, 1, ADDR(name));
	if (!PHANDLE_VALID(isa)) {
		name = "/ht@0/isa@6";
		isa = call_prom("finddevice", 1, 1, ADDR(name));
		rloc = 0x01003000; /* IO space; PCI device = 6 */
	}
	if (!PHANDLE_VALID(isa))
	if (!PHANDLE_VALID(isa))
		return;
		return;


	if (prom_getproplen(isa, "ranges") != 12)
		return;
	if (prom_getprop(isa, "ranges", isa_ranges, sizeof(isa_ranges))
	if (prom_getprop(isa, "ranges", isa_ranges, sizeof(isa_ranges))
		== PROM_ERROR)
		== PROM_ERROR)
		return;
		return;
@@ -2005,15 +2015,15 @@ static void __init fixup_device_tree_maple(void)
		isa_ranges[2] != 0x00010000)
		isa_ranges[2] != 0x00010000)
		return;
		return;


	prom_printf("fixing up bogus ISA range on Maple...\n");
	prom_printf("Fixing up bogus ISA range on Maple/Apache...\n");


	isa_ranges[0] = 0x1;
	isa_ranges[0] = 0x1;
	isa_ranges[1] = 0x0;
	isa_ranges[1] = 0x0;
	isa_ranges[2] = 0x01002000; /* IO space; PCI device = 4 */
	isa_ranges[2] = rloc;
	isa_ranges[3] = 0x0;
	isa_ranges[3] = 0x0;
	isa_ranges[4] = 0x0;
	isa_ranges[4] = 0x0;
	isa_ranges[5] = 0x00010000;
	isa_ranges[5] = 0x00010000;
	prom_setprop(isa, "/ht@0/isa@4", "ranges",
	prom_setprop(isa, name, "ranges",
			isa_ranges, sizeof(isa_ranges));
			isa_ranges, sizeof(isa_ranges));
}
}
#else
#else
+4 −2
Original line number Original line Diff line number Diff line
@@ -11,7 +11,7 @@
 *
 *
 */
 */


#define DEBUG
#undef DEBUG


#include <linux/init.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/errno.h>
@@ -256,7 +256,9 @@ static void __init maple_progress(char *s, unsigned short hex)
static int __init maple_probe(void)
static int __init maple_probe(void)
{
{
	unsigned long root = of_get_flat_dt_root();
	unsigned long root = of_get_flat_dt_root();
	if (!of_flat_dt_is_compatible(root, "Momentum,Maple"))

	if (!of_flat_dt_is_compatible(root, "Momentum,Maple") &&
	    !of_flat_dt_is_compatible(root, "Momentum,Apache"))
		return 0;
		return 0;
	/*
	/*
	 * On U3, the DART (iommu) must be allocated now since it
	 * On U3, the DART (iommu) must be allocated now since it