aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips
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/chips
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/chips')
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0001.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index e812df607a5c..fcd1aeccdf93 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -82,9 +82,8 @@ static struct mtd_info *cfi_intelext_setup (struct mtd_info *);
82static int cfi_intelext_partition_fixup(struct mtd_info *, struct cfi_private **); 82static int cfi_intelext_partition_fixup(struct mtd_info *, struct cfi_private **);
83 83
84static int cfi_intelext_point (struct mtd_info *mtd, loff_t from, size_t len, 84static int cfi_intelext_point (struct mtd_info *mtd, loff_t from, size_t len,
85 size_t *retlen, u_char **mtdbuf); 85 size_t *retlen, void **virt, resource_size_t *phys);
86static void cfi_intelext_unpoint (struct mtd_info *mtd, u_char *addr, loff_t from, 86static void cfi_intelext_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
87 size_t len);
88 87
89static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long adr, int mode); 88static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long adr, int mode);
90static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr, int mode); 89static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr, int mode);
@@ -1240,7 +1239,8 @@ static int do_point_onechip (struct map_info *map, struct flchip *chip, loff_t a
1240 return ret; 1239 return ret;
1241} 1240}
1242 1241
1243static int cfi_intelext_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf) 1242static int cfi_intelext_point(struct mtd_info *mtd, loff_t from, size_t len,
1243 size_t *retlen, void **virt, resource_size_t *phys)
1244{ 1244{
1245 struct map_info *map = mtd->priv; 1245 struct map_info *map = mtd->priv;
1246 struct cfi_private *cfi = map->fldrv_priv; 1246 struct cfi_private *cfi = map->fldrv_priv;
@@ -1257,8 +1257,10 @@ static int cfi_intelext_point (struct mtd_info *mtd, loff_t from, size_t len, si
1257 chipnum = (from >> cfi->chipshift); 1257 chipnum = (from >> cfi->chipshift);
1258 ofs = from - (chipnum << cfi->chipshift); 1258 ofs = from - (chipnum << cfi->chipshift);
1259 1259
1260 *mtdbuf = (void *)map->virt + cfi->chips[chipnum].start + ofs; 1260 *virt = map->virt + cfi->chips[chipnum].start + ofs;
1261 *retlen = 0; 1261 *retlen = 0;
1262 if (phys)
1263 *phys = map->phys + cfi->chips[chipnum].start + ofs;
1262 1264
1263 while (len) { 1265 while (len) {
1264 unsigned long thislen; 1266 unsigned long thislen;
@@ -1291,7 +1293,7 @@ static int cfi_intelext_point (struct mtd_info *mtd, loff_t from, size_t len, si
1291 return 0; 1293 return 0;
1292} 1294}
1293 1295
1294static void cfi_intelext_unpoint (struct mtd_info *mtd, u_char *addr, loff_t from, size_t len) 1296static void cfi_intelext_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
1295{ 1297{
1296 struct map_info *map = mtd->priv; 1298 struct map_info *map = mtd->priv;
1297 struct cfi_private *cfi = map->fldrv_priv; 1299 struct cfi_private *cfi = map->fldrv_priv;