diff options
author | Jared Hulbert <jaredeh@gmail.com> | 2008-04-30 02:26:49 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2008-05-01 13:59:11 -0400 |
commit | a98889f3d8882995b5aa2255b931cf0202325cc0 (patch) | |
tree | 686a1d3369143dc46c43709e0c40b2cc8ef619d7 /drivers/mtd/devices/phram.c | |
parent | 27c72b040c0be8f3704ed0b6b84c12cbba24a7e8 (diff) |
[MTD][NOR] Add physical address to point() method
Adding the ability to get a physical address from point() in addition
to virtual address. This physical address is required for XIP of
userspace code from flash.
Signed-off-by: Jared Hulbert <jaredeh@gmail.com>
Reviewed-by: Jörn Engel <joern@logfs.org>
Acked-by: Nicolas Pitre <nico@cam.org>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/devices/phram.c')
-rw-r--r-- | drivers/mtd/devices/phram.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c index 5f960182da95..c7987b1c5e01 100644 --- a/drivers/mtd/devices/phram.c +++ b/drivers/mtd/devices/phram.c | |||
@@ -57,20 +57,21 @@ static int phram_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
57 | } | 57 | } |
58 | 58 | ||
59 | static int phram_point(struct mtd_info *mtd, loff_t from, size_t len, | 59 | static int phram_point(struct mtd_info *mtd, loff_t from, size_t len, |
60 | size_t *retlen, u_char **mtdbuf) | 60 | size_t *retlen, void **virt, resource_size_t *phys) |
61 | { | 61 | { |
62 | u_char *start = mtd->priv; | ||
63 | |||
64 | if (from + len > mtd->size) | 62 | if (from + len > mtd->size) |
65 | return -EINVAL; | 63 | return -EINVAL; |
66 | 64 | ||
67 | *mtdbuf = start + from; | 65 | /* can we return a physical address with this driver? */ |
66 | if (phys) | ||
67 | return -EINVAL; | ||
68 | |||
69 | *virt = mtd->priv + from; | ||
68 | *retlen = len; | 70 | *retlen = len; |
69 | return 0; | 71 | return 0; |
70 | } | 72 | } |
71 | 73 | ||
72 | static void phram_unpoint(struct mtd_info *mtd, u_char *addr, loff_t from, | 74 | static void phram_unpoint(struct mtd_info *mtd, loff_t from, size_t len) |
73 | size_t len) | ||
74 | { | 75 | { |
75 | } | 76 | } |
76 | 77 | ||