Lines Matching refs:ecc

317 	if (chip->ecc.strength == FMC2_ECC_BCH8) {  in stm32_fmc2_nfc_setup()
320 } else if (chip->ecc.strength == FMC2_ECC_BCH4) { in stm32_fmc2_nfc_setup()
379 dma_cfg.src_addr += chip->ecc.strength == FMC2_ECC_HAM ? in stm32_fmc2_nfc_select_chip()
390 nfc->dma_ecc_len = chip->ecc.strength == FMC2_ECC_HAM ? in stm32_fmc2_nfc_select_chip()
468 if (chip->ecc.strength != FMC2_ECC_HAM) { in stm32_fmc2_nfc_hwctl()
485 static void stm32_fmc2_nfc_ham_set_ecc(const u32 ecc_sta, u8 *ecc) in stm32_fmc2_nfc_ham_set_ecc() argument
487 ecc[0] = ecc_sta; in stm32_fmc2_nfc_ham_set_ecc()
488 ecc[1] = ecc_sta >> 8; in stm32_fmc2_nfc_ham_set_ecc()
489 ecc[2] = ecc_sta >> 16; in stm32_fmc2_nfc_ham_set_ecc()
493 u8 *ecc) in stm32_fmc2_nfc_ham_calculate() argument
508 stm32_fmc2_nfc_ham_set_ecc(heccr, ecc); in stm32_fmc2_nfc_ham_calculate()
574 u8 *ecc) in stm32_fmc2_nfc_bch_calculate() argument
589 ecc[0] = bchpbr; in stm32_fmc2_nfc_bch_calculate()
590 ecc[1] = bchpbr >> 8; in stm32_fmc2_nfc_bch_calculate()
591 ecc[2] = bchpbr >> 16; in stm32_fmc2_nfc_bch_calculate()
592 ecc[3] = bchpbr >> 24; in stm32_fmc2_nfc_bch_calculate()
595 ecc[4] = bchpbr; in stm32_fmc2_nfc_bch_calculate()
596 ecc[5] = bchpbr >> 8; in stm32_fmc2_nfc_bch_calculate()
597 ecc[6] = bchpbr >> 16; in stm32_fmc2_nfc_bch_calculate()
599 if (chip->ecc.strength == FMC2_ECC_BCH8) { in stm32_fmc2_nfc_bch_calculate()
600 ecc[7] = bchpbr >> 24; in stm32_fmc2_nfc_bch_calculate()
603 ecc[8] = bchpbr; in stm32_fmc2_nfc_bch_calculate()
604 ecc[9] = bchpbr >> 8; in stm32_fmc2_nfc_bch_calculate()
605 ecc[10] = bchpbr >> 16; in stm32_fmc2_nfc_bch_calculate()
606 ecc[11] = bchpbr >> 24; in stm32_fmc2_nfc_bch_calculate()
609 ecc[12] = bchpbr; in stm32_fmc2_nfc_bch_calculate()
674 return stm32_fmc2_nfc_bch_decode(chip->ecc.size, dat, ecc_sta); in stm32_fmc2_nfc_bch_correct()
681 int ret, i, s, stat, eccsize = chip->ecc.size; in stm32_fmc2_nfc_read_page()
682 int eccbytes = chip->ecc.bytes; in stm32_fmc2_nfc_read_page()
683 int eccsteps = chip->ecc.steps; in stm32_fmc2_nfc_read_page()
684 int eccstrength = chip->ecc.strength; in stm32_fmc2_nfc_read_page()
686 u8 *ecc_calc = chip->ecc.calc_buf; in stm32_fmc2_nfc_read_page()
687 u8 *ecc_code = chip->ecc.code_buf; in stm32_fmc2_nfc_read_page()
696 chip->ecc.hwctl(chip, NAND_ECC_READ); in stm32_fmc2_nfc_read_page()
711 stat = chip->ecc.correct(chip, p, ecc_code, ecc_calc); in stm32_fmc2_nfc_read_page()
792 cfg[2] = FIELD_PREP(FMC2_CSQCFGR3_SNBR, chip->ecc.steps - 1); in stm32_fmc2_nfc_rw_page_init()
845 int eccsteps = chip->ecc.steps; in stm32_fmc2_nfc_xfer()
846 int eccsize = chip->ecc.size; in stm32_fmc2_nfc_xfer()
1032 int eccbytes = chip->ecc.bytes; in stm32_fmc2_nfc_seq_correct()
1033 int eccsteps = chip->ecc.steps; in stm32_fmc2_nfc_seq_correct()
1034 int eccstrength = chip->ecc.strength; in stm32_fmc2_nfc_seq_correct()
1035 int i, s, eccsize = chip->ecc.size; in stm32_fmc2_nfc_seq_correct()
1091 u8 *ecc_calc = chip->ecc.calc_buf; in stm32_fmc2_nfc_seq_read_page()
1092 u8 *ecc_code = chip->ecc.code_buf; in stm32_fmc2_nfc_seq_read_page()
1127 chip->ecc.total); in stm32_fmc2_nfc_seq_read_page()
1132 return chip->ecc.correct(chip, buf, ecc_code, ecc_calc); in stm32_fmc2_nfc_seq_read_page()
1615 chip->ecc.correct = stm32_fmc2_nfc_seq_correct; in stm32_fmc2_nfc_nand_callbacks_setup()
1616 chip->ecc.write_page = stm32_fmc2_nfc_seq_write_page; in stm32_fmc2_nfc_nand_callbacks_setup()
1617 chip->ecc.read_page = stm32_fmc2_nfc_seq_read_page; in stm32_fmc2_nfc_nand_callbacks_setup()
1618 chip->ecc.write_page_raw = stm32_fmc2_nfc_seq_write_page_raw; in stm32_fmc2_nfc_nand_callbacks_setup()
1619 chip->ecc.read_page_raw = stm32_fmc2_nfc_seq_read_page_raw; in stm32_fmc2_nfc_nand_callbacks_setup()
1622 chip->ecc.hwctl = stm32_fmc2_nfc_hwctl; in stm32_fmc2_nfc_nand_callbacks_setup()
1623 if (chip->ecc.strength == FMC2_ECC_HAM) { in stm32_fmc2_nfc_nand_callbacks_setup()
1625 chip->ecc.calculate = stm32_fmc2_nfc_ham_calculate; in stm32_fmc2_nfc_nand_callbacks_setup()
1626 chip->ecc.correct = stm32_fmc2_nfc_ham_correct; in stm32_fmc2_nfc_nand_callbacks_setup()
1627 chip->ecc.options |= NAND_ECC_GENERIC_ERASED_CHECK; in stm32_fmc2_nfc_nand_callbacks_setup()
1630 chip->ecc.calculate = stm32_fmc2_nfc_bch_calculate; in stm32_fmc2_nfc_nand_callbacks_setup()
1631 chip->ecc.correct = stm32_fmc2_nfc_bch_correct; in stm32_fmc2_nfc_nand_callbacks_setup()
1632 chip->ecc.read_page = stm32_fmc2_nfc_read_page; in stm32_fmc2_nfc_nand_callbacks_setup()
1637 if (chip->ecc.strength == FMC2_ECC_HAM) in stm32_fmc2_nfc_nand_callbacks_setup()
1638 chip->ecc.bytes = chip->options & NAND_BUSWIDTH_16 ? 4 : 3; in stm32_fmc2_nfc_nand_callbacks_setup()
1639 else if (chip->ecc.strength == FMC2_ECC_BCH8) in stm32_fmc2_nfc_nand_callbacks_setup()
1640 chip->ecc.bytes = chip->options & NAND_BUSWIDTH_16 ? 14 : 13; in stm32_fmc2_nfc_nand_callbacks_setup()
1642 chip->ecc.bytes = chip->options & NAND_BUSWIDTH_16 ? 8 : 7; in stm32_fmc2_nfc_nand_callbacks_setup()
1649 struct nand_ecc_ctrl *ecc = &chip->ecc; in stm32_fmc2_nfc_ooblayout_ecc() local
1654 oobregion->length = ecc->total; in stm32_fmc2_nfc_ooblayout_ecc()
1664 struct nand_ecc_ctrl *ecc = &chip->ecc; in stm32_fmc2_nfc_ooblayout_free() local
1669 oobregion->length = mtd->oobsize - ecc->total - FMC2_BBM_LEN; in stm32_fmc2_nfc_ooblayout_free()
1670 oobregion->offset = ecc->total + FMC2_BBM_LEN; in stm32_fmc2_nfc_ooblayout_free()
1676 .ecc = stm32_fmc2_nfc_ooblayout_ecc,
1711 if (chip->ecc.engine_type != NAND_ECC_ENGINE_TYPE_ON_HOST) { in stm32_fmc2_nfc_attach_chip()
1718 if (!chip->ecc.size) in stm32_fmc2_nfc_attach_chip()
1719 chip->ecc.size = FMC2_ECC_STEP_SIZE; in stm32_fmc2_nfc_attach_chip()
1721 if (!chip->ecc.strength) in stm32_fmc2_nfc_attach_chip()
1722 chip->ecc.strength = FMC2_ECC_BCH8; in stm32_fmc2_nfc_attach_chip()
1731 if (mtd->writesize / chip->ecc.size > FMC2_MAX_SG) { in stm32_fmc2_nfc_attach_chip()