[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>
This commit is contained in:

committed by
David Woodhouse

parent
27c72b040c
commit
a98889f3d8
@@ -57,20 +57,21 @@ static int phram_erase(struct mtd_info *mtd, struct erase_info *instr)
|
||||
}
|
||||
|
||||
static int phram_point(struct mtd_info *mtd, loff_t from, size_t len,
|
||||
size_t *retlen, u_char **mtdbuf)
|
||||
size_t *retlen, void **virt, resource_size_t *phys)
|
||||
{
|
||||
u_char *start = mtd->priv;
|
||||
|
||||
if (from + len > mtd->size)
|
||||
return -EINVAL;
|
||||
|
||||
*mtdbuf = start + from;
|
||||
/* can we return a physical address with this driver? */
|
||||
if (phys)
|
||||
return -EINVAL;
|
||||
|
||||
*virt = mtd->priv + from;
|
||||
*retlen = len;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void phram_unpoint(struct mtd_info *mtd, u_char *addr, loff_t from,
|
||||
size_t len)
|
||||
static void phram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user