Lines Matching refs:chip
385 struct nand_chip *chip, argument
388 struct mxc_nand_host *host = nand_get_controller_data(chip);
389 uint8_t *buf = chip->oob_poi;
391 int eccpitch = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad;
398 chip->cmdfunc(mtd, NAND_CMD_READOOB, mtd->writesize, page);
399 for (i = 0; i < chip->ecc.steps; i++) {
400 toread = min_t(int, length, chip->ecc.prepad);
402 chip->read_buf(mtd, bufpoi, toread);
406 bufpoi += chip->ecc.bytes;
407 host->col_addr += chip->ecc.bytes;
408 length -= chip->ecc.bytes;
410 toread = min_t(int, length, chip->ecc.postpad);
412 chip->read_buf(mtd, bufpoi, toread);
418 chip->read_buf(mtd, bufpoi, length);
421 chip->cmdfunc(mtd, NAND_CMD_READOOB,
422 mtd->writesize + chip->ecc.prepad, page);
423 bufpoi = buf + chip->ecc.prepad;
424 length = mtd->oobsize - chip->ecc.prepad;
425 for (i = 0; i < chip->ecc.steps; i++) {
426 toread = min_t(int, length, chip->ecc.bytes);
427 chip->read_buf(mtd, bufpoi, toread);
430 host->col_addr += chip->ecc.postpad + chip->ecc.prepad;
437 struct nand_chip *chip, argument
442 struct mxc_nand_host *host = nand_get_controller_data(chip);
443 int eccsize = chip->ecc.size;
444 int eccbytes = chip->ecc.bytes;
445 int eccpitch = eccbytes + chip->ecc.prepad + chip->ecc.postpad;
446 uint8_t *oob = chip->oob_poi;
451 chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page);
453 for (n = 0, steps = chip->ecc.steps; steps > 0; n++, steps--) {
455 chip->read_buf(mtd, buf, eccsize);
459 if (chip->ecc.prepad) {
460 chip->read_buf(mtd, oob, chip->ecc.prepad);
461 oob += chip->ecc.prepad;
464 chip->read_buf(mtd, oob, eccbytes);
467 if (chip->ecc.postpad) {
468 chip->read_buf(mtd, oob, chip->ecc.postpad);
469 oob += chip->ecc.postpad;
473 size = mtd->oobsize - (oob - chip->oob_poi);
475 chip->read_buf(mtd, oob, size);
482 struct nand_chip *chip, argument
487 struct mxc_nand_host *host = nand_get_controller_data(chip);
488 int n, eccsize = chip->ecc.size;
489 int eccbytes = chip->ecc.bytes;
490 int eccpitch = eccbytes + chip->ecc.prepad + chip->ecc.postpad;
491 int eccsteps = chip->ecc.steps;
493 uint8_t *oob = chip->oob_poi;
504 chip->read_buf(mtd, p, eccsize);
508 if (chip->ecc.prepad) {
509 chip->read_buf(mtd, oob, chip->ecc.prepad);
510 oob += chip->ecc.prepad;
513 stat = chip->ecc.correct(mtd, p, oob, NULL);
521 if (chip->ecc.postpad) {
522 chip->read_buf(mtd, oob, chip->ecc.postpad);
523 oob += chip->ecc.postpad;
528 n = mtd->oobsize - (oob - chip->oob_poi);
530 chip->read_buf(mtd, oob, n);
534 chip->cmdfunc(mtd, NAND_CMD_READOOB, mtd->writesize, page);
535 eccsteps = chip->ecc.steps;
536 oob = chip->oob_poi + chip->ecc.prepad;
540 chip->ecc.prepad;
541 chip->read_buf(mtd, oob, eccbytes);
542 oob += eccbytes + chip->ecc.postpad;
549 struct nand_chip *chip, int page) argument
551 struct mxc_nand_host *host = nand_get_controller_data(chip);
552 int eccpitch = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad;
554 int i, len, status, steps = chip->ecc.steps;
555 const uint8_t *bufpoi = chip->oob_poi;
557 chip->cmdfunc(mtd, NAND_CMD_SEQIN, mtd->writesize, page);
561 chip->write_buf(mtd, bufpoi, len);
564 host->col_addr += chip->ecc.prepad + chip->ecc.postpad;
567 chip->write_buf(mtd, bufpoi, length);
569 chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
570 status = chip->waitfunc(mtd, chip);
575 struct nand_chip *chip, argument
579 struct mxc_nand_host *host = nand_get_controller_data(chip);
580 int eccsize = chip->ecc.size;
581 int eccbytes = chip->ecc.bytes;
582 int eccpitch = eccbytes + chip->ecc.prepad + chip->ecc.postpad;
583 uint8_t *oob = chip->oob_poi;
587 for (n = 0, steps = chip->ecc.steps; steps > 0; n++, steps--) {
589 chip->write_buf(mtd, buf, eccsize);
594 if (chip->ecc.prepad) {
595 chip->write_buf(mtd, oob, chip->ecc.prepad);
596 oob += chip->ecc.prepad;
602 if (chip->ecc.postpad) {
603 chip->write_buf(mtd, oob, chip->ecc.postpad);
604 oob += chip->ecc.postpad;
608 size = mtd->oobsize - (oob - chip->oob_poi);
610 chip->write_buf(mtd, oob, size);
615 struct nand_chip *chip, argument
619 struct mxc_nand_host *host = nand_get_controller_data(chip);
620 int i, n, eccsize = chip->ecc.size;
621 int eccbytes = chip->ecc.bytes;
622 int eccpitch = eccbytes + chip->ecc.prepad + chip->ecc.postpad;
623 int eccsteps = chip->ecc.steps;
625 uint8_t *oob = chip->oob_poi;
627 chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
634 chip->write_buf(mtd, p, eccsize);
638 if (chip->ecc.prepad) {
639 chip->write_buf(mtd, oob, chip->ecc.prepad);
640 oob += chip->ecc.prepad;
643 chip->write_buf(mtd, oob, eccbytes);
646 if (chip->ecc.postpad) {
647 chip->write_buf(mtd, oob, chip->ecc.postpad);
648 oob += chip->ecc.postpad;
653 i = mtd->oobsize - (oob - chip->oob_poi);
655 chip->write_buf(mtd, oob, i);
949 static void mxc_nand_select_chip(struct mtd_info *mtd, int chip) argument
954 switch (chip) {