Home
last modified time | relevance | path

Searched refs:mtd (Results 1 – 25 of 181) sorted by relevance

12345678

/drivers/mtd/
Dmtdcore.c56 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_cls_suspend() local
58 return mtd ? mtd_suspend(mtd) : 0; in mtd_cls_suspend()
63 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_cls_resume() local
65 if (mtd) in mtd_cls_resume()
66 mtd_resume(mtd); in mtd_cls_resume()
105 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_release() local
106 dev_t index = MTD_DEVT(mtd->index); in mtd_release()
115 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_type_show() local
118 switch (mtd->type) { in mtd_type_show()
154 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_flags_show() local
[all …]
Dmtdpart.c42 struct mtd_info mtd; member
52 static inline struct mtd_part *mtd_to_part(const struct mtd_info *mtd) in mtd_to_part() argument
54 return container_of(mtd, struct mtd_part, mtd); in mtd_to_part()
63 static int part_read(struct mtd_info *mtd, loff_t from, size_t len, in part_read() argument
66 struct mtd_part *part = mtd_to_part(mtd); in part_read()
74 mtd->ecc_stats.failed += in part_read()
77 mtd->ecc_stats.corrected += in part_read()
82 static int part_point(struct mtd_info *mtd, loff_t from, size_t len, in part_point() argument
85 struct mtd_part *part = mtd_to_part(mtd); in part_point()
91 static int part_unpoint(struct mtd_info *mtd, loff_t from, size_t len) in part_unpoint() argument
[all …]
Dmtdchar.c51 struct mtd_info *mtd; member
58 return fixed_size_llseek(file, offset, orig, mfi->mtd->size); in mtdchar_lseek()
66 struct mtd_info *mtd; in mtdchar_open() local
76 mtd = get_mtd_device(NULL, devnum); in mtdchar_open()
78 if (IS_ERR(mtd)) { in mtdchar_open()
79 ret = PTR_ERR(mtd); in mtdchar_open()
83 if (mtd->type == MTD_ABSENT) { in mtdchar_open()
89 if ((file->f_mode & FMODE_WRITE) && !(mtd->flags & MTD_WRITEABLE)) { in mtdchar_open()
99 mfi->mtd = mtd; in mtdchar_open()
105 put_mtd_device(mtd); in mtdchar_open()
[all …]
Dmtdconcat.c44 struct mtd_info mtd; member
68 concat_read(struct mtd_info *mtd, loff_t from, size_t len, in concat_read() argument
71 struct mtd_concat *concat = CONCAT(mtd); in concat_read()
97 mtd->ecc_stats.failed++; in concat_read()
100 mtd->ecc_stats.corrected++; in concat_read()
120 concat_write(struct mtd_info *mtd, loff_t to, size_t len, in concat_write() argument
123 struct mtd_concat *concat = CONCAT(mtd); in concat_write()
158 concat_writev(struct mtd_info *mtd, const struct kvec *vecs, in concat_writev() argument
161 struct mtd_concat *concat = CONCAT(mtd); in concat_writev()
173 if (mtd->writesize > 1) { in concat_writev()
[all …]
Dmtdsuper.c28 struct mtd_info *mtd = _mtd; in get_sb_mtd_compare() local
30 if (sb->s_mtd == mtd) { in get_sb_mtd_compare()
32 mtd->index, mtd->name); in get_sb_mtd_compare()
37 sb->s_mtd->index, sb->s_mtd->name, mtd->index, mtd->name); in get_sb_mtd_compare()
48 struct mtd_info *mtd = _mtd; in get_sb_mtd_set() local
50 sb->s_mtd = mtd; in get_sb_mtd_set()
51 sb->s_dev = MKDEV(MTD_BLOCK_MAJOR, mtd->index); in get_sb_mtd_set()
52 sb->s_bdi = mtd->backing_dev_info; in get_sb_mtd_set()
61 struct mtd_info *mtd, in mount_mtd_aux() argument
67 sb = sget(fs_type, get_sb_mtd_compare, get_sb_mtd_set, flags, mtd); in mount_mtd_aux()
[all …]
Dmtdoops.c63 struct mtd_info *mtd; member
95 struct mtd_info *mtd = cxt->mtd; in mtdoops_erase_block() local
96 u32 start_page_offset = mtd_div_by_eb(offset, mtd) * mtd->erasesize; in mtdoops_erase_block()
98 u32 erase_pages = mtd->erasesize / record_size; in mtdoops_erase_block()
106 erase.mtd = mtd; in mtdoops_erase_block()
109 erase.len = mtd->erasesize; in mtdoops_erase_block()
115 ret = mtd_erase(mtd, &erase); in mtdoops_erase_block()
158 struct mtd_info *mtd = cxt->mtd; in mtdoops_workfunc_erase() local
162 if (!mtd) in mtdoops_workfunc_erase()
165 mod = (cxt->nextpage * record_size) % mtd->erasesize; in mtdoops_workfunc_erase()
[all …]
/drivers/staging/goldfish/
Dgoldfish_nand.c40 struct mtd_info mtd[0]; member
43 static u32 goldfish_nand_cmd_with_params(struct mtd_info *mtd, in goldfish_nand_cmd_with_params() argument
48 struct goldfish_nand *nand = mtd->priv; in goldfish_nand_cmd_with_params()
68 cps->dev = mtd - nand->mtd; in goldfish_nand_cmd_with_params()
78 static u32 goldfish_nand_cmd(struct mtd_info *mtd, enum nand_cmd cmd, in goldfish_nand_cmd() argument
81 struct goldfish_nand *nand = mtd->priv; in goldfish_nand_cmd()
86 if (goldfish_nand_cmd_with_params(mtd, cmd, addr, len, ptr, &rv)) { in goldfish_nand_cmd()
87 writel(mtd - nand->mtd, base + NAND_DEV); in goldfish_nand_cmd()
99 static int goldfish_nand_erase(struct mtd_info *mtd, struct erase_info *instr) in goldfish_nand_erase() argument
105 if (ofs + len > mtd->size) in goldfish_nand_erase()
[all …]
/drivers/mtd/nand/
Dnand_base.c50 static int nand_get_device(struct mtd_info *mtd, int new_state);
52 static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
56 static int nand_ooblayout_ecc_sp(struct mtd_info *mtd, int section, in nand_ooblayout_ecc_sp() argument
59 struct nand_chip *chip = mtd_to_nand(mtd); in nand_ooblayout_ecc_sp()
67 if (mtd->oobsize == 16) in nand_ooblayout_ecc_sp()
72 if (mtd->oobsize == 8) in nand_ooblayout_ecc_sp()
82 static int nand_ooblayout_free_sp(struct mtd_info *mtd, int section, in nand_ooblayout_free_sp() argument
88 if (mtd->oobsize == 16) { in nand_ooblayout_free_sp()
111 static int nand_ooblayout_ecc_lp(struct mtd_info *mtd, int section, in nand_ooblayout_ecc_lp() argument
114 struct nand_chip *chip = mtd_to_nand(mtd); in nand_ooblayout_ecc_lp()
[all …]
Dmpc5121_nfc.c132 static void mpc5121_nfc_done(struct mtd_info *mtd);
135 static inline u16 nfc_read(struct mtd_info *mtd, uint reg) in nfc_read() argument
137 struct nand_chip *chip = mtd_to_nand(mtd); in nfc_read()
144 static inline void nfc_write(struct mtd_info *mtd, uint reg, u16 val) in nfc_write() argument
146 struct nand_chip *chip = mtd_to_nand(mtd); in nfc_write()
153 static inline void nfc_set(struct mtd_info *mtd, uint reg, u16 bits) in nfc_set() argument
155 nfc_write(mtd, reg, nfc_read(mtd, reg) | bits); in nfc_set()
159 static inline void nfc_clear(struct mtd_info *mtd, uint reg, u16 bits) in nfc_clear() argument
161 nfc_write(mtd, reg, nfc_read(mtd, reg) & ~bits); in nfc_clear()
165 static inline void mpc5121_nfc_send_addr(struct mtd_info *mtd, u16 addr) in mpc5121_nfc_send_addr() argument
[all …]
Dsunxi_nand.c376 static int sunxi_nfc_dma_op_prepare(struct mtd_info *mtd, const void *buf, in sunxi_nfc_dma_op_prepare() argument
381 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_dma_op_prepare()
425 static void sunxi_nfc_dma_op_cleanup(struct mtd_info *mtd, in sunxi_nfc_dma_op_cleanup() argument
429 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_dma_op_cleanup()
437 static int sunxi_nfc_dev_ready(struct mtd_info *mtd) in sunxi_nfc_dev_ready() argument
439 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_dev_ready()
468 static void sunxi_nfc_select_chip(struct mtd_info *mtd, int chip) in sunxi_nfc_select_chip() argument
470 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_select_chip()
498 writel(mtd->writesize, nfc->regs + NFC_REG_SPARE_AREA); in sunxi_nfc_select_chip()
513 static void sunxi_nfc_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in sunxi_nfc_read_buf() argument
[all …]
Dnand_bbt.c79 static int nand_update_bbt(struct mtd_info *mtd, loff_t offs);
171 static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, in read_bbt() argument
175 struct nand_chip *this = mtd_to_nand(mtd); in read_bbt()
198 res = mtd_read(mtd, from, len, &retlen, buf); in read_bbt()
202 from & ~mtd->writesize); in read_bbt()
206 from & ~mtd->writesize); in read_bbt()
227 mtd->ecc_stats.bbtblocks++; in read_bbt()
244 mtd->ecc_stats.badblocks++; in read_bbt()
264 static int read_abs_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *td, int chip) in read_abs_bbt() argument
266 struct nand_chip *this = mtd_to_nand(mtd); in read_abs_bbt()
[all …]
Dau1550nd.c39 static u_char au_read_byte(struct mtd_info *mtd) in au_read_byte() argument
41 struct nand_chip *this = mtd_to_nand(mtd); in au_read_byte()
54 static void au_write_byte(struct mtd_info *mtd, u_char byte) in au_write_byte() argument
56 struct nand_chip *this = mtd_to_nand(mtd); in au_write_byte()
67 static u_char au_read_byte16(struct mtd_info *mtd) in au_read_byte16() argument
69 struct nand_chip *this = mtd_to_nand(mtd); in au_read_byte16()
82 static void au_write_byte16(struct mtd_info *mtd, u_char byte) in au_write_byte16() argument
84 struct nand_chip *this = mtd_to_nand(mtd); in au_write_byte16()
95 static u16 au_read_word(struct mtd_info *mtd) in au_read_word() argument
97 struct nand_chip *this = mtd_to_nand(mtd); in au_read_word()
[all …]
Dbf5xx_nand.c112 static int bootrom_ooblayout_ecc(struct mtd_info *mtd, int section, in bootrom_ooblayout_ecc() argument
124 static int bootrom_ooblayout_free(struct mtd_info *mtd, int section, in bootrom_ooblayout_free() argument
165 static struct bf5xx_nand_info *mtd_to_nand_info(struct mtd_info *mtd) in mtd_to_nand_info() argument
167 return container_of(mtd_to_nand(mtd), struct bf5xx_nand_info, in mtd_to_nand_info()
190 static void bf5xx_nand_hwcontrol(struct mtd_info *mtd, int cmd, in bf5xx_nand_hwcontrol() argument
211 static int bf5xx_nand_devready(struct mtd_info *mtd) in bf5xx_nand_devready() argument
230 static int bf5xx_nand_correct_data_256(struct mtd_info *mtd, u_char *dat, in bf5xx_nand_correct_data_256() argument
233 struct bf5xx_nand_info *info = mtd_to_nand_info(mtd); in bf5xx_nand_correct_data_256()
309 static int bf5xx_nand_correct_data(struct mtd_info *mtd, u_char *dat, in bf5xx_nand_correct_data() argument
312 struct nand_chip *chip = mtd_to_nand(mtd); in bf5xx_nand_correct_data()
[all …]
Ddiskonchip.c74 int (*late_init)(struct mtd_info *mtd);
87 static void doc200x_hwcontrol(struct mtd_info *mtd, int cmd,
89 static void doc200x_select_chip(struct mtd_info *mtd, int chip);
296 static void doc2000_write_byte(struct mtd_info *mtd, u_char datum) in doc2000_write_byte() argument
298 struct nand_chip *this = mtd_to_nand(mtd); in doc2000_write_byte()
308 static u_char doc2000_read_byte(struct mtd_info *mtd) in doc2000_read_byte() argument
310 struct nand_chip *this = mtd_to_nand(mtd); in doc2000_read_byte()
323 static void doc2000_writebuf(struct mtd_info *mtd, const u_char *buf, int len) in doc2000_writebuf() argument
325 struct nand_chip *this = mtd_to_nand(mtd); in doc2000_writebuf()
340 static void doc2000_readbuf(struct mtd_info *mtd, u_char *buf, int len) in doc2000_readbuf() argument
[all …]
Dfsl_elbc_nand.c82 static int fsl_elbc_ooblayout_ecc(struct mtd_info *mtd, int section, in fsl_elbc_ooblayout_ecc() argument
85 struct nand_chip *chip = mtd_to_nand(mtd); in fsl_elbc_ooblayout_ecc()
100 static int fsl_elbc_ooblayout_free(struct mtd_info *mtd, int section, in fsl_elbc_ooblayout_free() argument
103 struct nand_chip *chip = mtd_to_nand(mtd); in fsl_elbc_ooblayout_free()
111 if (mtd->writesize > 512) in fsl_elbc_ooblayout_free()
120 oobregion->length = mtd->oobsize - oobregion->offset; in fsl_elbc_ooblayout_free()
165 static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob) in set_addr() argument
167 struct nand_chip *chip = mtd_to_nand(mtd); in set_addr()
216 static int fsl_elbc_run_command(struct mtd_info *mtd) in fsl_elbc_run_command() argument
218 struct nand_chip *chip = mtd_to_nand(mtd); in fsl_elbc_run_command()
[all …]
/drivers/mtd/onenand/
Donenand_base.c71 static int flexonenand_ooblayout_ecc(struct mtd_info *mtd, int section, in flexonenand_ooblayout_ecc() argument
83 static int flexonenand_ooblayout_free(struct mtd_info *mtd, int section, in flexonenand_ooblayout_free() argument
107 static int onenand_ooblayout_128_ecc(struct mtd_info *mtd, int section, in onenand_ooblayout_128_ecc() argument
119 static int onenand_ooblayout_128_free(struct mtd_info *mtd, int section, in onenand_ooblayout_128_free() argument
143 static int onenand_ooblayout_32_64_ecc(struct mtd_info *mtd, int section, in onenand_ooblayout_32_64_ecc() argument
155 static int onenand_ooblayout_32_64_free(struct mtd_info *mtd, int section, in onenand_ooblayout_32_64_free() argument
158 int sections = (mtd->oobsize / 32) * 2; in onenand_ooblayout_32_64_free()
382 int flexonenand_region(struct mtd_info *mtd, loff_t addr) in flexonenand_region() argument
386 for (i = 0; i < mtd->numeraseregions; i++) in flexonenand_region()
387 if (addr < mtd->eraseregions[i].offset) in flexonenand_region()
[all …]
/drivers/mtd/ubi/
Dgluebi.c57 struct mtd_info mtd; member
97 static int gluebi_get_device(struct mtd_info *mtd) in gluebi_get_device() argument
102 if (mtd->flags & MTD_WRITEABLE) in gluebi_get_device()
105 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_get_device()
143 static void gluebi_put_device(struct mtd_info *mtd) in gluebi_put_device() argument
147 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_put_device()
166 static int gluebi_read(struct mtd_info *mtd, loff_t from, size_t len, in gluebi_read() argument
172 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_read()
173 lnum = div_u64_rem(from, mtd->erasesize, &offs); in gluebi_read()
176 size_t to_read = mtd->erasesize - offs; in gluebi_read()
[all …]
/drivers/mtd/devices/
Dmtdram.c38 static int check_offs_len(struct mtd_info *mtd, loff_t ofs, uint64_t len) in check_offs_len() argument
43 if (mtd_mod_by_eb(ofs, mtd)) { in check_offs_len()
49 if (mtd_mod_by_eb(len, mtd)) { in check_offs_len()
57 static int ram_erase(struct mtd_info *mtd, struct erase_info *instr) in ram_erase() argument
59 if (check_offs_len(mtd, instr->addr, instr->len)) in ram_erase()
61 memset((char *)mtd->priv + instr->addr, 0xff, instr->len); in ram_erase()
67 static int ram_point(struct mtd_info *mtd, loff_t from, size_t len, in ram_point() argument
70 *virt = mtd->priv + from; in ram_point()
75 static int ram_unpoint(struct mtd_info *mtd, loff_t from, size_t len) in ram_unpoint() argument
85 static unsigned long ram_get_unmapped_area(struct mtd_info *mtd, in ram_get_unmapped_area() argument
[all …]
/drivers/mtd/chips/
Dmap_ram.c35 struct mtd_info *mtd; in map_ram_probe() local
58 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_ram_probe()
59 if (!mtd) in map_ram_probe()
63 mtd->priv = map; in map_ram_probe()
64 mtd->name = map->name; in map_ram_probe()
65 mtd->type = MTD_RAM; in map_ram_probe()
66 mtd->size = map->size; in map_ram_probe()
67 mtd->_erase = mapram_erase; in map_ram_probe()
68 mtd->_get_unmapped_area = mapram_unmapped_area; in map_ram_probe()
69 mtd->_read = mapram_read; in map_ram_probe()
[all …]
Dmap_rom.c22 static int maprom_erase (struct mtd_info *mtd, struct erase_info *info);
43 struct mtd_info *mtd; in map_rom_probe() local
45 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_rom_probe()
46 if (!mtd) in map_rom_probe()
50 mtd->priv = map; in map_rom_probe()
51 mtd->name = map->name; in map_rom_probe()
52 mtd->type = MTD_ROM; in map_rom_probe()
53 mtd->size = map->size; in map_rom_probe()
54 mtd->_get_unmapped_area = maprom_unmapped_area; in map_rom_probe()
55 mtd->_read = maprom_read; in map_rom_probe()
[all …]
Dmap_absent.c46 struct mtd_info *mtd; in map_absent_probe() local
48 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_absent_probe()
49 if (!mtd) { in map_absent_probe()
54 mtd->priv = map; in map_absent_probe()
55 mtd->name = map->name; in map_absent_probe()
56 mtd->type = MTD_ABSENT; in map_absent_probe()
57 mtd->size = map->size; in map_absent_probe()
58 mtd->_erase = map_absent_erase; in map_absent_probe()
59 mtd->_read = map_absent_read; in map_absent_probe()
60 mtd->_write = map_absent_write; in map_absent_probe()
[all …]
/drivers/mtd/tests/
Doobtest.c43 static struct mtd_info *mtd; variable
73 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock()
76 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { in write_eraseblock()
85 err = mtd_write_oob(mtd, addr, &ops); in write_eraseblock()
182 loff_t addr = (loff_t)ebnum * mtd->erasesize; in verify_eraseblock()
186 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { in verify_eraseblock()
195 err = mtd_read_oob(mtd, addr, &ops); in verify_eraseblock()
221 if (use_offset != 0 || use_len < mtd->oobavail) { in verify_eraseblock()
227 ops.ooblen = mtd->oobavail; in verify_eraseblock()
232 err = mtd_read_oob(mtd, addr, &ops); in verify_eraseblock()
[all …]
Dpagetest.c40 static struct mtd_info *mtd; variable
55 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock()
57 prandom_bytes_state(&rnd_state, writebuf, mtd->erasesize); in write_eraseblock()
59 return mtdtest_write(mtd, addr, mtd->erasesize, writebuf); in write_eraseblock()
67 loff_t addr = (loff_t)ebnum * mtd->erasesize; in verify_eraseblock()
71 addr0 += mtd->erasesize; in verify_eraseblock()
73 addrn = mtd->size; in verify_eraseblock()
75 addrn -= mtd->erasesize; in verify_eraseblock()
77 prandom_bytes_state(&rnd_state, writebuf, mtd->erasesize); in verify_eraseblock()
80 err = mtdtest_read(mtd, addr0, bufsize, twopages); in verify_eraseblock()
[all …]
Dstresstest.c44 static struct mtd_info *mtd; variable
94 if (offs >= mtd->erasesize) in do_read()
95 offs -= mtd->erasesize; in do_read()
96 if (offs + len > mtd->erasesize) in do_read()
97 len = mtd->erasesize - offs; in do_read()
99 addr = (loff_t)eb * mtd->erasesize + offs; in do_read()
100 return mtdtest_read(mtd, addr, len, readbuf); in do_read()
109 if (offs >= mtd->erasesize) { in do_write()
110 err = mtdtest_erase_eraseblock(mtd, eb); in do_write()
117 if (offs + len > mtd->erasesize) { in do_write()
[all …]
Dspeedtest.c45 static struct mtd_info *mtd; variable
59 loff_t addr = (loff_t)ebnum * mtd->erasesize; in multiblock_erase()
62 ei.mtd = mtd; in multiblock_erase()
64 ei.len = mtd->erasesize * blocks; in multiblock_erase()
66 err = mtd_erase(mtd, &ei); in multiblock_erase()
84 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock()
86 return mtdtest_write(mtd, addr, mtd->erasesize, iobuf); in write_eraseblock()
92 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock_by_page()
96 err = mtdtest_write(mtd, addr, pgsize, buf); in write_eraseblock_by_page()
110 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock_by_2pages()
[all …]

12345678