Lines Matching full:ecc

23  *	1024 bytes data + 4Bytes sys data + 28Bytes~124Bytes ECC data +
24 * 1024 bytes data + 4Bytes sys data + 28Bytes~124Bytes ECC data +
31 * 4Bytes sys data + .... + 4Bytes sys data + ECC data.
93 * struct rk_ecc_cnt_status: represent a ecc status data.
95 * @low: ECC count low bit index at register.
97 * @low_bn: ECC count low bit number.
98 * @high: ECC count high bit index at register.
113 * @ecc_strengths: ECC strengths
114 * @ecc_cfgs: ECC config values
197 return (u8 *)p + i * chip->ecc.size;
214 poi = chip->oob_poi + rknand->metadata_size + chip->ecc.bytes * i;
221 return chip->ecc.size + chip->ecc.bytes + NFC_SYS_DATA_SIZE;
235 return nfc->page_buf + i * rk_nfc_data_len(chip) + chip->ecc.size;
255 /* Save chip ECC setting */
265 struct nand_ecc_ctrl *ecc = &chip->ecc;
296 * Compare current chip ECC setting with selected chip ECC setting and
299 if (nfc->cur_ecc != ecc->strength)
300 rk_nfc_hw_ecc_setup(chip, ecc->strength);
512 struct nand_ecc_ctrl *ecc = &chip->ecc;
518 rknand->boot_ecc != ecc->strength) {
521 * a different ECC strength is in use for the boot blocks.
529 for (i = 0; i < ecc->steps; i++) {
534 ecc->size);
571 rk_nfc_buf_to_oob_ptr(chip, ecc->steps - 1),
577 /* Copy ECC data to the NFC buffer. */
580 ecc->bytes);
594 struct nand_ecc_ctrl *ecc = &chip->ecc;
595 int oob_step = (ecc->bytes > 60) ? NFC_MAX_OOB_PER_STEP :
634 * Configure the ECC algorithm supported by the boot ROM.
639 if (rknand->boot_ecc != ecc->strength)
643 for (i = 0; i < ecc->steps; i++) {
645 oob = chip->oob_poi + (ecc->steps - 1) * NFC_SYS_DATA_SIZE;
663 ecc->steps * oob_step,
673 rk_nfc_xfer_start(nfc, NFC_WRITE, ecc->steps, dma_data,
688 dma_unmap_single(nfc->dev, dma_oob, ecc->steps * oob_step,
691 if (boot_rom_mode && rknand->boot_ecc != ecc->strength)
692 rk_nfc_hw_ecc_setup(chip, ecc->strength);
713 struct nand_ecc_ctrl *ecc = &chip->ecc;
719 rknand->boot_ecc != ecc->strength) {
722 * a different ECC strength is in use for the boot blocks.
729 for (i = 0; i < ecc->steps; i++) {
738 memcpy(rk_nfc_buf_to_oob_ptr(chip, ecc->steps - 1),
746 /* Copy ECC data from the NFC buffer. */
749 ecc->bytes);
755 ecc->size);
767 struct nand_ecc_ctrl *ecc = &chip->ecc;
768 int oob_step = (ecc->bytes > 60) ? NFC_MAX_OOB_PER_STEP :
786 ecc->steps * oob_step,
797 * Configure the ECC algorithm supported by the boot ROM.
802 if (rknand->boot_ecc != ecc->strength)
808 rk_nfc_xfer_start(nfc, NFC_READ, ecc->steps, dma_data,
823 dma_unmap_single(nfc->dev, dma_oob, ecc->steps * oob_step,
832 for (i = 0; i < ecc->steps; i++) {
834 oob = chip->oob_poi + (ecc->steps - 1) * NFC_SYS_DATA_SIZE;
849 for (i = 0; i < (ecc->steps / 2); i++) {
871 if (boot_rom_mode && rknand->boot_ecc != ecc->strength)
872 rk_nfc_hw_ecc_setup(chip, ecc->strength);
878 dev_err(nfc->dev, "read page: %x ecc error!\n", page);
982 .ecc = rk_nfc_ooblayout_ecc,
989 struct nand_ecc_ctrl *ecc = &chip->ecc;
996 if (!ecc->size || !ecc->strength ||
997 ecc->strength > nfc_max_strength) {
998 chip->ecc.size = 1024;
999 ecc->steps = mtd->writesize / ecc->size;
1002 * HW ECC always requests the number of ECC bytes per 1024 byte
1005 max_strength = ((mtd->oobsize / ecc->steps) - 4) * 8 /
1016 dev_err(nfc->dev, "unsupported ECC strength\n");
1020 ecc->strength = strengths[i];
1022 ecc->steps = mtd->writesize / ecc->size;
1023 ecc->bytes = DIV_ROUND_UP(ecc->strength * fls(8 * chip->ecc.size), 8);
1034 struct nand_ecc_ctrl *ecc = &chip->ecc;
1044 if (ecc->engine_type != NAND_ECC_ENGINE_TYPE_ON_HOST)
1051 rknand->metadata_size = NFC_SYS_DATA_SIZE * ecc->steps;
1071 new_oob_len = ecc->steps * NFC_MAX_OOB_PER_STEP;
1101 chip->ecc.write_page_raw = rk_nfc_write_page_raw;
1102 chip->ecc.write_page = rk_nfc_write_page_hwecc;
1103 chip->ecc.write_oob = rk_nfc_write_oob;
1105 chip->ecc.read_page_raw = rk_nfc_read_page_raw;
1106 chip->ecc.read_page = rk_nfc_read_page_hwecc;
1107 chip->ecc.read_oob = rk_nfc_read_oob;
1174 chip->ecc.engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST;
1195 ret = of_property_read_u32(np, "rockchip,boot-ecc-strength",
1197 rknand->boot_ecc = ret ? chip->ecc.strength : tmp;