Home
last modified time | relevance | path

Searched refs:mtd (Results 1 – 200 of 294) sorted by relevance

12

/linux-4.4.14/drivers/mtd/
Dmtdcore.c55 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_cls_suspend() local
57 return mtd ? mtd_suspend(mtd) : 0; in mtd_cls_suspend()
62 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_cls_resume() local
64 if (mtd) in mtd_cls_resume()
65 mtd_resume(mtd); in mtd_cls_resume()
104 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_release() local
105 dev_t index = MTD_DEVT(mtd->index); in mtd_release()
114 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_type_show() local
117 switch (mtd->type) { in mtd_type_show()
153 struct mtd_info *mtd = dev_get_drvdata(dev); in mtd_flags_show() local
[all …]
Dmtdpart.c43 struct mtd_info mtd; member
61 static int part_read(struct mtd_info *mtd, loff_t from, size_t len, in part_read() argument
64 struct mtd_part *part = PART(mtd); in part_read()
72 mtd->ecc_stats.failed += in part_read()
75 mtd->ecc_stats.corrected += in part_read()
80 static int part_point(struct mtd_info *mtd, loff_t from, size_t len, in part_point() argument
83 struct mtd_part *part = PART(mtd); in part_point()
89 static int part_unpoint(struct mtd_info *mtd, loff_t from, size_t len) in part_unpoint() argument
91 struct mtd_part *part = PART(mtd); in part_unpoint()
96 static unsigned long part_get_unmapped_area(struct mtd_info *mtd, in part_get_unmapped_area() argument
[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 …]
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 …]
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 …]
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 …]
Dmtdblock.c64 static int erase_write (struct mtd_info *mtd, unsigned long pos, in erase_write() argument
78 erase.mtd = mtd; in erase_write()
87 ret = mtd_erase(mtd, &erase); in erase_write()
93 pos, len, mtd->name); in erase_write()
104 ret = mtd_write(mtd, pos, len, &retlen, buf); in erase_write()
115 struct mtd_info *mtd = mtdblk->mbd.mtd; in write_cached_data() local
122 "at 0x%lx, size 0x%x\n", mtd->name, in write_cached_data()
125 ret = erase_write (mtd, mtdblk->cache_offset, in write_cached_data()
145 struct mtd_info *mtd = mtdblk->mbd.mtd; in do_cached_write() local
151 mtd->name, pos, len); in do_cached_write()
[all …]
Dssfdc.c106 static int get_valid_cis_sector(struct mtd_info *mtd) in get_valid_cis_sector() argument
124 for (k = 0, offset = 0; k < 4; k++, offset += mtd->erasesize) { in get_valid_cis_sector()
125 if (mtd_block_isbad(mtd, offset)) { in get_valid_cis_sector()
126 ret = mtd_read(mtd, offset, SECTOR_SIZE, &retlen, in get_valid_cis_sector()
139 " on %s (mtd%d)\n", mtd->name, in get_valid_cis_sector()
140 mtd->index); in get_valid_cis_sector()
152 static int read_physical_sector(struct mtd_info *mtd, uint8_t *sect_buf, in read_physical_sector() argument
159 ret = mtd_read(mtd, offset, SECTOR_SIZE, &retlen, sect_buf); in read_physical_sector()
167 static int read_raw_oob(struct mtd_info *mtd, loff_t offs, uint8_t *buf) in read_raw_oob() argument
178 ret = mtd_read_oob(mtd, offs, &ops); in read_raw_oob()
[all …]
Dnftlmount.c45 struct mtd_info *mtd = nftl->mbd.mtd; in find_boot_record() local
54 nftl->EraseSize = nftl->mbd.mtd->erasesize; in find_boot_record()
55 nftl->nb_blocks = (u32)nftl->mbd.mtd->size / nftl->EraseSize; in find_boot_record()
66 ret = mtd_read(mtd, block * nftl->EraseSize, SECTORSIZE, in find_boot_record()
75 block * nftl->EraseSize, nftl->mbd.mtd->index, ret); in find_boot_record()
86 block * nftl->EraseSize, nftl->mbd.mtd->index); in find_boot_record()
92 ret = nftl_read_oob(mtd, block * nftl->EraseSize + in find_boot_record()
97 block * nftl->EraseSize, nftl->mbd.mtd->index, ret); in find_boot_record()
107 block * nftl->EraseSize, nftl->mbd.mtd->index, in find_boot_record()
113 ret = mtd->read(mtd, block * nftl->EraseSize, SECTORSIZE, in find_boot_record()
[all …]
Dafs.c70 afs_read_footer(struct mtd_info *mtd, u_int *img_start, u_int *iis_start, in afs_read_footer() argument
74 u_int ptr = off + mtd->erasesize - sizeof(fs); in afs_read_footer()
78 ret = mtd_read(mtd, ptr, sizeof(fs), &sz, (u_char *)&fs); in afs_read_footer()
129 afs_read_iis(struct mtd_info *mtd, struct image_info_struct *iis, u_int ptr) in afs_read_iis() argument
135 ret = mtd_read(mtd, ptr, sizeof(*iis), &sz, (u_char *)iis); in afs_read_iis()
164 static int parse_afs_partitions(struct mtd_info *mtd, in parse_afs_partitions() argument
177 mask = mtd->size - 1; in parse_afs_partitions()
184 for (idx = off = sz = 0; off < mtd->size; off += mtd->erasesize) { in parse_afs_partitions()
188 ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask); in parse_afs_partitions()
194 ret = afs_read_iis(mtd, &iis, iis_ptr); in parse_afs_partitions()
[all …]
Dinftlcore.c48 static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) in inftl_add_mtd() argument
53 if (!mtd_type_is_nand(mtd) || mtd->size > UINT_MAX) in inftl_add_mtd()
56 if (memcmp(mtd->name, "DiskOnChip", 10)) in inftl_add_mtd()
59 if (!mtd->_block_isbad) { in inftl_add_mtd()
66 pr_debug("INFTL: add_mtd for %s\n", mtd->name); in inftl_add_mtd()
73 inftl->mbd.mtd = mtd; in inftl_add_mtd()
149 int inftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len, in inftl_read_oob() argument
156 ops.ooboffs = offs & (mtd->writesize - 1); in inftl_read_oob()
161 res = mtd_read_oob(mtd, offs & ~(mtd->writesize - 1), &ops); in inftl_read_oob()
169 int inftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len, in inftl_write_oob() argument
[all …]
Dnftlcore.c48 static void nftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) in nftl_add_mtd() argument
53 if (!mtd_type_is_nand(mtd) || mtd->size > UINT_MAX) in nftl_add_mtd()
56 if (memcmp(mtd->name, "DiskOnChip", 10)) in nftl_add_mtd()
59 pr_debug("NFTL: add_mtd for %s\n", mtd->name); in nftl_add_mtd()
66 nftl->mbd.mtd = mtd; in nftl_add_mtd()
136 int nftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len, in nftl_read_oob() argument
139 loff_t mask = mtd->writesize - 1; in nftl_read_oob()
149 res = mtd_read_oob(mtd, offs & ~mask, &ops); in nftl_read_oob()
157 int nftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len, in nftl_write_oob() argument
160 loff_t mask = mtd->writesize - 1; in nftl_write_oob()
[all …]
Dmtdcore.h9 int add_mtd_device(struct mtd_info *mtd);
10 int del_mtd_device(struct mtd_info *mtd);
20 #define mtd_for_each_device(mtd) \ argument
21 for ((mtd) = __mtd_next_device(0); \
22 (mtd) != NULL; \
23 (mtd) = __mtd_next_device(mtd->index + 1))
Drfd_ftl.c126 part->mbd.mtd->name, block_no, i, entry); in build_block_map()
133 part->mbd.mtd->name, entry); in build_block_map()
158 part->total_blocks = (u32)part->mbd.mtd->size / part->block_size; in scan_header()
195 "sector map", part->mbd.mtd->name); in scan_header()
203 rc = mtd_read(part->mbd.mtd, i * part->block_size, in scan_header()
219 part->mbd.mtd->name); in scan_header()
226 part->mbd.mtd->name); in scan_header()
253 rc = mtd_read(part->mbd.mtd, addr, SECTOR_SIZE, &retlen, in rfd_ftl_readsect()
260 "0x%lx\n", part->mbd.mtd->name, addr); in rfd_ftl_readsect()
282 "on '%s'\n", (unsigned long long)erase->addr, part->mbd.mtd->name); in erase_callback()
[all …]
Dinftlmount.c51 struct mtd_info *mtd = inftl->mbd.mtd; in find_boot_record() local
62 inftl->EraseSize = inftl->mbd.mtd->erasesize; in find_boot_record()
63 inftl->nb_blocks = (u32)inftl->mbd.mtd->size / inftl->EraseSize; in find_boot_record()
75 ret = mtd_read(mtd, block * inftl->EraseSize, SECTORSIZE, in find_boot_record()
86 inftl->mbd.mtd->index, ret); in find_boot_record()
101 ret = inftl_read_oob(mtd, in find_boot_record()
108 inftl->mbd.mtd->index, ret); in find_boot_record()
120 mtd_read(mtd, block * inftl->EraseSize + 4096, SECTORSIZE, in find_boot_record()
182 inftl->EraseSize = inftl->mbd.mtd->erasesize << in find_boot_record()
184 inftl->nb_blocks = (u32)inftl->mbd.mtd->size / inftl->EraseSize; in find_boot_record()
[all …]
Dmtdswap.c115 struct mtd_info *mtd; member
201 return (loff_t)(eb - d->eb_data) * d->mtd->erasesize; in mtdswap_eb_offset()
277 if (!mtd_can_have_bb(d->mtd)) in mtdswap_handle_badblock()
282 ret = mtd_block_markbad(d->mtd, offset); in mtdswap_handle_badblock()
315 int ret = mtd_read_oob(d->mtd, from, ops); in mtdswap_read_oob()
346 if (mtd_can_have_bb(d->mtd) && mtd_block_isbad(d->mtd, offset)) in mtdswap_read_markers()
349 ops.ooblen = 2 * d->mtd->ecclayout->oobavail; in mtdswap_read_markers()
362 (d->oob_buf + d->mtd->ecclayout->oobavail); in mtdswap_read_markers()
403 offset = mtdswap_eb_offset(d, eb) + d->mtd->writesize; in mtdswap_write_marker()
406 ret = mtd_write_oob(d->mtd, offset, &ops); in mtdswap_write_marker()
[all …]
Dmtdblock_ro.c34 if (mtd_read(dev->mtd, (block * 512), 512, &retlen, buf)) in mtdblock_readsect()
44 if (mtd_write(dev->mtd, (block * 512), 512, &retlen, buf)) in mtdblock_writesect()
49 static void mtdblock_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) in mtdblock_add_mtd() argument
56 dev->mtd = mtd; in mtdblock_add_mtd()
57 dev->devnum = mtd->index; in mtdblock_add_mtd()
59 dev->size = mtd->size >> 9; in mtdblock_add_mtd()
Dmtd_blkdevs.c204 if (!dev->mtd) in blktrans_open()
213 ret = __get_mtd_device(dev->mtd); in blktrans_open()
253 if (dev->mtd) { in blktrans_release()
256 __put_mtd_device(dev->mtd); in blktrans_release()
274 if (!dev->mtd) in blktrans_getgeo()
295 if (!dev->mtd) in blktrans_ioctl()
429 tr->name, new->mtd->index); in add_mtd_blktrans_dev()
434 gd->driverfs_dev = &new->mtd->dev; in add_mtd_blktrans_dev()
488 __put_mtd_device(old->mtd); in del_mtd_blktrans_dev()
491 old->mtd = NULL; in del_mtd_blktrans_dev()
[all …]
Dftl.c164 max_offset = (0x100000<part->mbd.mtd->size)?0x100000:part->mbd.mtd->size; in scan_header()
168 offset += part->mbd.mtd->erasesize ? : 0x2000) { in scan_header()
170 err = mtd_read(part->mbd.mtd, offset, sizeof(header), &ret, in scan_header()
189 if ((1 << header.EraseUnitSize) != part->mbd.mtd->erasesize) { in scan_header()
191 1 << header.EraseUnitSize,part->mbd.mtd->erasesize); in scan_header()
226 ret = mtd_read(part->mbd.mtd, offset, sizeof(header), &retval, in build_maps()
291 ret = mtd_read(part->mbd.mtd, offset, in build_maps()
351 erase->mtd = part->mbd.mtd; in erase_xfer()
357 ret = mtd_erase(part->mbd.mtd, erase); in erase_xfer()
424 ret = mtd_write(part->mbd.mtd, xfer->Offset, sizeof(header), &retlen, in prepare_xfer()
[all …]
Dsm_ftl.c240 struct mtd_info *mtd = ftl->trans->mtd; in sm_read_sector() local
278 ret = mtd_read_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops); in sm_read_sector()
323 struct mtd_info *mtd = ftl->trans->mtd; in sm_write_sector() local
343 ret = mtd_write_oob(mtd, sm_mkoffset(ftl, zone, block, boffset), &ops); in sm_write_sector()
459 struct mtd_info *mtd = ftl->trans->mtd; in sm_erase_block() local
462 erase.mtd = mtd; in sm_erase_block()
478 if (mtd_erase(mtd, &erase)) { in sm_erase_block()
571 static int sm_get_media_info(struct sm_ftl *ftl, struct mtd_info *mtd) in sm_get_media_info() argument
574 int size_in_megs = mtd->size / (1024 * 1024); in sm_get_media_info()
576 ftl->readonly = mtd->type == MTD_ROM; in sm_get_media_info()
[all …]
DKconfig92 <mtddef> := <mtd-id>:<partdef>[,<partdef>]
94 <mtd-id> := unique id used in mapping driver/device
100 allowed in the partition definition, including mtd id's and partition
105 1 flash resource (mtd-id "sa1100"), with 1 single writable partition:
136 as described in Documentation/devicetree/bindings/mtd/partition.txt.
307 Provides volatile block device driver on top of mtd partition
325 source "drivers/mtd/chips/Kconfig"
327 source "drivers/mtd/maps/Kconfig"
329 source "drivers/mtd/devices/Kconfig"
331 source "drivers/mtd/nand/Kconfig"
[all …]
DMakefile6 obj-$(CONFIG_MTD) += mtd.o
7 mtd-y := mtdcore.o mtdsuper.o mtdconcat.o mtdpart.o mtdchar.o
/linux-4.4.14/drivers/staging/goldfish/
Dgoldfish_nand.c39 struct mtd_info mtd[0]; member
42 static u32 goldfish_nand_cmd_with_params(struct mtd_info *mtd, in goldfish_nand_cmd_with_params() argument
47 struct goldfish_nand *nand = mtd->priv; in goldfish_nand_cmd_with_params()
67 cps->dev = mtd - nand->mtd; in goldfish_nand_cmd_with_params()
77 static u32 goldfish_nand_cmd(struct mtd_info *mtd, enum nand_cmd cmd, in goldfish_nand_cmd() argument
80 struct goldfish_nand *nand = mtd->priv; in goldfish_nand_cmd()
85 if (goldfish_nand_cmd_with_params(mtd, cmd, addr, len, ptr, &rv)) { in goldfish_nand_cmd()
86 writel(mtd - nand->mtd, base + NAND_DEV); in goldfish_nand_cmd()
98 static int goldfish_nand_erase(struct mtd_info *mtd, struct erase_info *instr) in goldfish_nand_erase() argument
104 if (ofs + len > mtd->size) in goldfish_nand_erase()
[all …]
/linux-4.4.14/include/linux/mtd/
Dmtd.h46 struct mtd_info *mtd; member
189 int (*_erase) (struct mtd_info *mtd, struct erase_info *instr);
190 int (*_point) (struct mtd_info *mtd, loff_t from, size_t len,
192 int (*_unpoint) (struct mtd_info *mtd, loff_t from, size_t len);
193 unsigned long (*_get_unmapped_area) (struct mtd_info *mtd,
197 int (*_read) (struct mtd_info *mtd, loff_t from, size_t len,
199 int (*_write) (struct mtd_info *mtd, loff_t to, size_t len,
201 int (*_panic_write) (struct mtd_info *mtd, loff_t to, size_t len,
203 int (*_read_oob) (struct mtd_info *mtd, loff_t from,
205 int (*_write_oob) (struct mtd_info *mtd, loff_t to,
[all …]
Dnand.h32 extern int nand_scan(struct mtd_info *mtd, int max_chips);
37 extern int nand_scan_ident(struct mtd_info *mtd, int max_chips,
39 extern int nand_scan_tail(struct mtd_info *mtd);
42 extern void nand_release(struct mtd_info *mtd);
45 extern void nand_wait_ready(struct mtd_info *mtd);
48 extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
51 extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
499 void (*hwctl)(struct mtd_info *mtd, int mode);
500 int (*calculate)(struct mtd_info *mtd, const uint8_t *dat,
502 int (*correct)(struct mtd_info *mtd, uint8_t *dat, uint8_t *read_ecc,
[all …]
Donenand.h25 extern int onenand_scan(struct mtd_info *mtd, int max_chips);
27 extern void onenand_release(struct mtd_info *mtd);
107 int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len);
108 int (*wait)(struct mtd_info *mtd, int state);
109 int (*bbt_wait)(struct mtd_info *mtd, int state);
110 void (*unlock_all)(struct mtd_info *mtd);
111 int (*read_bufferram)(struct mtd_info *mtd, int area,
113 int (*write_bufferram)(struct mtd_info *mtd, int area,
117 void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
118 int (*chip_probe)(struct mtd_info *mtd);
[all …]
Dnand_bch.h24 int nand_bch_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
30 int nand_bch_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc,
36 nand_bch_init(struct mtd_info *mtd, unsigned int eccsize,
48 nand_bch_calculate_ecc(struct mtd_info *mtd, const u_char *dat, in nand_bch_calculate_ecc() argument
55 nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf, in nand_bch_correct_data() argument
62 nand_bch_init(struct mtd_info *mtd, unsigned int eccsize, in nand_bch_init() argument
Dbbm.h160 int (*isbad_bbt)(struct mtd_info *mtd, loff_t ofs, int allowbbt);
169 extern int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
170 extern int onenand_default_bbt(struct mtd_info *mtd);
Dnand_ecc.h29 int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code);
40 int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc);
Dpartitions.h82 int mtd_is_partition(const struct mtd_info *mtd);
86 uint64_t mtd_get_device_size(const struct mtd_info *mtd);
Dnftl.h59 int nftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len,
61 int nftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len,
Dinftl.h56 int inftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len,
58 int inftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len,
Dblktrans.h37 struct mtd_info *mtd; member
81 void (*add_mtd)(struct mtd_blktrans_ops *tr, struct mtd_info *mtd);
Dmtdram.h5 int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,
Dsh_flctl.h146 struct mtd_info mtd; member
189 return container_of(mtdinfo, struct sh_flctl, mtd); in mtd_to_flctl()
Dconcat.h31 void mtd_concat_destroy(struct mtd_info *mtd);
Dcfi.h359 void (*fixup)(struct mtd_info *mtd);
383 void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups);
388 int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob,
/linux-4.4.14/drivers/mtd/nand/
Dmpc5121_nfc.c121 struct mtd_info mtd; member
133 static void mpc5121_nfc_done(struct mtd_info *mtd);
136 static inline u16 nfc_read(struct mtd_info *mtd, uint reg) in nfc_read() argument
138 struct nand_chip *chip = mtd->priv; in nfc_read()
145 static inline void nfc_write(struct mtd_info *mtd, uint reg, u16 val) in nfc_write() argument
147 struct nand_chip *chip = mtd->priv; in nfc_write()
154 static inline void nfc_set(struct mtd_info *mtd, uint reg, u16 bits) in nfc_set() argument
156 nfc_write(mtd, reg, nfc_read(mtd, reg) | bits); in nfc_set()
160 static inline void nfc_clear(struct mtd_info *mtd, uint reg, u16 bits) in nfc_clear() argument
162 nfc_write(mtd, reg, nfc_read(mtd, reg) & ~bits); in nfc_clear()
[all …]
Dnand_base.c95 static int nand_get_device(struct mtd_info *mtd, int new_state);
97 static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
106 static int check_offs_len(struct mtd_info *mtd, in check_offs_len() argument
109 struct nand_chip *chip = mtd->priv; in check_offs_len()
133 static void nand_release_device(struct mtd_info *mtd) in nand_release_device() argument
135 struct nand_chip *chip = mtd->priv; in nand_release_device()
151 static uint8_t nand_read_byte(struct mtd_info *mtd) in nand_read_byte() argument
153 struct nand_chip *chip = mtd->priv; in nand_read_byte()
164 static uint8_t nand_read_byte16(struct mtd_info *mtd) in nand_read_byte16() argument
166 struct nand_chip *chip = mtd->priv; in nand_read_byte16()
[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->priv; 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->priv; in read_abs_bbt()
[all …]
Dbf5xx_nand.c145 struct mtd_info mtd; member
161 static struct bf5xx_nand_info *mtd_to_nand_info(struct mtd_info *mtd) in mtd_to_nand_info() argument
163 return container_of(mtd, struct bf5xx_nand_info, mtd); in mtd_to_nand_info()
185 static void bf5xx_nand_hwcontrol(struct mtd_info *mtd, int cmd, in bf5xx_nand_hwcontrol() argument
206 static int bf5xx_nand_devready(struct mtd_info *mtd) in bf5xx_nand_devready() argument
225 static int bf5xx_nand_correct_data_256(struct mtd_info *mtd, u_char *dat, in bf5xx_nand_correct_data_256() argument
228 struct bf5xx_nand_info *info = mtd_to_nand_info(mtd); in bf5xx_nand_correct_data_256()
304 static int bf5xx_nand_correct_data(struct mtd_info *mtd, u_char *dat, in bf5xx_nand_correct_data() argument
307 struct nand_chip *chip = mtd->priv; in bf5xx_nand_correct_data()
310 ret = bf5xx_nand_correct_data_256(mtd, dat, read_ecc, calc_ecc); in bf5xx_nand_correct_data()
[all …]
Dsocrates_nand.c33 struct mtd_info mtd; member
44 static void socrates_nand_write_buf(struct mtd_info *mtd, in socrates_nand_write_buf() argument
48 struct nand_chip *this = mtd->priv; in socrates_nand_write_buf()
64 static void socrates_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in socrates_nand_read_buf() argument
67 struct nand_chip *this = mtd->priv; in socrates_nand_read_buf()
84 static uint8_t socrates_nand_read_byte(struct mtd_info *mtd) in socrates_nand_read_byte() argument
87 socrates_nand_read_buf(mtd, &byte, sizeof(byte)); in socrates_nand_read_byte()
95 static uint16_t socrates_nand_read_word(struct mtd_info *mtd) in socrates_nand_read_word() argument
98 socrates_nand_read_buf(mtd, (uint8_t *)&word, sizeof(word)); in socrates_nand_read_word()
105 static void socrates_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, in socrates_nand_cmd_ctrl() argument
[all …]
Dau1550nd.c40 static u_char au_read_byte(struct mtd_info *mtd) in au_read_byte() argument
42 struct nand_chip *this = mtd->priv; in au_read_byte()
55 static void au_write_byte(struct mtd_info *mtd, u_char byte) in au_write_byte() argument
57 struct nand_chip *this = mtd->priv; in au_write_byte()
68 static u_char au_read_byte16(struct mtd_info *mtd) in au_read_byte16() argument
70 struct nand_chip *this = mtd->priv; in au_read_byte16()
83 static void au_write_byte16(struct mtd_info *mtd, u_char byte) in au_write_byte16() argument
85 struct nand_chip *this = mtd->priv; in au_write_byte16()
96 static u16 au_read_word(struct mtd_info *mtd) in au_read_word() argument
98 struct nand_chip *this = mtd->priv; in au_read_word()
[all …]
Dvf610_nfc.c159 struct mtd_info mtd; member
174 #define mtd_to_nfc(_mtd) container_of(_mtd, struct vf610_nfc, mtd)
323 struct mtd_info *mtd = data; in vf610_nfc_irq() local
324 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_irq()
357 static void vf610_nfc_command(struct mtd_info *mtd, unsigned command, in vf610_nfc_command() argument
360 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_command()
394 trfr_sz += mtd->oobsize; in vf610_nfc_command()
395 column = mtd->writesize; in vf610_nfc_command()
404 trfr_sz += mtd->writesize + mtd->oobsize; in vf610_nfc_command()
451 static void vf610_nfc_read_buf(struct mtd_info *mtd, u_char *buf, int len) in vf610_nfc_read_buf() argument
[all …]
Dcafe_nand.c102 static int cafe_device_ready(struct mtd_info *mtd) in cafe_device_ready() argument
104 struct cafe_priv *cafe = mtd->priv; in cafe_device_ready()
118 static void cafe_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) in cafe_write_buf() argument
120 struct cafe_priv *cafe = mtd->priv; in cafe_write_buf()
133 static void cafe_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in cafe_read_buf() argument
135 struct cafe_priv *cafe = mtd->priv; in cafe_read_buf()
147 static uint8_t cafe_read_byte(struct mtd_info *mtd) in cafe_read_byte() argument
149 struct cafe_priv *cafe = mtd->priv; in cafe_read_byte()
152 cafe_read_buf(mtd, &d, 1); in cafe_read_byte()
158 static void cafe_nand_cmdfunc(struct mtd_info *mtd, unsigned command, in cafe_nand_cmdfunc() argument
[all …]
Ddiskonchip.c74 int (*late_init)(struct mtd_info *mtd);
91 static void doc200x_hwcontrol(struct mtd_info *mtd, int cmd,
93 static void doc200x_select_chip(struct mtd_info *mtd, int chip);
300 static void doc2000_write_byte(struct mtd_info *mtd, u_char datum) in doc2000_write_byte() argument
302 struct nand_chip *this = mtd->priv; in doc2000_write_byte()
312 static u_char doc2000_read_byte(struct mtd_info *mtd) in doc2000_read_byte() argument
314 struct nand_chip *this = mtd->priv; in doc2000_read_byte()
327 static void doc2000_writebuf(struct mtd_info *mtd, const u_char *buf, int len) in doc2000_writebuf() argument
329 struct nand_chip *this = mtd->priv; in doc2000_writebuf()
344 static void doc2000_readbuf(struct mtd_info *mtd, u_char *buf, int len) in doc2000_readbuf() argument
[all …]
Dfsl_elbc_nand.c51 struct mtd_info mtd; member
145 static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob) in set_addr() argument
147 struct nand_chip *chip = mtd->priv; in set_addr()
196 static int fsl_elbc_run_command(struct mtd_info *mtd) in fsl_elbc_run_command() argument
198 struct nand_chip *chip = mtd->priv; in fsl_elbc_run_command()
245 if (elbc_fcm_ctrl->read_bytes == mtd->writesize + mtd->oobsize) { in fsl_elbc_run_command()
261 mtd->ecc_stats.corrected++; in fsl_elbc_run_command()
300 static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command, in fsl_elbc_cmdfunc() argument
303 struct nand_chip *chip = mtd->priv; in fsl_elbc_cmdfunc()
329 set_addr(mtd, 0, page_addr, 0); in fsl_elbc_cmdfunc()
[all …]
Ddocg4.c79 struct mtd_info *mtd; member
242 static void docg4_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in docg4_read_buf() argument
245 struct nand_chip *nand = mtd->priv; in docg4_read_buf()
253 static void docg4_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len) in docg4_write_buf16() argument
256 struct nand_chip *nand = mtd->priv; in docg4_write_buf16()
297 static int docg4_wait(struct mtd_info *mtd, struct nand_chip *nand) in docg4_wait() argument
315 static void docg4_select_chip(struct mtd_info *mtd, int chip) in docg4_select_chip() argument
321 struct nand_chip *nand = mtd->priv; in docg4_select_chip()
336 static void reset(struct mtd_info *mtd) in reset() argument
340 struct nand_chip *nand = mtd->priv; in reset()
[all …]
Dlpc32xx_slc.c207 struct mtd_info mtd; member
259 static void lpc32xx_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, in lpc32xx_nand_cmd_ctrl() argument
263 struct nand_chip *chip = mtd->priv; in lpc32xx_nand_cmd_ctrl()
285 static int lpc32xx_nand_device_ready(struct mtd_info *mtd) in lpc32xx_nand_device_ready() argument
287 struct nand_chip *chip = mtd->priv; in lpc32xx_nand_device_ready()
318 static void lpc32xx_nand_ecc_enable(struct mtd_info *mtd, int mode) in lpc32xx_nand_ecc_enable() argument
326 static int lpc32xx_nand_ecc_calculate(struct mtd_info *mtd, in lpc32xx_nand_ecc_calculate() argument
340 static uint8_t lpc32xx_nand_read_byte(struct mtd_info *mtd) in lpc32xx_nand_read_byte() argument
342 struct nand_chip *chip = mtd->priv; in lpc32xx_nand_read_byte()
351 static void lpc32xx_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len) in lpc32xx_nand_read_buf() argument
[all …]
Dfsl_ifc_nand.c43 struct mtd_info mtd; member
231 static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob) in set_addr() argument
233 struct nand_chip *chip = mtd->priv; in set_addr()
246 ifc_nand_ctrl->addr = priv->vbase + buf_num * (mtd->writesize * 2); in set_addr()
251 ifc_nand_ctrl->index += mtd->writesize; in set_addr()
254 static int is_blank(struct mtd_info *mtd, unsigned int bufnum) in is_blank() argument
256 struct nand_chip *chip = mtd->priv; in is_blank()
258 u8 __iomem *addr = priv->vbase + bufnum * (mtd->writesize * 2); in is_blank()
260 u8 __iomem *oob = addr + mtd->writesize; in is_blank()
263 for (i = 0; i < mtd->writesize / 4; i++) { in is_blank()
[all …]
Dhisi504_nand.c137 struct mtd_info mtd; member
192 struct mtd_info *mtd = &host->mtd; in hisi_nfc_dma_transfer() local
193 struct nand_chip *chip = mtd->priv; in hisi_nfc_dma_transfer()
201 hinfc_write(host, ((mtd->oobsize & HINFC504_DMA_LEN_OOB_MASK) in hisi_nfc_dma_transfer()
265 struct mtd_info *mtd = &host->mtd; in hisi_nfc_send_cmd_readstart() local
279 hinfc_write(host, mtd->writesize + mtd->oobsize, in hisi_nfc_send_cmd_readstart()
358 static void hisi_nfc_select_chip(struct mtd_info *mtd, int chipselect) in hisi_nfc_select_chip() argument
360 struct nand_chip *chip = mtd->priv; in hisi_nfc_select_chip()
369 static uint8_t hisi_nfc_read_byte(struct mtd_info *mtd) in hisi_nfc_read_byte() argument
371 struct nand_chip *chip = mtd->priv; in hisi_nfc_read_byte()
[all …]
Dsh_flctl.c192 static void set_addr(struct mtd_info *mtd, int column, int page_addr) in set_addr() argument
194 struct sh_flctl *flctl = mtd_to_flctl(mtd); in set_addr()
500 static void set_cmd_regs(struct mtd_info *mtd, uint32_t cmd, uint32_t flcmcdr_val) in set_cmd_regs() argument
502 struct sh_flctl *flctl = mtd_to_flctl(mtd); in set_cmd_regs()
562 static int flctl_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, in flctl_read_page_hwecc() argument
565 chip->read_buf(mtd, buf, mtd->writesize); in flctl_read_page_hwecc()
567 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); in flctl_read_page_hwecc()
571 static int flctl_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, in flctl_write_page_hwecc() argument
575 chip->write_buf(mtd, buf, mtd->writesize); in flctl_write_page_hwecc()
576 chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); in flctl_write_page_hwecc()
[all …]
Dtxx9ndfmc.c66 struct mtd_info mtd; member
80 static struct platform_device *mtd_to_platdev(struct mtd_info *mtd) in mtd_to_platdev() argument
82 struct nand_chip *chip = mtd->priv; in mtd_to_platdev()
106 static uint8_t txx9ndfmc_read_byte(struct mtd_info *mtd) in txx9ndfmc_read_byte() argument
108 struct platform_device *dev = mtd_to_platdev(mtd); in txx9ndfmc_read_byte()
113 static void txx9ndfmc_write_buf(struct mtd_info *mtd, const uint8_t *buf, in txx9ndfmc_write_buf() argument
116 struct platform_device *dev = mtd_to_platdev(mtd); in txx9ndfmc_write_buf()
126 static void txx9ndfmc_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in txx9ndfmc_read_buf() argument
128 struct platform_device *dev = mtd_to_platdev(mtd); in txx9ndfmc_read_buf()
135 static void txx9ndfmc_cmd_ctrl(struct mtd_info *mtd, int cmd, in txx9ndfmc_cmd_ctrl() argument
[all …]
Dmxc_nand.c153 void (*select_chip)(struct mtd_info *mtd, int chip);
154 int (*correct_data)(struct mtd_info *mtd, u_char *dat,
176 struct mtd_info mtd; member
533 static void send_page_v3(struct mtd_info *mtd, unsigned int ops) in send_page_v3() argument
535 struct nand_chip *nand_chip = mtd->priv; in send_page_v3()
549 static void send_page_v2(struct mtd_info *mtd, unsigned int ops) in send_page_v2() argument
551 struct nand_chip *nand_chip = mtd->priv; in send_page_v2()
563 static void send_page_v1(struct mtd_info *mtd, unsigned int ops) in send_page_v1() argument
565 struct nand_chip *nand_chip = mtd->priv; in send_page_v1()
569 if (mtd->writesize > 512) in send_page_v1()
[all …]
Dsunxi_nand.c237 struct mtd_info mtd; member
351 static int sunxi_nfc_dev_ready(struct mtd_info *mtd) in sunxi_nfc_dev_ready() argument
353 struct nand_chip *nand = mtd->priv; in sunxi_nfc_dev_ready()
389 static void sunxi_nfc_select_chip(struct mtd_info *mtd, int chip) in sunxi_nfc_select_chip() argument
391 struct nand_chip *nand = mtd->priv; in sunxi_nfc_select_chip()
419 writel(mtd->writesize, nfc->regs + NFC_REG_SPARE_AREA); in sunxi_nfc_select_chip()
434 static void sunxi_nfc_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in sunxi_nfc_read_buf() argument
436 struct nand_chip *nand = mtd->priv; in sunxi_nfc_read_buf()
466 static void sunxi_nfc_write_buf(struct mtd_info *mtd, const uint8_t *buf, in sunxi_nfc_write_buf() argument
469 struct nand_chip *nand = mtd->priv; in sunxi_nfc_write_buf()
[all …]
Dnuc900_nand.c58 struct mtd_info mtd; member
78 static unsigned char nuc900_nand_read_byte(struct mtd_info *mtd) in nuc900_nand_read_byte() argument
83 nand = container_of(mtd, struct nuc900_nand, mtd); in nuc900_nand_read_byte()
90 static void nuc900_nand_read_buf(struct mtd_info *mtd, in nuc900_nand_read_buf() argument
96 nand = container_of(mtd, struct nuc900_nand, mtd); in nuc900_nand_read_buf()
102 static void nuc900_nand_write_buf(struct mtd_info *mtd, in nuc900_nand_write_buf() argument
108 nand = container_of(mtd, struct nuc900_nand, mtd); in nuc900_nand_write_buf()
125 static int nuc900_nand_devready(struct mtd_info *mtd) in nuc900_nand_devready() argument
130 nand = container_of(mtd, struct nuc900_nand, mtd); in nuc900_nand_devready()
136 static void nuc900_nand_command_lp(struct mtd_info *mtd, unsigned int command, in nuc900_nand_command_lp() argument
[all …]
Dtmio_nand.c106 struct mtd_info mtd; member
122 #define mtd_to_tmio(m) container_of(m, struct tmio_nand, mtd)
127 static void tmio_nand_hwcontrol(struct mtd_info *mtd, int cmd, in tmio_nand_hwcontrol() argument
130 struct tmio_nand *tmio = mtd_to_tmio(mtd); in tmio_nand_hwcontrol()
131 struct nand_chip *chip = mtd->priv; in tmio_nand_hwcontrol()
160 static int tmio_nand_dev_ready(struct mtd_info *mtd) in tmio_nand_dev_ready() argument
162 struct tmio_nand *tmio = mtd_to_tmio(mtd); in tmio_nand_dev_ready()
189 tmio_nand_wait(struct mtd_info *mtd, struct nand_chip *nand_chip) in tmio_nand_wait() argument
191 struct tmio_nand *tmio = mtd_to_tmio(mtd); in tmio_nand_wait()
199 tmio_nand_dev_ready(mtd), in tmio_nand_wait()
[all …]
Domap2.c155 struct mtd_info mtd; member
248 static void omap_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) in omap_hwcontrol() argument
250 struct omap_nand_info *info = container_of(mtd, in omap_hwcontrol()
251 struct omap_nand_info, mtd); in omap_hwcontrol()
271 static void omap_read_buf8(struct mtd_info *mtd, u_char *buf, int len) in omap_read_buf8() argument
273 struct nand_chip *nand = mtd->priv; in omap_read_buf8()
284 static void omap_write_buf8(struct mtd_info *mtd, const u_char *buf, int len) in omap_write_buf8() argument
286 struct omap_nand_info *info = container_of(mtd, in omap_write_buf8()
287 struct omap_nand_info, mtd); in omap_write_buf8()
307 static void omap_read_buf16(struct mtd_info *mtd, u_char *buf, int len) in omap_read_buf16() argument
[all …]
Dsharpsl.c32 struct mtd_info mtd; member
38 #define mtd_to_sharpsl(_mtd) container_of(_mtd, struct sharpsl_nand, mtd)
65 static void sharpsl_nand_hwcontrol(struct mtd_info *mtd, int cmd, in sharpsl_nand_hwcontrol() argument
68 struct sharpsl_nand *sharpsl = mtd_to_sharpsl(mtd); in sharpsl_nand_hwcontrol()
69 struct nand_chip *chip = mtd->priv; in sharpsl_nand_hwcontrol()
85 static int sharpsl_nand_dev_ready(struct mtd_info *mtd) in sharpsl_nand_dev_ready() argument
87 struct sharpsl_nand *sharpsl = mtd_to_sharpsl(mtd); in sharpsl_nand_dev_ready()
91 static void sharpsl_nand_enable_hwecc(struct mtd_info *mtd, int mode) in sharpsl_nand_enable_hwecc() argument
93 struct sharpsl_nand *sharpsl = mtd_to_sharpsl(mtd); in sharpsl_nand_enable_hwecc()
97 static int sharpsl_nand_calculate_ecc(struct mtd_info *mtd, const u_char * dat, u_char * ecc_code) in sharpsl_nand_calculate_ecc() argument
[all …]
Djz4740_nand.c62 struct mtd_info mtd; member
77 static inline struct jz_nand *mtd_to_jz_nand(struct mtd_info *mtd) in mtd_to_jz_nand() argument
79 return container_of(mtd, struct jz_nand, mtd); in mtd_to_jz_nand()
82 static void jz_nand_select_chip(struct mtd_info *mtd, int chipnr) in jz_nand_select_chip() argument
84 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_select_chip()
85 struct nand_chip *chip = mtd->priv; in jz_nand_select_chip()
104 static void jz_nand_cmd_ctrl(struct mtd_info *mtd, int dat, unsigned int ctrl) in jz_nand_cmd_ctrl() argument
106 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_cmd_ctrl()
107 struct nand_chip *chip = mtd->priv; in jz_nand_cmd_ctrl()
132 static int jz_nand_dev_ready(struct mtd_info *mtd) in jz_nand_dev_ready() argument
[all …]
Dlpc32xx_mlc.c176 struct mtd_info mtd; member
275 static void lpc32xx_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, in lpc32xx_nand_cmd_ctrl() argument
278 struct nand_chip *nand_chip = mtd->priv; in lpc32xx_nand_cmd_ctrl()
292 static int lpc32xx_nand_device_ready(struct mtd_info *mtd) in lpc32xx_nand_device_ready() argument
294 struct nand_chip *nand_chip = mtd->priv; in lpc32xx_nand_device_ready()
319 static int lpc32xx_waitfunc_nand(struct mtd_info *mtd, struct nand_chip *chip) in lpc32xx_waitfunc_nand() argument
330 dev_dbg(&mtd->dev, "Warning: NAND not ready.\n"); in lpc32xx_waitfunc_nand()
338 static int lpc32xx_waitfunc_controller(struct mtd_info *mtd, in lpc32xx_waitfunc_controller() argument
350 dev_dbg(&mtd->dev, "Warning: Controller not ready.\n"); in lpc32xx_waitfunc_controller()
358 static int lpc32xx_waitfunc(struct mtd_info *mtd, struct nand_chip *chip) in lpc32xx_waitfunc() argument
[all …]
Dndfc.c40 struct mtd_info mtd; member
48 static void ndfc_select_chip(struct mtd_info *mtd, int chip) in ndfc_select_chip() argument
51 struct nand_chip *nchip = mtd->priv; in ndfc_select_chip()
63 static void ndfc_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) in ndfc_hwcontrol() argument
65 struct nand_chip *chip = mtd->priv; in ndfc_hwcontrol()
77 static int ndfc_ready(struct mtd_info *mtd) in ndfc_ready() argument
79 struct nand_chip *chip = mtd->priv; in ndfc_ready()
85 static void ndfc_enable_hwecc(struct mtd_info *mtd, int mode) in ndfc_enable_hwecc() argument
88 struct nand_chip *chip = mtd->priv; in ndfc_enable_hwecc()
97 static int ndfc_calculate_ecc(struct mtd_info *mtd, in ndfc_calculate_ecc() argument
[all …]
Dfsl_upm.c34 struct mtd_info mtd; member
52 return container_of(mtdinfo, struct fsl_upm_nand, mtd); in to_fsl_upm_nand()
55 static int fun_chip_ready(struct mtd_info *mtd) in fun_chip_ready() argument
57 struct fsl_upm_nand *fun = to_fsl_upm_nand(mtd); in fun_chip_ready()
71 while (--cnt && !fun_chip_ready(&fun->mtd)) in fun_wait_rnb()
80 static void fun_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in fun_cmd_ctrl() argument
82 struct nand_chip *chip = mtd->priv; in fun_cmd_ctrl()
83 struct fsl_upm_nand *fun = to_fsl_upm_nand(mtd); in fun_cmd_ctrl()
110 static void fun_select_chip(struct mtd_info *mtd, int mchip_nr) in fun_select_chip() argument
112 struct nand_chip *chip = mtd->priv; in fun_select_chip()
[all …]
Datmel_nand.c119 struct mtd_info mtd; member
183 static void atmel_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in atmel_nand_cmd_ctrl() argument
185 struct nand_chip *nand_chip = mtd->priv; in atmel_nand_cmd_ctrl()
206 static int atmel_nand_device_ready(struct mtd_info *mtd) in atmel_nand_device_ready() argument
208 struct nand_chip *nand_chip = mtd->priv; in atmel_nand_device_ready()
216 static int atmel_nand_set_enable_ready_pins(struct mtd_info *mtd) in atmel_nand_set_enable_ready_pins() argument
218 struct nand_chip *chip = mtd->priv; in atmel_nand_set_enable_ready_pins()
268 static void atmel_read_buf8(struct mtd_info *mtd, u8 *buf, int len) in atmel_read_buf8() argument
270 struct nand_chip *nand_chip = mtd->priv; in atmel_read_buf8()
281 static void atmel_read_buf16(struct mtd_info *mtd, u8 *buf, int len) in atmel_read_buf16() argument
[all …]
Dcs553x_nand.c98 static void cs553x_read_buf(struct mtd_info *mtd, u_char *buf, int len) in cs553x_read_buf() argument
100 struct nand_chip *this = mtd->priv; in cs553x_read_buf()
110 static void cs553x_write_buf(struct mtd_info *mtd, const u_char *buf, int len) in cs553x_write_buf() argument
112 struct nand_chip *this = mtd->priv; in cs553x_write_buf()
122 static unsigned char cs553x_read_byte(struct mtd_info *mtd) in cs553x_read_byte() argument
124 struct nand_chip *this = mtd->priv; in cs553x_read_byte()
128 static void cs553x_write_byte(struct mtd_info *mtd, u_char byte) in cs553x_write_byte() argument
130 struct nand_chip *this = mtd->priv; in cs553x_write_byte()
140 static void cs553x_hwcontrol(struct mtd_info *mtd, int cmd, in cs553x_hwcontrol() argument
143 struct nand_chip *this = mtd->priv; in cs553x_hwcontrol()
[all …]
Ds3c2410.c107 struct mtd_info mtd; member
169 static struct s3c2410_nand_mtd *s3c2410_nand_mtd_toours(struct mtd_info *mtd) in s3c2410_nand_mtd_toours() argument
171 return container_of(mtd, struct s3c2410_nand_mtd, mtd); in s3c2410_nand_mtd_toours()
174 static struct s3c2410_nand_info *s3c2410_nand_mtd_toinfo(struct mtd_info *mtd) in s3c2410_nand_mtd_toinfo() argument
176 return s3c2410_nand_mtd_toours(mtd)->info; in s3c2410_nand_mtd_toinfo()
381 static void s3c2410_nand_select_chip(struct mtd_info *mtd, int chip) in s3c2410_nand_select_chip() argument
385 struct nand_chip *this = mtd->priv; in s3c2410_nand_select_chip()
423 static void s3c2410_nand_hwcontrol(struct mtd_info *mtd, int cmd, in s3c2410_nand_hwcontrol() argument
426 struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd); in s3c2410_nand_hwcontrol()
439 static void s3c2440_nand_hwcontrol(struct mtd_info *mtd, int cmd, in s3c2440_nand_hwcontrol() argument
[all …]
Dorion_nand.c26 static void orion_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in orion_nand_cmd_ctrl() argument
28 struct nand_chip *nc = mtd->priv; in orion_nand_cmd_ctrl()
48 static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in orion_nand_read_buf() argument
50 struct nand_chip *chip = mtd->priv; in orion_nand_read_buf()
78 struct mtd_info *mtd; in orion_nand_probe() local
93 mtd = (struct mtd_info *)(nc + 1); in orion_nand_probe()
126 mtd->priv = nc; in orion_nand_probe()
127 mtd->dev.parent = &pdev->dev; in orion_nand_probe()
148 platform_set_drvdata(pdev, mtd); in orion_nand_probe()
158 if (nand_scan(mtd, 1)) { in orion_nand_probe()
[all …]
Dpxa3xx_nand.c175 struct mtd_info *mtd; member
462 chip->cmdfunc(host->mtd, NAND_CMD_READID, 0x00, -1); in pxa3xx_nand_init_timings_compat()
464 id = chip->read_byte(host->mtd); in pxa3xx_nand_init_timings_compat()
465 id |= chip->read_byte(host->mtd) << 0x8; in pxa3xx_nand_init_timings_compat()
540 struct mtd_info *mtd) in pxa3xx_set_datasize() argument
544 info->data_size = mtd->writesize; in pxa3xx_set_datasize()
898 struct mtd_info *mtd = host->mtd; in prepare_start_command() local
918 pxa3xx_set_datasize(info, mtd); in prepare_start_command()
937 info->buf_count = mtd->writesize + mtd->oobsize; in prepare_start_command()
948 struct mtd_info *mtd; in prepare_set_command() local
[all …]
Dfsmc_nand.c302 struct mtd_info mtd; member
330 static void fsmc_select_chip(struct mtd_info *mtd, int chipnr) in fsmc_select_chip() argument
332 struct nand_chip *chip = mtd->priv; in fsmc_select_chip()
335 host = container_of(mtd, struct fsmc_nand_data, mtd); in fsmc_select_chip()
339 chip->cmd_ctrl(mtd, NAND_CMD_NONE, 0 | NAND_CTRL_CHANGE); in fsmc_select_chip()
359 static void fsmc_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in fsmc_cmd_ctrl() argument
361 struct nand_chip *this = mtd->priv; in fsmc_cmd_ctrl()
362 struct fsmc_nand_data *host = container_of(mtd, in fsmc_cmd_ctrl()
363 struct fsmc_nand_data, mtd); in fsmc_cmd_ctrl()
446 static void fsmc_enable_hwecc(struct mtd_info *mtd, int mode) in fsmc_enable_hwecc() argument
[all …]
Ddenali.c78 #define mtd_to_denali(m) container_of(m, struct denali_nand_info, mtd)
868 static int write_oob_data(struct mtd_info *mtd, uint8_t *buf, int page) in write_oob_data() argument
870 struct denali_nand_info *denali = mtd_to_denali(mtd); in write_oob_data()
880 write_data_to_flash_mem(denali, buf, mtd->oobsize); in write_oob_data()
897 static void read_oob_data(struct mtd_info *mtd, uint8_t *buf, int page) in read_oob_data() argument
899 struct denali_nand_info *denali = mtd_to_denali(mtd); in read_oob_data()
907 read_data_from_flash_mem(denali, buf, mtd->oobsize); in read_oob_data()
998 denali->mtd.ecc_stats.corrected++; in handle_ecc()
1060 static int write_page(struct mtd_info *mtd, struct nand_chip *chip, in write_page() argument
1063 struct denali_nand_info *denali = mtd_to_denali(mtd); in write_page()
[all …]
Ddavinci_nand.c56 struct mtd_info mtd; member
83 #define to_davinci_nand(m) container_of(m, struct davinci_nand_info, mtd)
104 static void nand_davinci_hwcontrol(struct mtd_info *mtd, int cmd, in nand_davinci_hwcontrol() argument
107 struct davinci_nand_info *info = to_davinci_nand(mtd); in nand_davinci_hwcontrol()
109 struct nand_chip *nand = mtd->priv; in nand_davinci_hwcontrol()
125 static void nand_davinci_select_chip(struct mtd_info *mtd, int chip) in nand_davinci_select_chip() argument
127 struct davinci_nand_info *info = to_davinci_nand(mtd); in nand_davinci_select_chip()
145 static inline uint32_t nand_davinci_readecc_1bit(struct mtd_info *mtd) in nand_davinci_readecc_1bit() argument
147 struct davinci_nand_info *info = to_davinci_nand(mtd); in nand_davinci_readecc_1bit()
153 static void nand_davinci_hwctl_1bit(struct mtd_info *mtd, int mode) in nand_davinci_hwctl_1bit() argument
[all …]
Dr852.c65 static inline struct r852_device *r852_get_dev(struct mtd_info *mtd) in r852_get_dev() argument
67 struct nand_chip *chip = mtd->priv; in r852_get_dev()
232 static void r852_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) in r852_write_buf() argument
234 struct r852_device *dev = r852_get_dev(mtd); in r852_write_buf()
266 static void r852_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in r852_read_buf() argument
268 struct r852_device *dev = r852_get_dev(mtd); in r852_read_buf()
303 static uint8_t r852_read_byte(struct mtd_info *mtd) in r852_read_byte() argument
305 struct r852_device *dev = r852_get_dev(mtd); in r852_read_byte()
317 static void r852_cmdctl(struct mtd_info *mtd, int dat, unsigned int ctrl) in r852_cmdctl() argument
319 struct r852_device *dev = r852_get_dev(mtd); in r852_cmdctl()
[all …]
Dsm_common.c41 static int sm_block_markbad(struct mtd_info *mtd, loff_t ofs) in sm_block_markbad() argument
54 ops.ooblen = mtd->oobsize; in sm_block_markbad()
59 ret = mtd_write_oob(mtd, ofs, &ops); in sm_block_markbad()
103 int sm_register_device(struct mtd_info *mtd, int smartmedia) in sm_register_device() argument
105 struct nand_chip *chip = mtd->priv; in sm_register_device()
111 ret = nand_scan_ident(mtd, 1, smartmedia ? in sm_register_device()
123 if (mtd->writesize == SM_SECTOR_SIZE) in sm_register_device()
125 else if (mtd->writesize == SM_SMALL_PAGE) in sm_register_device()
130 ret = nand_scan_tail(mtd); in sm_register_device()
135 return mtd_device_register(mtd, NULL, 0); in sm_register_device()
Dnand_bch.c52 int nand_bch_calculate_ecc(struct mtd_info *mtd, const unsigned char *buf, in nand_bch_calculate_ecc() argument
55 const struct nand_chip *chip = mtd->priv; in nand_bch_calculate_ecc()
79 int nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf, in nand_bch_correct_data() argument
82 const struct nand_chip *chip = mtd->priv; in nand_bch_correct_data()
127 nand_bch_init(struct mtd_info *mtd, unsigned int eccsize, unsigned int eccbytes, in nand_bch_init() argument
158 eccsteps = mtd->writesize/eccsize; in nand_bch_init()
164 if (mtd->oobsize < 64) { in nand_bch_init()
166 "oobsize %d\n", mtd->oobsize); in nand_bch_init()
174 if (layout->eccbytes+2 > mtd->oobsize) { in nand_bch_init()
176 "for oobsize %d eccbytes %u\n", mtd->oobsize, in nand_bch_init()
[all …]
Dams-delta.c65 static void ams_delta_write_byte(struct mtd_info *mtd, u_char byte) in ams_delta_write_byte() argument
67 struct nand_chip *this = mtd->priv; in ams_delta_write_byte()
77 static u_char ams_delta_read_byte(struct mtd_info *mtd) in ams_delta_read_byte() argument
80 struct nand_chip *this = mtd->priv; in ams_delta_read_byte()
92 static void ams_delta_write_buf(struct mtd_info *mtd, const u_char *buf, in ams_delta_write_buf() argument
98 ams_delta_write_byte(mtd, buf[i]); in ams_delta_write_buf()
101 static void ams_delta_read_buf(struct mtd_info *mtd, u_char *buf, int len) in ams_delta_read_buf() argument
106 buf[i] = ams_delta_read_byte(mtd); in ams_delta_read_buf()
117 static void ams_delta_hwcontrol(struct mtd_info *mtd, int cmd, in ams_delta_hwcontrol() argument
131 ams_delta_write_byte(mtd, cmd); in ams_delta_hwcontrol()
[all …]
Dcmx270_nand.c54 static u_char cmx270_read_byte(struct mtd_info *mtd) in cmx270_read_byte() argument
56 struct nand_chip *this = mtd->priv; in cmx270_read_byte()
61 static void cmx270_write_buf(struct mtd_info *mtd, const u_char *buf, int len) in cmx270_write_buf() argument
64 struct nand_chip *this = mtd->priv; in cmx270_write_buf()
70 static void cmx270_read_buf(struct mtd_info *mtd, u_char *buf, int len) in cmx270_read_buf() argument
73 struct nand_chip *this = mtd->priv; in cmx270_read_buf()
94 static void cmx270_hwcontrol(struct mtd_info *mtd, int dat, in cmx270_hwcontrol() argument
97 struct nand_chip* this = mtd->priv; in cmx270_hwcontrol()
128 static int cmx270_device_ready(struct mtd_info *mtd) in cmx270_device_ready() argument
Dpasemi_nand.c46 static void pasemi_read_buf(struct mtd_info *mtd, u_char *buf, int len) in pasemi_read_buf() argument
48 struct nand_chip *chip = mtd->priv; in pasemi_read_buf()
58 static void pasemi_write_buf(struct mtd_info *mtd, const u_char *buf, int len) in pasemi_write_buf() argument
60 struct nand_chip *chip = mtd->priv; in pasemi_write_buf()
70 static void pasemi_hwcontrol(struct mtd_info *mtd, int cmd, in pasemi_hwcontrol() argument
73 struct nand_chip *chip = mtd->priv; in pasemi_hwcontrol()
88 int pasemi_device_ready(struct mtd_info *mtd) in pasemi_device_ready() argument
Dplat_nand.c23 struct mtd_info mtd; member
61 data->mtd.priv = &data->chip; in plat_nand_probe()
62 data->mtd.dev.parent = &pdev->dev; in plat_nand_probe()
90 if (nand_scan(&data->mtd, pdata->chip.nr_chips)) { in plat_nand_probe()
98 err = mtd_device_parse_register(&data->mtd, part_types, &ppdata, in plat_nand_probe()
105 nand_release(&data->mtd); in plat_nand_probe()
120 nand_release(&data->mtd); in plat_nand_remove()
Dxway_nand.c73 static void xway_select_chip(struct mtd_info *mtd, int chip) in xway_select_chip() argument
90 static void xway_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in xway_cmd_ctrl() argument
92 struct nand_chip *this = mtd->priv; in xway_cmd_ctrl()
114 static int xway_dev_ready(struct mtd_info *mtd) in xway_dev_ready() argument
119 static unsigned char xway_read_byte(struct mtd_info *mtd) in xway_read_byte() argument
121 struct nand_chip *this = mtd->priv; in xway_read_byte()
Dnandsim.c667 static int init_nandsim(struct mtd_info *mtd) in init_nandsim() argument
669 struct nand_chip *chip = mtd->priv; in init_nandsim()
685 ns->geom.totsz = mtd->size; in init_nandsim()
686 ns->geom.pgsz = mtd->writesize; in init_nandsim()
687 ns->geom.oobsz = mtd->oobsize; in init_nandsim()
688 ns->geom.secsz = mtd->erasesize; in init_nandsim()
815 static int parse_badblocks(struct nandsim *ns, struct mtd_info *mtd) in parse_badblocks() argument
833 if (mtd_block_markbad(mtd, offset)) { in parse_badblocks()
1014 static int setup_wear_reporting(struct mtd_info *mtd) in setup_wear_reporting() argument
1018 wear_eb_count = div_u64(mtd->size, mtd->erasesize); in setup_wear_reporting()
[all …]
Dnand_ecc.c423 int nand_calculate_ecc(struct mtd_info *mtd, const unsigned char *buf, in nand_calculate_ecc() argument
427 ((struct nand_chip *)mtd->priv)->ecc.size, code); in nand_calculate_ecc()
523 int nand_correct_data(struct mtd_info *mtd, unsigned char *buf, in nand_correct_data() argument
527 ((struct nand_chip *)mtd->priv)->ecc.size); in nand_correct_data()
Dgpio.c72 static void gpio_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in gpio_nand_cmd_ctrl() argument
74 struct gpiomtd *gpiomtd = gpio_nand_getpriv(mtd); in gpio_nand_cmd_ctrl()
91 static int gpio_nand_devready(struct mtd_info *mtd) in gpio_nand_devready() argument
93 struct gpiomtd *gpiomtd = gpio_nand_getpriv(mtd); in gpio_nand_devready()
Dsm_common.h39 extern int sm_register_device(struct mtd_info *mtd, int smartmedia);
/linux-4.4.14/drivers/mtd/onenand/
Donenand_base.c349 int flexonenand_region(struct mtd_info *mtd, loff_t addr) in flexonenand_region() argument
353 for (i = 0; i < mtd->numeraseregions; i++) in flexonenand_region()
354 if (addr < mtd->eraseregions[i].offset) in flexonenand_region()
370 static int onenand_command(struct mtd_info *mtd, int cmd, loff_t addr, size_t len) in onenand_command() argument
372 struct onenand_chip *this = mtd->priv; in onenand_command()
525 static int onenand_wait(struct mtd_info *mtd, int state) in onenand_wait() argument
527 struct onenand_chip * this = mtd->priv; in onenand_wait()
560 mtd->ecc_stats.failed++; in onenand_wait()
565 mtd->ecc_stats.corrected++; in onenand_wait()
623 static int onenand_interrupt_wait(struct mtd_info *mtd, int state) in onenand_interrupt_wait() argument
[all …]
Donenand_bbt.c57 static int create_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr *bd, int chip) in create_bbt() argument
59 struct onenand_chip *this = mtd->priv; in create_bbt()
95 ret = onenand_bbt_read_oob(mtd, in create_bbt()
107 mtd->ecc_stats.badblocks++; in create_bbt()
114 rgn = flexonenand_region(mtd, from); in create_bbt()
115 from += mtd->eraseregions[rgn].erasesize; in create_bbt()
132 static inline int onenand_memory_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd) in onenand_memory_bbt() argument
134 struct onenand_chip *this = mtd->priv; in onenand_memory_bbt()
136 return create_bbt(mtd, this->page_buf, bd, -1); in onenand_memory_bbt()
145 static int onenand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt) in onenand_isbad_bbt() argument
[all …]
Dsamsung.c128 struct mtd_info *mtd; member
226 struct onenand_chip *this = onenand->mtd->priv; in s3c_onenand_readw()
276 struct onenand_chip *this = onenand->mtd->priv; in s3c_onenand_writew()
318 static int s3c_onenand_wait(struct mtd_info *mtd, int state) in s3c_onenand_wait() argument
366 mtd->ecc_stats.failed++; in s3c_onenand_wait()
384 static int s3c_onenand_command(struct mtd_info *mtd, int cmd, loff_t addr, in s3c_onenand_command() argument
387 struct onenand_chip *this = mtd->priv; in s3c_onenand_command()
421 s += (mtd->oobsize >> 2); in s3c_onenand_command()
424 mcount = mtd->writesize >> 2; in s3c_onenand_command()
425 scount = mtd->oobsize >> 2; in s3c_onenand_command()
[all …]
Domap2.c55 struct mtd_info mtd; member
106 static int omap2_onenand_wait(struct mtd_info *mtd, int state) in omap2_onenand_wait() argument
108 struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd); in omap2_onenand_wait()
109 struct onenand_chip *this = mtd->priv; in omap2_onenand_wait()
248 mtd->ecc_stats.failed++; in omap2_onenand_wait()
254 mtd->ecc_stats.corrected++; in omap2_onenand_wait()
280 static inline int omap2_onenand_bufferram_offset(struct mtd_info *mtd, int area) in omap2_onenand_bufferram_offset() argument
282 struct onenand_chip *this = mtd->priv; in omap2_onenand_bufferram_offset()
288 return mtd->oobsize; in omap2_onenand_bufferram_offset()
296 static int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area, in omap3_onenand_read_bufferram() argument
[all …]
Dgeneric.c33 struct mtd_info mtd; member
63 info->mtd.dev.parent = &pdev->dev; in generic_onenand_probe()
64 info->mtd.priv = &info->onenand; in generic_onenand_probe()
66 if (onenand_scan(&info->mtd, 1)) { in generic_onenand_probe()
71 err = mtd_device_parse_register(&info->mtd, NULL, NULL, in generic_onenand_probe()
96 onenand_release(&info->mtd); in generic_onenand_remove()
/linux-4.4.14/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
105 if (mtd->flags & MTD_WRITEABLE) in gluebi_get_device()
108 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_get_device()
147 static void gluebi_put_device(struct mtd_info *mtd) in gluebi_put_device() argument
151 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_put_device()
171 static int gluebi_read(struct mtd_info *mtd, loff_t from, size_t len, in gluebi_read() argument
177 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_read()
178 lnum = div_u64_rem(from, mtd->erasesize, &offs); in gluebi_read()
181 size_t to_read = mtd->erasesize - offs; in gluebi_read()
[all …]
Dbuild.c387 ret = sprintf(buf, "%d\n", ubi->mtd->index); in dev_attribute_show()
594 device_size = mtd_get_device_size(ubi->mtd); in get_bad_peb_limit()
595 device_pebs = mtd_div_by_eb(device_size, ubi->mtd); in get_bad_peb_limit()
626 if (ubi->mtd->numeraseregions != 0) { in io_init()
648 ubi->peb_size = ubi->mtd->erasesize; in io_init()
649 ubi->peb_count = mtd_div_by_eb(ubi->mtd->size, ubi->mtd); in io_init()
650 ubi->flash_size = ubi->mtd->size; in io_init()
652 if (mtd_can_have_bb(ubi->mtd)) { in io_init()
657 if (ubi->mtd->type == MTD_NORFLASH) { in io_init()
658 ubi_assert(ubi->mtd->writesize == 1); in io_init()
[all …]
Dio.c167 err = mtd_read(ubi->mtd, addr, len, &read, buf); in ubi_io_read()
284 err = mtd_write(ubi->mtd, addr, len, &written, buf); in ubi_io_write()
350 ei.mtd = ubi->mtd; in do_sync_erase()
356 err = mtd_erase(ubi->mtd, &ei); in do_sync_erase()
526 err = mtd_write(ubi->mtd, addr, 4, &written, (void *)&data); in nor_erase_prepare()
535 err = mtd_write(ubi->mtd, addr, 4, &written, (void *)&data); in nor_erase_prepare()
612 struct mtd_info *mtd = ubi->mtd; in ubi_io_is_bad() local
619 ret = mtd_block_isbad(mtd, (loff_t)pnum * ubi->peb_size); in ubi_io_is_bad()
642 struct mtd_info *mtd = ubi->mtd; in ubi_io_mark_bad() local
654 err = mtd_block_markbad(mtd, (loff_t)pnum * ubi->peb_size); in ubi_io_mark_bad()
[all …]
/linux-4.4.14/drivers/mtd/devices/
Dmtdram.c35 static int check_offs_len(struct mtd_info *mtd, loff_t ofs, uint64_t len) in check_offs_len() argument
40 if (mtd_mod_by_eb(ofs, mtd)) { in check_offs_len()
46 if (mtd_mod_by_eb(len, mtd)) { in check_offs_len()
54 static int ram_erase(struct mtd_info *mtd, struct erase_info *instr) in ram_erase() argument
56 if (check_offs_len(mtd, instr->addr, instr->len)) in ram_erase()
58 memset((char *)mtd->priv + instr->addr, 0xff, instr->len); in ram_erase()
64 static int ram_point(struct mtd_info *mtd, loff_t from, size_t len, in ram_point() argument
67 *virt = mtd->priv + from; in ram_point()
72 static int ram_unpoint(struct mtd_info *mtd, loff_t from, size_t len) in ram_unpoint() argument
82 static unsigned long ram_get_unmapped_area(struct mtd_info *mtd, in ram_get_unmapped_area() argument
[all …]
Dpowernv_flash.c40 struct mtd_info mtd; member
50 static int powernv_flash_async_op(struct mtd_info *mtd, enum flash_op op, in powernv_flash_async_op() argument
53 struct powernv_flash *info = (struct powernv_flash *)mtd->priv; in powernv_flash_async_op()
54 struct device *dev = &mtd->dev; in powernv_flash_async_op()
119 static int powernv_flash_read(struct mtd_info *mtd, loff_t from, size_t len, in powernv_flash_read() argument
122 return powernv_flash_async_op(mtd, FLASH_OP_READ, from, in powernv_flash_read()
135 static int powernv_flash_write(struct mtd_info *mtd, loff_t to, size_t len, in powernv_flash_write() argument
138 return powernv_flash_async_op(mtd, FLASH_OP_WRITE, to, in powernv_flash_write()
147 static int powernv_flash_erase(struct mtd_info *mtd, struct erase_info *erase) in powernv_flash_erase() argument
154 rc = powernv_flash_async_op(mtd, FLASH_OP_ERASE, erase->addr, in powernv_flash_erase()
[all …]
Dlart.c361 static int flash_erase (struct mtd_info *mtd,struct erase_info *instr) in flash_erase() argument
379 for (i = 0; i < mtd->numeraseregions && instr->addr >= mtd->eraseregions[i].offset; i++) ; in flash_erase()
388 if (i < 0 || (instr->addr & (mtd->eraseregions[i].erasesize - 1))) in flash_erase()
401 … for (; i < mtd->numeraseregions && instr->addr + instr->len >= mtd->eraseregions[i].offset; i++) ; in flash_erase()
405 if (i < 0 || ((instr->addr + instr->len) & (mtd->eraseregions[i].erasesize - 1))) in flash_erase()
422 addr += mtd->eraseregions[i].erasesize; in flash_erase()
423 len -= mtd->eraseregions[i].erasesize; in flash_erase()
425 …if (addr == mtd->eraseregions[i].offset + (mtd->eraseregions[i].erasesize * mtd->eraseregions[i].n… in flash_erase()
434 static int flash_read (struct mtd_info *mtd,loff_t from,size_t len,size_t *retlen,u_char *buf) in flash_read() argument
509 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 …]
Dphram.c30 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()
52 static int phram_point(struct mtd_info *mtd, loff_t from, size_t len, in phram_point() argument
55 *virt = mtd->priv + from; in phram_point()
60 static int phram_unpoint(struct mtd_info *mtd, loff_t from, size_t len) in phram_unpoint() argument
65 static int phram_read(struct mtd_info *mtd, loff_t from, size_t len, in phram_read() argument
68 u_char *start = mtd->priv; in phram_read()
75 static int phram_write(struct mtd_info *mtd, loff_t to, size_t len, in phram_write() argument
78 u_char *start = mtd->priv; in phram_write()
[all …]
Dbcm47xxsflash.c67 static int bcm47xxsflash_erase(struct mtd_info *mtd, struct erase_info *erase) in bcm47xxsflash_erase() argument
69 struct bcm47xxsflash *b47s = mtd->priv; in bcm47xxsflash_erase()
103 static int bcm47xxsflash_read(struct mtd_info *mtd, loff_t from, size_t len, in bcm47xxsflash_read() argument
106 struct bcm47xxsflash *b47s = mtd->priv; in bcm47xxsflash_read()
109 if ((from + len) > mtd->size) in bcm47xxsflash_read()
119 static int bcm47xxsflash_write_st(struct mtd_info *mtd, u32 offset, size_t len, in bcm47xxsflash_write_st() argument
122 struct bcm47xxsflash *b47s = mtd->priv; in bcm47xxsflash_write_st()
164 static int bcm47xxsflash_write_at(struct mtd_info *mtd, u32 offset, size_t len, in bcm47xxsflash_write_at() argument
167 struct bcm47xxsflash *b47s = mtd->priv; in bcm47xxsflash_write_at()
207 static int bcm47xxsflash_write(struct mtd_info *mtd, loff_t to, size_t len, in bcm47xxsflash_write() argument
[all …]
Dsst25l.c53 struct mtd_info mtd; member
64 #define to_sst25l_flash(x) container_of(x, struct sst25l_flash, mtd)
170 static int sst25l_erase(struct mtd_info *mtd, struct erase_info *instr) in sst25l_erase() argument
172 struct sst25l_flash *flash = to_sst25l_flash(mtd); in sst25l_erase()
177 if ((uint32_t)instr->len % mtd->erasesize) in sst25l_erase()
180 if ((uint32_t)instr->addr % mtd->erasesize) in sst25l_erase()
203 addr += mtd->erasesize; in sst25l_erase()
213 static int sst25l_read(struct mtd_info *mtd, loff_t from, size_t len, in sst25l_read() argument
216 struct sst25l_flash *flash = to_sst25l_flash(mtd); in sst25l_read()
256 static int sst25l_write(struct mtd_info *mtd, loff_t to, size_t len, in sst25l_write() argument
[all …]
Dpmc551.c136 static int pmc551_point(struct mtd_info *mtd, loff_t from, size_t len,
139 static int pmc551_erase(struct mtd_info *mtd, struct erase_info *instr) in pmc551_erase() argument
141 struct mypriv *priv = mtd->priv; in pmc551_erase()
159 pmc551_point(mtd, instr->addr, instr->len, &retlen, in pmc551_erase()
162 if (soff_hi == eoff_hi || mtd->size == priv->asize) { in pmc551_erase()
175 if (soff_hi + priv->asize >= mtd->size) { in pmc551_erase()
179 pmc551_point(mtd, (priv->base_map0 | soff_hi), in pmc551_erase()
196 static int pmc551_point(struct mtd_info *mtd, loff_t from, size_t len, in pmc551_point() argument
199 struct mypriv *priv = mtd->priv; in pmc551_point()
222 static int pmc551_unpoint(struct mtd_info *mtd, loff_t from, size_t len) in pmc551_unpoint() argument
[all …]
Dms02-nv.c57 static int ms02nv_read(struct mtd_info *mtd, loff_t from, in ms02nv_read() argument
60 struct ms02nv_private *mp = mtd->priv; in ms02nv_read()
67 static int ms02nv_write(struct mtd_info *mtd, loff_t to, in ms02nv_write() argument
70 struct ms02nv_private *mp = mtd->priv; in ms02nv_write()
110 struct mtd_info *mtd; in ms02nv_init_one() local
145 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in ms02nv_init_one()
146 if (!mtd) in ms02nv_init_one()
152 mtd->priv = mp; in ms02nv_init_one()
205 mtd->type = MTD_RAM; in ms02nv_init_one()
206 mtd->flags = MTD_CAP_RAM; in ms02nv_init_one()
[all …]
Dblock2mtd.c38 struct mtd_info mtd; member
84 static int block2mtd_erase(struct mtd_info *mtd, struct erase_info *instr) in block2mtd_erase() argument
86 struct block2mtd_dev *dev = mtd->priv; in block2mtd_erase()
106 static int block2mtd_read(struct mtd_info *mtd, loff_t from, size_t len, in block2mtd_read() argument
109 struct block2mtd_dev *dev = mtd->priv; in block2mtd_read()
180 static int block2mtd_write(struct mtd_info *mtd, loff_t to, size_t len, in block2mtd_write() argument
183 struct block2mtd_dev *dev = mtd->priv; in block2mtd_write()
196 static void block2mtd_sync(struct mtd_info *mtd) in block2mtd_sync() argument
198 struct block2mtd_dev *dev = mtd->priv; in block2mtd_sync()
209 kfree(dev->mtd.name); in block2mtd_free_device()
[all …]
Ddocg3.c857 static int doc_read_oob(struct mtd_info *mtd, loff_t from, in doc_read_oob() argument
860 struct docg3 *docg3 = mtd->priv; in doc_read_oob()
885 if (from + len > mtd->size) in doc_read_oob()
942 mtd->ecc_stats.failed++; in doc_read_oob()
946 mtd->ecc_stats.corrected += ret; in doc_read_oob()
985 static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, in doc_read() argument
996 ret = doc_read_oob(mtd, from, &ops); in doc_read()
1030 static int doc_block_isbad(struct mtd_info *mtd, loff_t from) in doc_block_isbad() argument
1032 struct docg3 *docg3 = mtd->priv; in doc_block_isbad()
1201 static int doc_erase(struct mtd_info *mtd, struct erase_info *info) in doc_erase() argument
[all …]
Dspear_smi.c199 struct mtd_info mtd; member
208 static inline struct spear_snor_flash *get_flash_data(struct mtd_info *mtd) in get_flash_data() argument
210 return container_of(mtd, struct spear_snor_flash, mtd); in get_flash_data()
494 static int spear_mtd_erase(struct mtd_info *mtd, struct erase_info *e_info) in spear_mtd_erase() argument
496 struct spear_snor_flash *flash = get_flash_data(mtd); in spear_mtd_erase()
497 struct spear_smi *dev = mtd->priv; in spear_mtd_erase()
525 addr += mtd->erasesize; in spear_mtd_erase()
526 len -= mtd->erasesize; in spear_mtd_erase()
548 static int spear_mtd_read(struct mtd_info *mtd, loff_t from, size_t len, in spear_mtd_read() argument
551 struct spear_snor_flash *flash = get_flash_data(mtd); in spear_mtd_read()
[all …]
Dslram.c82 static int slram_erase(struct mtd_info *mtd, struct erase_info *instr) in slram_erase() argument
84 slram_priv_t *priv = mtd->priv; in slram_erase()
96 static int slram_point(struct mtd_info *mtd, loff_t from, size_t len, in slram_point() argument
99 slram_priv_t *priv = mtd->priv; in slram_point()
106 static int slram_unpoint(struct mtd_info *mtd, loff_t from, size_t len) in slram_unpoint() argument
111 static int slram_read(struct mtd_info *mtd, loff_t from, size_t len, in slram_read() argument
114 slram_priv_t *priv = mtd->priv; in slram_read()
121 static int slram_write(struct mtd_info *mtd, loff_t to, size_t len, in slram_write() argument
124 slram_priv_t *priv = mtd->priv; in slram_write()
Dmtd_dataflash.c96 struct mtd_info mtd; member
149 static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr) in dataflash_erase() argument
151 struct dataflash *priv = mtd->priv; in dataflash_erase()
235 static int dataflash_read(struct mtd_info *mtd, loff_t from, size_t len, in dataflash_read() argument
238 struct dataflash *priv = mtd->priv; in dataflash_read()
300 static int dataflash_write(struct mtd_info *mtd, loff_t to, size_t len, in dataflash_write() argument
303 struct dataflash *priv = mtd->priv; in dataflash_write()
443 static int dataflash_get_otp_info(struct mtd_info *mtd, size_t len, in dataflash_get_otp_info() argument
502 static int dataflash_read_fact_otp(struct mtd_info *mtd, in dataflash_read_fact_otp() argument
505 struct dataflash *priv = mtd->priv; in dataflash_read_fact_otp()
[all …]
Dst_spi_fsm.c263 struct mtd_info mtd; member
1674 static int stfsm_mtd_read(struct mtd_info *mtd, loff_t from, size_t len, in stfsm_mtd_read() argument
1677 struct stfsm *fsm = dev_get_drvdata(mtd->dev.parent); in stfsm_mtd_read()
1750 static int stfsm_mtd_write(struct mtd_info *mtd, loff_t to, size_t len, in stfsm_mtd_write() argument
1753 struct stfsm *fsm = dev_get_drvdata(mtd->dev.parent); in stfsm_mtd_write()
1796 static int stfsm_mtd_erase(struct mtd_info *mtd, struct erase_info *instr) in stfsm_mtd_erase() argument
1798 struct stfsm *fsm = dev_get_drvdata(mtd->dev.parent); in stfsm_mtd_erase()
1811 if (len == mtd->size) { in stfsm_mtd_erase()
1821 addr += mtd->erasesize; in stfsm_mtd_erase()
1822 len -= mtd->erasesize; in stfsm_mtd_erase()
[all …]
Dm25p80.c160 flash->spi_nor.mtd.erasesize / 1024, (u32)offset); in m25p80_erase()
214 nor->mtd.name = data->name; in m25p_probe()
232 return mtd_device_parse_register(&nor->mtd, NULL, &ppdata, in m25p_probe()
243 return mtd_device_unregister(&flash->spi_nor.mtd); in m25p_remove()
/linux-4.4.14/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 …]
Dcfi_cmdset_0001.c67 static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
68 static int cfi_intelext_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
69 static int cfi_intelext_is_locked(struct mtd_info *mtd, loff_t ofs,
92 static int cfi_intelext_point (struct mtd_info *mtd, loff_t from, size_t len,
94 static int cfi_intelext_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
169 static void fixup_convert_atmel_pri(struct mtd_info *mtd) in fixup_convert_atmel_pri() argument
171 struct map_info *map = mtd->priv; in fixup_convert_atmel_pri()
209 static void fixup_at49bv640dx_lock(struct mtd_info *mtd) in fixup_at49bv640dx_lock() argument
211 struct map_info *map = mtd->priv; in fixup_at49bv640dx_lock()
216 mtd->flags |= MTD_POWERUP_LOCK; in fixup_at49bv640dx_lock()
[all …]
Dcfi_cmdset_0002.c74 static int cfi_amdstd_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
86 static int cfi_atmel_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
87 static int cfi_atmel_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
89 static int cfi_ppb_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
90 static int cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
91 static int cfi_ppb_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len);
156 static void fixup_amd_bootblock(struct mtd_info *mtd) in fixup_amd_bootblock() argument
158 struct map_info *map = mtd->priv; in fixup_amd_bootblock()
205 static void fixup_use_write_buffers(struct mtd_info *mtd) in fixup_use_write_buffers() argument
207 struct map_info *map = mtd->priv; in fixup_use_write_buffers()
[all …]
Dcfi_cmdset_0020.c39 static int cfi_staa_writev(struct mtd_info *mtd, const struct kvec *vecs,
43 static int cfi_staa_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
44 static int cfi_staa_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
169 struct mtd_info *mtd; in cfi_staa_setup() local
174 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in cfi_staa_setup()
177 if (!mtd) { in cfi_staa_setup()
182 mtd->priv = map; in cfi_staa_setup()
183 mtd->type = MTD_NORFLASH; in cfi_staa_setup()
184 mtd->size = devsize * cfi->numchips; in cfi_staa_setup()
186 mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips; in cfi_staa_setup()
[all …]
Dfwh_lock.h79 static int fwh_lock_varsize(struct mtd_info *mtd, loff_t ofs, uint64_t len) in fwh_lock_varsize() argument
83 ret = cfi_varsize_frob(mtd, fwh_xxlock_oneblock, ofs, len, in fwh_lock_varsize()
90 static int fwh_unlock_varsize(struct mtd_info *mtd, loff_t ofs, uint64_t len) in fwh_unlock_varsize() argument
94 ret = cfi_varsize_frob(mtd, fwh_xxlock_oneblock, ofs, len, in fwh_unlock_varsize()
100 static void fixup_use_fwh_lock(struct mtd_info *mtd) in fixup_use_fwh_lock() argument
104 mtd->_lock = fwh_lock_varsize; in fixup_use_fwh_lock()
105 mtd->_unlock = fwh_unlock_varsize; in fixup_use_fwh_lock()
Dgen_probe.c23 struct mtd_info *mtd = NULL; in mtd_do_chip_probe() local
35 mtd = check_cmd_set(map, 1); /* First the primary cmdset */ in mtd_do_chip_probe()
36 if (!mtd) in mtd_do_chip_probe()
37 mtd = check_cmd_set(map, 0); /* Then the secondary */ in mtd_do_chip_probe()
39 if (mtd) { in mtd_do_chip_probe()
40 if (mtd->size > map->size) { in mtd_do_chip_probe()
42 (unsigned long)mtd->size >> 10, in mtd_do_chip_probe()
44 mtd->size = map->size; in mtd_do_chip_probe()
46 return mtd; in mtd_do_chip_probe()
217 struct mtd_info *mtd; in cfi_cmdset_unknown() local
[all …]
Dchipreg.c85 void map_destroy(struct mtd_info *mtd) in map_destroy() argument
87 struct map_info *map = mtd->priv; in map_destroy()
90 map->fldrv->destroy(mtd); in map_destroy()
94 kfree(mtd); in map_destroy()
Dcfi_util.c336 void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup *fixups) in cfi_fixup() argument
338 struct map_info *map = mtd->priv; in cfi_fixup()
345 f->fixup(mtd); in cfi_fixup()
352 int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob, in cfi_varsize_frob() argument
355 struct map_info *map = mtd->priv; in cfi_varsize_frob()
360 struct mtd_erase_region_info *regions = mtd->eraseregions; in cfi_varsize_frob()
374 while (i < mtd->numeraseregions && ofs >= regions[i].offset) in cfi_varsize_frob()
394 while (i<mtd->numeraseregions && (ofs + len) >= regions[i].offset) in cfi_varsize_frob()
/linux-4.4.14/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()
218 if (use_offset != 0 || use_len < mtd->ecclayout->oobavail) { in verify_eraseblock()
224 ops.ooblen = mtd->ecclayout->oobavail; in verify_eraseblock()
229 err = mtd_read_oob(mtd, addr, &ops); 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 …]
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 …]
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 …]
Dreadtest.c38 static struct mtd_info *mtd; variable
50 loff_t addr = (loff_t)ebnum * mtd->erasesize; in read_eraseblock_by_page()
56 ret = mtdtest_read(mtd, addr, pgsize, buf); in read_eraseblock_by_page()
61 if (mtd->oobsize) { in read_eraseblock_by_page()
67 ops.ooblen = mtd->oobsize; in read_eraseblock_by_page()
72 ret = mtd_read_oob(mtd, addr, &ops); in read_eraseblock_by_page()
74 ops.oobretlen != mtd->oobsize) { in read_eraseblock_by_page()
82 oobbuf += mtd->oobsize; in read_eraseblock_by_page()
98 n = mtd->erasesize; in dump_eraseblock()
108 if (!mtd->oobsize) in dump_eraseblock()
[all …]
Dnandbiterrs.c80 static struct mtd_info *mtd; /* MTD device */ variable
108 return mtdtest_write(mtd, offset, mtd->writesize, wbuffer); in write_page()
121 ops.len = mtd->writesize; in rewrite_page()
129 err = mtd_write_oob(mtd, offset, &ops); in rewrite_page()
130 if (err || ops.retlen != mtd->writesize) { in rewrite_page()
151 memcpy(&oldstats, &mtd->ecc_stats, sizeof(oldstats)); in read_page()
153 err = mtd_read(mtd, offset, mtd->writesize, &read, rbuffer); in read_page()
155 err = mtd->ecc_stats.corrected - oldstats.corrected; in read_page()
157 if (err < 0 || read != mtd->writesize) { in read_page()
174 for (i = 0; i < mtd->writesize; i++) { in verify_page()
[all …]
Dmtd_test.c9 int mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum) in mtdtest_erase_eraseblock() argument
13 loff_t addr = (loff_t)ebnum * mtd->erasesize; in mtdtest_erase_eraseblock()
16 ei.mtd = mtd; in mtdtest_erase_eraseblock()
18 ei.len = mtd->erasesize; in mtdtest_erase_eraseblock()
20 err = mtd_erase(mtd, &ei); in mtdtest_erase_eraseblock()
33 static int is_block_bad(struct mtd_info *mtd, unsigned int ebnum) in is_block_bad() argument
36 loff_t addr = (loff_t)ebnum * mtd->erasesize; in is_block_bad()
38 ret = mtd_block_isbad(mtd, addr); in is_block_bad()
45 int mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt, in mtdtest_scan_for_bad_eraseblocks() argument
50 if (!mtd_can_have_bb(mtd)) in mtdtest_scan_for_bad_eraseblocks()
[all …]
Dsubpagetest.c39 static struct mtd_info *mtd; variable
60 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock()
63 err = mtd_write(mtd, addr, subpgsize, &written, writebuf); in write_eraseblock()
77 err = mtd_write(mtd, addr, subpgsize, &written, writebuf); in write_eraseblock()
95 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock2()
98 if (addr + (subpgsize * k) > (loff_t)(ebnum + 1) * mtd->erasesize) in write_eraseblock2()
101 err = mtd_write(mtd, addr, subpgsize * k, &written, writebuf); in write_eraseblock2()
134 loff_t addr = (loff_t)ebnum * mtd->erasesize; in verify_eraseblock()
138 err = mtd_read(mtd, addr, subpgsize, &read, readbuf); in verify_eraseblock()
165 err = mtd_read(mtd, addr, subpgsize, &read, readbuf); in verify_eraseblock()
[all …]
Dtorturetest.c69 static struct mtd_info *mtd; variable
105 loff_t addr = (loff_t)ebnum * mtd->erasesize; in check_eraseblock()
106 size_t len = mtd->erasesize; in check_eraseblock()
109 addr = (loff_t)(ebnum + 1) * mtd->erasesize - pgcnt * pgsize; in check_eraseblock()
114 err = mtd_read(mtd, addr, len, &read, check_buf); in check_eraseblock()
159 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_pattern()
160 size_t len = mtd->erasesize; in write_pattern()
163 addr = (loff_t)(ebnum + 1) * mtd->erasesize - pgcnt * pgsize; in write_pattern()
166 err = mtd_write(mtd, addr, len, &written, buf); in write_pattern()
205 mtd = get_mtd_device(NULL, dev); in tort_init()
[all …]
Dmtd_test.h15 int mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum);
16 int mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
18 int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
21 int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf);
22 int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size,
/linux-4.4.14/drivers/net/ethernet/sfc/
Dmtd.c19 #define to_efx_mtd_partition(mtd) \ argument
20 container_of(mtd, struct efx_mtd_partition, mtd)
24 static int efx_mtd_erase(struct mtd_info *mtd, struct erase_info *erase) in efx_mtd_erase() argument
26 struct efx_nic *efx = mtd->priv; in efx_mtd_erase()
29 rc = efx->type->mtd_erase(mtd, erase->addr, erase->len); in efx_mtd_erase()
40 static void efx_mtd_sync(struct mtd_info *mtd) in efx_mtd_sync() argument
42 struct efx_mtd_partition *part = to_efx_mtd_partition(mtd); in efx_mtd_sync()
43 struct efx_nic *efx = mtd->priv; in efx_mtd_sync()
46 rc = efx->type->mtd_sync(mtd); in efx_mtd_sync()
57 rc = mtd_device_unregister(&part->mtd); in efx_mtd_remove_partition()
[all …]
Dmcdi.h103 #define to_efx_mcdi_mtd_partition(mtd) \ argument
104 container_of(mtd, struct efx_mcdi_mtd_partition, common.mtd)
363 int efx_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, size_t len,
365 int efx_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len);
366 int efx_mcdi_mtd_write(struct mtd_info *mtd, loff_t start, size_t len,
368 int efx_mcdi_mtd_sync(struct mtd_info *mtd);
Dfalcon.c652 #define to_falcon_mtd_partition(mtd) \ argument
653 container_of(mtd, struct falcon_mtd_partition, common.mtd)
741 struct efx_nic *efx = part->common.mtd.priv; in falcon_spi_slow_wait()
805 struct efx_nic *efx = part->common.mtd.priv; in falcon_spi_erase()
851 struct efx_nic *efx = part->mtd.priv; in falcon_mtd_rename()
857 static int falcon_mtd_read(struct mtd_info *mtd, loff_t start, in falcon_mtd_read() argument
860 struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd); in falcon_mtd_read()
861 struct efx_nic *efx = mtd->priv; in falcon_mtd_read()
874 static int falcon_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len) in falcon_mtd_erase() argument
876 struct falcon_mtd_partition *part = to_falcon_mtd_partition(mtd); in falcon_mtd_erase()
[all …]
Dmcdi.c1945 int efx_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, in efx_mcdi_mtd_read() argument
1948 struct efx_mcdi_mtd_partition *part = to_efx_mcdi_mtd_partition(mtd); in efx_mcdi_mtd_read()
1949 struct efx_nic *efx = mtd->priv; in efx_mcdi_mtd_read()
1951 loff_t end = min_t(loff_t, start + len, mtd->size); in efx_mcdi_mtd_read()
1969 int efx_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len) in efx_mcdi_mtd_erase() argument
1971 struct efx_mcdi_mtd_partition *part = to_efx_mcdi_mtd_partition(mtd); in efx_mcdi_mtd_erase()
1972 struct efx_nic *efx = mtd->priv; in efx_mcdi_mtd_erase()
1973 loff_t offset = start & ~((loff_t)(mtd->erasesize - 1)); in efx_mcdi_mtd_erase()
1974 loff_t end = min_t(loff_t, start + len, mtd->size); in efx_mcdi_mtd_erase()
1975 size_t chunk = part->common.mtd.erasesize; in efx_mcdi_mtd_erase()
[all …]
/linux-4.4.14/drivers/mtd/nand/gpmi-nand/
Dgpmi-nand.c110 struct mtd_info *mtd = &this->mtd; in get_ecc_strength() local
113 ecc_strength = ((mtd->oobsize - geo->metadata_size) * 8) in get_ecc_strength()
142 struct mtd_info *mtd = &this->mtd; in set_geometry_by_ecc_info() local
143 struct nand_chip *chip = mtd->priv; in set_geometry_by_ecc_info()
169 if (geo->ecc_chunk_size < mtd->oobsize) { in set_geometry_by_ecc_info()
172 chip->ecc_step_ds, mtd->oobsize); in set_geometry_by_ecc_info()
179 geo->ecc_chunk_count = mtd->writesize / geo->ecc_chunk_size; in set_geometry_by_ecc_info()
229 geo->page_size = mtd->writesize + geo->metadata_size + in set_geometry_by_ecc_info()
233 if (geo->page_size < mtd->writesize + mtd->oobsize) { in set_geometry_by_ecc_info()
234 of->offset = geo->page_size - mtd->writesize; in set_geometry_by_ecc_info()
[all …]
Dgpmi-lib.c922 struct mtd_info *mtd = &this->mtd; in enable_edo_mode() local
931 nand->select_chip(mtd, 0); in enable_edo_mode()
935 ret = nand->onfi_set_features(mtd, nand, in enable_edo_mode()
942 ret = nand->onfi_get_features(mtd, nand, in enable_edo_mode()
947 nand->select_chip(mtd, -1); in enable_edo_mode()
963 nand->select_chip(mtd, -1); in enable_edo_mode()
/linux-4.4.14/Documentation/ABI/testing/
Dsysfs-class-mtd1 What: /sys/class/mtd/
4 Contact: linux-mtd@lists.infradead.org
6 The mtd/ class subdirectory belongs to the MTD subsystem
9 What: /sys/class/mtd/mtdX/
12 Contact: linux-mtd@lists.infradead.org
14 The /sys/class/mtd/mtd{0,1,2,3,...} directories correspond
19 What: /sys/class/mtd/mtdXro/
22 Contact: linux-mtd@lists.infradead.org
25 nodes for /sys/class/mtd/mtdX/ .
27 What: /sys/class/mtd/mtdX/dev
[all …]
/linux-4.4.14/fs/logfs/
Ddev_mtd.c19 struct mtd_info *mtd = logfs_super(sb)->s_mtd; in logfs_mtd_read() local
23 ret = mtd_read(mtd, ofs, len, &retlen, buf); in logfs_mtd_read()
39 struct mtd_info *mtd = super->s_mtd; in loffs_mtd_write() local
47 BUG_ON((ofs >= mtd->size) || (len > mtd->size - ofs)); in loffs_mtd_write()
52 ret = mtd_write(mtd, ofs, len, &retlen, buf); in loffs_mtd_write()
93 struct mtd_info *mtd = logfs_super(sb)->s_mtd; in logfs_mtd_erase() local
98 BUG_ON(len % mtd->erasesize); in logfs_mtd_erase()
103 ei.mtd = mtd; in logfs_mtd_erase()
108 ret = mtd_erase(mtd, &ei); in logfs_mtd_erase()
120 struct mtd_info *mtd = logfs_super(sb)->s_mtd; in logfs_mtd_sync() local
[all …]
/linux-4.4.14/drivers/mtd/spi-nor/
Dspi-nor.c179 static inline struct spi_nor *mtd_to_spi_nor(struct mtd_info *mtd) in mtd_to_spi_nor() argument
181 return mtd->priv; in mtd_to_spi_nor()
286 dev_dbg(nor->dev, " %lldKiB\n", (long long)(nor->mtd.size >> 10)); in erase_chip()
319 static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr) in spi_nor_erase() argument
321 struct spi_nor *nor = mtd_to_spi_nor(mtd); in spi_nor_erase()
329 div_u64_rem(instr->len, mtd->erasesize, &rem); in spi_nor_erase()
341 if (len == mtd->size) { in spi_nor_erase()
359 (unsigned long)(mtd->size / SZ_2M)); in spi_nor_erase()
379 addr += mtd->erasesize; in spi_nor_erase()
380 len -= mtd->erasesize; in spi_nor_erase()
[all …]
Dfsl-quadspi.c890 nor->mtd.erasesize / 1024, q->chip_base_addr, (u32)offs); in fsl_qspi_erase()
935 struct mtd_info *mtd; in fsl_qspi_probe() local
1013 mtd = &nor->mtd; in fsl_qspi_probe()
1042 ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0); in fsl_qspi_probe()
1048 q->nor_size = mtd->size; in fsl_qspi_probe()
1082 mtd_device_unregister(&q->nor[i].mtd); in fsl_qspi_probe()
1102 mtd_device_unregister(&q->nor[i].mtd); in fsl_qspi_remove()
/linux-4.4.14/fs/romfs/
Dmmap-nommu.c29 struct mtd_info *mtd = inode->i_sb->s_mtd; in romfs_get_unmapped_area() local
33 if (!mtd) in romfs_get_unmapped_area()
48 if (len > mtd->size || pgoff >= (mtd->size >> PAGE_SHIFT)) in romfs_get_unmapped_area()
52 if (offset >= mtd->size) in romfs_get_unmapped_area()
55 if ((offset + len) > mtd->size) in romfs_get_unmapped_area()
56 len = mtd->size - offset; in romfs_get_unmapped_area()
58 ret = mtd_get_unmapped_area(mtd, len, offset, flags); in romfs_get_unmapped_area()
75 struct mtd_info *mtd = file_inode(file)->i_sb->s_mtd; in romfs_mmap_capabilities() local
77 if (!mtd) in romfs_mmap_capabilities()
79 return mtd_mmap_capabilities(mtd); in romfs_mmap_capabilities()
/linux-4.4.14/drivers/mtd/lpddr/
Dlpddr_cmds.c32 static int lpddr_read(struct mtd_info *mtd, loff_t adr, size_t len,
34 static int lpddr_write_buffers(struct mtd_info *mtd, loff_t to,
36 static int lpddr_writev(struct mtd_info *mtd, const struct kvec *vecs,
38 static int lpddr_erase(struct mtd_info *mtd, struct erase_info *instr);
39 static int lpddr_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
40 static int lpddr_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
41 static int lpddr_point(struct mtd_info *mtd, loff_t adr, size_t len,
43 static int lpddr_unpoint(struct mtd_info *mtd, loff_t adr, size_t len);
53 struct mtd_info *mtd; in lpddr_cmdset() local
57 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in lpddr_cmdset()
[all …]
Dlpddr2_nvm.c242 static int lpddr2_nvm_do_block_op(struct mtd_info *mtd, loff_t start_add, in lpddr2_nvm_do_block_op() argument
245 struct map_info *map = mtd->priv; in lpddr2_nvm_do_block_op()
260 add += mtd->erasesize; in lpddr2_nvm_do_block_op()
307 static int lpddr2_nvm_read(struct mtd_info *mtd, loff_t start_add, in lpddr2_nvm_read() argument
310 struct map_info *map = mtd->priv; in lpddr2_nvm_read()
325 static int lpddr2_nvm_write(struct mtd_info *mtd, loff_t start_add, in lpddr2_nvm_write() argument
328 struct map_info *map = mtd->priv; in lpddr2_nvm_write()
344 if (!(IS_ALIGNED(add, mtd->writesize))) { /* do sw program */ in lpddr2_nvm_write()
360 (u_long) mtd->writesize); in lpddr2_nvm_write()
381 static int lpddr2_nvm_erase(struct mtd_info *mtd, struct erase_info *instr) in lpddr2_nvm_erase() argument
[all …]
Dqinfo_probe.c200 struct mtd_info *mtd = NULL; in lpddr_probe() local
209 mtd = lpddr_cmdset(map); in lpddr_probe()
210 if (mtd) { in lpddr_probe()
211 if (mtd->size > map->size) { in lpddr_probe()
213 "to %ldKiB\n", (unsigned long)mtd->size >> 10, in lpddr_probe()
215 mtd->size = map->size; in lpddr_probe()
217 return mtd; in lpddr_probe()
/linux-4.4.14/drivers/mtd/maps/
Dsa1100-flash.c29 struct mtd_info *mtd; member
34 struct mtd_info *mtd; member
59 if (subdev->mtd) in sa1100_destroy_subdev()
60 map_destroy(subdev->mtd); in sa1100_destroy_subdev()
115 subdev->mtd = do_map_probe(subdev->plat->map_name, &subdev->map); in sa1100_probe_subdev()
116 if (subdev->mtd == NULL) { in sa1100_probe_subdev()
122 phys, (unsigned)(subdev->mtd->size >> 20), in sa1100_probe_subdev()
137 if (info->mtd) { in sa1100_destroy()
138 mtd_device_unregister(info->mtd); in sa1100_destroy()
139 if (info->mtd != info->subdev[0].mtd) in sa1100_destroy()
[all …]
Duclinux.c58 static int uclinux_point(struct mtd_info *mtd, loff_t from, size_t len, in uclinux_point() argument
61 struct map_info *map = mtd->priv; in uclinux_point()
73 struct mtd_info *mtd; in uclinux_mtd_init() local
105 mtd = do_map_probe("map_" MAP_NAME, mapp); in uclinux_mtd_init()
106 if (!mtd) { in uclinux_mtd_init()
111 mtd->owner = THIS_MODULE; in uclinux_mtd_init()
112 mtd->_point = uclinux_point; in uclinux_mtd_init()
113 mtd->priv = mapp; in uclinux_mtd_init()
115 uclinux_ram_mtdinfo = mtd; in uclinux_mtd_init()
116 mtd_device_register(mtd, uclinux_romfs, NUM_PARTITIONS); in uclinux_mtd_init()
Drbtx4939-flash.c25 struct mtd_info *mtd; member
37 if (info->mtd) { in rbtx4939_flash_remove()
38 mtd_device_unregister(info->mtd); in rbtx4939_flash_remove()
39 map_destroy(info->mtd); in rbtx4939_flash_remove()
92 for (; !info->mtd && *probe_type; probe_type++) in rbtx4939_flash_probe()
93 info->mtd = do_map_probe(*probe_type, &info->map); in rbtx4939_flash_probe()
94 if (!info->mtd) { in rbtx4939_flash_probe()
99 info->mtd->dev.parent = &dev->dev; in rbtx4939_flash_probe()
100 err = mtd_device_parse_register(info->mtd, NULL, NULL, pdata->parts, in rbtx4939_flash_probe()
117 if (mtd_suspend(info->mtd) == 0) in rbtx4939_flash_shutdown()
[all …]
Dscb2_flash.c71 static int scb2_fixup_mtd(struct mtd_info *mtd) in scb2_fixup_mtd() argument
75 struct map_info *map = mtd->priv; in scb2_fixup_mtd()
88 mtd->size = map->size; in scb2_fixup_mtd()
103 mtd->erasesize /= 2; in scb2_fixup_mtd()
104 for (i = 0; i < mtd->numeraseregions; i++) { in scb2_fixup_mtd()
105 struct mtd_erase_region_info *region = &mtd->eraseregions[i]; in scb2_fixup_mtd()
115 for (i = 0; !done && i < mtd->numeraseregions; i++) { in scb2_fixup_mtd()
116 struct mtd_erase_region_info *region = &mtd->eraseregions[i]; in scb2_fixup_mtd()
118 if (region->numblocks * region->erasesize > mtd->size) { in scb2_fixup_mtd()
119 region->numblocks = ((unsigned long)mtd->size / in scb2_fixup_mtd()
Dphysmap.c27 struct mtd_info *mtd[MAX_RESOURCES]; member
48 if (info->cmtd != info->mtd[0]) in physmap_flash_remove()
53 if (info->mtd[i] != NULL) in physmap_flash_remove()
54 map_destroy(info->mtd[i]); in physmap_flash_remove()
158 for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++) in physmap_flash_probe()
159 info->mtd[i] = do_map_probe(*probe_type, &info->map[i]); in physmap_flash_probe()
161 info->mtd[i] = do_map_probe(physmap_data->probe_type, &info->map[i]); in physmap_flash_probe()
163 if (info->mtd[i] == NULL) { in physmap_flash_probe()
170 info->mtd[i]->dev.parent = &dev->dev; in physmap_flash_probe()
174 info->cmtd = info->mtd[0]; in physmap_flash_probe()
[all …]
Dplat-ram.c44 struct mtd_info *mtd; member
91 if (info->mtd) { in platram_remove()
92 mtd_device_unregister(info->mtd); in platram_remove()
93 map_destroy(info->mtd); in platram_remove()
200 for ( ; !info->mtd && *map_probes; map_probes++) in platram_probe()
201 info->mtd = do_map_probe(*map_probes , &info->map); in platram_probe()
205 info->mtd = do_map_probe("map_ram", &info->map); in platram_probe()
207 if (info->mtd == NULL) { in platram_probe()
213 info->mtd->dev.parent = &pdev->dev; in platram_probe()
220 err = mtd_device_parse_register(info->mtd, pdata->probes, NULL, in platram_probe()
[all …]
Dvmu-flash.c50 struct mtd_info *mtd; member
59 struct mtd_info *mtd, int partition) in ofs_to_block() argument
67 mpart = mtd->priv; in ofs_to_block()
112 struct mtd_info *mtd) in maple_vmu_read_block() argument
122 mpart = mtd->priv; in maple_vmu_read_block()
229 struct mtd_info *mtd) in maple_vmu_write_block() argument
237 mpart = mtd->priv; in maple_vmu_write_block()
305 struct mtd_info *mtd) in vmu_flash_read_char() argument
314 mpart = mtd->priv; in vmu_flash_read_char()
327 vblock = ofs_to_block(ofs, mtd, partition); in vmu_flash_read_char()
[all …]
Dphysmap_of.c29 struct mtd_info *mtd; member
52 if (info->cmtd != info->list[0].mtd) in of_flash_remove()
57 if (info->list[i].mtd) in of_flash_remove()
58 map_destroy(info->list[i].mtd); in of_flash_remove()
82 struct mtd_info *mtd; in obsolete_probe() local
91 mtd = do_map_probe(rom_probe_types[i], map); in obsolete_probe()
92 if (mtd) in obsolete_probe()
93 return mtd; in obsolete_probe()
268 info->list[i].mtd = do_map_probe(probe_type, in of_flash_probe()
271 info->list[i].mtd = obsolete_probe(dev, in of_flash_probe()
[all …]
Dpxa2xx-flash.c43 struct mtd_info *mtd; member
88 info->mtd = do_map_probe(flash->map_name, &info->map); in pxa2xx_flash_probe()
90 if (!info->mtd) { in pxa2xx_flash_probe()
96 info->mtd->dev.parent = &pdev->dev; in pxa2xx_flash_probe()
98 mtd_device_parse_register(info->mtd, probes, NULL, flash->parts, in pxa2xx_flash_probe()
109 mtd_device_unregister(info->mtd); in pxa2xx_flash_remove()
111 map_destroy(info->mtd); in pxa2xx_flash_remove()
124 if (info && mtd_suspend(info->mtd) == 0) in pxa2xx_flash_shutdown()
125 mtd_resume(info->mtd); in pxa2xx_flash_shutdown()
Damd76xrom.c42 struct mtd_info *mtd; member
85 mtd_device_unregister(map->mtd); in amd76xrom_cleanup()
86 map_destroy(map->mtd); in amd76xrom_cleanup()
223 map->mtd = do_map_probe(*probe_type, &map->map); in amd76xrom_init_one()
224 if (map->mtd) in amd76xrom_init_one()
232 if (map->mtd->size > map->map.size) { in amd76xrom_init_one()
235 (unsigned long long)map->mtd->size, map->map.size); in amd76xrom_init_one()
236 map->mtd->size = map->map.size; in amd76xrom_init_one()
246 map->rsrc.end = map->map.phys + map->mtd->size - 1; in amd76xrom_init_one()
264 map->mtd->owner = THIS_MODULE; in amd76xrom_init_one()
[all …]
Dsun_uflash.c41 struct mtd_info *mtd; /* mtd info */ member
93 up->mtd = do_map_probe("cfi_probe", &up->map); in uflash_devinit()
94 if (!up->mtd) { in uflash_devinit()
101 up->mtd->owner = THIS_MODULE; in uflash_devinit()
103 mtd_device_register(up->mtd, NULL, 0); in uflash_devinit()
127 if (up->mtd) { in uflash_remove()
128 mtd_device_unregister(up->mtd); in uflash_remove()
129 map_destroy(up->mtd); in uflash_remove()
Dck804xrom.c46 struct mtd_info *mtd; member
97 mtd_device_unregister(map->mtd); in ck804xrom_cleanup()
98 map_destroy(map->mtd); in ck804xrom_cleanup()
253 map->mtd = do_map_probe(*probe_type, &map->map); in ck804xrom_init_one()
254 if (map->mtd) in ck804xrom_init_one()
262 if (map->mtd->size > map->map.size) { in ck804xrom_init_one()
265 (unsigned long long)map->mtd->size, map->map.size); in ck804xrom_init_one()
266 map->mtd->size = map->map.size; in ck804xrom_init_one()
276 map->rsrc.end = map->map.phys + map->mtd->size - 1; in ck804xrom_init_one()
293 map->mtd->owner = THIS_MODULE; in ck804xrom_init_one()
[all …]
Dichxrom.c47 struct mtd_info *mtd; member
70 mtd_device_unregister(map->mtd); in ichxrom_cleanup()
71 map_destroy(map->mtd); in ichxrom_cleanup()
248 map->mtd = do_map_probe(*probe_type, &map->map); in ichxrom_init_one()
249 if (map->mtd) in ichxrom_init_one()
257 if (map->mtd->size > map->map.size) { in ichxrom_init_one()
260 (unsigned long long)map->mtd->size, map->map.size); in ichxrom_init_one()
261 map->mtd->size = map->map.size; in ichxrom_init_one()
271 map->rsrc.end = map->map.phys + map->mtd->size - 1; in ichxrom_init_one()
289 map->mtd->owner = THIS_MODULE; in ichxrom_init_one()
[all …]
Dlantiq-flash.c43 struct mtd_info *mtd; member
155 ltq_mtd->mtd = do_map_probe("cfi_probe", ltq_mtd->map); in ltq_mtd_probe()
158 if (!ltq_mtd->mtd) { in ltq_mtd_probe()
163 ltq_mtd->mtd->dev.parent = &pdev->dev; in ltq_mtd_probe()
170 err = mtd_device_parse_register(ltq_mtd->mtd, NULL, &ppdata, NULL, 0); in ltq_mtd_probe()
179 map_destroy(ltq_mtd->mtd); in ltq_mtd_probe()
188 if (ltq_mtd && ltq_mtd->mtd) { in ltq_mtd_remove()
189 mtd_device_unregister(ltq_mtd->mtd); in ltq_mtd_remove()
190 map_destroy(ltq_mtd->mtd); in ltq_mtd_remove()
Dixp4xx.c146 struct mtd_info *mtd; member
161 if (info->mtd) { in ixp4xx_flash_remove()
162 mtd_device_unregister(info->mtd); in ixp4xx_flash_remove()
163 map_destroy(info->mtd); in ixp4xx_flash_remove()
223 info->mtd = do_map_probe(plat->map_name, &info->map); in ixp4xx_flash_probe()
224 if (!info->mtd) { in ixp4xx_flash_probe()
229 info->mtd->dev.parent = &dev->dev; in ixp4xx_flash_probe()
234 err = mtd_device_parse_register(info->mtd, probes, &ppdata, in ixp4xx_flash_probe()
Desb2rom.c108 struct mtd_info *mtd; member
131 mtd_device_unregister(map->mtd); in esb2rom_cleanup()
132 map_destroy(map->mtd); in esb2rom_cleanup()
314 map->mtd = do_map_probe(*probe_type, &map->map); in esb2rom_init_one()
315 if (map->mtd) in esb2rom_init_one()
323 if (map->mtd->size > map->map.size) { in esb2rom_init_one()
326 (unsigned long long)map->mtd->size, map->map.size); in esb2rom_init_one()
327 map->mtd->size = map->map.size; in esb2rom_init_one()
337 map->rsrc.end = map->map.phys + map->mtd->size - 1; in esb2rom_init_one()
354 map->mtd->owner = THIS_MODULE; in esb2rom_init_one()
[all …]
Dtsunami_flash.c76 struct mtd_info *mtd; in cleanup_tsunami_flash() local
77 mtd = tsunami_flash_mtd; in cleanup_tsunami_flash()
78 if (mtd) { in cleanup_tsunami_flash()
79 mtd_device_unregister(mtd); in cleanup_tsunami_flash()
80 map_destroy(mtd); in cleanup_tsunami_flash()
Dlatch-addr-flash.c25 struct mtd_info *mtd; member
107 if (info->mtd != NULL) { in latch_addr_flash_remove()
108 mtd_device_unregister(info->mtd); in latch_addr_flash_remove()
109 map_destroy(info->mtd); in latch_addr_flash_remove()
189 for (probe_type = rom_probe_types; !info->mtd && *probe_type; in latch_addr_flash_probe()
191 info->mtd = do_map_probe(*probe_type, &info->map); in latch_addr_flash_probe()
193 if (info->mtd == NULL) { in latch_addr_flash_probe()
198 info->mtd->dev.parent = &dev->dev; in latch_addr_flash_probe()
200 mtd_device_parse_register(info->mtd, NULL, NULL, in latch_addr_flash_probe()
Dpci.c259 struct mtd_info *mtd = NULL; in mtd_pci_probe() local
285 mtd = do_map_probe(info->map_name, &map->map); in mtd_pci_probe()
287 if (!mtd) in mtd_pci_probe()
290 mtd->owner = THIS_MODULE; in mtd_pci_probe()
291 mtd_device_register(mtd, NULL, 0); in mtd_pci_probe()
293 pci_set_drvdata(dev, mtd); in mtd_pci_probe()
310 struct mtd_info *mtd = pci_get_drvdata(dev); in mtd_pci_remove() local
311 struct map_pci_info *map = mtd->priv; in mtd_pci_remove()
313 mtd_device_unregister(mtd); in mtd_pci_remove()
314 map_destroy(mtd); in mtd_pci_remove()
Dbfin-async-flash.c38 struct mtd_info *mtd; member
160 state->mtd = do_map_probe(memory->name, &state->map); in bfin_flash_probe()
161 if (!state->mtd) { in bfin_flash_probe()
167 mtd_device_parse_register(state->mtd, part_probe_types, NULL, in bfin_flash_probe()
179 mtd_device_unregister(state->mtd); in bfin_flash_remove()
180 map_destroy(state->mtd); in bfin_flash_remove()
Dpcmciamtd.c466 struct mtd_info *mtd = NULL; in pcmciamtd_config() local
568 mtd = do_map_probe("map_ram", &dev->pcmcia_map); in pcmciamtd_config()
570 mtd = do_map_probe("map_rom", &dev->pcmcia_map); in pcmciamtd_config()
574 mtd = do_map_probe(probes[i], &dev->pcmcia_map); in pcmciamtd_config()
575 if(mtd) in pcmciamtd_config()
582 if(!mtd) { in pcmciamtd_config()
588 dev->mtd_info = mtd; in pcmciamtd_config()
589 mtd->owner = THIS_MODULE; in pcmciamtd_config()
597 if(mtd->size < 1048576) { /* <1MiB in size, show size in KiB */ in pcmciamtd_config()
598 size = mtd->size >> 10; in pcmciamtd_config()
[all …]
Dgpio-addr-flash.c44 struct mtd_info *mtd; member
262 state->mtd = do_map_probe(memory->name, &state->map); in gpio_flash_probe()
263 if (!state->mtd) { in gpio_flash_probe()
269 state->mtd->dev.parent = &pdev->dev; in gpio_flash_probe()
271 mtd_device_parse_register(state->mtd, part_probe_types, NULL, in gpio_flash_probe()
284 mtd_device_unregister(state->mtd); in gpio_flash_remove()
285 map_destroy(state->mtd); in gpio_flash_remove()
/linux-4.4.14/drivers/media/pci/cobalt/
Dcobalt-flash.c100 struct mtd_info *mtd; in cobalt_flash_probe() local
109 mtd = do_map_probe("cfi_probe", map); in cobalt_flash_probe()
110 cobalt->mtd = mtd; in cobalt_flash_probe()
111 if (!mtd) { in cobalt_flash_probe()
116 mtd->owner = THIS_MODULE; in cobalt_flash_probe()
117 mtd->dev.parent = &cobalt->pci_dev->dev; in cobalt_flash_probe()
118 mtd_device_register(mtd, NULL, 0); in cobalt_flash_probe()
124 if (cobalt->mtd) { in cobalt_flash_remove()
125 mtd_device_unregister(cobalt->mtd); in cobalt_flash_remove()
126 map_destroy(cobalt->mtd); in cobalt_flash_remove()
/linux-4.4.14/drivers/mtd/nand/bcm47xxnflash/
Dops_bcm4706.c89 static void bcm47xxnflash_ops_bcm4706_read(struct mtd_info *mtd, uint8_t *buf, in bcm47xxnflash_ops_bcm4706_read() argument
92 struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; in bcm47xxnflash_ops_bcm4706_read()
139 static void bcm47xxnflash_ops_bcm4706_write(struct mtd_info *mtd, in bcm47xxnflash_ops_bcm4706_write() argument
142 struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; in bcm47xxnflash_ops_bcm4706_write()
173 static void bcm47xxnflash_ops_bcm4706_cmd_ctrl(struct mtd_info *mtd, int cmd, in bcm47xxnflash_ops_bcm4706_cmd_ctrl() argument
176 struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; in bcm47xxnflash_ops_bcm4706_cmd_ctrl()
194 static void bcm47xxnflash_ops_bcm4706_select_chip(struct mtd_info *mtd, in bcm47xxnflash_ops_bcm4706_select_chip() argument
200 static int bcm47xxnflash_ops_bcm4706_dev_ready(struct mtd_info *mtd) in bcm47xxnflash_ops_bcm4706_dev_ready() argument
202 struct nand_chip *nand_chip = (struct nand_chip *)mtd->priv; in bcm47xxnflash_ops_bcm4706_dev_ready()
215 static void bcm47xxnflash_ops_bcm4706_cmdfunc(struct mtd_info *mtd, in bcm47xxnflash_ops_bcm4706_cmdfunc() argument
[all …]
Dmain.c37 b47n->mtd.dev.parent = &pdev->dev; in bcm47xxnflash_probe()
38 b47n->mtd.priv = &b47n->nand_chip; /* Required */ in bcm47xxnflash_probe()
52 err = mtd_device_parse_register(&b47n->mtd, probes, NULL, NULL, 0); in bcm47xxnflash_probe()
65 if (nflash->mtd) in bcm47xxnflash_remove()
66 mtd_device_unregister(nflash->mtd); in bcm47xxnflash_remove()
Dbcm47xxnflash.h15 struct mtd_info mtd; member
/linux-4.4.14/Documentation/DocBook/
D.mtdnand.xml.cmd2 …e/linux/mtd/nand.h drivers/mtd/nand/nand_base.c drivers/mtd/nand/nand_bbt.c drivers/mtd/nand/nand_…
/linux-4.4.14/drivers/staging/mt29f_spinand/
Dmt29f_spinand.c32 static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd) in mtd_to_state() argument
34 struct nand_chip *chip = (struct nand_chip *)mtd->priv; in mtd_to_state()
614 static int spinand_write_page_hwecc(struct mtd_info *mtd, in spinand_write_page_hwecc() argument
624 chip->write_buf(mtd, p, eccsize * eccsteps); in spinand_write_page_hwecc()
628 static int spinand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, in spinand_read_page_hwecc() argument
640 chip->read_buf(mtd, p, eccsize * eccsteps); in spinand_read_page_hwecc()
642 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); in spinand_read_page_hwecc()
647 dev_err(&mtd->dev, in spinand_read_page_hwecc()
655 mtd->ecc_stats.failed++; in spinand_read_page_hwecc()
658 mtd->ecc_stats.corrected++; in spinand_read_page_hwecc()
[all …]
Dmt29f_spinand.h104 int spinand_mtd(struct mtd_info *mtd);
105 void spinand_mtd_release(struct mtd_info *mtd);
/linux-4.4.14/drivers/mtd/nand/brcmnand/
Dbrcmnand.c182 struct mtd_info mtd; member
907 static void brcmnand_wp(struct mtd_info *mtd, int wp) in brcmnand_wp() argument
909 struct nand_chip *chip = mtd->priv; in brcmnand_wp()
1067 static void brcmnand_cmd_ctrl(struct mtd_info *mtd, int dat, in brcmnand_cmd_ctrl() argument
1073 static int brcmnand_waitfunc(struct mtd_info *mtd, struct nand_chip *this) in brcmnand_waitfunc() argument
1075 struct nand_chip *chip = mtd->priv; in brcmnand_waitfunc()
1110 struct mtd_info *mtd = &host->mtd; in brcmnand_low_level_op() local
1143 return brcmnand_waitfunc(mtd, chip); in brcmnand_low_level_op()
1146 static void brcmnand_cmdfunc(struct mtd_info *mtd, unsigned command, in brcmnand_cmdfunc() argument
1149 struct nand_chip *chip = mtd->priv; in brcmnand_cmdfunc()
[all …]
/linux-4.4.14/Documentation/devicetree/bindings/mtd/
Dmtd-physmap.txt6 - compatible : should contain the specific model of mtd chip(s)
8 "mtd-ram" or "mtd-rom".
9 - reg : Address range(s) of the mtd chip(s)
14 - device-width : (optional) Width of a single mtd chip. If
26 - linux,mtd-name: allow to specify the mtd name for retro capability with
27 physmap-flash drivers as boot loader pass the mtd partition via the old
85 compatible = "samsung,k6f1616u6a", "mtd-ram";
Dgpmc-nor.txt13 - compatible: Documentation/devicetree/bindings/mtd/mtd-physmap.txt
24 - linux,mtd-name: Documentation/devicetree/bindings/mtd/mtd-physmap.txt
53 linux,mtd-name= "intel,pf48f6000m0y1be";
Dpartition.txt3 Partitions can be represented by sub-nodes of an mtd device. This can be used
8 The partition table should be a subnode of the mtd node and should be named
13 For backwards compatibility partitions as direct subnodes of the mtd device are
19 mtd device. There are two valid values for both:
26 - reg : The partition's offset and size within the mtd bank.
/linux-4.4.14/arch/arm/mach-ep93xx/
Dsnappercl15.c49 static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, in snappercl15_nand_cmd_ctrl() argument
52 struct nand_chip *chip = mtd->priv; in snappercl15_nand_cmd_ctrl()
77 static int snappercl15_nand_dev_ready(struct mtd_info *mtd) in snappercl15_nand_dev_ready() argument
79 struct nand_chip *chip = mtd->priv; in snappercl15_nand_dev_ready()
Dts72xx.c74 static void ts72xx_nand_hwcontrol(struct mtd_info *mtd, in ts72xx_nand_hwcontrol() argument
77 struct nand_chip *chip = mtd->priv; in ts72xx_nand_hwcontrol()
97 static int ts72xx_nand_device_ready(struct mtd_info *mtd) in ts72xx_nand_device_ready() argument
99 struct nand_chip *chip = mtd->priv; in ts72xx_nand_device_ready()
/linux-4.4.14/fs/jffs2/
Dwbuf.c237 ret = mtd_read(c->mtd, ofs, c->wbuf_pagesize, &retlen, c->wbuf_verify); in jffs2_verify_write()
288 if (c->wbuf_ofs % c->mtd->erasesize) in jffs2_wbuf_recover()
348 ret = mtd_read(c->mtd, start, c->wbuf_ofs - start, &retlen, in jffs2_wbuf_recover()
425 mtd_write(c->mtd, ofs, towrite, &retlen, brokenbuf); in jffs2_wbuf_recover()
429 ret = mtd_write(c->mtd, ofs, towrite, &retlen, in jffs2_wbuf_recover()
632 mtd_write(c->mtd, c->wbuf_ofs, c->wbuf_pagesize, &retlen, in __jffs2_flush_wbuf()
638 ret = mtd_write(c->mtd, c->wbuf_ofs, c->wbuf_pagesize, in __jffs2_flush_wbuf()
876 ret = mtd_write(c->mtd, outvec_to, PAGE_DIV(vlen), in jffs2_flash_writev()
963 return mtd_read(c->mtd, ofs, len, retlen, buf); in jffs2_flash_read()
967 ret = mtd_read(c->mtd, ofs, len, retlen, buf); in jffs2_flash_read()
[all …]
Dos-linux.h79 #define jffs2_flash_read(c, ofs, len, retlen, buf) (mtd_read((c)->mtd, ofs, len, retlen, buf))
107 #define jffs2_can_mark_obsolete(c) (c->mtd->flags & (MTD_BIT_WRITEABLE))
110 #define jffs2_cleanmarker_oob(c) (c->mtd->type == MTD_NANDFLASH)
129 #define jffs2_dataflash(c) (c->mtd->type == MTD_DATAFLASH)
132 #define jffs2_ubivol(c) (c->mtd->type == MTD_UBIVOLUME)
136 #define jffs2_nor_wbuf_flash(c) (c->mtd->type == MTD_NORFLASH && ! (c->mtd->flags & MTD_BIT_WRITEAB…
Dwritev.c29 return mtd_writev(c->mtd, vecs, count, to, retlen); in jffs2_flash_direct_writev()
36 ret = mtd_write(c->mtd, ofs, len, retlen, buf); in jffs2_flash_direct_write()
Derase.c70 instr->mtd = c->mtd; in jffs2_erase_block()
79 ret = mtd_erase(c->mtd, instr); in jffs2_erase_block()
348 ret = mtd_point(c->mtd, jeb->offset, c->sector_size, &retlen, in jffs2_block_check_erase()
359 mtd_unpoint(c->mtd, jeb->offset, retlen); in jffs2_block_check_erase()
368 mtd_unpoint(c->mtd, jeb->offset, c->sector_size); in jffs2_block_check_erase()
394 ret = mtd_read(c->mtd, ofs, readlen, &retlen, ebuf); in jffs2_block_check_erase()
Dsuper.c224 if (opt > c->mtd->size) { in jffs2_parse_options()
226 "is %llu KB\n", c->mtd->size / 1024); in jffs2_parse_options()
283 c->mtd = sb->s_mtd; in jffs2_fill_super()
341 mtd_sync(c->mtd); in jffs2_put_super()
/linux-4.4.14/drivers/firmware/broadcom/
Dbcm47xx_nvram.c147 struct mtd_info *mtd; in nvram_init() local
152 mtd = get_mtd_device_nm("nvram"); in nvram_init()
153 if (IS_ERR(mtd)) in nvram_init()
156 err = mtd_read(mtd, 0, sizeof(header), &bytes_read, (uint8_t *)&header); in nvram_init()
166 err = mtd_read(mtd, 0, nvram_len, &nvram_len, in nvram_init()
/linux-4.4.14/arch/arm/mach-omap1/
Dboard-nand.c23 void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in omap1_nand_cmd_ctl() argument
25 struct nand_chip *this = mtd->priv; in omap1_nand_cmd_ctl()
Dcommon.h86 extern void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd,
/linux-4.4.14/include/uapi/mtd/
DKbuild3 header-y += mtd-abi.h
4 header-y += mtd-user.h
Dmtd-abi.h279 static inline int mtd_type_is_nand_user(const struct mtd_info_user *mtd) in mtd_type_is_nand_user() argument
281 return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH; in mtd_type_is_nand_user()
/linux-4.4.14/arch/arm/mach-imx/
Dmach-qong.c132 static void qong_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in qong_nand_cmd_ctrl() argument
134 struct nand_chip *nand_chip = mtd->priv; in qong_nand_cmd_ctrl()
148 static int qong_nand_device_ready(struct mtd_info *mtd) in qong_nand_device_ready() argument
153 static void qong_nand_select_chip(struct mtd_info *mtd, int chip) in qong_nand_select_chip() argument
/linux-4.4.14/arch/arm/mach-orion5x/
Dts78xx-setup.c176 static void ts78xx_ts_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, in ts78xx_ts_nand_cmd_ctrl() argument
179 struct nand_chip *this = mtd->priv; in ts78xx_ts_nand_cmd_ctrl()
195 static int ts78xx_ts_nand_dev_ready(struct mtd_info *mtd) in ts78xx_ts_nand_dev_ready() argument
200 static void ts78xx_ts_nand_write_buf(struct mtd_info *mtd, in ts78xx_ts_nand_write_buf() argument
203 struct nand_chip *chip = mtd->priv; in ts78xx_ts_nand_write_buf()
227 static void ts78xx_ts_nand_read_buf(struct mtd_info *mtd, in ts78xx_ts_nand_read_buf() argument
230 struct nand_chip *chip = mtd->priv; in ts78xx_ts_nand_read_buf()
/linux-4.4.14/Documentation/arm/Samsung-S3C24XX/
DEB2410ITX.txt40 The NAND and NOR support has been merged from the linux-mtd project.
41 Any problems, see http://www.linux-mtd.infradead.org/ for more
42 information or up-to-date versions of linux-mtd.
/linux-4.4.14/arch/cris/arch-v32/drivers/mach-a3/
Dnandflash.c50 static void crisv32_hwcontrol(struct mtd_info *mtd, int cmd, in crisv32_hwcontrol() argument
55 struct nand_chip *this = mtd->priv; in crisv32_hwcontrol()
96 static int crisv32_device_ready(struct mtd_info *mtd) in crisv32_device_ready() argument
/linux-4.4.14/arch/cris/arch-v32/drivers/mach-fs/
Dnandflash.c49 static void crisv32_hwcontrol(struct mtd_info *mtd, int cmd, in crisv32_hwcontrol() argument
54 struct nand_chip *this = mtd->priv; in crisv32_hwcontrol()
91 static int crisv32_device_ready(struct mtd_info *mtd) in crisv32_device_ready() argument
/linux-4.4.14/arch/mips/rb532/
Ddevices.c144 static int rb532_dev_ready(struct mtd_info *mtd) in rb532_dev_ready() argument
149 static void rb532_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in rb532_cmd_ctrl() argument
151 struct nand_chip *chip = mtd->priv; in rb532_cmd_ctrl()
/linux-4.4.14/arch/arm/boot/dts/
Dimx27-phytec-phycore-som.dtsi334 linux,mtd-name = "physmap-flash.0";
341 compatible = "mtd-ram";
344 linux,mtd-name = "mtd-ram.0";
Domap3430-sdp.dts59 linux,mtd-name= "intel,pf48f6000m0y1be";
106 linux,mtd-name= "micron,mt29f1g08abb";
150 linux,mtd-name= "samsung,kfm2g16q2m-deb8";
/linux-4.4.14/arch/mips/pnx833x/common/
Dplatform.c181 pnx833x_flash_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in pnx833x_flash_nand_cmd_ctrl() argument
183 struct nand_chip *this = mtd->priv; in pnx833x_flash_nand_cmd_ctrl()
/linux-4.4.14/include/linux/platform_data/
Dmtd-orion_nand.h15 int (*dev_ready)(struct mtd_info *mtd);
/linux-4.4.14/arch/arm/include/asm/mach/
Dflash.h34 void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
/linux-4.4.14/arch/mips/cobalt/
DMakefile5 obj-y := buttons.o irq.o lcd.o led.o mtd.o reset.o rtc.o serial.o setup.o time.o
/linux-4.4.14/arch/blackfin/mach-bf561/boards/
Dacvilon.c267 static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, in bfin_plat_nand_cmd_ctrl() argument
270 struct nand_chip *this = mtd->priv; in bfin_plat_nand_cmd_ctrl()
282 static int bfin_plat_nand_dev_ready(struct mtd_info *mtd) in bfin_plat_nand_dev_ready() argument
/linux-4.4.14/arch/arm/mach-pxa/
Dballoon3.c573 static void balloon3_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in balloon3_nand_cmd_ctl() argument
575 struct nand_chip *this = mtd->priv; in balloon3_nand_cmd_ctl()
602 static void balloon3_nand_select_chip(struct mtd_info *mtd, int chip) in balloon3_nand_select_chip() argument
618 static int balloon3_nand_dev_ready(struct mtd_info *mtd) in balloon3_nand_dev_ready() argument
/linux-4.4.14/include/uapi/
DKbuild9 header-y += mtd/

12