Lines Matching refs:mtk_nand
190 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in oob_ptr() local
197 if (i < mtk_nand->bad_mark.sec) in oob_ptr()
198 poi = chip->oob_poi + (i + 1) * mtk_nand->fdm.reg_size; in oob_ptr()
199 else if (i == mtk_nand->bad_mark.sec) in oob_ptr()
202 poi = chip->oob_poi + i * mtk_nand->fdm.reg_size; in oob_ptr()
209 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_data_len() local
211 return chip->ecc.size + mtk_nand->spare_per_sector; in mtk_data_len()
321 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_hw_runtime_config() local
328 spare = mtk_nand->spare_per_sector; in mtk_nfc_hw_runtime_config()
379 fmt |= mtk_nand->fdm.reg_size << PAGEFMT_FDM_SHIFT; in mtk_nfc_hw_runtime_config()
380 fmt |= mtk_nand->fdm.ecc_size << PAGEFMT_FDM_ECC_SHIFT; in mtk_nfc_hw_runtime_config()
384 nfc->ecc_cfg.len = chip->ecc.size + mtk_nand->fdm.ecc_size; in mtk_nfc_hw_runtime_config()
502 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(nand); in mtk_nfc_select_target() local
506 nfi_writel(nfc, mtk_nand->sels[cs], NFI_CSEL); in mtk_nfc_select_target()
644 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_sector_encode() local
645 int size = chip->ecc.size + mtk_nand->fdm.reg_size; in mtk_nfc_sector_encode()
676 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_format_subpage() local
678 struct mtk_nfc_fdm *fdm = &mtk_nand->fdm; in mtk_nfc_format_subpage()
693 if (i == mtk_nand->bad_mark.sec) in mtk_nfc_format_subpage()
694 mtk_nand->bad_mark.bm_swap(mtd, nfc->buffer, 1); in mtk_nfc_format_subpage()
710 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_format_page() local
712 struct mtk_nfc_fdm *fdm = &mtk_nand->fdm; in mtk_nfc_format_page()
721 if (i == mtk_nand->bad_mark.sec) in mtk_nfc_format_page()
722 mtk_nand->bad_mark.bm_swap(mtd, nfc->buffer, 1); in mtk_nfc_format_page()
732 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_read_fdm() local
733 struct mtk_nfc_fdm *fdm = &mtk_nand->fdm; in mtk_nfc_read_fdm()
751 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_write_fdm() local
752 struct mtk_nfc_fdm *fdm = &mtk_nand->fdm; in mtk_nfc_write_fdm()
829 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_write_page() local
856 mtk_nand->bad_mark.bm_swap(mtd, nfc->buffer, raw); in mtk_nfc_write_page()
919 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_update_ecc_stats() local
921 u32 reg_size = mtk_nand->fdm.reg_size; in mtk_nfc_update_ecc_stats()
944 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_read_subpage() local
945 u32 spare = mtk_nand->spare_per_sector; in mtk_nfc_read_subpage()
1030 if (clamp(mtk_nand->bad_mark.sec, start, end) == mtk_nand->bad_mark.sec) in mtk_nfc_read_subpage()
1031 mtk_nand->bad_mark.bm_swap(mtd, bufpoi, raw); in mtk_nfc_read_subpage()
1057 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_read_page_raw() local
1059 struct mtk_nfc_fdm *fdm = &mtk_nand->fdm; in mtk_nfc_read_page_raw()
1071 if (i == mtk_nand->bad_mark.sec) in mtk_nfc_read_page_raw()
1072 mtk_nand->bad_mark.bm_swap(mtd, nfc->buffer, 1); in mtk_nfc_read_page_raw()
1125 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_ooblayout_free() local
1126 struct mtk_nfc_fdm *fdm = &mtk_nand->fdm; in mtk_nfc_ooblayout_free()
1144 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_ooblayout_ecc() local
1151 oob_region->offset = mtk_nand->fdm.reg_size * eccsteps; in mtk_nfc_ooblayout_ecc()
1301 struct mtk_nfc_nand_chip *mtk_nand = to_mtk_nand(chip); in mtk_nfc_attach_chip() local
1318 ret = mtk_nfc_set_spare_per_sector(&mtk_nand->spare_per_sector, mtd); in mtk_nfc_attach_chip()
1322 mtk_nfc_set_fdm(&mtk_nand->fdm, mtd); in mtk_nfc_attach_chip()
1323 mtk_nfc_set_bad_mark_ctl(&mtk_nand->bad_mark, mtd); in mtk_nfc_attach_chip()