summaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
authorChristian Krafft <krafft@de.ibm.com>2007-04-23 21:35:45 +0200
committerArnd Bergmann <arnd@klappe.arndb.de>2007-04-23 21:44:40 +0200
commit6bf05fd776e38a0a9c17e17c2345b59b1b9aa2cb (patch)
tree2f7c2ecec6918614f6f407bec94299d79baf5b47 /include/asm-powerpc
parent4a065f9418274f2d73066f1638b3612341e4f030 (diff)
downloadop-kernel-dev-6bf05fd776e38a0a9c17e17c2345b59b1b9aa2cb.zip
op-kernel-dev-6bf05fd776e38a0a9c17e17c2345b59b1b9aa2cb.tar.gz
[POWERPC] add of_iomap function
The of_iomap function maps memory for a given device_node and returns a pointer to that memory. This is used at some places, so it makes sense to a seperate function. Signed-off-by: Christian Krafft <krafft@de.ibm.com> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/prom.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index e73a2b4..f31af71 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -20,6 +20,7 @@
#include <linux/platform_device.h>
#include <asm/irq.h>
#include <asm/atomic.h>
+#include <asm/io.h>
/* Definitions used by the flattened device tree */
#define OF_DT_HEADER 0xd00dfeed /* marker */
@@ -355,6 +356,16 @@ static inline int of_irq_to_resource(struct device_node *dev, int index, struct
return irq;
}
+static inline void __iomem *of_iomap(struct device_node *np, int index)
+{
+ struct resource res;
+
+ if (of_address_to_resource(np, index, &res))
+ return NULL;
+
+ return ioremap(res.start, 1 + res.end - res.start);
+}
+
#endif /* __KERNEL__ */
#endif /* _POWERPC_PROM_H */
OpenPOWER on IntegriCloud