/openbmc/linux/drivers/mtd/tests/ |
H A D | nandbiterrs.c | 95 return mtdtest_write(mtd, offset, mtd->writesize, wbuffer); in write_page() 108 ops.len = mtd->writesize; in rewrite_page() 117 if (err || ops.retlen != mtd->writesize) { in rewrite_page() 140 err = mtd_read(mtd, offset, mtd->writesize, &read, rbuffer); in read_page() 144 if (err < 0 || read != mtd->writesize) { in read_page() 161 for (i = 0; i < mtd->writesize; i++) { in verify_page() 184 while (byte < mtd->writesize) { in insert_biterror() 208 for (i = 0; i < mtd->writesize; i++) in incremental_errors_test() 271 for (i = 0; i < mtd->writesize; i++) in overwrite_test() 351 mtd->writesize, mtd->oobsize); in mtd_nandbiterrs_init() [all …]
|
H A D | oobtest.c | 64 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { in write_eraseblock() 174 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { in verify_eraseblock() 294 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { in verify_eraseblock_in_one_go() 370 pgcnt = mtd->erasesize / mtd->writesize; 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 …]
|
/openbmc/u-boot/drivers/mtd/nand/raw/ |
H A D | mxs_nand_spl.c | 114 mtd->writesize = le32_to_cpu(p->byte_per_page); in mxs_flash_onfi_ident() 115 mtd->erasesize = le32_to_cpu(p->pages_per_block) * mtd->writesize; in mxs_flash_onfi_ident() 120 chip->page_shift = ffs(mtd->writesize) - 1; in mxs_flash_onfi_ident() 127 debug("writesize=%d (>>%d)\n", mtd->writesize, chip->page_shift); in mxs_flash_onfi_ident() 169 chip->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page); in is_badblock() 201 nand_chip.oob_poi = nand_chip.buffers->databuf + mtd->writesize; in nand_init() 219 nand_page_per_block = mtd->erasesize / mtd->writesize; in nand_spl_load_image() 223 size = roundup(size, mtd->writesize); in nand_spl_load_image() 227 sz += mtd->writesize; in nand_spl_load_image() 228 offs += mtd->writesize; in nand_spl_load_image() [all …]
|
H A D | denali.c | 635 int writesize = mtd->writesize; in denali_oob_xfer() local 642 size_t size = writesize + oobsize; in denali_oob_xfer() 646 chip->cmdfunc(mtd, start_cmd, writesize, page); in denali_oob_xfer() 658 if (pos >= writesize) in denali_oob_xfer() 660 else if (pos + len > writesize) in denali_oob_xfer() 661 len = writesize - pos; in denali_oob_xfer() 671 chip->cmdfunc(mtd, rnd_cmd, writesize + oob_skip, -1); in denali_oob_xfer() 693 int writesize = mtd->writesize; in denali_read_page_raw() local 700 size_t size = writesize + oobsize; in denali_read_page_raw() 713 if (pos >= writesize) in denali_read_page_raw() [all …]
|
H A D | mxc_nand.c | 397 chip->cmdfunc(mtd, NAND_CMD_READOOB, mtd->writesize, page); 421 mtd->writesize + chip->ecc.prepad, page); 457 host->col_addr = mtd->writesize + n * eccpitch; 505 host->col_addr = mtd->writesize + n * eccpitch; 533 chip->cmdfunc(mtd, NAND_CMD_READOOB, mtd->writesize, page); 537 host->col_addr = mtd->writesize + 556 chip->cmdfunc(mtd, NAND_CMD_SEQIN, mtd->writesize, page); 591 host->col_addr = mtd->writesize + n * eccpitch; 635 host->col_addr = mtd->writesize + n * eccpitch; 664 int subpages = mtd->writesize / nand_chip->subpagesize; [all …]
|
H A D | nand_base.c | 355 ofs += mtd->erasesize - mtd->writesize; in nand_block_bad() 378 ofs += mtd->writesize; in nand_block_bad() 415 ofs += mtd->erasesize - mtd->writesize; in nand_default_block_markbad() 422 ofs += mtd->writesize; in nand_default_block_markbad() 608 if (column >= mtd->writesize) { in nand_command() 610 column -= mtd->writesize; in nand_command() 709 column += mtd->writesize; in nand_command_lp() 1223 chip->read_buf(mtd, buf, mtd->writesize); in nand_read_page_raw() 1373 chip->cmdfunc(mtd, NAND_CMD_RNDOUT, mtd->writesize, -1); in nand_read_subpage() 1388 mtd->writesize + aligned_pos, -1); in nand_read_subpage() [all …]
|
H A D | nand_util.c | 276 if ((offset & (mtd->writesize - 1)) != 0) { in nand_get_lock_status() 454 l = (l + mtd->writesize - 1) / mtd->writesize; in drop_ffs() 455 l *= mtd->writesize; in drop_ffs() 482 size_t verlen = mtd->writesize + mtd->oobsize; in nand_verify_page_oob() 491 vops.oobbuf = vops.datbuf + mtd->writesize; in nand_verify_page_oob() 522 size_t verlen = mtd->writesize; in nand_verify() 531 verlen = min(mtd->writesize, (uint32_t)(ofs + len - verofs)); in nand_verify() 596 if ((offset & (mtd->writesize - 1)) != 0) { in nand_write_skip_bad() 714 if ((offset & (mtd->writesize - 1)) != 0) { in nand_read_skip_bad()
|
H A D | nand_bbt.c | 200 from & ~mtd->writesize); in read_bbt() 204 from & ~mtd->writesize); in read_bbt() 324 ops.len = min(len, (size_t)mtd->writesize); in scan_read_oob() 335 buf += mtd->oobsize + mtd->writesize; in scan_read_oob() 336 len -= mtd->writesize; in scan_read_oob() 337 offs += mtd->writesize; in scan_read_oob() 372 ver_offs += mtd->writesize; in bbt_get_ver_offs() 394 mtd->writesize, td); in read_abs_bbts() 403 mtd->writesize, md); in read_abs_bbts() 436 offs += mtd->writesize; in scan_block_fast() [all …]
|
H A D | fsl_elbc_nand.c | 306 ctrl->read_bytes = mtd->writesize + mtd->oobsize; in fsl_elbc_cmdfunc() 321 ctrl->read_bytes = mtd->writesize + mtd->oobsize; in fsl_elbc_cmdfunc() 407 if (column >= mtd->writesize) { in fsl_elbc_cmdfunc() 409 column -= mtd->writesize; in fsl_elbc_cmdfunc() 436 ctrl->index != mtd->writesize + mtd->oobsize) in fsl_elbc_cmdfunc() 494 unsigned int bufsize = mtd->writesize + mtd->oobsize; in fsl_elbc_write_buf() 600 fsl_elbc_read_buf(mtd, buf, mtd->writesize); in fsl_elbc_read_page() 616 fsl_elbc_write_buf(mtd, buf, mtd->writesize); in fsl_elbc_write_page() 631 fsl_elbc_write_buf(mtd, buf, mtd->writesize); in fsl_elbc_write_subpage() 756 if (mtd->writesize == 2048) { in fsl_elbc_chip_init() [all …]
|
H A D | mxs_nand.c | 192 geo->ecc_chunk_count = mtd->writesize / geo->ecc_chunk_size; in mxs_nand_calc_ecc_layout_by_info() 220 geo->ecc_chunk_count = mtd->writesize / geo->ecc_chunk_size; in mxs_nand_calc_ecc_layout() 595 (mtd->writesize + mtd->oobsize); in mxs_nand_ecc_read_page() 601 d->cmd.pio_words[3] = mtd->writesize + mtd->oobsize; in mxs_nand_ecc_read_page() 621 (mtd->writesize + mtd->oobsize); in mxs_nand_ecc_read_page() 693 memcpy(buf, nand_info->data_buf, mtd->writesize); in mxs_nand_ecc_read_page() 714 memcpy(nand_info->data_buf, buf, mtd->writesize); in mxs_nand_ecc_write_page() 739 d->cmd.pio_words[3] = (mtd->writesize + mtd->oobsize); in mxs_nand_ecc_write_page() 896 nand->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page); in mxs_nand_ecc_read_oob() 905 nand->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page); in mxs_nand_ecc_read_oob() [all …]
|
/openbmc/linux/drivers/mtd/nand/onenand/ |
H A D | onenand_base.c | 445 if (addr & this->writesize) in onenand_command() 740 return this->writesize; in onenand_bufferram_offset() 881 if (addr & this->writesize) in onenand_get_2x_blockpage() 1101 this->command(mtd, FLEXONENAND_CMD_RECOVER_LSB, addr, this->writesize); in onenand_recover_lsb() 1126 int writesize = this->writesize; in onenand_mlc_read_ops_nolock() local 1148 thislen = min_t(int, writesize, len - read); in onenand_mlc_read_ops_nolock() 1150 column = from & (writesize - 1); in onenand_mlc_read_ops_nolock() 1151 if (column + thislen > writesize) in onenand_mlc_read_ops_nolock() 1152 thislen = writesize - column; in onenand_mlc_read_ops_nolock() 1155 this->command(mtd, ONENAND_CMD_READ, from, writesize); in onenand_mlc_read_ops_nolock() [all …]
|
/openbmc/u-boot/cmd/ |
H A D | mtd.c | 36 do_div(len, mtd->writesize); in mtd_len_to_pages() 43 return !do_div(size, mtd->writesize); in mtd_is_aligned_with_min_io_size() 78 u64 data_off = page * mtd->writesize; in mtd_dump_device_buf() 81 mtd->writesize, start_off + data_off); in mtd_dump_device_buf() 83 mtd->writesize, start_off + data_off); in mtd_dump_device_buf() 159 printf(" - min I/O: 0x%x bytes\n", mtd->writesize); in mtd_show_device() 232 io_op->retlen = mtd->writesize; in mtd_special_write_oob() 286 mtd->writesize); in do_mtd_io() 291 default_len = dump ? mtd->writesize : mtd->size; in do_mtd_io() 294 len = round_up(len, mtd->writesize); in do_mtd_io() [all …]
|
H A D | nand.c | 50 off = last + mtd->writesize; in nand_dump() 54 datbuf = memalign(ARCH_DMA_MINALIGN, mtd->writesize); in nand_dump() 66 off &= ~(mtd->writesize - 1); in nand_dump() 72 ops.len = mtd->writesize; in nand_dump() 84 i = mtd->writesize >> 4; in nand_dump() 300 printf(" Page size %8d b\n", mtd->writesize); in nand_print_and_set_info() 308 env_set_hex("nand_writesize", mtd->writesize); in nand_print_and_set_info() 322 .oobbuf = ((u8 *)addr) + mtd->writesize, in raw_access() 323 .len = mtd->writesize, in raw_access() 342 addr += mtd->writesize + mtd->oobsize; in raw_access() [all …]
|
H A D | onenand.c | 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() 125 to += mtd->writesize; in onenand_write_oneblock_withoob() 142 if ((to & (mtd->writesize - 1)) != 0) { in onenand_block_write() 312 datbuf = malloc(mtd->writesize + mtd->oobsize); in onenand_dump() 318 off &= ~(mtd->writesize - 1); in onenand_dump() 323 ops.len = mtd->writesize; in onenand_dump() 334 i = mtd->writesize >> 4; in onenand_dump()
|
/openbmc/u-boot/drivers/mtd/onenand/ |
H A D | onenand_base.c | 521 return mtd->writesize; in onenand_bufferram_offset() 624 if (addr & this->writesize) in onenand_get_2x_blockpage() 835 this->command(mtd, FLEXONENAND_CMD_RECOVER_LSB, addr, this->writesize); in onenand_recover_lsb() 859 int writesize = this->writesize; in onenand_read_ops_nolock() local 888 this->command(mtd, ONENAND_CMD_READ, from, writesize); in onenand_read_ops_nolock() 898 thislen = min_t(int, writesize, len - read); in onenand_read_ops_nolock() 899 column = from & (writesize - 1); in onenand_read_ops_nolock() 900 if (column + thislen > writesize) in onenand_read_ops_nolock() 901 thislen = writesize - column; in onenand_read_ops_nolock() 908 this->command(mtd, ONENAND_CMD_READ, from, writesize); in onenand_read_ops_nolock() [all …]
|
/openbmc/u-boot/board/armltd/integrator/ |
H A D | lowlevel_init.S | 132 b writesize 138 b writesize 144 b writesize 150 b writesize 158 writesize: label
|
/openbmc/linux/drivers/mtd/nand/raw/ |
H A D | cadence-nand-controller.c | 1241 last_sec_size = mtd->writesize + mtd->oobsize; in cadence_nand_prepare_data_size() 1244 offset = mtd->writesize + cdns_chip->bbm_offs; in cadence_nand_prepare_data_size() 1444 mtd->writesize in cadence_nand_write_page() 1453 memset(cdns_ctrl->buf + mtd->writesize, 0xFF, in cadence_nand_write_page() 1461 if (cadence_nand_dma_buf_ok(cdns_ctrl, buf, mtd->writesize) && in cadence_nand_write_page() 1468 oob = cdns_ctrl->buf + mtd->writesize; in cadence_nand_write_page() 1473 mtd->writesize, in cadence_nand_write_page() 1486 memcpy(cdns_ctrl->buf + mtd->writesize, chip->oob_poi, in cadence_nand_write_page() 1490 memcpy(cdns_ctrl->buf, buf, mtd->writesize); in cadence_nand_write_page() 1497 mtd->writesize in cadence_nand_write_page() [all …]
|
H A D | nand_micron.c | 233 ret = nand_change_read_column_op(chip, mtd->writesize, in micron_nand_on_die_ecc_status_4() 243 mtd->writesize + mtd->oobsize); in micron_nand_on_die_ecc_status_4() 259 rawbuf = micron->ecc.rawbuf + mtd->writesize + offs; in micron_nand_on_die_ecc_status_4() 333 !nand_read_data_op(chip, buf, mtd->writesize, false, true)) in micron_nand_read_page_on_die_ecc() 341 ret = nand_read_data_op(chip, buf, mtd->writesize, false, in micron_nand_read_page_on_die_ecc() 347 ret = nand_change_read_column_op(chip, 0, buf, mtd->writesize, in micron_nand_read_page_on_die_ecc() 350 ret = nand_change_read_column_op(chip, mtd->writesize, in micron_nand_read_page_on_die_ecc() 499 if (mtd->writesize == 2048) in micron_nand_init() 532 micron->ecc.rawbuf = kmalloc(mtd->writesize + in micron_nand_init()
|
H A D | denali.c | 204 iowrite32(mtd->writesize, denali->reg + DEVICE_MAIN_AREA_SIZE); in denali_select_target() 247 int writesize = mtd->writesize; in denali_payload_xfer() local 255 if (pos >= writesize) { in denali_payload_xfer() 257 } else if (pos + len > writesize) { in denali_payload_xfer() 260 writesize - pos, write); in denali_payload_xfer() 264 buf += writesize - pos; in denali_payload_xfer() 265 len -= writesize - pos; in denali_payload_xfer() 266 pos = writesize + oob_skip; in denali_payload_xfer() 284 int writesize = mtd->writesize; in denali_oob_xfer() local 290 ret = denali_change_column(chip, writesize, buf, oob_skip, write); in denali_oob_xfer() [all …]
|
H A D | mxc_nand.c | 252 u16 num_chunks = mtd->writesize / 512; in copy_spare() 299 if (mtd->writesize > 512) in mxc_do_addr_cycle() 311 if (mtd->writesize > 512) { in mxc_do_addr_cycle() 588 if (mtd->writesize > 512) in send_page_v1() 724 if (mtd->writesize > 512) in mxc_nand_read_page_v1() 727 no_subpages = mtd->writesize >> 9; in mxc_nand_read_page_v1() 761 memcpy32_fromio(buf, host->main_area0, mtd->writesize); in mxc_nand_read_page_v1() 783 if (mtd->writesize > 512) in mxc_nand_read_page_v2_v3() 790 memcpy32_fromio(buf, host->main_area0, mtd->writesize); in mxc_nand_read_page_v2_v3() 797 no_subpages = mtd->writesize >> 9; in mxc_nand_read_page_v2_v3() [all …]
|
H A D | fsl_elbc_nand.c | 97 if (mtd->writesize > 512) in fsl_elbc_ooblayout_free() 251 if (elbc_fcm_ctrl->read_bytes == mtd->writesize + mtd->oobsize) { in fsl_elbc_run_command() 336 elbc_fcm_ctrl->read_bytes = mtd->writesize + mtd->oobsize; in fsl_elbc_cmdfunc() 361 elbc_fcm_ctrl->read_bytes = mtd->writesize + mtd->oobsize; in fsl_elbc_cmdfunc() 429 if (column >= mtd->writesize) { in fsl_elbc_cmdfunc() 431 column -= mtd->writesize; in fsl_elbc_cmdfunc() 486 elbc_fcm_ctrl->index != mtd->writesize + mtd->oobsize) in fsl_elbc_cmdfunc() 545 unsigned int bufsize = mtd->writesize + mtd->oobsize; in fsl_elbc_write_buf() 640 nand_read_page_op(chip, page, 0, buf, mtd->writesize); in fsl_elbc_read_page() 658 nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize); in fsl_elbc_write_page() [all …]
|
H A D | renesas-nand-controller.c | 411 .len = mtd->writesize, in rnandc_read_page_hw_ecc() 412 .ecc_offset = ECC_OFFSET(mtd->writesize + 2), in rnandc_read_page_hw_ecc() 427 dma_addr = dma_map_single(rnandc->dev, rnandc->buf, mtd->writesize, in rnandc_read_page_hw_ecc() 430 writel(mtd->writesize, rnandc->regs + DMA_CNT_REG); in rnandc_read_page_hw_ecc() 437 dma_unmap_single(rnandc->dev, dma_addr, mtd->writesize, DMA_FROM_DEVICE); in rnandc_read_page_hw_ecc() 447 ret = nand_change_read_column_op(chip, mtd->writesize, in rnandc_read_page_hw_ecc() 482 memcpy(buf, rnandc->buf, mtd->writesize); in rnandc_read_page_hw_ecc() 507 .ecc_offset = ECC_OFFSET(mtd->writesize + ecc_off), in rnandc_read_subpage_hw_ecc() 543 ret = nand_change_read_column_op(chip, mtd->writesize, in rnandc_read_subpage_hw_ecc() 591 .len = mtd->writesize, in rnandc_write_page_hw_ecc() [all …]
|
H A D | cafe_nand.c | 185 if (mtd->writesize > 512 && in cafe_nand_cmdfunc() 187 column += mtd->writesize; in cafe_nand_cmdfunc() 205 if (mtd->size > mtd->writesize << 16) in cafe_nand_cmdfunc() 225 cafe->datalen = mtd->writesize + mtd->oobsize - column; in cafe_nand_cmdfunc() 244 else if (command == NAND_CMD_READ0 && mtd->writesize > 512) in cafe_nand_cmdfunc() 349 return nand_prog_page_op(chip, page, mtd->writesize, chip->oob_poi, in cafe_nand_write_oob() 381 nand_read_page_op(chip, page, 0, buf, mtd->writesize); in cafe_nand_read_page() 540 nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize); in cafe_nand_write_page_lowlevel() 613 if (mtd->writesize == 2048) in cafe_nand_attach_chip() 618 if (mtd->writesize == 2048) { in cafe_nand_attach_chip() [all …]
|
H A D | nand_base.c | 53 int lastpage = (mtd->erasesize / mtd->writesize) - 1; in nand_pairing_dist3_get_info() 73 int lastpair = ((mtd->erasesize / mtd->writesize) - 1) / 2; in nand_pairing_dist3_get_wunit() 88 if (page >= mtd->erasesize / mtd->writesize) in nand_pairing_dist3_get_wunit() 229 int last_page = ((mtd->erasesize - mtd->writesize) >> in nand_bbm_get_next_page() 521 ofs + (page_offset * mtd->writesize), in nand_default_block_markbad() 1093 bool ident_stage = !mtd->writesize; in nand_fill_column_cycles() 1098 if (offset_in_page > mtd->writesize + mtd->oobsize) in nand_fill_column_cycles() 1106 if (mtd->writesize <= 512 && offset_in_page >= mtd->writesize) in nand_fill_column_cycles() 1107 offset_in_page -= mtd->writesize; in nand_fill_column_cycles() 1127 if (!ident_stage && mtd->writesize <= 512) in nand_fill_column_cycles() [all …]
|
/openbmc/linux/drivers/mtd/nand/raw/gpmi-nand/ |
H A D | gpmi-nand.c | 282 i = (mtd->writesize * 8 - geo->metadata_size * 8) / in bbm_in_data_chunk() 286 j = (mtd->writesize * 8 - geo->metadata_size * 8) - in bbm_in_data_chunk() 346 geo->ecc_chunk_count = mtd->writesize / geo->eccn_chunk_size; in set_geometry_by_ecc_info() 396 geo->page_size = mtd->writesize + geo->metadata_size + in set_geometry_by_ecc_info() 399 geo->payload_size = mtd->writesize; in set_geometry_by_ecc_info() 409 block_mark_bit_offset = mtd->writesize * 8 - in set_geometry_by_ecc_info() 480 geo->ecc_chunk_count = mtd->writesize / geo->eccn_chunk_size; in set_geometry_for_large_oob() 500 geo->ecc_chunk_count = (mtd->writesize / geo->eccn_chunk_size) + 1; in set_geometry_for_large_oob() 510 bbm_chunk = (mtd->writesize * 8 - geo->metadata_size * 8 - in set_geometry_for_large_oob() 517 geo->page_size = mtd->writesize + geo->metadata_size + in set_geometry_for_large_oob() [all …]
|