/u-boot/include/linux/mtd/ |
A D | mtd.h | 46 struct mtd_info *mtd; member 360 return mtd->parent; in mtd_is_partition() 396 return ops->mode == MTD_OPS_AUTO_OOB ? mtd->oobavail : mtd->oobsize; in mtd_oobavail() 436 if (mtd->_sync) in mtd_sync() 437 mtd->_sync(mtd); in mtd_sync() 450 return mtd->_suspend ? mtd->_suspend(mtd) : 0; in mtd_suspend() 455 if (mtd->_resume) in mtd_resume() 456 mtd->_resume(mtd); in mtd_resume() 492 return mtd->_read_oob && mtd->_write_oob; in mtd_has_oob() 497 return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH; in mtd_type_is_nand() [all …]
|
/u-boot/drivers/mtd/nand/raw/ |
A D | mxs_nand_spl.c | 17 static struct mtd_info *mtd; variable 59 if (chip->dev_ready(mtd)) in mxs_nand_command() 117 if (chip->read_byte(mtd) != 'O' || chip->read_byte(mtd) != 'N' || in mxs_flash_onfi_ident() 118 chip->read_byte(mtd) != 'F' || chip->read_byte(mtd) != 'I') { in mxs_flash_onfi_ident() 125 mtd->name = p->model; in mxs_flash_onfi_ident() 127 mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize; in mxs_flash_onfi_ident() 181 chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page); in is_badblock() 183 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); in is_badblock() 216 nand_chip.scan_bbt(mtd); in nand_init() 217 mxs_nand_setup_ecc(mtd); in nand_init() [all …]
|
A D | nand_util.c | 74 erase.mtd = mtd; in nand_erase_opts() 78 mtd->erasesize); in nand_erase_opts() 235 chip->cmdfunc(mtd, in nand_lock() 457 l = (l + mtd->writesize - 1) / mtd->writesize; in drop_ffs() 485 size_t verlen = mtd->writesize + mtd->oobsize; in nand_verify_page_oob() 759 if (nand_block_isbad(mtd, offset & ~(mtd->erasesize - 1))) { in nand_read_skip_bad() 825 .mtd = mtd, in nand_torture() 838 if (offset + mtd->erasesize > mtd->size) { in nand_torture() 860 err = mtd_read(mtd, offset, mtd->erasesize, &retlen, buf); in nand_torture() 877 err = mtd_write(mtd, offset, mtd->erasesize, &retlen, buf); in nand_torture() [all …]
|
A D | vf610_nfc.c | 216 vf610_nfc_write(mtd, reg, vf610_nfc_read(mtd, reg) | bits); in vf610_nfc_set() 221 vf610_nfc_write(mtd, reg, vf610_nfc_read(mtd, reg) & ~bits); in vf610_nfc_clear() 399 trfr_sz += mtd->writesize + mtd->oobsize; in vf610_nfc_command() 471 l = min_t(uint, len, mtd->writesize + mtd->oobsize - c); in vf610_nfc_write_buf() 573 vf610_nfc_read_buf(mtd, oob, mtd->oobsize); in vf610_nfc_correct_data() 599 vf610_nfc_read_buf(mtd, chip->oob_poi, mtd->oobsize); in vf610_nfc_read_page() 620 vf610_nfc_write_buf(mtd, buf, mtd->writesize); in vf610_nfc_write_page() 622 vf610_nfc_write_buf(mtd, chip->oob_poi, mtd->oobsize); in vf610_nfc_write_page() 625 nfc->write_sz = mtd->writesize + mtd->oobsize; in vf610_nfc_write_page() 695 if (mtd->writesize + mtd->oobsize > PAGE_2K + OOB_MAX - 8) { in vf610_nfc_nand_init() [all …]
|
A D | nand_spl_simple.c | 13 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 …]
|
A D | am335x_spl_bch.c | 19 static struct mtd_info *mtd; variable 38 while (!this->dev_ready(mtd)) in nand_command() 59 while (!this->dev_ready(mtd)) in nand_command() 70 hwctrl(mtd, offs & 0xff, in nand_command() 75 hwctrl(mtd, (page_addr & 0xff), in nand_command() 112 hwctrl(mtd, NAND_CMD_READSTART, in nand_command() 123 while (!this->dev_ready(mtd)) in nand_command() 171 this->read_buf(mtd, p, eccsize); in nand_read_page() 207 mtd = nand_to_mtd(&nand_chip); in nand_init() 213 nand_chip.select_chip(mtd, 0); in nand_init() [all …]
|
A D | nand_base.c | 360 ofs += mtd->erasesize - mtd->writesize; in nand_block_bad() 420 ofs += mtd->erasesize - mtd->writesize; in nand_default_block_markbad() 460 einfo.mtd = mtd; in nand_block_markbad_lowlevel() 1107 if (offset_in_page + len > mtd->writesize + mtd->oobsize) in nand_read_page_op() 1169 if (offset_in_page + len > mtd->writesize + mtd->oobsize) in nand_change_read_column_op() 3961 mtd->erasesize *= mtd->writesize; in nand_flash_detect_onfi() 4066 mtd->erasesize *= mtd->writesize; in nand_flash_detect_jedec() 4289 mtd->oobsize = 32 * mtd->writesize >> 9; in nand_decode_ext_id() 4308 mtd->oobsize = mtd->writesize / 32; in nand_decode_id() 4571 mtd->erasesize >> 10, mtd->writesize, mtd->oobsize); in nand_get_flash_type() [all …]
|
A D | nand.c | 44 if (mtd && get_nand_dev_by_index(i) == mtd) in nand_mtd_to_devnum() 57 nand_info[devnum] = mtd; in nand_register() 60 mtd->name = dev_name[devnum]; in nand_register() 67 add_mtd_device(mtd); in nand_register() 70 total_nand_size += mtd->size / 1024; in nand_register() 82 struct mtd_info *mtd = nand_to_mtd(nand); in nand_init_chip() local 94 if (nand_scan(mtd, maxchips)) in nand_init_chip() 97 nand_register(i, mtd); in nand_init_chip() 110 if (mtd != NULL) { in create_mtd_concat() 116 struct mtd_info *mtd; in create_mtd_concat() local [all …]
|
A D | mxs_nand.c | 642 nand->read_buf(mtd, buf, mtd->writesize); in mxs_nand_erased_page() 706 (mtd->writesize + mtd->oobsize); in mxs_nand_ecc_read_page() 712 d->cmd.pio_words[3] = mtd->writesize + mtd->oobsize; in mxs_nand_ecc_read_page() 738 (mtd->writesize + mtd->oobsize); in mxs_nand_ecc_read_page() 869 d->cmd.pio_words[3] = (mtd->writesize + mtd->oobsize); in mxs_nand_ecc_write_page() 1039 nand->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page); in mxs_nand_ecc_read_oob() 1040 nand->read_buf(mtd, nand->oob_poi, mtd->oobsize); in mxs_nand_ecc_read_oob() 1048 nand->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page); in mxs_nand_ecc_read_oob() 1080 nand->cmdfunc(mtd, NAND_CMD_SEQIN, mtd->writesize, page); in mxs_nand_ecc_write_oob() 1127 if (mtd->oobsize > 1024 || chip->ecc_step_ds < mtd->oobsize) in mxs_nand_set_geometry() [all …]
|
A D | nand_bbt.c | 323 ops.ooblen = mtd->oobsize; in scan_read_oob() 338 buf += mtd->oobsize + mtd->writesize; in scan_read_oob() 339 len -= mtd->writesize; in scan_read_oob() 340 offs += mtd->writesize; in scan_read_oob() 439 offs += mtd->writesize; in scan_block_fast() 487 from += mtd->erasesize - (mtd->writesize * numpages); in create_bbt() 530 int scanlen = mtd->writesize + mtd->oobsize; in search_bbt() 564 scan_read(mtd, buf, offs, mtd->writesize, td); in search_bbt() 601 search_bbt(mtd, buf, td); in search_read_bbts() 734 res = mtd_read_oob(mtd, to + mtd->writesize, &ops); in write_bbt() [all …]
|
A D | mxc_nand.c | 399 chip->cmdfunc(mtd, NAND_CMD_READOOB, mtd->writesize, page); 535 chip->cmdfunc(mtd, NAND_CMD_READOOB, mtd->writesize, page); 558 chip->cmdfunc(mtd, NAND_CMD_SEQIN, mtd->writesize, page); 780 col += mtd->writesize; 832 col += mtd->writesize; 834 n = mtd->writesize + mtd->oobsize - col; 868 m += mtd->oobsize; 905 n = mtd->writesize + mtd->oobsize - col; 932 m += mtd->oobsize; 1148 struct mtd_info *mtd; local [all …]
|
A D | zynq_nand.c | 451 chip->read_buf(mtd, p, (mtd->oobsize - data_width)); in zynq_nand_read_oob() 475 chip->cmdfunc(mtd, NAND_CMD_SEQIN, mtd->writesize, page); in zynq_nand_write_oob() 477 chip->write_buf(mtd, buf, (mtd->oobsize - data_width)); in zynq_nand_write_oob() 508 chip->read_buf(mtd, buf, mtd->writesize); in zynq_nand_read_page_raw() 511 chip->read_buf(mtd, p, (mtd->oobsize - data_width)); in zynq_nand_read_page_raw() 525 chip->read_buf(mtd, buf, mtd->writesize); in zynq_nand_read_page_raw_nooob() 556 chip->write_buf(mtd, buf, mtd->writesize); in zynq_nand_write_page_raw() 559 chip->write_buf(mtd, p, (mtd->oobsize - data_width)); in zynq_nand_write_page_raw() 619 chip->write_buf(mtd, oob_ptr, (mtd->oobsize - data_width)); in zynq_nand_write_page_hwecc() 709 chip->read_buf(mtd, oob_ptr, (mtd->oobsize - data_width)); in zynq_nand_read_page_hwecc() [all …]
|
/u-boot/drivers/mtd/ |
A D | mtdcore.c | 195 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 …]
|
A D | cfi_mtd.c | 26 flash_info_t *fi = mtd->priv; in cfi_mtd_erase() 157 mtd->numeraseregions = 0; in cfi_mtd_set_erasesize() 206 struct mtd_info *mtd; in cfi_mtd_init() local 216 mtd = &cfi_mtd_info[i]; in cfi_mtd_init() 228 mtd->size = fi->size; in cfi_mtd_init() 229 mtd->writesize = 1; in cfi_mtd_init() 230 mtd->writebufsize = mtd->writesize; in cfi_mtd_init() 238 mtd->priv = fi; in cfi_mtd_init() 240 if (add_mtd_device(mtd)) in cfi_mtd_init() 256 if (mtd == NULL) in cfi_mtd_init() [all …]
|
A D | Makefile | 6 mtd-$(CONFIG_MTD) += mtdcore.o mtd_uboot.o 7 mtd-$(CONFIG_DM_MTD) += mtd-uclass.o 8 mtd-$(CONFIG_MTD_PARTITIONS) += mtdpart.o 9 mtd-$(CONFIG_MTD_CONCAT) += mtdconcat.o 10 mtd-$(CONFIG_ALTERA_QSPI) += altera_qspi.o 12 mtd-$(CONFIG_FLASH_CFI_MTD) += cfi_mtd.o 15 mtd-$(CONFIG_ST_SMI) += st_smi.o 23 ifneq ($(mtd-y),) 24 obj-y += mtd.o 34 ifneq ($(mtd-y),) [all …]
|
A D | altera_qspi.c | 66 struct mtd_info *mtd = info->mtd; in flash_print_info() local 88 struct mtd_info *mtd = info->mtd; in flash_erase() local 93 instr.mtd = mtd; in flash_erase() 108 struct mtd_info *mtd = info->mtd; in write_buff() local 252 *len = mtd->size; in altera_qspi_get_locked_range() 269 num_sectors = mtd->size / mtd->erasesize; in altera_qspi_lock() 320 mtd->dev = dev; in altera_qspi_probe() 321 mtd->name = "nor0"; in altera_qspi_probe() 326 mtd->writebufsize = mtd->writesize; in altera_qspi_probe() 338 flash->mtd = mtd; in altera_qspi_probe() [all …]
|
A D | mtdpart.c | 299 res = mtd->parent->_read(mtd->parent, from + mtd->offset, len, in part_read() 314 return mtd->parent->_point(mtd->parent, from + mtd->offset, len, in part_point() 320 return mtd->parent->_unpoint(mtd->parent, from + mtd->offset, len); in part_unpoint() 360 res = mtd->parent->_read_oob(mtd->parent, from + mtd->offset, ops); in part_read_oob() 401 return mtd->parent->_write(mtd->parent, to + mtd->offset, len, in part_write() 408 return mtd->parent->_panic_write(mtd->parent, to + mtd->offset, len, in part_panic_write() 419 return mtd->parent->_write_oob(mtd->parent, to + mtd->offset, ops); in part_write_oob() 472 return mtd->parent->_lock(mtd->parent, ofs + mtd->offset, len); in part_lock() 477 return mtd->parent->_unlock(mtd->parent, ofs + mtd->offset, len); in part_unlock() 487 mtd->parent->_sync(mtd->parent); in part_sync() [all …]
|
A D | mtdconcat.c | 40 struct mtd_info mtd; member 97 mtd->ecc_stats.failed++; in concat_read() 100 mtd->ecc_stats.corrected++; in concat_read() 178 if (mtd->writesize > 1) { in concat_writev() 180 if (do_div(__to, mtd->writesize) || (total_len % mtd->writesize)) in concat_writev() 266 mtd->ecc_stats.failed++; in concat_read_oob() 360 erase->mtd = mtd; in concat_dev_erase() 368 err = mtd_erase(mtd, erase); in concat_dev_erase() 779 concat->mtd.flags |= in mtd_concat_create() 813 concat->mtd.name = name; in mtd_concat_create() [all …]
|
/u-boot/cmd/ |
A D | mtd.c | 24 struct mtd_info *mtd; in get_mtd_by_name() local 31 PTR_ERR(mtd)); in get_mtd_by_name() 33 return mtd; in get_mtd_by_name() 123 if (mtd->dev) { in mtd_show_device() 132 switch (mtd->type) { in mtd_show_device() 163 if (mtd->oobsize) { in mtd_show_device() 176 mtd->offset, mtd->offset + mtd->size, mtd->name); in mtd_show_device() 263 if (mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH) in do_mtd_io() 294 default_len = dump ? mtd->writesize : mtd->size; in do_mtd_io() 427 erase_op.mtd = mtd; in do_mtd_erase() [all …]
|
A D | nand.c | 125 if (!mtd) in set_dev() 173 for (off = 0; off < mtd->size; off += mtd->erasesize) { in do_nand_status() 260 ret = mtd->write_oob(mtd, ENV_OFFSET_SIZE, &ops); in do_nand_env_oob() 296 if (!mtd) in nand_print_and_set_info() 304 mtd->name, mtd->erasesize >> 10); in nand_print_and_set_info() 347 addr += mtd->writesize + mtd->oobsize; in raw_access() 446 if (!mtd) { in do_nand() 453 for (off = 0; off < mtd->size; off += mtd->erasesize) in do_nand() 595 rwsize = pagecount * (mtd->writesize + mtd->oobsize); in do_nand() 873 r = nand_read_skip_bad(mtd, offset, &cnt, NULL, mtd->size, in nand_load_image() [all …]
|
A D | onenand.c | 53 if (*size == mtd->size) in arg_off_size_onenand() 112 .len = mtd->writesize, in onenand_write_oneblock_withoob() 117 for (page = 0; page < (mtd->erasesize / mtd->writesize); page ++) { in onenand_write_oneblock_withoob() 119 buf += mtd->writesize; in onenand_write_oneblock_withoob() 121 buf += mtd->oobsize; in onenand_write_oneblock_withoob() 125 to += mtd->writesize; in onenand_write_oneblock_withoob() 207 instr.mtd = mtd; in onenand_block_erase() 312 datbuf = malloc(mtd->writesize + mtd->oobsize); in onenand_dump() 373 mtd = &onenand_mtd; in do_onenand_bad() 376 for (ofs = 0; ofs < mtd->size; ofs += mtd->erasesize) { in do_onenand_bad() [all …]
|
/u-boot/drivers/dfu/ |
A D | dfu_mtd.c | 25 struct mtd_info *mtd = dfu->data.mtd.info; in mtd_block_op() local 38 lim = dfu->data.mtd.start + dfu->data.mtd.size; in mtd_block_op() 60 erase_op.mtd = mtd; in mtd_block_op() 202 struct mtd_info *mtd = dfu->data.mtd.info; in dfu_flush_medium_mtd() local 210 erase_op.mtd = dfu->data.mtd.info; in dfu_flush_medium_mtd() 216 remaining = dfu->data.mtd.start + dfu->data.mtd.size - in dfu_flush_medium_mtd() 261 put_mtd_device(mtd); in dfu_fill_entity_mtd() 264 dfu->data.mtd.info = mtd; in dfu_fill_entity_mtd() 266 has_pages = mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH; in dfu_fill_entity_mtd() 305 if (!mtd_is_aligned_with_block_size(mtd, dfu->data.mtd.start)) { in dfu_fill_entity_mtd() [all …]
|
/u-boot/drivers/mtd/onenand/ |
A D | onenand_base.c | 1050 this->command(mtd, readcmd, from, mtd->oobsize); in onenand_read_oob_nolock() 1248 this->command(mtd, readcmd, from, mtd->oobsize); in onenand_bbt_read_oob() 1298 this->command(mtd, readcmd, to, mtd->oobsize); in onenand_verify_oob() 1486 this->command(mtd, ONENAND_CMD_PROG, to, mtd->writesize); in onenand_write_ops_nolock() 1590 this->command(mtd, ONENAND_CMD_BUFFERRAM, to, mtd->oobsize); in onenand_write_oob_nolock() 1608 this->command(mtd, oobcmd, to, mtd->oobsize); in onenand_write_oob_nolock() 2632 mtd->oobsize = mtd->writesize >> 5; in onenand_probe() 2634 mtd->erasesize = mtd->writesize << 6; in onenand_probe() 2646 this->page_mask = (mtd->erasesize / mtd->writesize) - 1; in onenand_probe() 2668 mtd->writebufsize = mtd->writesize; in onenand_probe() [all …]
|
/u-boot/arch/arm/mach-imx/ |
A D | cmd_nandbcb.c | 198 boot_cfg->mtd = mtd; in nandbcb_get_info() 211 mtd = boot_cfg->mtd; in nandbcb_get_size() 240 mtd = boot_cfg->mtd; in nandbcb_set_boot_config() 428 struct mtd_info *mtd = boot_cfg->mtd; in fill_fcb() local 506 mtd = boot_cfg->mtd; in read_fcb() 576 mtd = boot_cfg->mtd; in write_fcb() 681 mtd = boot_cfg->mtd; in read_dbbt() 720 mtd = boot_cfg->mtd; in write_dbbt() 825 mtd = boot_cfg->mtd; in nandbcb_write_bs_skip_bad() 967 mtd = boot_cfg->mtd; in nandbcb_init() [all …]
|
/u-boot/board/socrates/ |
A D | nand.c | 15 static void sc_nand_write_byte(struct mtd_info *mtd, u_char byte); 17 static u_char sc_nand_read_byte(struct mtd_info *mtd); 18 static u16 sc_nand_read_word(struct mtd_info *mtd); 36 static void sc_nand_write_byte(struct mtd_info *mtd, u_char byte) in sc_nand_write_byte() argument 38 sc_nand_write_buf(mtd, (const uchar *)&byte, sizeof(byte)); in sc_nand_write_byte() 50 struct nand_chip *this = mtd_to_nand(mtd); in sc_nand_write_buf() 63 static u_char sc_nand_read_byte(struct mtd_info *mtd) in sc_nand_read_byte() argument 66 sc_nand_read_buf(mtd, (uchar *)&byte, sizeof(byte)); in sc_nand_read_byte() 74 static u16 sc_nand_read_word(struct mtd_info *mtd) in sc_nand_read_word() argument 77 sc_nand_read_buf(mtd, (uchar *)&word, sizeof(word)); in sc_nand_read_word() [all …]
|