Lines Matching refs:fdm
138 struct mtk_nfc_fdm fdm; member
186 poi = chip->oob_poi + (i + 1) * mtk_nand->fdm.reg_size; in oob_ptr()
190 poi = chip->oob_poi + i * mtk_nand->fdm.reg_size; in oob_ptr()
409 fmt |= mtk_nand->fdm.reg_size << PAGEFMT_FDM_SHIFT; in mtk_nfc_hw_runtime_config()
410 fmt |= mtk_nand->fdm.ecc_size << PAGEFMT_FDM_ECC_SHIFT; in mtk_nfc_hw_runtime_config()
414 nfc->ecc_cfg.len = chip->ecc.size + mtk_nand->fdm.ecc_size; in mtk_nfc_hw_runtime_config()
538 int size = chip->ecc.size + mtk_nand->fdm.reg_size; in mtk_nfc_sector_encode()
571 struct mtk_nfc_fdm *fdm = &mtk_nand->fdm; in mtk_nfc_format_subpage() local
589 memcpy(mtk_oob_ptr(chip, i), oob_ptr(chip, i), fdm->reg_size); in mtk_nfc_format_subpage()
605 struct mtk_nfc_fdm *fdm = &mtk_nand->fdm; in mtk_nfc_format_page() local
617 memcpy(mtk_oob_ptr(chip, i), oob_ptr(chip, i), fdm->reg_size); in mtk_nfc_format_page()
626 struct mtk_nfc_fdm *fdm = &mtk_nand->fdm; in mtk_nfc_read_fdm() local
636 for (j = 0; j < fdm->reg_size; j++) in mtk_nfc_read_fdm()
645 struct mtk_nfc_fdm *fdm = &mtk_nand->fdm; in mtk_nfc_write_fdm() local
656 vall |= (j < fdm->reg_size ? oobptr[j] : 0xff) in mtk_nfc_write_fdm()
659 valm |= (j < fdm->reg_size ? oobptr[j] : 0xff) in mtk_nfc_write_fdm()
825 memset(oob_ptr(chip, i), 0xff, mtk_nand->fdm.reg_size); in mtk_nfc_update_ecc_stats()
957 struct mtk_nfc_fdm *fdm = &mtk_nand->fdm; in mtk_nfc_read_page_raw() local
967 memcpy(oob_ptr(chip, i), mtk_oob_ptr(chip, i), fdm->reg_size); in mtk_nfc_read_page_raw()
1068 struct mtk_nfc_fdm *fdm = &mtk_nand->fdm; in mtk_nfc_ooblayout_free() local
1076 oob_region->length = fdm->reg_size - fdm->ecc_size; in mtk_nfc_ooblayout_free()
1077 oob_region->offset = section * fdm->reg_size + fdm->ecc_size; in mtk_nfc_ooblayout_free()
1093 oob_region->offset = mtk_nand->fdm.reg_size * eccsteps; in mtk_nfc_ooblayout_ecc()
1104 static void mtk_nfc_set_fdm(struct mtk_nfc_fdm *fdm, struct mtd_info *mtd) in mtk_nfc_set_fdm() argument
1112 fdm->reg_size = chip->spare_per_sector - ecc_bytes; in mtk_nfc_set_fdm()
1113 if (fdm->reg_size > NFI_FDM_MAX_SIZE) in mtk_nfc_set_fdm()
1114 fdm->reg_size = NFI_FDM_MAX_SIZE; in mtk_nfc_set_fdm()
1117 fdm->ecc_size = 1; in mtk_nfc_set_fdm()
1316 mtk_nfc_set_fdm(&chip->fdm, mtd); in mtk_nfc_nand_chip_init()