Lines Matching full:adr

97 static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr, int mode);
98 static void put_chip(struct map_info *map, struct flchip *chip, unsigned long adr);
130 unsigned long adr) in cfi_check_err_status() argument
140 status = map_read(map, adr); in cfi_check_err_status()
558 unsigned long adr) in cfi_fixup_m29ew_erase_suspend() argument
563 map_write(map, CMD(0xF0), adr); in cfi_fixup_m29ew_erase_suspend()
639 __u16 adr = primary?cfi->cfiq->P_ADR:cfi->cfiq->A_ADR; in cfi_cmdset_0002() local
642 extp = (struct cfi_pri_amdstd*)cfi_read_pri(map, adr, sizeof(*extp), "Amd/Fujitsu"); in cfi_cmdset_0002()
874 static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr, int mode) in get_chip() argument
888 if (chip_ready(map, chip, adr, NULL)) in get_chip()
915 if ((adr & chip->in_progress_block_mask) == in get_chip()
927 if (chip_ready(map, chip, adr, NULL)) in get_chip()
936 put_chip(map, chip, adr); in get_chip()
980 static void put_chip(struct map_info *map, struct flchip *chip, unsigned long adr) in put_chip() argument
1022 unsigned long adr) in xip_disable() argument
1025 (void) map_read(map, adr); /* ensure mmu mapping is up to date */ in xip_disable()
1030 unsigned long adr) in xip_enable() argument
1035 map_write(map, CMD(0xf0), adr); in xip_enable()
1038 (void) map_read(map, adr); in xip_enable()
1057 unsigned long adr, int usec) in xip_udelay() argument
1080 map_write(map, CMD(0xb0), adr); in xip_udelay()
1093 status = map_read(map, adr); in xip_udelay()
1102 map_write(map, CMD(0xf0), adr); in xip_udelay()
1103 (void) map_read(map, adr); in xip_udelay()
1130 cfi_fixup_m29ew_erase_suspend(map, adr); in xip_udelay()
1132 map_write(map, cfi->sector_erase_cmd, adr); in xip_udelay()
1143 status = map_read(map, adr); in xip_udelay()
1148 #define UDELAY(map, chip, adr, usec) xip_udelay(map, chip, adr, usec) argument
1160 #define INVALIDATE_CACHE_UDELAY(map, chip, adr, len, usec) \ argument
1161 UDELAY(map, chip, adr, usec)
1182 #define xip_disable(map, chip, adr) argument
1183 #define xip_enable(map, chip, adr) argument
1186 #define UDELAY(map, chip, adr, usec) \ argument
1193 #define INVALIDATE_CACHE_UDELAY(map, chip, adr, len, usec) \ argument
1196 INVALIDATE_CACHED_RANGE(map, adr, len); \
1203 static inline int do_read_onechip(struct map_info *map, struct flchip *chip, loff_t adr, size_t len… in do_read_onechip() argument
1209 adr += chip->start; in do_read_onechip()
1212 cmd_addr = adr & ~(map_bankwidth(map)-1); in do_read_onechip()
1226 map_copy_from(map, buf, adr, len); in do_read_onechip()
1273 loff_t adr, size_t len, u_char *buf, size_t grouplen);
1276 loff_t adr, size_t len) in otp_enter() argument
1287 INVALIDATE_CACHED_RANGE(map, chip->start + adr, len); in otp_enter()
1291 loff_t adr, size_t len) in otp_exit() argument
1304 INVALIDATE_CACHED_RANGE(map, chip->start + adr, len); in otp_exit()
1308 struct flchip *chip, loff_t adr, in do_read_secsi_onechip() argument
1329 adr += chip->start; in do_read_secsi_onechip()
1333 otp_enter(map, chip, adr, len); in do_read_secsi_onechip()
1334 map_copy_from(map, buf, adr, len); in do_read_secsi_onechip()
1335 otp_exit(map, chip, adr, len); in do_read_secsi_onechip()
1383 unsigned long adr, map_word datum,
1386 static int do_otp_write(struct map_info *map, struct flchip *chip, loff_t adr, in do_otp_write() argument
1391 unsigned long bus_ofs = adr & ~(map_bankwidth(map)-1); in do_otp_write()
1392 int gap = adr - bus_ofs; in do_otp_write()
1408 adr += n; in do_otp_write()
1416 static int do_otp_lock(struct map_info *map, struct flchip *chip, loff_t adr, in do_otp_lock() argument
1425 if ((adr != 0) || (len != grouplen)) in do_otp_lock()
1458 if (chip_ready(map, chip, adr, NULL)) in do_otp_lock()
1646 unsigned long adr, map_word datum, in do_write_oneword_once() argument
1665 map_write(map, datum, adr); in do_write_oneword_once()
1669 adr, map_bankwidth(map), in do_write_oneword_once()
1694 !chip_good(map, chip, adr, &datum)) { in do_write_oneword_once()
1695 xip_enable(map, chip, adr); in do_write_oneword_once()
1697 xip_disable(map, chip, adr); in do_write_oneword_once()
1702 if (chip_good(map, chip, adr, &datum)) { in do_write_oneword_once()
1703 if (cfi_check_err_status(map, chip, adr)) in do_write_oneword_once()
1709 UDELAY(map, chip, adr, 1); in do_write_oneword_once()
1717 unsigned long adr, int mode) in do_write_oneword_start() argument
1723 ret = get_chip(map, chip, adr, mode); in do_write_oneword_start()
1730 otp_enter(map, chip, adr, map_bankwidth(map)); in do_write_oneword_start()
1737 unsigned long adr, int mode) in do_write_oneword_done() argument
1740 otp_exit(map, chip, adr, map_bankwidth(map)); in do_write_oneword_done()
1744 put_chip(map, chip, adr); in do_write_oneword_done()
1751 unsigned long adr, map_word datum, in do_write_oneword_retry() argument
1765 oldd = map_read(map, adr); in do_write_oneword_retry()
1771 XIP_INVAL_CACHED_RANGE(map, adr, map_bankwidth(map)); in do_write_oneword_retry()
1773 xip_disable(map, chip, adr); in do_write_oneword_retry()
1776 ret = do_write_oneword_once(map, chip, adr, datum, mode, cfi); in do_write_oneword_retry()
1787 xip_enable(map, chip, adr); in do_write_oneword_retry()
1793 unsigned long adr, map_word datum, in do_write_oneword() argument
1798 adr += chip->start; in do_write_oneword()
1800 pr_debug("MTD %s(): WRITE 0x%.8lx(0x%.8lx)\n", __func__, adr, in do_write_oneword()
1803 ret = do_write_oneword_start(map, chip, adr, mode); in do_write_oneword()
1807 ret = do_write_oneword_retry(map, chip, adr, datum, mode); in do_write_oneword()
1809 do_write_oneword_done(map, chip, adr, mode); in do_write_oneword()
1940 struct flchip *chip, unsigned long adr, in do_write_buffer_wait() argument
1974 !chip_good(map, chip, adr, &datum)) { in do_write_buffer_wait()
1976 __func__, adr); in do_write_buffer_wait()
1981 if (chip_good(map, chip, adr, &datum)) { in do_write_buffer_wait()
1982 if (cfi_check_err_status(map, chip, adr)) in do_write_buffer_wait()
1988 UDELAY(map, chip, adr, 1); in do_write_buffer_wait()
2020 unsigned long adr, const u_char *buf, in do_write_buffer() argument
2029 adr += chip->start; in do_write_buffer()
2030 cmd_adr = adr; in do_write_buffer()
2033 ret = get_chip(map, chip, adr, FL_WRITING); in do_write_buffer()
2042 __func__, adr, datum.x[0]); in do_write_buffer()
2044 XIP_INVAL_CACHED_RANGE(map, adr, len); in do_write_buffer()
2063 map_write(map, datum, adr + z); in do_write_buffer()
2070 adr += z; in do_write_buffer()
2077 adr, map_bankwidth(map), in do_write_buffer()
2080 ret = do_write_buffer_wait(map, chip, adr, datum); in do_write_buffer()
2084 xip_enable(map, chip, adr); in do_write_buffer()
2088 put_chip(map, chip, adr); in do_write_buffer()
2180 unsigned long adr) in cfi_amdstd_panic_wait() argument
2190 if (chip->state == FL_READY && chip_ready(map, chip, adr, NULL)) in cfi_amdstd_panic_wait()
2207 if (chip_ready(map, chip, adr, NULL)) in cfi_amdstd_panic_wait()
2232 unsigned long adr, map_word datum) in do_panic_write_oneword() argument
2241 adr += chip->start; in do_panic_write_oneword()
2243 ret = cfi_amdstd_panic_wait(map, chip, adr); in do_panic_write_oneword()
2248 __func__, adr, datum.x[0]); in do_panic_write_oneword()
2256 oldd = map_read(map, adr); in do_panic_write_oneword()
2268 map_write(map, datum, adr); in do_panic_write_oneword()
2271 if (chip_ready(map, chip, adr, NULL)) in do_panic_write_oneword()
2277 if (!chip_ready(map, chip, adr, &datum) || in do_panic_write_oneword()
2278 cfi_check_err_status(map, chip, adr)) { in do_panic_write_oneword()
2415 unsigned long int adr; in do_erase_chip() local
2421 adr = cfi->addr_unlock1; in do_erase_chip()
2424 ret = get_chip(map, chip, adr, FL_ERASING); in do_erase_chip()
2433 XIP_INVAL_CACHED_RANGE(map, adr, map->size); in do_erase_chip()
2435 xip_disable(map, chip, adr); in do_erase_chip()
2447 chip->in_progress_block_addr = adr; in do_erase_chip()
2451 adr, map->size, in do_erase_chip()
2474 if (chip_ready(map, chip, adr, &datum)) { in do_erase_chip()
2475 if (cfi_check_err_status(map, chip, adr)) in do_erase_chip()
2488 UDELAY(map, chip, adr, 1000000/HZ); in do_erase_chip()
2503 xip_enable(map, chip, adr); in do_erase_chip()
2505 put_chip(map, chip, adr); in do_erase_chip()
2512 static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr,… in do_erase_oneblock() argument
2521 adr += chip->start; in do_erase_oneblock()
2524 ret = get_chip(map, chip, adr, FL_ERASING); in do_erase_oneblock()
2531 __func__, adr); in do_erase_oneblock()
2533 XIP_INVAL_CACHED_RANGE(map, adr, len); in do_erase_oneblock()
2535 xip_disable(map, chip, adr); in do_erase_oneblock()
2543 map_write(map, cfi->sector_erase_cmd, adr); in do_erase_oneblock()
2547 chip->in_progress_block_addr = adr; in do_erase_oneblock()
2551 adr, len, in do_erase_oneblock()
2574 if (chip_ready(map, chip, adr, &datum)) { in do_erase_oneblock()
2575 if (cfi_check_err_status(map, chip, adr)) in do_erase_oneblock()
2588 UDELAY(map, chip, adr, 1000000/HZ); in do_erase_oneblock()
2603 xip_enable(map, chip, adr); in do_erase_oneblock()
2605 put_chip(map, chip, adr); in do_erase_oneblock()
2633 unsigned long adr, int len, void *thunk) in do_atmel_lock() argument
2639 ret = get_chip(map, chip, adr + chip->start, FL_LOCKING); in do_atmel_lock()
2644 pr_debug("MTD %s(): LOCK 0x%08lx len %d\n", __func__, adr, len); in do_atmel_lock()
2656 map_write(map, CMD(0x40), chip->start + adr); in do_atmel_lock()
2659 put_chip(map, chip, adr + chip->start); in do_atmel_lock()
2668 unsigned long adr, int len, void *thunk) in do_atmel_unlock() argument
2674 ret = get_chip(map, chip, adr + chip->start, FL_UNLOCKING); in do_atmel_unlock()
2679 pr_debug("MTD %s(): LOCK 0x%08lx len %d\n", __func__, adr, len); in do_atmel_unlock()
2683 map_write(map, CMD(0x70), adr); in do_atmel_unlock()
2686 put_chip(map, chip, adr + chip->start); in do_atmel_unlock()
2710 unsigned long adr; member
2720 unsigned long adr, int len, void *thunk) in do_ppb_xxlock() argument
2726 adr += chip->start; in do_ppb_xxlock()
2728 ret = get_chip(map, chip, adr, FL_LOCKING); in do_ppb_xxlock()
2734 pr_debug("MTD %s(): XXLOCK 0x%08lx len %d\n", __func__, adr, len); in do_ppb_xxlock()
2746 map_write(map, CMD(0xA0), adr); in do_ppb_xxlock()
2747 map_write(map, CMD(0x00), adr); in do_ppb_xxlock()
2759 ret = !cfi_read_query(map, adr); in do_ppb_xxlock()
2768 if (chip_ready(map, chip, adr, NULL)) in do_ppb_xxlock()
2777 UDELAY(map, chip, adr, 1); in do_ppb_xxlock()
2785 put_chip(map, chip, adr); in do_ppb_xxlock()
2805 unsigned long adr; in cfi_ppb_unlock() local
2834 adr = 0; in cfi_ppb_unlock()
2849 sect[sectors].adr = adr; in cfi_ppb_unlock()
2851 map, &cfi->chips[chipnum], adr, 0, in cfi_ppb_unlock()
2855 adr += size; in cfi_ppb_unlock()
2862 if (adr >> cfi->chipshift) { in cfi_ppb_unlock()
2865 adr = 0; in cfi_ppb_unlock()
2895 do_ppb_xxlock(map, sect[i].chip, sect[i].adr, 0, in cfi_ppb_unlock()