[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
@@ -332,7 +332,8 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
|
||||
if (c->mtd->point) {
|
||||
unsigned long *wordebuf;
|
||||
|
||||
ret = c->mtd->point(c->mtd, jeb->offset, c->sector_size, &retlen, (unsigned char **)&ebuf);
|
||||
ret = c->mtd->point(c->mtd, jeb->offset, c->sector_size,
|
||||
&retlen, &ebuf, NULL);
|
||||
if (ret) {
|
||||
D1(printk(KERN_DEBUG "MTD point failed %d\n", ret));
|
||||
goto do_flash_read;
|
||||
@@ -340,7 +341,7 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
|
||||
if (retlen < c->sector_size) {
|
||||
/* Don't muck about if it won't let us point to the whole erase sector */
|
||||
D1(printk(KERN_DEBUG "MTD point returned len too short: 0x%zx\n", retlen));
|
||||
c->mtd->unpoint(c->mtd, ebuf, jeb->offset, retlen);
|
||||
c->mtd->unpoint(c->mtd, jeb->offset, retlen);
|
||||
goto do_flash_read;
|
||||
}
|
||||
wordebuf = ebuf-sizeof(*wordebuf);
|
||||
@@ -349,7 +350,7 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
|
||||
if (*++wordebuf != ~0)
|
||||
break;
|
||||
} while(--retlen);
|
||||
c->mtd->unpoint(c->mtd, ebuf, jeb->offset, c->sector_size);
|
||||
c->mtd->unpoint(c->mtd, jeb->offset, c->sector_size);
|
||||
if (retlen) {
|
||||
printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08tx\n",
|
||||
*wordebuf, jeb->offset + c->sector_size-retlen*sizeof(*wordebuf));
|
||||
|
Reference in New Issue
Block a user