Lines Matching refs:nand
237 struct nand_chip nand; member
250 static inline struct sunxi_nand_chip *to_sunxi_nand(struct nand_chip *nand) in to_sunxi_nand() argument
252 return container_of(nand, struct sunxi_nand_chip, nand); in to_sunxi_nand()
381 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_dev_ready() local
382 struct sunxi_nand_chip *sunxi_nand = to_sunxi_nand(nand); in sunxi_nfc_dev_ready()
383 struct sunxi_nfc *nfc = to_sunxi_nfc(sunxi_nand->nand.controller); in sunxi_nfc_dev_ready()
385 unsigned long timeo = (sunxi_nand->nand.state == FL_ERASING ? 400 : 20); in sunxi_nfc_dev_ready()
419 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_select_chip() local
420 struct sunxi_nand_chip *sunxi_nand = to_sunxi_nand(nand); in sunxi_nfc_select_chip()
421 struct sunxi_nfc *nfc = to_sunxi_nfc(sunxi_nand->nand.controller); in sunxi_nfc_select_chip()
438 NFC_PAGE_SHIFT(nand->page_shift - 10); in sunxi_nfc_select_chip()
440 nand->dev_ready = NULL; in sunxi_nfc_select_chip()
442 nand->dev_ready = sunxi_nfc_dev_ready; in sunxi_nfc_select_chip()
464 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_read_buf() local
465 struct sunxi_nand_chip *sunxi_nand = to_sunxi_nand(nand); in sunxi_nfc_read_buf()
466 struct sunxi_nfc *nfc = to_sunxi_nfc(sunxi_nand->nand.controller); in sunxi_nfc_read_buf()
497 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_write_buf() local
498 struct sunxi_nand_chip *sunxi_nand = to_sunxi_nand(nand); in sunxi_nfc_write_buf()
499 struct sunxi_nfc *nfc = to_sunxi_nfc(sunxi_nand->nand.controller); in sunxi_nfc_write_buf()
538 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_cmd_ctrl() local
539 struct sunxi_nand_chip *sunxi_nand = to_sunxi_nand(nand); in sunxi_nfc_cmd_ctrl()
540 struct sunxi_nfc *nfc = to_sunxi_nfc(sunxi_nand->nand.controller); in sunxi_nfc_cmd_ctrl()
705 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_randomizer_config() local
706 struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); in sunxi_nfc_randomizer_config()
710 if (!(nand->options & NAND_NEED_SCRAMBLING)) in sunxi_nfc_randomizer_config()
721 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_randomizer_enable() local
722 struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); in sunxi_nfc_randomizer_enable()
724 if (!(nand->options & NAND_NEED_SCRAMBLING)) in sunxi_nfc_randomizer_enable()
733 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_randomizer_disable() local
734 struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); in sunxi_nfc_randomizer_disable()
736 if (!(nand->options & NAND_NEED_SCRAMBLING)) in sunxi_nfc_randomizer_disable()
772 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_hw_ecc_enable() local
773 struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); in sunxi_nfc_hw_ecc_enable()
774 struct sunxi_nand_hw_ecc *data = nand->ecc.priv; in sunxi_nfc_hw_ecc_enable()
782 if (nand->ecc.size == 512) in sunxi_nfc_hw_ecc_enable()
790 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_hw_ecc_disable() local
791 struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); in sunxi_nfc_hw_ecc_disable()
812 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_hw_ecc_read_chunk() local
813 struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); in sunxi_nfc_hw_ecc_read_chunk()
814 struct nand_ecc_ctrl *ecc = &nand->ecc; in sunxi_nfc_hw_ecc_read_chunk()
820 nand->cmdfunc(mtd, NAND_CMD_RNDOUT, data_off, -1); in sunxi_nfc_hw_ecc_read_chunk()
825 nand->cmdfunc(mtd, NAND_CMD_RNDOUT, oob_off, -1); in sunxi_nfc_hw_ecc_read_chunk()
859 nand->cmdfunc(mtd, NAND_CMD_RNDOUT, oob_off, -1); in sunxi_nfc_hw_ecc_read_chunk()
867 if (nand->options & NAND_NEED_SCRAMBLING) { in sunxi_nfc_hw_ecc_read_chunk()
868 nand->cmdfunc(mtd, NAND_CMD_RNDOUT, data_off, -1); in sunxi_nfc_hw_ecc_read_chunk()
869 nand->read_buf(mtd, data, ecc->size); in sunxi_nfc_hw_ecc_read_chunk()
870 nand->cmdfunc(mtd, NAND_CMD_RNDOUT, oob_off, -1); in sunxi_nfc_hw_ecc_read_chunk()
871 nand->read_buf(mtd, oob, ecc->bytes + 4); in sunxi_nfc_hw_ecc_read_chunk()
889 if (bbm && nand->options & NAND_NEED_SCRAMBLING) in sunxi_nfc_hw_ecc_read_chunk()
907 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_hw_ecc_read_extra_oob() local
908 struct nand_ecc_ctrl *ecc = &nand->ecc; in sunxi_nfc_hw_ecc_read_extra_oob()
916 nand->cmdfunc(mtd, NAND_CMD_RNDOUT, in sunxi_nfc_hw_ecc_read_extra_oob()
939 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_hw_ecc_write_chunk() local
940 struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); in sunxi_nfc_hw_ecc_write_chunk()
941 struct nand_ecc_ctrl *ecc = &nand->ecc; in sunxi_nfc_hw_ecc_write_chunk()
945 nand->cmdfunc(mtd, NAND_CMD_RNDIN, data_off, -1); in sunxi_nfc_hw_ecc_write_chunk()
950 if ((nand->options & NAND_NEED_SCRAMBLING) && bbm) { in sunxi_nfc_hw_ecc_write_chunk()
963 nand->cmdfunc(mtd, NAND_CMD_RNDIN, oob_off, -1); in sunxi_nfc_hw_ecc_write_chunk()
988 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nfc_hw_ecc_write_extra_oob() local
989 struct nand_ecc_ctrl *ecc = &nand->ecc; in sunxi_nfc_hw_ecc_write_extra_oob()
997 nand->cmdfunc(mtd, NAND_CMD_RNDIN, in sunxi_nfc_hw_ecc_write_extra_oob()
1348 struct mtd_info *mtd = nand_to_mtd(&chip->nand); in sunxi_nand_chip_init_timings()
1353 mode = onfi_get_async_timing_mode(&chip->nand); in sunxi_nand_chip_init_timings()
1355 mode = chip->nand.onfi_timing_mode_default; in sunxi_nand_chip_init_timings()
1366 chip->nand.select_chip(mtd, i); in sunxi_nand_chip_init_timings()
1367 ret = chip->nand.onfi_set_features(mtd, in sunxi_nand_chip_init_timings()
1368 &chip->nand, in sunxi_nand_chip_init_timings()
1371 chip->nand.select_chip(mtd, -1); in sunxi_nand_chip_init_timings()
1561 struct nand_chip *nand = mtd_to_nand(mtd); in sunxi_nand_ecc_init() local
1565 ecc->size = nand->ecc_step_ds; in sunxi_nand_ecc_init()
1566 ecc->strength = nand->ecc_strength_ds; in sunxi_nand_ecc_init()
1605 struct nand_chip *nand; in sunxi_nand_chip_init() local
1697 nand = &chip->nand; in sunxi_nand_chip_init()
1699 nand->chip_delay = 200; in sunxi_nand_chip_init()
1700 nand->controller = &nfc->controller; in sunxi_nand_chip_init()
1705 nand->ecc.mode = NAND_ECC_HW; in sunxi_nand_chip_init()
1706 nand->flash_node = node; in sunxi_nand_chip_init()
1707 nand->select_chip = sunxi_nfc_select_chip; in sunxi_nand_chip_init()
1708 nand->cmd_ctrl = sunxi_nfc_cmd_ctrl; in sunxi_nand_chip_init()
1709 nand->read_buf = sunxi_nfc_read_buf; in sunxi_nand_chip_init()
1710 nand->write_buf = sunxi_nfc_write_buf; in sunxi_nand_chip_init()
1711 nand->read_byte = sunxi_nfc_read_byte; in sunxi_nand_chip_init()
1713 mtd = nand_to_mtd(nand); in sunxi_nand_chip_init()
1718 if (nand->bbt_options & NAND_BBT_USE_FLASH) in sunxi_nand_chip_init()
1719 nand->bbt_options |= NAND_BBT_NO_OOB; in sunxi_nand_chip_init()
1721 if (nand->options & NAND_NEED_SCRAMBLING) in sunxi_nand_chip_init()
1722 nand->options |= NAND_NO_SUBPAGE_WRITE; in sunxi_nand_chip_init()
1724 nand->options |= NAND_SUBPAGE_READ; in sunxi_nand_chip_init()
1732 ret = sunxi_nand_ecc_init(mtd, &nand->ecc); in sunxi_nand_chip_init()
1790 sunxi_nand_ecc_cleanup(&chip->nand.ecc); in sunxi_nand_chips_cleanup()