Home
last modified time | relevance | path

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

12345678910>>...26

/openbmc/u-boot/drivers/mtd/
H A Dmtdcore.c195 return mtd ? mtd_suspend(mtd) : 0; in mtd_cls_suspend()
479 dev_set_drvdata(&mtd->dev, mtd); in add_mtd_device()
554 mtd->index, mtd->name, mtd->usecount); in del_mtd_device()
732 if (mtd && mtd != ret) in get_mtd_device()
759 err = mtd->_get_device(mtd); in __get_mtd_device()
844 if (!mtd->_block_isbad(mtd, offset & ~(mtd->erasesize - 1))) in mtd_get_len_incl_bad()
868 mtd->_put_device(mtd); in __put_mtd_device()
893 return mtd->_erase(mtd, instr); in mtd_erase()
1580 return mtd->_lock(mtd, ofs, len); in mtd_lock()
1592 return mtd->_unlock(mtd, ofs, len); in mtd_unlock()
[all …]
H A Dcfi_mtd.c25 flash_info_t *fi = mtd->priv; in cfi_mtd_erase()
155 mtd->numeraseregions = 0; in cfi_mtd_set_erasesize()
204 struct mtd_info *mtd; in cfi_mtd_init() local
214 mtd = &cfi_mtd_info[i]; in cfi_mtd_init()
226 mtd->size = fi->size; in cfi_mtd_init()
227 mtd->writesize = 1; in cfi_mtd_init()
228 mtd->writebufsize = mtd->writesize; in cfi_mtd_init()
236 mtd->priv = fi; in cfi_mtd_init()
238 if (add_mtd_device(mtd)) in cfi_mtd_init()
254 if (mtd == NULL) in cfi_mtd_init()
[all …]
H A Daltera_qspi.c63 struct mtd_info *mtd = info->mtd; in flash_print_info() local
85 struct mtd_info *mtd = info->mtd; in flash_erase() local
90 instr.mtd = mtd; in flash_erase()
105 struct mtd_info *mtd = info->mtd; in write_buff() local
249 *len = mtd->size; in altera_qspi_get_locked_range()
266 num_sectors = mtd->size / mtd->erasesize; in altera_qspi_lock()
317 mtd->dev = dev; in altera_qspi_probe()
318 mtd->name = "nor0"; in altera_qspi_probe()
323 mtd->writebufsize = mtd->writesize; in altera_qspi_probe()
335 flash->mtd = mtd; in altera_qspi_probe()
[all …]
H A Dmtdpart.c296 res = mtd->parent->_read(mtd->parent, from + mtd->offset, len, in part_read()
311 return mtd->parent->_point(mtd->parent, from + mtd->offset, len, in part_point()
317 return mtd->parent->_unpoint(mtd->parent, from + mtd->offset, len); in part_unpoint()
357 res = mtd->parent->_read_oob(mtd->parent, from + mtd->offset, ops); in part_read_oob()
398 return mtd->parent->_write(mtd->parent, to + mtd->offset, len, in part_write()
405 return mtd->parent->_panic_write(mtd->parent, to + mtd->offset, len, in part_panic_write()
416 return mtd->parent->_write_oob(mtd->parent, to + mtd->offset, ops); in part_write_oob()
469 return mtd->parent->_lock(mtd->parent, ofs + mtd->offset, len); in part_lock()
474 return mtd->parent->_unlock(mtd->parent, ofs + mtd->offset, len); in part_unlock()
484 mtd->parent->_sync(mtd->parent); in part_sync()
[all …]
/openbmc/linux/include/linux/mtd/
H A Dmtd.h405 while (mtd->parent) in mtd_get_master()
406 mtd = mtd->parent; in mtd_get_master()
408 return mtd; in mtd_get_master()
413 while (mtd->parent) { in mtd_get_master_ofs()
415 mtd = mtd->parent; in mtd_get_master_ofs()
423 return mtd->parent; in mtd_is_partition()
464 mtd->dev.of_node = np; in mtd_set_of_node()
465 if (!mtd->name) in mtd_set_of_node()
476 return ops->mode == MTD_OPS_AUTO_OOB ? mtd->oobavail : mtd->oobsize; in mtd_oobavail()
642 return mtd_div_by_ws(mtd_mod_by_eb(offs, mtd), mtd); in mtd_offset_to_wunit()
[all …]
/openbmc/u-boot/include/linux/mtd/
H A Dmtd.h46 struct mtd_info *mtd; member
361 return mtd->parent; in mtd_is_partition()
397 return ops->mode == MTD_OPS_AUTO_OOB ? mtd->oobavail : mtd->oobsize; in mtd_oobavail()
437 if (mtd->_sync) in mtd_sync()
438 mtd->_sync(mtd); in mtd_sync()
451 return mtd->_suspend ? mtd->_suspend(mtd) : 0; in mtd_suspend()
456 if (mtd->_resume) in mtd_resume()
457 mtd->_resume(mtd); in mtd_resume()
493 return mtd->_read_oob && mtd->_write_oob; in mtd_has_oob()
498 return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH; in mtd_type_is_nand()
[all …]
/openbmc/linux/drivers/mtd/
H A Dmtdcore.c47 return mtd ? mtd_suspend(mtd) : 0; in mtd_cls_suspend()
124 memset(&mtd->dev, 0, sizeof(mtd->dev)); in mtd_device_release()
419 mtd->_reboot(mtd); in mtd_reboot_notifier()
664 (mtd->_read && mtd->_read_oob))) in add_mtd_device()
744 dev_set_drvdata(&mtd->dev, mtd); in add_mtd_device()
777 mtd->index, mtd->name); in add_mtd_device()
1218 if (mtd && mtd != ret) in get_mtd_device()
1257 mtd = mtd->parent; in __get_mtd_device()
1496 mtd = mtd->parent; in mtd_update_ecc_stats()
2345 mtd = mtd->parent; in mtd_block_markbad()
[all …]
H A Dmtdpstore.c30 struct mtd_info *mtd = cxt->mtd; in mtdpstore_block_isbad() local
52 struct mtd_info *mtd = cxt->mtd; in mtdpstore_panic_block_isbad() local
63 struct mtd_info *mtd = cxt->mtd; in mtdpstore_mark_used() local
73 struct mtd_info *mtd = cxt->mtd; in mtdpstore_mark_unused() local
83 struct mtd_info *mtd = cxt->mtd; in mtdpstore_block_mark_unused() local
110 struct mtd_info *mtd = cxt->mtd; in mtdpstore_block_is_used() local
128 struct mtd_info *mtd = cxt->mtd; in mtdpstore_is_empty() local
142 struct mtd_info *mtd = cxt->mtd; in mtdpstore_mark_removed() local
152 struct mtd_info *mtd = cxt->mtd; in mtdpstore_block_clear_removed() local
168 struct mtd_info *mtd = cxt->mtd; in mtdpstore_block_is_removed() local
[all …]
/openbmc/u-boot/drivers/mtd/nand/raw/
H A Dmxs_nand_spl.c11 static struct mtd_info *mtd; variable
47 if (chip->dev_ready(mtd)) in mxs_nand_command()
105 if (chip->read_byte(mtd) != 'O' || chip->read_byte(mtd) != 'N' || in mxs_flash_onfi_ident()
106 chip->read_byte(mtd) != 'F' || chip->read_byte(mtd) != 'I') { in mxs_flash_onfi_ident()
113 mtd->name = p->model; in mxs_flash_onfi_ident()
115 mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize; in mxs_flash_onfi_ident()
169 chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page); in is_badblock()
171 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); in is_badblock()
219 nand_page_per_block = mtd->erasesize / mtd->writesize; in nand_spl_load_image()
227 sz += mtd->writesize; in nand_spl_load_image()
[all …]
H A Dnand_util.c71 erase.mtd = mtd; in nand_erase_opts()
232 chip->cmdfunc(mtd, in nand_lock()
454 l = (l + mtd->writesize - 1) / mtd->writesize; in drop_ffs()
482 size_t verlen = mtd->writesize + mtd->oobsize; in nand_verify_page_oob()
640 if (nand_block_isbad(mtd, offset & ~(mtd->erasesize - 1))) { in nand_write_skip_bad()
756 if (nand_block_isbad(mtd, offset & ~(mtd->erasesize - 1))) { in nand_read_skip_bad()
822 .mtd = mtd, in nand_torture()
835 if (offset + mtd->erasesize > mtd->size) { in nand_torture()
857 err = mtd_read(mtd, offset, mtd->erasesize, &retlen, buf); in nand_torture()
874 err = mtd_write(mtd, offset, mtd->erasesize, &retlen, buf); in nand_torture()
[all …]
H A Dvf610_nfc.c213 vf610_nfc_write(mtd, reg, vf610_nfc_read(mtd, reg) | bits); in vf610_nfc_set()
218 vf610_nfc_write(mtd, reg, vf610_nfc_read(mtd, reg) & ~bits); in vf610_nfc_clear()
396 trfr_sz += mtd->writesize + mtd->oobsize; in vf610_nfc_command()
468 l = min_t(uint, len, mtd->writesize + mtd->oobsize - c); in vf610_nfc_write_buf()
570 vf610_nfc_read_buf(mtd, oob, mtd->oobsize); in vf610_nfc_correct_data()
596 vf610_nfc_read_buf(mtd, chip->oob_poi, mtd->oobsize); in vf610_nfc_read_page()
617 vf610_nfc_write_buf(mtd, buf, mtd->writesize); in vf610_nfc_write_page()
619 vf610_nfc_write_buf(mtd, chip->oob_poi, mtd->oobsize); in vf610_nfc_write_page()
622 nfc->write_sz = mtd->writesize + mtd->oobsize; in vf610_nfc_write_page()
703 if (mtd->writesize + mtd->oobsize > PAGE_2K + OOB_MAX - 8) { in vf610_nfc_nand_init()
[all …]
H A Dnand_base.c355 ofs += mtd->erasesize - mtd->writesize; in nand_block_bad()
415 ofs += mtd->erasesize - mtd->writesize; in nand_default_block_markbad()
455 einfo.mtd = mtd; in nand_block_markbad_lowlevel()
1223 chip->read_buf(mtd, buf, mtd->writesize); in nand_read_page_raw()
2157 chip->write_buf(mtd, buf, mtd->writesize); in nand_write_page_raw()
3270 mtd->erasesize *= mtd->writesize; in nand_flash_detect_onfi()
3373 mtd->erasesize *= mtd->writesize; in nand_flash_detect_jedec()
3596 mtd->oobsize = 32 * mtd->writesize >> 9; in nand_decode_ext_id()
3615 mtd->oobsize = mtd->writesize / 32; in nand_decode_id()
3875 mtd->erasesize >> 10, mtd->writesize, mtd->oobsize); in nand_get_flash_type()
[all …]
H A Dnand_spl_simple.c13 static struct mtd_info *mtd; variable
31 while (!this->dev_ready(mtd)) in nand_command()
53 while (!this->dev_ready(mtd)) in nand_command()
70 while (!this->dev_ready(mtd)) in nand_command()
87 hwctrl(mtd, offs & 0xff, in nand_command()
100 hwctrl(mtd, NAND_CMD_READSTART, in nand_command()
107 while (!this->dev_ready(mtd)) in nand_command()
126 this->read_buf(mtd, bb_data, 2); in nand_is_bad_block()
130 this->read_buf(mtd, bb_data, 1); in nand_is_bad_block()
217 mtd = nand_to_mtd(&nand_chip); in nand_init()
[all …]
/openbmc/u-boot/cmd/
H A Dmtd.c22 struct mtd_info *mtd; in get_mtd_by_name() local
27 if (IS_ERR_OR_NULL(mtd)) in get_mtd_by_name()
29 PTR_ERR(mtd)); in get_mtd_by_name()
31 return mtd; in get_mtd_by_name()
121 if (mtd->dev) { in mtd_show_device()
161 if (mtd->oobsize) { in mtd_show_device()
174 mtd->offset, mtd->offset + mtd->size, mtd->name); in mtd_show_device()
260 if (mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH) in do_mtd_io()
291 default_len = dump ? mtd->writesize : mtd->size; in do_mtd_io()
424 erase_op.mtd = mtd; in do_mtd_erase()
[all …]
H A Dnand.c120 if (!mtd) in set_dev()
168 for (off = 0; off < mtd->size; off += mtd->erasesize) { in do_nand_status()
255 ret = mtd->write_oob(mtd, ENV_OFFSET_SIZE, &ops); in do_nand_env_oob()
291 if (!mtd) in nand_print_and_set_info()
299 mtd->name, mtd->erasesize >> 10); in nand_print_and_set_info()
342 addr += mtd->writesize + mtd->oobsize; in raw_access()
440 if (!mtd) { in do_nand()
447 for (off = 0; off < mtd->size; off += mtd->erasesize) in do_nand()
589 rwsize = pagecount * (mtd->writesize + mtd->oobsize); in do_nand()
867 r = nand_read_skip_bad(mtd, offset, &cnt, NULL, mtd->size, in nand_load_image()
[all …]
/openbmc/linux/drivers/mtd/nand/onenand/
H A Donenand_base.c1386 this->command(mtd, readcmd, from, mtd->oobsize); in onenand_read_oob_nolock()
1573 this->command(mtd, readcmd, from, mtd->oobsize); in onenand_bbt_read_oob()
1621 this->command(mtd, readcmd, to, mtd->oobsize); in onenand_verify_oob()
1750 this->command(mtd, ONENAND_CMD_PROG, to, mtd->writesize); in onenand_panic_write()
1918 this->command(mtd, cmd, to, mtd->writesize); in onenand_write_ops_nolock()
2027 this->command(mtd, ONENAND_CMD_BUFFERRAM, to, mtd->oobsize); in onenand_write_oob_nolock()
2045 this->command(mtd, oobcmd, to, mtd->oobsize); in onenand_write_oob_nolock()
3750 mtd->oobsize = mtd->writesize >> 5; in onenand_probe()
3752 mtd->erasesize = mtd->writesize << 6; in onenand_probe()
3933 this->subpagesize = mtd->writesize >> mtd->subpage_sft; in onenand_scan()
[all …]
/openbmc/linux/drivers/mtd/nand/raw/
H A Dmpc5121_nfc.c142 nfc_write(mtd, reg, nfc_read(mtd, reg) | bits); in nfc_set()
148 nfc_write(mtd, reg, nfc_read(mtd, reg) & ~bits); in nfc_clear()
156 mpc5121_nfc_done(mtd); in mpc5121_nfc_send_addr()
164 mpc5121_nfc_done(mtd); in mpc5121_nfc_send_cmd()
172 mpc5121_nfc_done(mtd); in mpc5121_nfc_send_prog_page()
180 mpc5121_nfc_done(mtd); in mpc5121_nfc_send_read_page()
188 mpc5121_nfc_done(mtd); in mpc5121_nfc_send_read_id()
416 sbsize = (mtd->oobsize / (mtd->writesize / 512)) & ~1; in mpc5121_nfc_copy_spare()
755 nfc_write(mtd, NFC_SPAS, mtd->oobsize >> 1); in mpc5121_nfc_probe()
759 mtd); in mpc5121_nfc_probe()
[all …]
/openbmc/u-boot/drivers/mtd/onenand/
H A Donenand_base.c1047 this->command(mtd, readcmd, from, mtd->oobsize); in onenand_read_oob_nolock()
1245 this->command(mtd, readcmd, from, mtd->oobsize); in onenand_bbt_read_oob()
1295 this->command(mtd, readcmd, to, mtd->oobsize); in onenand_verify_oob()
1483 this->command(mtd, ONENAND_CMD_PROG, to, mtd->writesize); in onenand_write_ops_nolock()
1587 this->command(mtd, ONENAND_CMD_BUFFERRAM, to, mtd->oobsize); in onenand_write_oob_nolock()
1605 this->command(mtd, oobcmd, to, mtd->oobsize); in onenand_write_oob_nolock()
2629 mtd->oobsize = mtd->writesize >> 5; in onenand_probe()
2631 mtd->erasesize = mtd->writesize << 6; in onenand_probe()
2643 this->page_mask = (mtd->erasesize / mtd->writesize) - 1; in onenand_probe()
2664 mtd->writebufsize = mtd->writesize; in onenand_probe()
[all …]
/openbmc/linux/drivers/mtd/ubi/
H A Dgluebi.c44 struct mtd_info mtd; member
92 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_get_device()
134 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_put_device()
159 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_read()
199 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_write()
202 if (len % mtd->writesize || offs % mtd->writesize) in gluebi_write()
244 gluebi = container_of(mtd, struct gluebi_device, mtd); in gluebi_erase()
288 mtd = &gluebi->mtd; in gluebi_create()
290 if (!mtd->name) { in gluebi_create()
368 mtd = &gluebi->mtd; in gluebi_remove()
[all …]
/openbmc/linux/drivers/mtd/chips/
H A Dmap_ram.c37 struct mtd_info *mtd; in map_ram_probe() local
60 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_ram_probe()
61 if (!mtd) in map_ram_probe()
65 mtd->priv = map; in map_ram_probe()
66 mtd->name = map->name; in map_ram_probe()
67 mtd->type = MTD_RAM; in map_ram_probe()
68 mtd->size = map->size; in map_ram_probe()
77 mtd->writesize = 1; in map_ram_probe()
80 while(mtd->size & (mtd->erasesize - 1)) in map_ram_probe()
81 mtd->erasesize >>= 1; in map_ram_probe()
[all …]
H A Dmap_rom.c46 struct mtd_info *mtd; in map_rom_probe() local
48 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_rom_probe()
49 if (!mtd) in map_rom_probe()
53 mtd->priv = map; in map_rom_probe()
54 mtd->name = map->name; in map_rom_probe()
55 mtd->type = MTD_ROM; in map_rom_probe()
56 mtd->size = map->size; in map_rom_probe()
61 mtd->_sync = maprom_nop; in map_rom_probe()
65 mtd->writesize = 1; in map_rom_probe()
66 mtd->writebufsize = 1; in map_rom_probe()
[all …]
H A Dmap_absent.c47 struct mtd_info *mtd; in map_absent_probe() local
49 mtd = kzalloc(sizeof(*mtd), GFP_KERNEL); in map_absent_probe()
50 if (!mtd) { in map_absent_probe()
55 mtd->priv = map; in map_absent_probe()
56 mtd->name = map->name; in map_absent_probe()
57 mtd->type = MTD_ABSENT; in map_absent_probe()
58 mtd->size = map->size; in map_absent_probe()
63 mtd->flags = 0; in map_absent_probe()
64 mtd->erasesize = PAGE_SIZE; in map_absent_probe()
65 mtd->writesize = 1; in map_absent_probe()
[all …]
/openbmc/linux/drivers/mtd/devices/
H A Dmtdram.c68 *virt = mtd->priv + from; in ram_point()
127 memset(mtd, 0, sizeof(*mtd)); in mtdram_init_device()
130 mtd->name = name; in mtdram_init_device()
131 mtd->type = MTD_RAM; in mtdram_init_device()
132 mtd->flags = MTD_CAP_RAM; in mtdram_init_device()
133 mtd->size = size; in mtdram_init_device()
134 mtd->writesize = 1; in mtdram_init_device()
140 mtd->_erase = ram_erase; in mtdram_init_device()
141 mtd->_point = ram_point; in mtdram_init_device()
143 mtd->_read = ram_read; in mtdram_init_device()
[all …]
/openbmc/linux/drivers/mtd/tests/
H A Doobtest.c356 if (IS_ERR(mtd)) { in mtd_oobtest_init()
367 tmp = mtd->size; in mtd_oobtest_init()
370 pgcnt = mtd->erasesize / mtd->writesize; in mtd_oobtest_init()
375 (unsigned long long)mtd->size, mtd->erasesize, in mtd_oobtest_init()
376 mtd->writesize, ebcnt, pgcnt, mtd->oobsize); in mtd_oobtest_init()
551 err = mtd_write_oob(mtd, mtd->size - mtd->writesize, &ops); in mtd_oobtest_init()
570 err = mtd_read_oob(mtd, mtd->size - mtd->writesize, &ops); in mtd_oobtest_init()
596 err = mtd_write_oob(mtd, mtd->size - mtd->writesize, &ops); in mtd_oobtest_init()
615 err = mtd_read_oob(mtd, mtd->size - mtd->writesize, &ops); in mtd_oobtest_init()
644 addr = (loff_t)(i + 1) * mtd->erasesize - mtd->writesize; in mtd_oobtest_init()
[all …]
H A Dstresstest.c32 static struct mtd_info *mtd; variable
73 if (offs >= mtd->erasesize) in do_read()
74 offs -= mtd->erasesize; in do_read()
113 offs -= mtd->erasesize; in do_write()
145 if (IS_ERR(mtd)) { in mtd_stresstest_init()
146 err = PTR_ERR(mtd); in mtd_stresstest_init()
151 if (mtd->writesize == 1) { in mtd_stresstest_init()
156 pgsize = mtd->writesize; in mtd_stresstest_init()
158 tmp = mtd->size; in mtd_stresstest_init()
166 (unsigned long long)mtd->size, mtd->erasesize, in mtd_stresstest_init()
[all …]

12345678910>>...26