-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Grant Likely
committed
Jul 5, 2010
1 parent
a7c194b
commit 6b884a8
Showing
8 changed files
with
38 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
#include <linux/io.h> | ||
#include <linux/ioport.h> | ||
#include <linux/of_address.h> | ||
|
||
/** | ||
* of_iomap - Maps the memory mapped IO for a given device_node | ||
* @device: the device whose io range will be mapped | ||
* @index: index of the io range | ||
* | ||
* Returns a pointer to the mapped memory | ||
*/ | ||
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); | ||
} | ||
EXPORT_SYMBOL(of_iomap); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef __OF_ADDRESS_H | ||
#define __OF_ADDRESS_H | ||
#include <linux/ioport.h> | ||
#include <linux/of.h> | ||
|
||
extern void __iomem *of_iomap(struct device_node *device, int index); | ||
|
||
#endif /* __OF_ADDRESS_H */ | ||
|