Skip to contentSkip to conversation

MTD: add physical address to point() api -- slram interface fixes

PATCH In review Jared Hulbert 1 participant 1 message Nov 8, 2007 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 7/8 MTD: add physical address to point() api -- slram interface fixes

Adding the ability to get a physical address from point() in addition to virtual address. This physical address will be required for axfs and cramfs with XIP.

----

drivers/mtd/devices/slram.c +1 -2
index d293add..110884f 100644
@@ -76,8 +76,8 @@ static char *map;
 static slram_mtd_list_t *slram_mtdlist = NULL;
 
 static int slram_erase(struct mtd_info *, struct erase_info *);
-static int slram_point(struct mtd_info *, loff_t, size_t, size_t *, u_char **);
-static void slram_unpoint(struct mtd_info *, u_char *, loff_t,	size_t);
+static int slram_point(struct mtd_info *, loff_t, size_t, size_t *,

void **, resource_size_t *);
+static void slram_unpoint(struct mtd_info *, loff_t, size_t);
static int slram_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *); static int slram_write(struct mtd_info *, loff_t, size_t, size_t *,
const u_char *);

@@ -104,19 +104,23 @@ static int slram_erase(struct mtd_info *mtd, struct erase_info *instr)
}

static int slram_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)
{
slram_priv_t *priv = mtd->priv;

+ /* can we return a physical address with this driver? */
+ if (phys)
+ return -EINVAL;
+
if (from + len > mtd->size)
return -EINVAL;

- *mtdbuf = priv->start + from;
+ *virt = priv->start + from;
*retlen = len;
return(0);
}

-static void slram_unpoint(struct mtd_info *mtd, u_char *addr, loff_t from, size_t len)
+static void slram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
{
}