/* * This locking/unlock is specific to firmware hub parts. Only one * is known that supports the Intel command set. Firmware * hub parts cannot be interleaved as they are on the LPC bus * so this code has not been tested with interleaved chips, * and will likely fail in that context.
*/ staticint fwh_xxlock_oneblock(struct map_info *map, struct flchip *chip, unsignedlong adr, int len, void *thunk)
{ struct cfi_private *cfi = map->fldrv_priv; struct fwh_xxlock_thunk *xxlt = (struct fwh_xxlock_thunk *)thunk; int ret;
/* Refuse the operation if the we cannot look behind the chip */ if (chip->start < 0x400000) {
pr_debug( "MTD %s(): chip->start: %lx wanted >= 0x400000\n",
__func__, chip->start ); return -EIO;
} /* * lock block registers: * - on 64k boundariesand * - bit 1 set high * - block lock registers are 4MiB lower - overflow subtract (danger) * * The address manipulation is first done on the logical address * which is 0 at the start of the chip, and then the offset of * the individual chip is addted to it. Any other order a weird * map offset could cause problems.
*/
adr = (adr & ~0xffffUL) | 0x2;
adr += chip->start - 0x400000;
/* * This is easy because these are writes to registers and not writes * to flash memory - that means that we don't have to check status * and timeout.
*/
mutex_lock(&chip->mutex);
ret = get_chip(map, chip, adr, FL_LOCKING); if (ret) {
mutex_unlock(&chip->mutex); return 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.