/kernel/linux/linux-5.10/include/linux/mtd/ |
D | mtd.h | 102 int (*ecc)(struct mtd_info *mtd, int section, 104 int (*free)(struct mtd_info *mtd, int section, 178 int (*get_info)(struct mtd_info *mtd, int wunit, 180 int (*get_wunit)(struct mtd_info *mtd, 313 int (*_erase) (struct mtd_info *mtd, struct erase_info *instr); 314 int (*_point) (struct mtd_info *mtd, loff_t from, size_t len, 316 int (*_unpoint) (struct mtd_info *mtd, loff_t from, size_t len); 317 int (*_read) (struct mtd_info *mtd, loff_t from, size_t len, 319 int (*_write) (struct mtd_info *mtd, loff_t to, size_t len, 321 int (*_panic_write) (struct mtd_info *mtd, loff_t to, size_t len, [all …]
|
/kernel/linux/linux-5.10/drivers/mtd/ |
D | mtdcore.c | 43 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_cls_suspend() local 45 return mtd ? mtd_suspend(mtd) : 0; in mtd_cls_suspend() 50 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_cls_resume() local 52 if (mtd) in mtd_cls_resume() 53 mtd_resume(mtd); in mtd_cls_resume() 127 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_release() local 128 dev_t index = MTD_DEVT(mtd->index); in mtd_release() 137 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_type_show() local 140 switch (mtd->type) { in mtd_type_show() 176 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_flags_show() local [all …]
|
D | mtdpstore.c | 16 struct mtd_info *mtd; member 30 struct mtd_info *mtd = cxt->mtd; in mtdpstore_block_isbad() local 33 off = ALIGN_DOWN(off, mtd->erasesize); in mtdpstore_block_isbad() 34 blknum = div_u64(off, mtd->erasesize); in mtdpstore_block_isbad() 38 ret = mtd_block_isbad(mtd, off); in mtdpstore_block_isbad() 40 dev_err(&mtd->dev, "mtd_block_isbad failed, aborting\n"); in mtdpstore_block_isbad() 52 struct mtd_info *mtd = cxt->mtd; in mtdpstore_panic_block_isbad() local 55 off = ALIGN_DOWN(off, mtd->erasesize); in mtdpstore_panic_block_isbad() 56 blknum = div_u64(off, mtd->erasesize); in mtdpstore_panic_block_isbad() 63 struct mtd_info *mtd = cxt->mtd; in mtdpstore_mark_used() local [all …]
|
D | mtdconcat.c | 30 struct mtd_info mtd; member 54 concat_read(struct mtd_info *mtd, loff_t from, size_t len, in concat_read() argument 57 struct mtd_concat *concat = CONCAT(mtd); in concat_read() 83 mtd->ecc_stats.failed++; in concat_read() 86 mtd->ecc_stats.corrected++; in concat_read() 106 concat_panic_write(struct mtd_info *mtd, loff_t to, size_t len, in concat_panic_write() argument 109 struct mtd_concat *concat = CONCAT(mtd); in concat_panic_write() 147 concat_write(struct mtd_info *mtd, loff_t to, size_t len, in concat_write() argument 150 struct mtd_concat *concat = CONCAT(mtd); in concat_write() 185 concat_writev(struct mtd_info *mtd, const struct kvec *vecs, in concat_writev() argument [all …]
|
D | mtdchar.c | 37 struct mtd_info *mtd; member 44 return fixed_size_llseek(file, offset, orig, mfi->mtd->size); in mtdchar_lseek() 52 struct mtd_info *mtd; in mtdchar_open() local 62 mtd = get_mtd_device(NULL, devnum); in mtdchar_open() 64 if (IS_ERR(mtd)) { in mtdchar_open() 65 ret = PTR_ERR(mtd); in mtdchar_open() 69 if (mtd->type == MTD_ABSENT) { in mtdchar_open() 75 if ((file->f_mode & FMODE_WRITE) && !(mtd->flags & MTD_WRITEABLE)) { in mtdchar_open() 85 mfi->mtd = mtd; in mtdchar_open() 91 put_mtd_device(mtd); in mtdchar_open() [all …]
|
D | mtdoops.c | 49 struct mtd_info *mtd; member 75 struct mtd_info *mtd = cxt->mtd; in mtdoops_erase_block() local 76 u32 start_page_offset = mtd_div_by_eb(offset, mtd) * mtd->erasesize; in mtdoops_erase_block() 78 u32 erase_pages = mtd->erasesize / record_size; in mtdoops_erase_block() 84 erase.len = mtd->erasesize; in mtdoops_erase_block() 86 ret = mtd_erase(mtd, &erase); in mtdoops_erase_block() 124 struct mtd_info *mtd = cxt->mtd; in mtdoops_workfunc_erase() local 128 if (!mtd) in mtdoops_workfunc_erase() 131 mod = (cxt->nextpage * record_size) % mtd->erasesize; in mtdoops_workfunc_erase() 133 cxt->nextpage = cxt->nextpage + ((mtd->erasesize - mod) / record_size); in mtdoops_workfunc_erase() [all …]
|
D | mtdsuper.c | 27 struct mtd_info *mtd = fc->sget_key; in mtd_test_super() local 31 mtd->index, mtd->name); in mtd_test_super() 36 sb->s_mtd->index, sb->s_mtd->name, mtd->index, mtd->name); in mtd_test_super() 57 struct mtd_info *mtd, in mtd_get_sb() argument 64 fc->sget_key = mtd; in mtd_get_sb() 72 mtd->index, mtd->name); in mtd_get_sb() 73 put_mtd_device(mtd); in mtd_get_sb() 77 mtd->index, mtd->name); in mtd_get_sb() 102 struct mtd_info *mtd; in mtd_get_sb_by_nr() local 104 mtd = get_mtd_device(NULL, mtdnr); in mtd_get_sb_by_nr() [all …]
|
/kernel/linux/linux-5.10/drivers/mtd/nand/onenand/ |
D | onenand_base.c | 66 static int flexonenand_ooblayout_ecc(struct mtd_info *mtd, int section, in flexonenand_ooblayout_ecc() argument 78 static int flexonenand_ooblayout_free(struct mtd_info *mtd, int section, in flexonenand_ooblayout_free() argument 102 static int onenand_ooblayout_128_ecc(struct mtd_info *mtd, int section, in onenand_ooblayout_128_ecc() argument 114 static int onenand_ooblayout_128_free(struct mtd_info *mtd, int section, in onenand_ooblayout_128_free() argument 138 static int onenand_ooblayout_32_64_ecc(struct mtd_info *mtd, int section, in onenand_ooblayout_32_64_ecc() argument 150 static int onenand_ooblayout_32_64_free(struct mtd_info *mtd, int section, in onenand_ooblayout_32_64_free() argument 153 int sections = (mtd->oobsize / 32) * 2; in onenand_ooblayout_32_64_free() 377 int flexonenand_region(struct mtd_info *mtd, loff_t addr) in flexonenand_region() argument 381 for (i = 0; i < mtd->numeraseregions; i++) in flexonenand_region() 382 if (addr < mtd->eraseregions[i].offset) in flexonenand_region() [all …]
|
/kernel/linux/linux-5.10/drivers/mtd/nand/raw/ |
D | mpc5121_nfc.c | 119 static void mpc5121_nfc_done(struct mtd_info *mtd); 122 static inline u16 nfc_read(struct mtd_info *mtd, uint reg) in nfc_read() argument 124 struct nand_chip *chip = mtd_to_nand(mtd); in nfc_read() 131 static inline void nfc_write(struct mtd_info *mtd, uint reg, u16 val) in nfc_write() argument 133 struct nand_chip *chip = mtd_to_nand(mtd); in nfc_write() 140 static inline void nfc_set(struct mtd_info *mtd, uint reg, u16 bits) in nfc_set() argument 142 nfc_write(mtd, reg, nfc_read(mtd, reg) | bits); in nfc_set() 146 static inline void nfc_clear(struct mtd_info *mtd, uint reg, u16 bits) in nfc_clear() argument 148 nfc_write(mtd, reg, nfc_read(mtd, reg) & ~bits); in nfc_clear() 152 static inline void mpc5121_nfc_send_addr(struct mtd_info *mtd, u16 addr) in mpc5121_nfc_send_addr() argument [all …]
|
/kernel/linux/linux-5.10/drivers/mtd/ubi/ |
D | gluebi.c | 44 struct mtd_info mtd; member 84 static int gluebi_get_device(struct mtd_info *mtd) in gluebi_get_device() argument 89 if (mtd->flags & MTD_WRITEABLE) in gluebi_get_device() 92 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_get_device() 130 static void gluebi_put_device(struct mtd_info *mtd) in gluebi_put_device() argument 134 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_put_device() 153 static int gluebi_read(struct mtd_info *mtd, loff_t from, size_t len, in gluebi_read() argument 159 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_read() 160 lnum = div_u64_rem(from, mtd->erasesize, &offs); in gluebi_read() 163 size_t to_read = mtd->erasesize - offs; in gluebi_read() [all …]
|
/kernel/linux/linux-5.10/drivers/mtd/chips/ |
D | map_ram.c | 23 static int mapram_point (struct mtd_info *mtd, loff_t from, size_t len, 25 static int mapram_unpoint(struct mtd_info *mtd, loff_t from, size_t len); 36 struct mtd_info *mtd; in map_ram_probe() local 59 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_ram_probe() 60 if (!mtd) in map_ram_probe() 64 mtd->priv = map; in map_ram_probe() 65 mtd->name = map->name; in map_ram_probe() 66 mtd->type = MTD_RAM; in map_ram_probe() 67 mtd->size = map->size; in map_ram_probe() 68 mtd->_erase = mapram_erase; in map_ram_probe() [all …]
|
D | map_rom.c | 22 static int maprom_erase (struct mtd_info *mtd, struct erase_info *info); 23 static int maprom_point (struct mtd_info *mtd, loff_t from, size_t len, 25 static int maprom_unpoint(struct mtd_info *mtd, loff_t from, size_t len); 45 struct mtd_info *mtd; in map_rom_probe() local 47 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_rom_probe() 48 if (!mtd) in map_rom_probe() 52 mtd->priv = map; in map_rom_probe() 53 mtd->name = map->name; in map_rom_probe() 54 mtd->type = MTD_ROM; in map_rom_probe() 55 mtd->size = map->size; in map_rom_probe() [all …]
|
D | map_absent.c | 47 struct mtd_info *mtd; in map_absent_probe() local 49 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_absent_probe() 50 if (!mtd) { in map_absent_probe() 55 mtd->priv = map; in map_absent_probe() 56 mtd->name = map->name; in map_absent_probe() 57 mtd->type = MTD_ABSENT; in map_absent_probe() 58 mtd->size = map->size; in map_absent_probe() 59 mtd->_erase = map_absent_erase; in map_absent_probe() 60 mtd->_read = map_absent_read; in map_absent_probe() 61 mtd->_write = map_absent_write; in map_absent_probe() [all …]
|
/kernel/linux/linux-5.10/drivers/mtd/devices/ |
D | mtdram.c | 37 static int check_offs_len(struct mtd_info *mtd, loff_t ofs, uint64_t len) in check_offs_len() argument 42 if (mtd_mod_by_eb(ofs, mtd)) { in check_offs_len() 48 if (mtd_mod_by_eb(len, mtd)) { in check_offs_len() 56 static int ram_erase(struct mtd_info *mtd, struct erase_info *instr) in ram_erase() argument 58 if (check_offs_len(mtd, instr->addr, instr->len)) in ram_erase() 60 memset((char *)mtd->priv + instr->addr, 0xff, instr->len); in ram_erase() 65 static int ram_point(struct mtd_info *mtd, loff_t from, size_t len, in ram_point() argument 68 *virt = mtd->priv + from; in ram_point() 94 static int ram_unpoint(struct mtd_info *mtd, loff_t from, size_t len) in ram_unpoint() argument 99 static int ram_read(struct mtd_info *mtd, loff_t from, size_t len, in ram_read() argument [all …]
|
D | powernv_flash.c | 31 struct mtd_info mtd; member 46 static int powernv_flash_async_op(struct mtd_info *mtd, enum flash_op op, in powernv_flash_async_op() argument 49 struct powernv_flash *info = (struct powernv_flash *)mtd->priv; in powernv_flash_async_op() 50 struct device *dev = &mtd->dev; in powernv_flash_async_op() 137 static int powernv_flash_read(struct mtd_info *mtd, loff_t from, size_t len, in powernv_flash_read() argument 140 return powernv_flash_async_op(mtd, FLASH_OP_READ, from, in powernv_flash_read() 153 static int powernv_flash_write(struct mtd_info *mtd, loff_t to, size_t len, in powernv_flash_write() argument 156 return powernv_flash_async_op(mtd, FLASH_OP_WRITE, to, in powernv_flash_write() 165 static int powernv_flash_erase(struct mtd_info *mtd, struct erase_info *erase) in powernv_flash_erase() argument 169 rc = powernv_flash_async_op(mtd, FLASH_OP_ERASE, erase->addr, in powernv_flash_erase() [all …]
|
D | lart.c | 358 static int flash_erase (struct mtd_info *mtd,struct erase_info *instr) in flash_erase() argument 376 for (i = 0; i < mtd->numeraseregions && instr->addr >= mtd->eraseregions[i].offset; i++) ; in flash_erase() 385 if (i < 0 || (instr->addr & (mtd->eraseregions[i].erasesize - 1))) in flash_erase() 398 … for (; i < mtd->numeraseregions && instr->addr + instr->len >= mtd->eraseregions[i].offset; i++) ; in flash_erase() 402 if (i < 0 || ((instr->addr + instr->len) & (mtd->eraseregions[i].erasesize - 1))) in flash_erase() 416 addr += mtd->eraseregions[i].erasesize; in flash_erase() 417 len -= mtd->eraseregions[i].erasesize; in flash_erase() 419 …if (addr == mtd->eraseregions[i].offset + (mtd->eraseregions[i].erasesize * mtd->eraseregions[i].n… in flash_erase() 425 static int flash_read (struct mtd_info *mtd,loff_t from,size_t len,size_t *retlen,u_char *buf) in flash_read() argument 503 static int flash_write (struct mtd_info *mtd,loff_t to,size_t len,size_t *retlen,const u_char *buf) in flash_write() argument [all …]
|
D | phram.c | 31 struct mtd_info mtd; member 37 static int phram_erase(struct mtd_info *mtd, struct erase_info *instr) in phram_erase() argument 39 u_char *start = mtd->priv; in phram_erase() 46 static int phram_point(struct mtd_info *mtd, loff_t from, size_t len, in phram_point() argument 49 *virt = mtd->priv + from; in phram_point() 54 static int phram_unpoint(struct mtd_info *mtd, loff_t from, size_t len) in phram_unpoint() argument 59 static int phram_read(struct mtd_info *mtd, loff_t from, size_t len, in phram_read() argument 62 u_char *start = mtd->priv; in phram_read() 69 static int phram_write(struct mtd_info *mtd, loff_t to, size_t len, in phram_write() argument 72 u_char *start = mtd->priv; in phram_write() [all …]
|
/kernel/linux/linux-5.10/drivers/mtd/tests/ |
D | oobtest.c | 31 static struct mtd_info *mtd; variable 61 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock() 64 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { in write_eraseblock() 73 err = mtd_write_oob(mtd, addr, &ops); in write_eraseblock() 170 loff_t addr = (loff_t)ebnum * mtd->erasesize; in verify_eraseblock() 174 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { in verify_eraseblock() 183 err = mtd_read_oob(mtd, addr, &ops); in verify_eraseblock() 209 if (use_offset != 0 || use_len < mtd->oobavail) { in verify_eraseblock() 215 ops.ooblen = mtd->oobavail; in verify_eraseblock() 220 err = mtd_read_oob(mtd, addr, &ops); in verify_eraseblock() [all …]
|
D | pagetest.c | 28 static struct mtd_info *mtd; variable 43 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock() 45 prandom_bytes_state(&rnd_state, writebuf, mtd->erasesize); in write_eraseblock() 47 return mtdtest_write(mtd, addr, mtd->erasesize, writebuf); in write_eraseblock() 55 loff_t addr = (loff_t)ebnum * mtd->erasesize; in verify_eraseblock() 59 addr0 += mtd->erasesize; in verify_eraseblock() 61 addrn = mtd->size; in verify_eraseblock() 63 addrn -= mtd->erasesize; in verify_eraseblock() 65 prandom_bytes_state(&rnd_state, writebuf, mtd->erasesize); in verify_eraseblock() 68 err = mtdtest_read(mtd, addr0, bufsize, twopages); in verify_eraseblock() [all …]
|
D | stresstest.c | 32 static struct mtd_info *mtd; variable 82 if (offs >= mtd->erasesize) in do_read() 83 offs -= mtd->erasesize; in do_read() 84 if (offs + len > mtd->erasesize) in do_read() 85 len = mtd->erasesize - offs; in do_read() 87 addr = (loff_t)eb * mtd->erasesize + offs; in do_read() 88 return mtdtest_read(mtd, addr, len, readbuf); in do_read() 97 if (offs >= mtd->erasesize) { in do_write() 98 err = mtdtest_erase_eraseblock(mtd, eb); in do_write() 105 if (offs + len > mtd->erasesize) { in do_write() [all …]
|
D | speedtest.c | 33 static struct mtd_info *mtd; variable 47 loff_t addr = (loff_t)ebnum * mtd->erasesize; in multiblock_erase() 51 ei.len = mtd->erasesize * blocks; in multiblock_erase() 53 err = mtd_erase(mtd, &ei); in multiblock_erase() 65 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock() 67 return mtdtest_write(mtd, addr, mtd->erasesize, iobuf); in write_eraseblock() 73 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock_by_page() 77 err = mtdtest_write(mtd, addr, pgsize, buf); in write_eraseblock_by_page() 91 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock_by_2pages() 95 err = mtdtest_write(mtd, addr, sz, buf); in write_eraseblock_by_2pages() [all …]
|
D | readtest.c | 26 static struct mtd_info *mtd; variable 38 loff_t addr = (loff_t)ebnum * mtd->erasesize; in read_eraseblock_by_page() 44 ret = mtdtest_read(mtd, addr, pgsize, buf); in read_eraseblock_by_page() 49 if (mtd->oobsize) { in read_eraseblock_by_page() 55 ops.ooblen = mtd->oobsize; in read_eraseblock_by_page() 60 ret = mtd_read_oob(mtd, addr, &ops); in read_eraseblock_by_page() 62 ops.oobretlen != mtd->oobsize) { in read_eraseblock_by_page() 70 oobbuf += mtd->oobsize; in read_eraseblock_by_page() 86 n = mtd->erasesize; in dump_eraseblock() 96 if (!mtd->oobsize) in dump_eraseblock() [all …]
|
D | nandbiterrs.c | 67 static struct mtd_info *mtd; /* MTD device */ variable 95 return mtdtest_write(mtd, offset, mtd->writesize, wbuffer); in write_page() 108 ops.len = mtd->writesize; in rewrite_page() 116 err = mtd_write_oob(mtd, offset, &ops); in rewrite_page() 117 if (err || ops.retlen != mtd->writesize) { in rewrite_page() 138 memcpy(&oldstats, &mtd->ecc_stats, sizeof(oldstats)); in read_page() 140 err = mtd_read(mtd, offset, mtd->writesize, &read, rbuffer); in read_page() 142 err = mtd->ecc_stats.corrected - oldstats.corrected; in read_page() 144 if (err < 0 || read != mtd->writesize) { in read_page() 161 for (i = 0; i < mtd->writesize; i++) { in verify_page() [all …]
|
/kernel/linux/linux-5.10/drivers/net/ethernet/sfc/ |
D | mtd.c | 16 #define to_efx_mtd_partition(mtd) \ argument 17 container_of(mtd, struct efx_mtd_partition, mtd) 21 static int efx_mtd_erase(struct mtd_info *mtd, struct erase_info *erase) in efx_mtd_erase() argument 23 struct efx_nic *efx = mtd->priv; in efx_mtd_erase() 25 return efx->type->mtd_erase(mtd, erase->addr, erase->len); in efx_mtd_erase() 28 static void efx_mtd_sync(struct mtd_info *mtd) in efx_mtd_sync() argument 30 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in efx_mtd_sync() 31 struct efx_nic *efx = mtd->priv; in efx_mtd_sync() 34 rc = efx->type->mtd_sync(mtd); in efx_mtd_sync() 45 rc = mtd_device_unregister(&part->mtd); in efx_mtd_remove_partition() [all …]
|
/kernel/linux/linux-5.10/drivers/net/ethernet/sfc/falcon/ |
D | mtd.c | 16 #define to_ef4_mtd_partition(mtd) \ argument 17 container_of(mtd, struct ef4_mtd_partition, mtd) 21 static int ef4_mtd_erase(struct mtd_info *mtd, struct erase_info *erase) in ef4_mtd_erase() argument 23 struct ef4_nic *efx = mtd->priv; in ef4_mtd_erase() 25 return efx->type->mtd_erase(mtd, erase->addr, erase->len); in ef4_mtd_erase() 28 static void ef4_mtd_sync(struct mtd_info *mtd) in ef4_mtd_sync() argument 30 struct ef4_mtd_partition *part = to_ef4_mtd_partition(mtd); in ef4_mtd_sync() 31 struct ef4_nic *efx = mtd->priv; in ef4_mtd_sync() 34 rc = efx->type->mtd_sync(mtd); in ef4_mtd_sync() 45 rc = mtd_device_unregister(&part->mtd); in ef4_mtd_remove_partition() [all …]
|