/* The map stuff is very simple. You fill in your struct map_info with a handful of routines for accessing the device, making sure they handle paging etc. correctly if your device needs it. Then you pass it off to a chip probe routine -- either JEDEC or CFI probe or both -- via do_map_probe(). If a chip is recognised, the probe code will invoke the appropriate chip driver (if present) and return a struct mtd_info. At which point, you fill in the mtd->module with your own module address, and register it with the MTD core code. Or you could partition it and register the partitions instead, or keep it for your own private use; whatever.
The mtd->priv field will point to the struct map_info, and any further private data required by the chip driver is linked from the mtd->priv->fldrv_priv field. This allows the map driver to get at the destructor function map->fldrv_destroy() when it's tired of living.
*/
int swap; /* this mapping's byte-swapping requirement */ int bankwidth; /* in octets. This isn't necessarily the width of actual bus cycles -- it's the repeat interval in bytes, before you are talking to the first chip again.
*/
/* We can perhaps put in 'point' and 'unpoint' methods, if we really
want to enable XIP for non-linear mappings. Not yet though. */ #endif /* It's possible for the map driver to use cached memory in its copy_from implementation (and _only_ with copy_from). However, when the chip driver knows some flash area has changed contents, it will signal it to the map driver through this routine to let the map driver invalidate the corresponding cache as needed.
If there is no cache to care about this can be set to NULL. */ void (*inval_cache)(struct map_info *, unsignedlong, ssize_t);
/* This will be called with 1 as parameter when the first map user * needs VPP, and called with 0 when the last user exits. The map * core maintains a reference counter, and assumes that VPP is a * global resource applying to all mapped flash chips on the system.
*/ void (*set_vpp)(struct map_info *, int);
#define ENABLE_VPP(map) do { if (map->set_vpp) map->set_vpp(map, 1); } while (0) #define DISABLE_VPP(map) do { if (map->set_vpp) map->set_vpp(map, 0); } while (0)
#define INVALIDATE_CACHED_RANGE(map, from, size) \ do { if (map->inval_cache) map->inval_cache(map, from, size); } while (0)
#define map_word_equal(map, val1, val2) \
({ \ int i, ret = 1; \ for (i = 0; i < map_words(map); i++) \ if ((val1).x[i] != (val2).x[i]) { \
ret = 0; \ break; \
} \
ret; \
})
#define map_word_and(map, val1, val2) \
({ \
map_word r; \ int i; \ for (i = 0; i < map_words(map); i++) \
r.x[i] = (val1).x[i] & (val2).x[i]; \
r; \
})
#define map_word_clr(map, val1, val2) \
({ \
map_word r; \ int i; \ for (i = 0; i < map_words(map); i++) \
r.x[i] = (val1).x[i] & ~(val2).x[i]; \
r; \
})
#define map_word_or(map, val1, val2) \
({ \
map_word r; \ int i; \ for (i = 0; i < map_words(map); i++) \
r.x[i] = (val1).x[i] | (val2).x[i]; \
r; \
})
#define map_word_andequal(map, val1, val2, val3) \
({ \ int i, ret = 1; \ for (i = 0; i < map_words(map); i++) { \ if (((val1).x[i] & (val2).x[i]) != (val3).x[i]) { \
ret = 0; \ break; \
} \
} \
ret; \
})
#define map_word_bitsset(map, val1, val2) \
({ \ int i, ret = 0; \ for (i = 0; i < map_words(map); i++) { \ if ((val1).x[i] & (val2).x[i]) { \
ret = 1; \ break; \
} \
} \
ret; \
})
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.