From: Nate Case <ncase@xes-inc.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH] POWERPC: Support ISA legacy addresses in of_address_to_resource()
Date: Thu, 08 May 2008 18:26:32 -0500 [thread overview]
Message-ID: <1210289192.13845.281.camel@localhost.localdomain> (raw)
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
next reply other threads:[~2008-05-08 23:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-08 23:26 Nate Case [this message]
2008-05-09 4:31 ` [PATCH] POWERPC: Support ISA legacy addresses in of_address_to_resource() Benjamin Herrenschmidt
2008-05-09 21:31 ` Nate Case
2008-05-09 22:27 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1210289192.13845.281.camel@localhost.localdomain \
--to=ncase@xes-inc.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).