aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/slram.c
diff options
context:
space:
mode:
authorJared Hulbert <jaredeh@gmail.com>2008-04-30 02:26:49 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2008-05-01 13:59:11 -0400
commita98889f3d8882995b5aa2255b931cf0202325cc0 (patch)
tree686a1d3369143dc46c43709e0c40b2cc8ef619d7 /drivers/mtd/devices/slram.c
parent27c72b040c0be8f3704ed0b6b84c12cbba24a7e8 (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/slram.c')
-rw-r--r--drivers/mtd/devices/slram.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c
index d293add1857c..cb86db746f28 100644
--- a/drivers/mtd/devices/slram.c
+++ b/drivers/mtd/devices/slram.c
@@ -76,8 +76,9 @@ static char *map;
76static slram_mtd_list_t *slram_mtdlist = NULL; 76static slram_mtd_list_t *slram_mtdlist = NULL;
77 77
78static int slram_erase(struct mtd_info *, struct erase_info *); 78static int slram_erase(struct mtd_info *, struct erase_info *);
79static int slram_point(struct mtd_info *, loff_t, size_t, size_t *, u_char **); 79static int slram_point(struct mtd_info *, loff_t, size_t, size_t *, void **,
80static void slram_unpoint(struct mtd_info *, u_char *, loff_t, size_t); 80 resource_size_t *);
81static void slram_unpoint(struct mtd_info *, loff_t, size_t);
81static int slram_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *); 82static int slram_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *);
82static int slram_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); 83static int slram_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
83 84
@@ -104,19 +105,23 @@ static int slram_erase(struct mtd_info *mtd, struct erase_info *instr)
104} 105}
105 106
106static int slram_point(struct mtd_info *mtd, loff_t from, size_t len, 107static int slram_point(struct mtd_info *mtd, loff_t from, size_t len,
107 size_t *retlen, u_char **mtdbuf) 108 size_t *retlen, void **virt, resource_size_t *phys)
108{ 109{
109 slram_priv_t *priv = mtd->priv; 110 slram_priv_t *priv = mtd->priv;
110 111
112 /* can we return a physical address with this driver? */
113 if (phys)
114 return -EINVAL;
115
111 if (from + len > mtd->size) 116 if (from + len > mtd->size)
112 return -EINVAL; 117 return -EINVAL;
113 118
114 *mtdbuf = priv->start + from; 119 *virt = priv->start + from;
115 *retlen = len; 120 *retlen = len;
116 return(0); 121 return(0);
117} 122}
118 123
119static void slram_unpoint(struct mtd_info *mtd, u_char *addr, loff_t from, size_t len) 124static void slram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
120{ 125{
121} 126}
122 127