aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-06-08 09:48:09 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-07-05 18:14:26 -0400
commit6b884a8d50a6eea2fb3dad7befe748f67193073b (patch)
tree85756fbd09ebaebdeb9a7ab56806bcbc5e793532 /arch/microblaze
parenta7c194b007ec40a130207e9ace9cecf598fc6ac5 (diff)
of/address: merge of_iomap()
Merge common code between Microblaze and PowerPC. This patch creates new of_address.h and address.c files to containing address translation and mapping routines. First routine to be moved it of_iomap() Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: Michal Simek <monstr@monstr.eu> CC: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch/microblaze')
-rw-r--r--arch/microblaze/include/asm/prom.h10
-rw-r--r--arch/microblaze/kernel/prom_parse.c11
2 files changed, 1 insertions, 20 deletions
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
index 5fbdfe76fe76..6411c3b3a80f 100644
--- a/arch/microblaze/include/asm/prom.h
+++ b/arch/microblaze/include/asm/prom.h
@@ -20,6 +20,7 @@
20#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
21 21
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/of_address.h>
23#include <linux/of_irq.h> 24#include <linux/of_irq.h>
24#include <linux/of_fdt.h> 25#include <linux/of_fdt.h>
25#include <linux/proc_fs.h> 26#include <linux/proc_fs.h>
@@ -103,15 +104,6 @@ extern const void *of_get_mac_address(struct device_node *np);
103struct pci_dev; 104struct pci_dev;
104extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); 105extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
105 106
106/**
107 * of_iomap - Maps the memory mapped IO for a given device_node
108 * @device: the device whose io range will be mapped
109 * @index: index of the io range
110 *
111 * Returns a pointer to the mapped memory
112 */
113extern void __iomem *of_iomap(struct device_node *device, int index);
114
115#endif /* __ASSEMBLY__ */ 107#endif /* __ASSEMBLY__ */
116#endif /* __KERNEL__ */ 108#endif /* __KERNEL__ */
117#endif /* _ASM_MICROBLAZE_PROM_H */ 109#endif /* _ASM_MICROBLAZE_PROM_H */
diff --git a/arch/microblaze/kernel/prom_parse.c b/arch/microblaze/kernel/prom_parse.c
index e28968fa34c1..1159ba52ad4a 100644
--- a/arch/microblaze/kernel/prom_parse.c
+++ b/arch/microblaze/kernel/prom_parse.c
@@ -681,14 +681,3 @@ const void *of_get_mac_address(struct device_node *np)
681 return NULL; 681 return NULL;
682} 682}
683EXPORT_SYMBOL(of_get_mac_address); 683EXPORT_SYMBOL(of_get_mac_address);
684
685void __iomem *of_iomap(struct device_node *np, int index)
686{
687 struct resource res;
688
689 if (of_address_to_resource(np, index, &res))
690 return NULL;
691
692 return ioremap(res.start, 1 + res.end - res.start);
693}
694EXPORT_SYMBOL(of_iomap);