/drivers/mtd/devices/ |
D | goldfish_nand.c | 34 struct mtd_info mtd[0]; member 37 static uint32_t goldfish_nand_cmd_with_params(struct mtd_info *mtd, in goldfish_nand_cmd_with_params() argument 42 struct goldfish_nand *nand = mtd->priv; in goldfish_nand_cmd_with_params() 62 cps->dev = mtd - nand->mtd; in goldfish_nand_cmd_with_params() 72 static uint32_t goldfish_nand_cmd(struct mtd_info *mtd, enum nand_cmd cmd, in goldfish_nand_cmd() argument 75 struct goldfish_nand *nand = mtd->priv; in goldfish_nand_cmd() 81 if (goldfish_nand_cmd_with_params(mtd, cmd, addr, len, ptr, &rv)) in goldfish_nand_cmd() 83 writel(mtd - nand->mtd, base + NAND_DEV); in goldfish_nand_cmd() 95 static int goldfish_nand_erase(struct mtd_info *mtd, struct erase_info *instr) in goldfish_nand_erase() argument 101 if (ofs + len > mtd->size) in goldfish_nand_erase() [all …]
|
D | mtdram.c | 36 static int ram_erase(struct mtd_info *mtd, struct erase_info *instr) in ram_erase() argument 38 if (instr->addr + instr->len > mtd->size) in ram_erase() 41 memset((char *)mtd->priv + instr->addr, 0xff, instr->len); in ram_erase() 49 static int ram_point(struct mtd_info *mtd, loff_t from, size_t len, in ram_point() argument 52 if (from + len > mtd->size) in ram_point() 59 *virt = mtd->priv + from; in ram_point() 64 static void ram_unpoint(struct mtd_info *mtd, loff_t from, size_t len) in ram_unpoint() argument 68 static int ram_read(struct mtd_info *mtd, loff_t from, size_t len, in ram_read() argument 71 if (from + len > mtd->size) in ram_read() 74 memcpy(buf, mtd->priv + from, len); in ram_read() [all …]
|
D | phram.c | 29 struct mtd_info mtd; member 36 static int phram_erase(struct mtd_info *mtd, struct erase_info *instr) in phram_erase() argument 38 u_char *start = mtd->priv; in phram_erase() 40 if (instr->addr + instr->len > mtd->size) in phram_erase() 57 static int phram_point(struct mtd_info *mtd, loff_t from, size_t len, in phram_point() argument 60 if (from + len > mtd->size) in phram_point() 67 *virt = mtd->priv + from; in phram_point() 72 static void phram_unpoint(struct mtd_info *mtd, loff_t from, size_t len) in phram_unpoint() argument 76 static int phram_read(struct mtd_info *mtd, loff_t from, size_t len, in phram_read() argument 79 u_char *start = mtd->priv; in phram_read() [all …]
|
/drivers/mtd/nand/ |
D | nand_base.c | 85 static int nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, 88 static int nand_do_write_oob(struct mtd_info *mtd, loff_t to, 103 static void nand_release_device(struct mtd_info *mtd) in nand_release_device() argument 105 struct nand_chip *chip = mtd->priv; in nand_release_device() 108 chip->select_chip(mtd, -1); in nand_release_device() 124 static uint8_t nand_read_byte(struct mtd_info *mtd) in nand_read_byte() argument 126 struct nand_chip *chip = mtd->priv; in nand_read_byte() 137 static uint8_t nand_read_byte16(struct mtd_info *mtd) in nand_read_byte16() argument 139 struct nand_chip *chip = mtd->priv; in nand_read_byte16() 150 static u16 nand_read_word(struct mtd_info *mtd) in nand_read_word() argument [all …]
|
D | nand_bbt.c | 143 static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, in read_bbt() argument 147 struct nand_chip *this = mtd->priv; in read_bbt() 157 res = mtd->read(mtd, from, len, &retlen, buf); in read_bbt() 177 mtd->ecc_stats.bbtblocks++; in read_bbt() 189 mtd->ecc_stats.badblocks++; in read_bbt() 209 static int read_abs_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *td, int chip) in read_abs_bbt() argument 211 struct nand_chip *this = mtd->priv; in read_abs_bbt() 220 …res = read_bbt (mtd, buf, td->pages[i], this->chipsize >> this->bbt_erase_shift, bits, offs, td->r… in read_abs_bbt() 226 …res = read_bbt (mtd, buf, td->pages[0], mtd->size >> this->bbt_erase_shift, bits, 0, td->reserved_… in read_abs_bbt() 236 static int scan_read_raw(struct mtd_info *mtd, uint8_t *buf, loff_t offs, in scan_read_raw() argument [all …]
|
D | diskonchip.c | 89 static void doc200x_hwcontrol(struct mtd_info *mtd, int cmd, 91 static void doc200x_select_chip(struct mtd_info *mtd, int chip); 297 static void doc2000_write_byte(struct mtd_info *mtd, u_char datum) in doc2000_write_byte() argument 299 struct nand_chip *this = mtd->priv; in doc2000_write_byte() 309 static u_char doc2000_read_byte(struct mtd_info *mtd) in doc2000_read_byte() argument 311 struct nand_chip *this = mtd->priv; in doc2000_read_byte() 324 static void doc2000_writebuf(struct mtd_info *mtd, const u_char *buf, int len) in doc2000_writebuf() argument 326 struct nand_chip *this = mtd->priv; in doc2000_writebuf() 341 static void doc2000_readbuf(struct mtd_info *mtd, u_char *buf, int len) in doc2000_readbuf() argument 343 struct nand_chip *this = mtd->priv; in doc2000_readbuf() [all …]
|
D | cafe_nand.c | 103 static int cafe_device_ready(struct mtd_info *mtd) in cafe_device_ready() argument 105 struct cafe_priv *cafe = mtd->priv; in cafe_device_ready() 119 static void cafe_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) in cafe_write_buf() argument 121 struct cafe_priv *cafe = mtd->priv; in cafe_write_buf() 134 static void cafe_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in cafe_read_buf() argument 136 struct cafe_priv *cafe = mtd->priv; in cafe_read_buf() 148 static uint8_t cafe_read_byte(struct mtd_info *mtd) in cafe_read_byte() argument 150 struct cafe_priv *cafe = mtd->priv; in cafe_read_byte() 153 cafe_read_buf(mtd, &d, 1); in cafe_read_byte() 159 static void cafe_nand_cmdfunc(struct mtd_info *mtd, unsigned command, in cafe_nand_cmdfunc() argument [all …]
|
D | au1550nd.c | 51 static u_char au_read_byte(struct mtd_info *mtd) in au_read_byte() argument 53 struct nand_chip *this = mtd->priv; in au_read_byte() 66 static void au_write_byte(struct mtd_info *mtd, u_char byte) in au_write_byte() argument 68 struct nand_chip *this = mtd->priv; in au_write_byte() 80 static u_char au_read_byte16(struct mtd_info *mtd) in au_read_byte16() argument 82 struct nand_chip *this = mtd->priv; in au_read_byte16() 96 static void au_write_byte16(struct mtd_info *mtd, u_char byte) in au_write_byte16() argument 98 struct nand_chip *this = mtd->priv; in au_write_byte16() 110 static u16 au_read_word(struct mtd_info *mtd) in au_read_word() argument 112 struct nand_chip *this = mtd->priv; in au_read_word() [all …]
|
/drivers/mtd/ |
D | mtdpart.c | 27 struct mtd_info mtd; member 47 static int part_read(struct mtd_info *mtd, loff_t from, size_t len, in part_read() argument 50 struct mtd_part *part = PART(mtd); in part_read() 53 if (from >= mtd->size) in part_read() 55 else if (from + len > mtd->size) in part_read() 56 len = mtd->size - from; in part_read() 61 mtd->ecc_stats.corrected++; in part_read() 63 mtd->ecc_stats.failed++; in part_read() 68 static int part_point(struct mtd_info *mtd, loff_t from, size_t len, in part_point() argument 71 struct mtd_part *part = PART(mtd); in part_point() [all …]
|
D | mtdchar.c | 24 static void mtd_notify_add(struct mtd_info* mtd) in mtd_notify_add() argument 26 if (!mtd) in mtd_notify_add() 29 device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2), in mtd_notify_add() 30 NULL, "mtd%d", mtd->index); in mtd_notify_add() 32 device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1), in mtd_notify_add() 33 NULL, "mtd%dro", mtd->index); in mtd_notify_add() 36 static void mtd_notify_remove(struct mtd_info* mtd) in mtd_notify_remove() argument 38 if (!mtd) in mtd_notify_remove() 41 device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2)); in mtd_notify_remove() 42 device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1)); in mtd_notify_remove() [all …]
|
D | mtdcore.c | 45 int add_mtd_device(struct mtd_info *mtd) in add_mtd_device() argument 49 BUG_ON(mtd->writesize == 0); in add_mtd_device() 56 mtd_table[i] = mtd; in add_mtd_device() 57 mtd->index = i; in add_mtd_device() 58 mtd->usecount = 0; in add_mtd_device() 60 if (is_power_of_2(mtd->erasesize)) in add_mtd_device() 61 mtd->erasesize_shift = ffs(mtd->erasesize) - 1; in add_mtd_device() 63 mtd->erasesize_shift = 0; in add_mtd_device() 65 if (is_power_of_2(mtd->writesize)) in add_mtd_device() 66 mtd->writesize_shift = ffs(mtd->writesize) - 1; in add_mtd_device() [all …]
|
D | mtdoops.c | 43 struct mtd_info *mtd; member 62 static int mtdoops_erase_block(struct mtd_info *mtd, int offset) in mtdoops_erase_block() argument 70 erase.mtd = mtd; in mtdoops_erase_block() 73 erase.len = mtd->erasesize; in mtdoops_erase_block() 79 ret = mtd->erase(mtd, &erase); in mtdoops_erase_block() 85 (unsigned long long)erase.addr, (unsigned long long)erase.len, mtd->name); in mtdoops_erase_block() 97 struct mtd_info *mtd = cxt->mtd; in mtdoops_inc_counter() local 109 ret = mtd->read(mtd, cxt->nextpage * OOPS_PAGE_SIZE, 4, in mtdoops_inc_counter() 135 struct mtd_info *mtd = cxt->mtd; in mtdoops_workfunc_erase() local 139 if (!mtd) in mtdoops_workfunc_erase() [all …]
|
D | mtdconcat.c | 29 struct mtd_info mtd; member 53 concat_read(struct mtd_info *mtd, loff_t from, size_t len, in concat_read() argument 56 struct mtd_concat *concat = CONCAT(mtd); in concat_read() 84 mtd->ecc_stats.failed++; in concat_read() 87 mtd->ecc_stats.corrected++; in concat_read() 107 concat_write(struct mtd_info *mtd, loff_t to, size_t len, in concat_write() argument 110 struct mtd_concat *concat = CONCAT(mtd); in concat_write() 114 if (!(mtd->flags & MTD_WRITEABLE)) in concat_write() 154 concat_writev(struct mtd_info *mtd, const struct kvec *vecs, in concat_writev() argument 157 struct mtd_concat *concat = CONCAT(mtd); in concat_writev() [all …]
|
D | mtdblock.c | 23 struct mtd_info *mtd; member 48 static int erase_write (struct mtd_info *mtd, unsigned long pos, in erase_write() argument 62 erase.mtd = mtd; in erase_write() 71 ret = mtd->erase(mtd, &erase); in erase_write() 77 pos, len, mtd->name); in erase_write() 88 ret = mtd->write(mtd, pos, len, &retlen, buf); in erase_write() 99 struct mtd_info *mtd = mtdblk->mtd; in write_cached_data() local 106 "at 0x%lx, size 0x%x\n", mtd->name, in write_cached_data() 109 ret = erase_write (mtd, mtdblk->cache_offset, in write_cached_data() 129 struct mtd_info *mtd = mtdblk->mtd; in do_cached_write() local [all …]
|
D | mtdsuper.c | 23 struct mtd_info *mtd = _mtd; in get_sb_mtd_compare() local 25 if (sb->s_mtd == mtd) { in get_sb_mtd_compare() 27 mtd->index, mtd->name); in get_sb_mtd_compare() 32 sb->s_mtd->index, sb->s_mtd->name, mtd->index, mtd->name); in get_sb_mtd_compare() 43 struct mtd_info *mtd = _mtd; in get_sb_mtd_set() local 45 sb->s_mtd = mtd; in get_sb_mtd_set() 46 sb->s_dev = MKDEV(MTD_BLOCK_MAJOR, mtd->index); in get_sb_mtd_set() 55 struct mtd_info *mtd, in get_sb_mtd_aux() argument 62 sb = sget(fs_type, get_sb_mtd_compare, get_sb_mtd_set, mtd); in get_sb_mtd_aux() 71 mtd->index, mtd->name); in get_sb_mtd_aux() [all …]
|
/drivers/mtd/onenand/ |
D | onenand_base.c | 195 static int onenand_command(struct mtd_info *mtd, int cmd, loff_t addr, size_t len) in onenand_command() argument 197 struct onenand_chip *this = mtd->priv; in onenand_command() 304 static int onenand_wait(struct mtd_info *mtd, int state) in onenand_wait() argument 306 struct onenand_chip * this = mtd->priv; in onenand_wait() 338 mtd->ecc_stats.failed++; in onenand_wait() 342 mtd->ecc_stats.corrected++; in onenand_wait() 387 static int onenand_interrupt_wait(struct mtd_info *mtd, int state) in onenand_interrupt_wait() argument 389 struct onenand_chip *this = mtd->priv; in onenand_interrupt_wait() 393 return onenand_wait(mtd, state); in onenand_interrupt_wait() 403 static int onenand_try_interrupt_wait(struct mtd_info *mtd, int state) in onenand_try_interrupt_wait() argument [all …]
|
/drivers/mtd/ubi/ |
D | gluebi.c | 42 static int gluebi_get_device(struct mtd_info *mtd) in gluebi_get_device() argument 46 vol = container_of(mtd, struct ubi_volume, gluebi_mtd); in gluebi_get_device() 84 static void gluebi_put_device(struct mtd_info *mtd) in gluebi_put_device() argument 88 vol = container_of(mtd, struct ubi_volume, gluebi_mtd); in gluebi_put_device() 106 static int gluebi_read(struct mtd_info *mtd, loff_t from, size_t len, in gluebi_read() argument 115 if (len < 0 || from < 0 || from + len > mtd->size) in gluebi_read() 118 vol = container_of(mtd, struct ubi_volume, gluebi_mtd); in gluebi_read() 121 lnum = div_u64_rem(from, mtd->erasesize, &offs); in gluebi_read() 124 size_t to_read = mtd->erasesize - offs; in gluebi_read() 154 static int gluebi_write(struct mtd_info *mtd, loff_t to, size_t len, in gluebi_write() argument [all …]
|
/drivers/mtd/tests/ |
D | mtd_oobtest.c | 36 static struct mtd_info *mtd; variable 73 loff_t addr = ebnum * mtd->erasesize; in erase_eraseblock() 76 ei.mtd = mtd; in erase_eraseblock() 78 ei.len = mtd->erasesize; in erase_eraseblock() 80 err = mtd->erase(mtd, &ei); in erase_eraseblock() 129 loff_t addr = ebnum * mtd->erasesize; in write_eraseblock() 131 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { in write_eraseblock() 141 err = mtd->write_oob(mtd, addr, &ops); in write_eraseblock() 182 loff_t addr = ebnum * mtd->erasesize; in verify_eraseblock() 184 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { in verify_eraseblock() [all …]
|
D | mtd_stresstest.c | 40 static struct mtd_info *mtd; variable 107 loff_t addr = ebnum * mtd->erasesize; in erase_eraseblock() 110 ei.mtd = mtd; in erase_eraseblock() 112 ei.len = mtd->erasesize; in erase_eraseblock() 114 err = mtd->erase(mtd, &ei); in erase_eraseblock() 131 loff_t addr = ebnum * mtd->erasesize; in is_block_bad() 134 ret = mtd->block_isbad(mtd, addr); in is_block_bad() 149 if (offs >= mtd->erasesize) in do_read() 150 offs -= mtd->erasesize; in do_read() 151 if (offs + len > mtd->erasesize) in do_read() [all …]
|
D | mtd_pagetest.c | 36 static struct mtd_info *mtd; variable 72 loff_t addr = ebnum * mtd->erasesize; in erase_eraseblock() 75 ei.mtd = mtd; in erase_eraseblock() 77 ei.len = mtd->erasesize; in erase_eraseblock() 79 err = mtd->erase(mtd, &ei); in erase_eraseblock() 98 loff_t addr = ebnum * mtd->erasesize; in write_eraseblock() 100 set_random_data(writebuf, mtd->erasesize); in write_eraseblock() 102 err = mtd->write(mtd, addr, mtd->erasesize, &written, writebuf); in write_eraseblock() 103 if (err || written != mtd->erasesize) in write_eraseblock() 116 loff_t addr = ebnum * mtd->erasesize; in verify_eraseblock() [all …]
|
D | mtd_speedtest.c | 35 static struct mtd_info *mtd; variable 69 loff_t addr = ebnum * mtd->erasesize; in erase_eraseblock() 72 ei.mtd = mtd; in erase_eraseblock() 74 ei.len = mtd->erasesize; in erase_eraseblock() 76 err = mtd->erase(mtd, &ei); in erase_eraseblock() 111 loff_t addr = ebnum * mtd->erasesize; in write_eraseblock() 113 err = mtd->write(mtd, addr, mtd->erasesize, &written, iobuf); in write_eraseblock() 114 if (err || written != mtd->erasesize) { in write_eraseblock() 127 loff_t addr = ebnum * mtd->erasesize; in write_eraseblock_by_page() 131 err = mtd->write(mtd, addr, pgsize, &written, buf); in write_eraseblock_by_page() [all …]
|
D | mtd_readtest.c | 35 static struct mtd_info *mtd; variable 48 loff_t addr = ebnum * mtd->erasesize; in read_eraseblock_by_page() 54 ret = mtd->read(mtd, addr, pgsize, &read, buf); in read_eraseblock_by_page() 65 if (mtd->oobsize) { in read_eraseblock_by_page() 71 ops.ooblen = mtd->oobsize; in read_eraseblock_by_page() 76 ret = mtd->read_oob(mtd, addr, &ops); in read_eraseblock_by_page() 77 if (ret || ops.oobretlen != mtd->oobsize) { in read_eraseblock_by_page() 85 oobbuf += mtd->oobsize; in read_eraseblock_by_page() 101 n = mtd->erasesize; in dump_eraseblock() 111 if (!mtd->oobsize) in dump_eraseblock() [all …]
|
/drivers/misc/ |
D | apanic.c | 58 struct mtd_info *mtd; member 94 static void alloc_bbt(struct mtd_info *mtd, unsigned int *bbt) in alloc_bbt() argument 97 apanic_erase_blocks = (mtd->size)>>(mtd->erasesize_shift); in alloc_bbt() 104 static void scan_bbt(struct mtd_info *mtd, unsigned int *bbt) in scan_bbt() argument 109 if (mtd->block_isbad(mtd, i*mtd->erasesize)) in scan_bbt() 116 static unsigned int phy_offset(struct mtd_info *mtd, unsigned int offset) in phy_offset() argument 118 unsigned int logic_block = offset>>(mtd->erasesize_shift); in phy_offset() 132 return offset + ((phy_block-logic_block)<<mtd->erasesize_shift); in phy_offset() 178 if (count > ctx->mtd->writesize) in apanic_proc_read() 179 count = ctx->mtd->writesize; in apanic_proc_read() [all …]
|
/drivers/mtd/chips/ |
D | map_ram.c | 34 struct mtd_info *mtd; in map_ram_probe() local 57 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_ram_probe() 58 if (!mtd) in map_ram_probe() 62 mtd->priv = map; in map_ram_probe() 63 mtd->name = map->name; in map_ram_probe() 64 mtd->type = MTD_RAM; in map_ram_probe() 65 mtd->size = map->size; in map_ram_probe() 66 mtd->erase = mapram_erase; in map_ram_probe() 67 mtd->read = mapram_read; in map_ram_probe() 68 mtd->write = mapram_write; in map_ram_probe() [all …]
|
D | map_rom.c | 22 static int maprom_erase (struct mtd_info *mtd, struct erase_info *info); 32 struct mtd_info *mtd; in map_rom_probe() local 34 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_rom_probe() 35 if (!mtd) in map_rom_probe() 39 mtd->priv = map; in map_rom_probe() 40 mtd->name = map->name; in map_rom_probe() 41 mtd->type = MTD_ROM; in map_rom_probe() 42 mtd->size = map->size; in map_rom_probe() 43 mtd->read = maprom_read; in map_rom_probe() 44 mtd->write = maprom_write; in map_rom_probe() [all …]
|