linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] POWERPC: Support ISA legacy addresses in of_address_to_resource()
@ 2008-05-08 23:26 Nate Case
  2008-05-09  4:31 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Nate Case @ 2008-05-08 23:26 UTC (permalink / raw)
  To: linuxppc-dev

When mapping an open firmware device tree node to a resource,
check if the device is on the "isa" legacy bus.  In this case,
pci_address_to_pio() should not be used since that function is only
for addresses above the 64KB reserved region.

This was necessary to get IPMI working on a board that accesses
the IPMI controller via the legacy I/O region.

Signed-off-by: Nate Case <ncase@xes-inc.com>
---
 arch/powerpc/kernel/prom_parse.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 90eb3a3..28d354d 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -622,7 +622,15 @@ static int __of_address_to_resource(struct device_node *dev, const u32 *addrp,
 	memset(r, 0, sizeof(struct resource));
 	if (flags & IORESOURCE_IO) {
 		unsigned long port;
-		port = pci_address_to_pio(taddr);
+		struct device_node *parent;
+
+		parent = of_get_parent(dev);
+		if (of_bus_isa_match(parent))
+			port = (unsigned long) taddr;
+		else
+			port = pci_address_to_pio(taddr);
+		of_node_put(parent);
+
 		if (port == (unsigned long)-1)
 			return -EINVAL;
 		r->start = port;
-- 
1.5.4.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-09 22:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-08 23:26 [PATCH] POWERPC: Support ISA legacy addresses in of_address_to_resource() Nate Case
2008-05-09  4:31 ` Benjamin Herrenschmidt
2008-05-09 21:31   ` Nate Case
2008-05-09 22:27     ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).