ecc 798 arch/arm/mach-pxa/spitz.c .ecc = akita_ooblayout_ecc, ecc 207 arch/mips/include/asm/octeon/cvmx-l2c-defs.h __BITFIELD_FIELD(uint64_t ecc:6, ecc 481 arch/mips/mm/cerr-sb1.c uint8_t ecc, lru; ecc 551 arch/mips/mm/cerr-sb1.c ecc = dc_ecc(datalo); ecc 552 arch/mips/mm/cerr-sb1.c if (ecc != datahi) { ecc 555 arch/mips/mm/cerr-sb1.c ecc ^= datahi; ecc 556 arch/mips/mm/cerr-sb1.c bits = hweight8(ecc); ecc 301 drivers/crypto/ccp/ccp-dev-v3.c | (op->u.ecc.function << REQ1_ECC_FUNCTION_SHIFT) ecc 575 drivers/crypto/ccp/ccp-dev-v3.c .ecc = ccp_perform_ecc, ecc 133 drivers/crypto/ccp/ccp-dev-v5.c } ecc; ecc 152 drivers/crypto/ccp/ccp-dev-v5.c #define CCP_ECC_MODE(p) ((p)->ecc.mode) ecc 153 drivers/crypto/ccp/ccp-dev-v5.c #define CCP_ECC_AFFINE(p) ((p)->ecc.one) ecc 571 drivers/crypto/ccp/ccp-dev-v5.c function.ecc.mode = op->u.ecc.function; ecc 1094 drivers/crypto/ccp/ccp-dev-v5.c .ecc = ccp5_perform_ecc, ecc 552 drivers/crypto/ccp/ccp-dev.h struct ccp_ecc_op ecc; ecc 658 drivers/crypto/ccp/ccp-dev.h int (*ecc)(struct ccp_op *); ecc 2145 drivers/crypto/ccp/ccp-ops.c struct ccp_ecc_engine *ecc = &cmd->u.ecc; ecc 2151 drivers/crypto/ccp/ccp-ops.c if (!ecc->u.mm.operand_1 || ecc 2152 drivers/crypto/ccp/ccp-ops.c (ecc->u.mm.operand_1_len > CCP_ECC_MODULUS_BYTES)) ecc 2155 drivers/crypto/ccp/ccp-ops.c if (ecc->function != CCP_ECC_FUNCTION_MINV_384BIT) ecc 2156 drivers/crypto/ccp/ccp-ops.c if (!ecc->u.mm.operand_2 || ecc 2157 drivers/crypto/ccp/ccp-ops.c (ecc->u.mm.operand_2_len > CCP_ECC_MODULUS_BYTES)) ecc 2160 drivers/crypto/ccp/ccp-ops.c if (!ecc->u.mm.result || ecc 2161 drivers/crypto/ccp/ccp-ops.c (ecc->u.mm.result_len < CCP_ECC_MODULUS_BYTES)) ecc 2184 drivers/crypto/ccp/ccp-ops.c ret = ccp_reverse_set_dm_area(&src, 0, ecc->mod, 0, ecc->mod_len); ecc 2190 drivers/crypto/ccp/ccp-ops.c ret = ccp_reverse_set_dm_area(&src, 0, ecc->u.mm.operand_1, 0, ecc 2191 drivers/crypto/ccp/ccp-ops.c ecc->u.mm.operand_1_len); ecc 2196 drivers/crypto/ccp/ccp-ops.c if (ecc->function != CCP_ECC_FUNCTION_MINV_384BIT) { ecc 2198 drivers/crypto/ccp/ccp-ops.c ret = ccp_reverse_set_dm_area(&src, 0, ecc->u.mm.operand_2, 0, ecc 2199 drivers/crypto/ccp/ccp-ops.c ecc->u.mm.operand_2_len); ecc 2222 drivers/crypto/ccp/ccp-ops.c op.u.ecc.function = cmd->u.ecc.function; ecc 2224 drivers/crypto/ccp/ccp-ops.c ret = cmd_q->ccp->vdata->perform->ecc(&op); ecc 2230 drivers/crypto/ccp/ccp-ops.c ecc->ecc_result = le16_to_cpup( ecc 2232 drivers/crypto/ccp/ccp-ops.c if (!(ecc->ecc_result & CCP_ECC_RESULT_SUCCESS)) { ecc 2238 drivers/crypto/ccp/ccp-ops.c ccp_reverse_get_dm_area(&dst, 0, ecc->u.mm.result, 0, ecc 2252 drivers/crypto/ccp/ccp-ops.c struct ccp_ecc_engine *ecc = &cmd->u.ecc; ecc 2258 drivers/crypto/ccp/ccp-ops.c if (!ecc->u.pm.point_1.x || ecc 2259 drivers/crypto/ccp/ccp-ops.c (ecc->u.pm.point_1.x_len > CCP_ECC_MODULUS_BYTES) || ecc 2260 drivers/crypto/ccp/ccp-ops.c !ecc->u.pm.point_1.y || ecc 2261 drivers/crypto/ccp/ccp-ops.c (ecc->u.pm.point_1.y_len > CCP_ECC_MODULUS_BYTES)) ecc 2264 drivers/crypto/ccp/ccp-ops.c if (ecc->function == CCP_ECC_FUNCTION_PADD_384BIT) { ecc 2265 drivers/crypto/ccp/ccp-ops.c if (!ecc->u.pm.point_2.x || ecc 2266 drivers/crypto/ccp/ccp-ops.c (ecc->u.pm.point_2.x_len > CCP_ECC_MODULUS_BYTES) || ecc 2267 drivers/crypto/ccp/ccp-ops.c !ecc->u.pm.point_2.y || ecc 2268 drivers/crypto/ccp/ccp-ops.c (ecc->u.pm.point_2.y_len > CCP_ECC_MODULUS_BYTES)) ecc 2271 drivers/crypto/ccp/ccp-ops.c if (!ecc->u.pm.domain_a || ecc 2272 drivers/crypto/ccp/ccp-ops.c (ecc->u.pm.domain_a_len > CCP_ECC_MODULUS_BYTES)) ecc 2275 drivers/crypto/ccp/ccp-ops.c if (ecc->function == CCP_ECC_FUNCTION_PMUL_384BIT) ecc 2276 drivers/crypto/ccp/ccp-ops.c if (!ecc->u.pm.scalar || ecc 2277 drivers/crypto/ccp/ccp-ops.c (ecc->u.pm.scalar_len > CCP_ECC_MODULUS_BYTES)) ecc 2281 drivers/crypto/ccp/ccp-ops.c if (!ecc->u.pm.result.x || ecc 2282 drivers/crypto/ccp/ccp-ops.c (ecc->u.pm.result.x_len < CCP_ECC_MODULUS_BYTES) || ecc 2283 drivers/crypto/ccp/ccp-ops.c !ecc->u.pm.result.y || ecc 2284 drivers/crypto/ccp/ccp-ops.c (ecc->u.pm.result.y_len < CCP_ECC_MODULUS_BYTES)) ecc 2307 drivers/crypto/ccp/ccp-ops.c ret = ccp_reverse_set_dm_area(&src, 0, ecc->mod, 0, ecc->mod_len); ecc 2313 drivers/crypto/ccp/ccp-ops.c ret = ccp_reverse_set_dm_area(&src, 0, ecc->u.pm.point_1.x, 0, ecc 2314 drivers/crypto/ccp/ccp-ops.c ecc->u.pm.point_1.x_len); ecc 2318 drivers/crypto/ccp/ccp-ops.c ret = ccp_reverse_set_dm_area(&src, 0, ecc->u.pm.point_1.y, 0, ecc 2319 drivers/crypto/ccp/ccp-ops.c ecc->u.pm.point_1.y_len); ecc 2328 drivers/crypto/ccp/ccp-ops.c if (ecc->function == CCP_ECC_FUNCTION_PADD_384BIT) { ecc 2330 drivers/crypto/ccp/ccp-ops.c ret = ccp_reverse_set_dm_area(&src, 0, ecc->u.pm.point_2.x, 0, ecc 2331 drivers/crypto/ccp/ccp-ops.c ecc->u.pm.point_2.x_len); ecc 2335 drivers/crypto/ccp/ccp-ops.c ret = ccp_reverse_set_dm_area(&src, 0, ecc->u.pm.point_2.y, 0, ecc 2336 drivers/crypto/ccp/ccp-ops.c ecc->u.pm.point_2.y_len); ecc 2346 drivers/crypto/ccp/ccp-ops.c ret = ccp_reverse_set_dm_area(&src, 0, ecc->u.pm.domain_a, 0, ecc 2347 drivers/crypto/ccp/ccp-ops.c ecc->u.pm.domain_a_len); ecc 2352 drivers/crypto/ccp/ccp-ops.c if (ecc->function == CCP_ECC_FUNCTION_PMUL_384BIT) { ecc 2355 drivers/crypto/ccp/ccp-ops.c ecc->u.pm.scalar, 0, ecc 2356 drivers/crypto/ccp/ccp-ops.c ecc->u.pm.scalar_len); ecc 2380 drivers/crypto/ccp/ccp-ops.c op.u.ecc.function = cmd->u.ecc.function; ecc 2382 drivers/crypto/ccp/ccp-ops.c ret = cmd_q->ccp->vdata->perform->ecc(&op); ecc 2388 drivers/crypto/ccp/ccp-ops.c ecc->ecc_result = le16_to_cpup( ecc 2390 drivers/crypto/ccp/ccp-ops.c if (!(ecc->ecc_result & CCP_ECC_RESULT_SUCCESS)) { ecc 2401 drivers/crypto/ccp/ccp-ops.c ccp_reverse_get_dm_area(&dst, 0, ecc->u.pm.result.x, 0, ecc 2404 drivers/crypto/ccp/ccp-ops.c ccp_reverse_get_dm_area(&dst, 0, ecc->u.pm.result.y, 0, ecc 2423 drivers/crypto/ccp/ccp-ops.c struct ccp_ecc_engine *ecc = &cmd->u.ecc; ecc 2425 drivers/crypto/ccp/ccp-ops.c ecc->ecc_result = 0; ecc 2427 drivers/crypto/ccp/ccp-ops.c if (!ecc->mod || ecc 2428 drivers/crypto/ccp/ccp-ops.c (ecc->mod_len > CCP_ECC_MODULUS_BYTES)) ecc 2431 drivers/crypto/ccp/ccp-ops.c switch (ecc->function) { ecc 228 drivers/dma/ti/edma.c struct edma_cc *ecc; ecc 302 drivers/dma/ti/edma.c static inline unsigned int edma_read(struct edma_cc *ecc, int offset) ecc 304 drivers/dma/ti/edma.c return (unsigned int)__raw_readl(ecc->base + offset); ecc 307 drivers/dma/ti/edma.c static inline void edma_write(struct edma_cc *ecc, int offset, int val) ecc 309 drivers/dma/ti/edma.c __raw_writel(val, ecc->base + offset); ecc 312 drivers/dma/ti/edma.c static inline void edma_modify(struct edma_cc *ecc, int offset, unsigned and, ecc 315 drivers/dma/ti/edma.c unsigned val = edma_read(ecc, offset); ecc 319 drivers/dma/ti/edma.c edma_write(ecc, offset, val); ecc 322 drivers/dma/ti/edma.c static inline void edma_and(struct edma_cc *ecc, int offset, unsigned and) ecc 324 drivers/dma/ti/edma.c unsigned val = edma_read(ecc, offset); ecc 327 drivers/dma/ti/edma.c edma_write(ecc, offset, val); ecc 330 drivers/dma/ti/edma.c static inline void edma_or(struct edma_cc *ecc, int offset, unsigned or) ecc 332 drivers/dma/ti/edma.c unsigned val = edma_read(ecc, offset); ecc 335 drivers/dma/ti/edma.c edma_write(ecc, offset, val); ecc 338 drivers/dma/ti/edma.c static inline unsigned int edma_read_array(struct edma_cc *ecc, int offset, ecc 341 drivers/dma/ti/edma.c return edma_read(ecc, offset + (i << 2)); ecc 344 drivers/dma/ti/edma.c static inline void edma_write_array(struct edma_cc *ecc, int offset, int i, ecc 347 drivers/dma/ti/edma.c edma_write(ecc, offset + (i << 2), val); ecc 350 drivers/dma/ti/edma.c static inline void edma_modify_array(struct edma_cc *ecc, int offset, int i, ecc 353 drivers/dma/ti/edma.c edma_modify(ecc, offset + (i << 2), and, or); ecc 356 drivers/dma/ti/edma.c static inline void edma_or_array(struct edma_cc *ecc, int offset, int i, ecc 359 drivers/dma/ti/edma.c edma_or(ecc, offset + (i << 2), or); ecc 362 drivers/dma/ti/edma.c static inline void edma_or_array2(struct edma_cc *ecc, int offset, int i, int j, ecc 365 drivers/dma/ti/edma.c edma_or(ecc, offset + ((i * 2 + j) << 2), or); ecc 368 drivers/dma/ti/edma.c static inline void edma_write_array2(struct edma_cc *ecc, int offset, int i, ecc 371 drivers/dma/ti/edma.c edma_write(ecc, offset + ((i * 2 + j) << 2), val); ecc 374 drivers/dma/ti/edma.c static inline unsigned int edma_shadow0_read(struct edma_cc *ecc, int offset) ecc 376 drivers/dma/ti/edma.c return edma_read(ecc, EDMA_SHADOW0 + offset); ecc 379 drivers/dma/ti/edma.c static inline unsigned int edma_shadow0_read_array(struct edma_cc *ecc, ecc 382 drivers/dma/ti/edma.c return edma_read(ecc, EDMA_SHADOW0 + offset + (i << 2)); ecc 385 drivers/dma/ti/edma.c static inline void edma_shadow0_write(struct edma_cc *ecc, int offset, ecc 388 drivers/dma/ti/edma.c edma_write(ecc, EDMA_SHADOW0 + offset, val); ecc 391 drivers/dma/ti/edma.c static inline void edma_shadow0_write_array(struct edma_cc *ecc, int offset, ecc 394 drivers/dma/ti/edma.c edma_write(ecc, EDMA_SHADOW0 + offset + (i << 2), val); ecc 397 drivers/dma/ti/edma.c static inline unsigned int edma_param_read(struct edma_cc *ecc, int offset, ecc 400 drivers/dma/ti/edma.c return edma_read(ecc, EDMA_PARM + offset + (param_no << 5)); ecc 403 drivers/dma/ti/edma.c static inline void edma_param_write(struct edma_cc *ecc, int offset, ecc 406 drivers/dma/ti/edma.c edma_write(ecc, EDMA_PARM + offset + (param_no << 5), val); ecc 409 drivers/dma/ti/edma.c static inline void edma_param_modify(struct edma_cc *ecc, int offset, ecc 412 drivers/dma/ti/edma.c edma_modify(ecc, EDMA_PARM + offset + (param_no << 5), and, or); ecc 415 drivers/dma/ti/edma.c static inline void edma_param_and(struct edma_cc *ecc, int offset, int param_no, ecc 418 drivers/dma/ti/edma.c edma_and(ecc, EDMA_PARM + offset + (param_no << 5), and); ecc 421 drivers/dma/ti/edma.c static inline void edma_param_or(struct edma_cc *ecc, int offset, int param_no, ecc 424 drivers/dma/ti/edma.c edma_or(ecc, EDMA_PARM + offset + (param_no << 5), or); ecc 427 drivers/dma/ti/edma.c static void edma_assign_priority_to_queue(struct edma_cc *ecc, int queue_no, ecc 432 drivers/dma/ti/edma.c edma_modify(ecc, EDMA_QUEPRI, ~(0x7 << bit), ((priority & 0x7) << bit)); ecc 437 drivers/dma/ti/edma.c struct edma_cc *ecc = echan->ecc; ecc 440 drivers/dma/ti/edma.c if (ecc->chmap_exist) { ecc 442 drivers/dma/ti/edma.c edma_write_array(ecc, EDMA_DCHMAP, channel, (slot << 5)); ecc 448 drivers/dma/ti/edma.c struct edma_cc *ecc = echan->ecc; ecc 454 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_ICR, idx, ch_bit); ecc 455 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_IESR, idx, ch_bit); ecc 457 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_IECR, idx, ch_bit); ecc 464 drivers/dma/ti/edma.c static void edma_write_slot(struct edma_cc *ecc, unsigned slot, ecc 468 drivers/dma/ti/edma.c if (slot >= ecc->num_slots) ecc 470 drivers/dma/ti/edma.c memcpy_toio(ecc->base + PARM_OFFSET(slot), param, PARM_SIZE); ecc 473 drivers/dma/ti/edma.c static int edma_read_slot(struct edma_cc *ecc, unsigned slot, ecc 477 drivers/dma/ti/edma.c if (slot >= ecc->num_slots) ecc 479 drivers/dma/ti/edma.c memcpy_fromio(param, ecc->base + PARM_OFFSET(slot), PARM_SIZE); ecc 499 drivers/dma/ti/edma.c static int edma_alloc_slot(struct edma_cc *ecc, int slot) ecc 504 drivers/dma/ti/edma.c if (ecc->chmap_exist && slot < ecc->num_channels) ecc 509 drivers/dma/ti/edma.c if (ecc->chmap_exist) ecc 512 drivers/dma/ti/edma.c slot = ecc->num_channels; ecc 514 drivers/dma/ti/edma.c slot = find_next_zero_bit(ecc->slot_inuse, ecc 515 drivers/dma/ti/edma.c ecc->num_slots, ecc 517 drivers/dma/ti/edma.c if (slot == ecc->num_slots) ecc 519 drivers/dma/ti/edma.c if (!test_and_set_bit(slot, ecc->slot_inuse)) ecc 522 drivers/dma/ti/edma.c } else if (slot >= ecc->num_slots) { ecc 524 drivers/dma/ti/edma.c } else if (test_and_set_bit(slot, ecc->slot_inuse)) { ecc 528 drivers/dma/ti/edma.c edma_write_slot(ecc, slot, &dummy_paramset); ecc 530 drivers/dma/ti/edma.c return EDMA_CTLR_CHAN(ecc->id, slot); ecc 533 drivers/dma/ti/edma.c static void edma_free_slot(struct edma_cc *ecc, unsigned slot) ecc 536 drivers/dma/ti/edma.c if (slot >= ecc->num_slots) ecc 539 drivers/dma/ti/edma.c edma_write_slot(ecc, slot, &dummy_paramset); ecc 540 drivers/dma/ti/edma.c clear_bit(slot, ecc->slot_inuse); ecc 551 drivers/dma/ti/edma.c static void edma_link(struct edma_cc *ecc, unsigned from, unsigned to) ecc 554 drivers/dma/ti/edma.c dev_warn(ecc->dev, "Ignoring eDMA instance for linking\n"); ecc 558 drivers/dma/ti/edma.c if (from >= ecc->num_slots || to >= ecc->num_slots) ecc 561 drivers/dma/ti/edma.c edma_param_modify(ecc, PARM_LINK_BCNTRLD, from, 0xffff0000, ecc 573 drivers/dma/ti/edma.c static dma_addr_t edma_get_position(struct edma_cc *ecc, unsigned slot, ecc 582 drivers/dma/ti/edma.c return edma_read(ecc, offs); ecc 593 drivers/dma/ti/edma.c struct edma_cc *ecc = echan->ecc; ecc 600 drivers/dma/ti/edma.c dev_dbg(ecc->dev, "ESR%d %08x\n", idx, ecc 601 drivers/dma/ti/edma.c edma_shadow0_read_array(ecc, SH_ESR, idx)); ecc 602 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_ESR, idx, ch_bit); ecc 605 drivers/dma/ti/edma.c dev_dbg(ecc->dev, "ER%d %08x\n", idx, ecc 606 drivers/dma/ti/edma.c edma_shadow0_read_array(ecc, SH_ER, idx)); ecc 608 drivers/dma/ti/edma.c edma_write_array(ecc, EDMA_ECR, idx, ch_bit); ecc 609 drivers/dma/ti/edma.c edma_write_array(ecc, EDMA_EMCR, idx, ch_bit); ecc 611 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_SECR, idx, ch_bit); ecc 612 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_EESR, idx, ch_bit); ecc 613 drivers/dma/ti/edma.c dev_dbg(ecc->dev, "EER%d %08x\n", idx, ecc 614 drivers/dma/ti/edma.c edma_shadow0_read_array(ecc, SH_EER, idx)); ecc 620 drivers/dma/ti/edma.c struct edma_cc *ecc = echan->ecc; ecc 625 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_EECR, idx, ch_bit); ecc 626 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_ECR, idx, ch_bit); ecc 627 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_SECR, idx, ch_bit); ecc 628 drivers/dma/ti/edma.c edma_write_array(ecc, EDMA_EMCR, idx, ch_bit); ecc 631 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_ICR, idx, ch_bit); ecc 633 drivers/dma/ti/edma.c dev_dbg(ecc->dev, "EER%d %08x\n", idx, ecc 634 drivers/dma/ti/edma.c edma_shadow0_read_array(ecc, SH_EER, idx)); ecc 649 drivers/dma/ti/edma.c edma_shadow0_write_array(echan->ecc, SH_EECR, ecc 659 drivers/dma/ti/edma.c edma_shadow0_write_array(echan->ecc, SH_EESR, ecc 666 drivers/dma/ti/edma.c struct edma_cc *ecc = echan->ecc; ecc 671 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_ESR, idx, ch_bit); ecc 673 drivers/dma/ti/edma.c dev_dbg(ecc->dev, "ESR%d %08x\n", idx, ecc 674 drivers/dma/ti/edma.c edma_shadow0_read_array(ecc, SH_ESR, idx)); ecc 679 drivers/dma/ti/edma.c struct edma_cc *ecc = echan->ecc; ecc 684 drivers/dma/ti/edma.c dev_dbg(ecc->dev, "EMR%d %08x\n", idx, ecc 685 drivers/dma/ti/edma.c edma_read_array(ecc, EDMA_EMR, idx)); ecc 686 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_ECR, idx, ch_bit); ecc 688 drivers/dma/ti/edma.c edma_write_array(ecc, EDMA_EMCR, idx, ch_bit); ecc 690 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_SECR, idx, ch_bit); ecc 691 drivers/dma/ti/edma.c edma_write(ecc, EDMA_CCERRCLR, BIT(16) | BIT(1) | BIT(0)); ecc 698 drivers/dma/ti/edma.c struct edma_cc *ecc = echan->ecc; ecc 704 drivers/dma/ti/edma.c eventq_no = ecc->default_queue; ecc 705 drivers/dma/ti/edma.c if (eventq_no >= ecc->num_tc) ecc 709 drivers/dma/ti/edma.c edma_modify_array(ecc, EDMA_DMAQNUM, (channel >> 3), ~(0x7 << bit), ecc 716 drivers/dma/ti/edma.c struct edma_cc *ecc = echan->ecc; ecc 720 drivers/dma/ti/edma.c edma_or_array2(ecc, EDMA_DRAE, 0, EDMA_REG_ARRAY_INDEX(channel), ecc 764 drivers/dma/ti/edma.c struct edma_cc *ecc = echan->ecc; ecc 789 drivers/dma/ti/edma.c edma_write_slot(ecc, echan->slot[i], &edesc->pset[j].param); ecc 814 drivers/dma/ti/edma.c edma_link(ecc, echan->slot[i], echan->slot[i + 1]); ecc 826 drivers/dma/ti/edma.c edma_link(ecc, echan->slot[nslots - 1], echan->slot[1]); ecc 828 drivers/dma/ti/edma.c edma_link(ecc, echan->slot[nslots - 1], ecc 829 drivers/dma/ti/edma.c echan->ecc->dummy_slot); ecc 1103 drivers/dma/ti/edma.c edma_alloc_slot(echan->ecc, EDMA_SLOT_ANY); ecc 1233 drivers/dma/ti/edma.c echan->slot[1] = edma_alloc_slot(echan->ecc, ecc 1350 drivers/dma/ti/edma.c edma_alloc_slot(echan->ecc, EDMA_SLOT_ANY); ecc 1462 drivers/dma/ti/edma.c struct edma_cc *ecc = data; ecc 1468 drivers/dma/ti/edma.c ctlr = ecc->id; ecc 1472 drivers/dma/ti/edma.c dev_vdbg(ecc->dev, "dma_irq_handler\n"); ecc 1474 drivers/dma/ti/edma.c sh_ipr = edma_shadow0_read_array(ecc, SH_IPR, 0); ecc 1476 drivers/dma/ti/edma.c sh_ipr = edma_shadow0_read_array(ecc, SH_IPR, 1); ecc 1479 drivers/dma/ti/edma.c sh_ier = edma_shadow0_read_array(ecc, SH_IER, 1); ecc 1482 drivers/dma/ti/edma.c sh_ier = edma_shadow0_read_array(ecc, SH_IER, 0); ecc 1496 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_ICR, bank, BIT(slot)); ecc 1497 drivers/dma/ti/edma.c edma_completion_handler(&ecc->slave_chans[channel]); ecc 1501 drivers/dma/ti/edma.c edma_shadow0_write(ecc, SH_IEVAL, 1); ecc 1507 drivers/dma/ti/edma.c struct edma_cc *ecc = echan->ecc; ecc 1517 drivers/dma/ti/edma.c err = edma_read_slot(ecc, echan->slot[0], &p); ecc 1548 drivers/dma/ti/edma.c static inline bool edma_error_pending(struct edma_cc *ecc) ecc 1550 drivers/dma/ti/edma.c if (edma_read_array(ecc, EDMA_EMR, 0) || ecc 1551 drivers/dma/ti/edma.c edma_read_array(ecc, EDMA_EMR, 1) || ecc 1552 drivers/dma/ti/edma.c edma_read(ecc, EDMA_QEMR) || edma_read(ecc, EDMA_CCERR)) ecc 1561 drivers/dma/ti/edma.c struct edma_cc *ecc = data; ecc 1567 drivers/dma/ti/edma.c ctlr = ecc->id; ecc 1571 drivers/dma/ti/edma.c dev_vdbg(ecc->dev, "dma_ccerr_handler\n"); ecc 1573 drivers/dma/ti/edma.c if (!edma_error_pending(ecc)) { ecc 1579 drivers/dma/ti/edma.c dev_err(ecc->dev, "%s: Error interrupt without error event!\n", ecc 1581 drivers/dma/ti/edma.c edma_write(ecc, EDMA_EEVAL, 1); ecc 1590 drivers/dma/ti/edma.c val = edma_read_array(ecc, EDMA_EMR, j); ecc 1594 drivers/dma/ti/edma.c dev_dbg(ecc->dev, "EMR%d 0x%08x\n", j, val); ecc 1601 drivers/dma/ti/edma.c edma_write_array(ecc, EDMA_EMCR, j, BIT(i)); ecc 1603 drivers/dma/ti/edma.c edma_shadow0_write_array(ecc, SH_SECR, j, ecc 1605 drivers/dma/ti/edma.c edma_error_handler(&ecc->slave_chans[k]); ecc 1609 drivers/dma/ti/edma.c val = edma_read(ecc, EDMA_QEMR); ecc 1611 drivers/dma/ti/edma.c dev_dbg(ecc->dev, "QEMR 0x%02x\n", val); ecc 1613 drivers/dma/ti/edma.c edma_write(ecc, EDMA_QEMCR, val); ecc 1614 drivers/dma/ti/edma.c edma_shadow0_write(ecc, SH_QSECR, val); ecc 1617 drivers/dma/ti/edma.c val = edma_read(ecc, EDMA_CCERR); ecc 1619 drivers/dma/ti/edma.c dev_warn(ecc->dev, "CCERR 0x%08x\n", val); ecc 1621 drivers/dma/ti/edma.c edma_write(ecc, EDMA_CCERRCLR, val); ecc 1624 drivers/dma/ti/edma.c if (!edma_error_pending(ecc)) ecc 1630 drivers/dma/ti/edma.c edma_write(ecc, EDMA_EEVAL, 1); ecc 1638 drivers/dma/ti/edma.c struct edma_cc *ecc = echan->ecc; ecc 1639 drivers/dma/ti/edma.c struct device *dev = ecc->dev; ecc 1645 drivers/dma/ti/edma.c } else if (ecc->tc_list) { ecc 1647 drivers/dma/ti/edma.c echan->tc = &ecc->tc_list[ecc->info->default_queue]; ecc 1655 drivers/dma/ti/edma.c echan->slot[0] = edma_alloc_slot(ecc, echan->ch_num); ecc 1682 drivers/dma/ti/edma.c struct device *dev = echan->ecc->dev; ecc 1693 drivers/dma/ti/edma.c edma_free_slot(echan->ecc, echan->slot[i]); ecc 1699 drivers/dma/ti/edma.c edma_set_chmap(echan, echan->ecc->dummy_slot); ecc 1752 drivers/dma/ti/edma.c pos = edma_get_position(echan->ecc, echan->slot[0], dst); ecc 1768 drivers/dma/ti/edma.c while (edma_shadow0_read_array(echan->ecc, event_reg, idx) & ch_bit) { ecc 1769 drivers/dma/ti/edma.c pos = edma_get_position(echan->ecc, echan->slot[0], dst); ecc 1892 drivers/dma/ti/edma.c static void edma_dma_init(struct edma_cc *ecc, bool legacy_mode) ecc 1894 drivers/dma/ti/edma.c struct dma_device *s_ddev = &ecc->dma_slave; ecc 1896 drivers/dma/ti/edma.c s32 *memcpy_channels = ecc->info->memcpy_channels; ecc 1902 drivers/dma/ti/edma.c if (ecc->legacy_mode && !memcpy_channels) { ecc 1903 drivers/dma/ti/edma.c dev_warn(ecc->dev, ecc 1929 drivers/dma/ti/edma.c s_ddev->dev = ecc->dev; ecc 1933 drivers/dma/ti/edma.c m_ddev = devm_kzalloc(ecc->dev, sizeof(*m_ddev), GFP_KERNEL); ecc 1935 drivers/dma/ti/edma.c dev_warn(ecc->dev, "memcpy is disabled due to OoM\n"); ecc 1939 drivers/dma/ti/edma.c ecc->dma_memcpy = m_ddev; ecc 1960 drivers/dma/ti/edma.c m_ddev->dev = ecc->dev; ecc 1962 drivers/dma/ti/edma.c } else if (!ecc->legacy_mode) { ecc 1963 drivers/dma/ti/edma.c dev_info(ecc->dev, "memcpy is disabled\n"); ecc 1967 drivers/dma/ti/edma.c for (i = 0; i < ecc->num_channels; i++) { ecc 1968 drivers/dma/ti/edma.c struct edma_chan *echan = &ecc->slave_chans[i]; ecc 1969 drivers/dma/ti/edma.c echan->ch_num = EDMA_CTLR_CHAN(ecc->id, i); ecc 1970 drivers/dma/ti/edma.c echan->ecc = ecc; ecc 1985 drivers/dma/ti/edma.c struct edma_cc *ecc) ecc 1992 drivers/dma/ti/edma.c cccfg = edma_read(ecc, EDMA_CCCFG); ecc 1995 drivers/dma/ti/edma.c ecc->num_region = BIT(value); ecc 1998 drivers/dma/ti/edma.c ecc->num_channels = BIT(value + 1); ecc 2001 drivers/dma/ti/edma.c ecc->num_qchannels = value * 2; ecc 2004 drivers/dma/ti/edma.c ecc->num_slots = BIT(value + 4); ecc 2007 drivers/dma/ti/edma.c ecc->num_tc = value + 1; ecc 2009 drivers/dma/ti/edma.c ecc->chmap_exist = (cccfg & CHMAP_EXIST) ? true : false; ecc 2012 drivers/dma/ti/edma.c dev_dbg(dev, "num_region: %u\n", ecc->num_region); ecc 2013 drivers/dma/ti/edma.c dev_dbg(dev, "num_channels: %u\n", ecc->num_channels); ecc 2014 drivers/dma/ti/edma.c dev_dbg(dev, "num_qchannels: %u\n", ecc->num_qchannels); ecc 2015 drivers/dma/ti/edma.c dev_dbg(dev, "num_slots: %u\n", ecc->num_slots); ecc 2016 drivers/dma/ti/edma.c dev_dbg(dev, "num_tc: %u\n", ecc->num_tc); ecc 2017 drivers/dma/ti/edma.c dev_dbg(dev, "chmap_exist: %s\n", ecc->chmap_exist ? "yes" : "no"); ecc 2033 drivers/dma/ti/edma.c queue_priority_map = devm_kcalloc(dev, ecc->num_tc + 1, sizeof(s8), ecc 2038 drivers/dma/ti/edma.c for (i = 0; i < ecc->num_tc; i++) { ecc 2198 drivers/dma/ti/edma.c struct edma_cc *ecc = ofdma->of_dma_data; ecc 2203 drivers/dma/ti/edma.c if (!ecc || dma_spec->args_count < 1) ecc 2206 drivers/dma/ti/edma.c for (i = 0; i < ecc->num_channels; i++) { ecc 2207 drivers/dma/ti/edma.c echan = &ecc->slave_chans[i]; ecc 2217 drivers/dma/ti/edma.c if (echan->ecc->legacy_mode && dma_spec->args_count == 1) ecc 2220 drivers/dma/ti/edma.c if (!echan->ecc->legacy_mode && dma_spec->args_count == 2 && ecc 2221 drivers/dma/ti/edma.c dma_spec->args[1] < echan->ecc->num_tc) { ecc 2222 drivers/dma/ti/edma.c echan->tc = &echan->ecc->tc_list[dma_spec->args[1]]; ecc 2260 drivers/dma/ti/edma.c struct edma_cc *ecc; ecc 2292 drivers/dma/ti/edma.c ecc = devm_kzalloc(dev, sizeof(*ecc), GFP_KERNEL); ecc 2293 drivers/dma/ti/edma.c if (!ecc) ecc 2296 drivers/dma/ti/edma.c ecc->dev = dev; ecc 2297 drivers/dma/ti/edma.c ecc->id = pdev->id; ecc 2298 drivers/dma/ti/edma.c ecc->legacy_mode = legacy_mode; ecc 2300 drivers/dma/ti/edma.c if (ecc->id < 0) ecc 2301 drivers/dma/ti/edma.c ecc->id = 0; ecc 2312 drivers/dma/ti/edma.c ecc->base = devm_ioremap_resource(dev, mem); ecc 2313 drivers/dma/ti/edma.c if (IS_ERR(ecc->base)) ecc 2314 drivers/dma/ti/edma.c return PTR_ERR(ecc->base); ecc 2316 drivers/dma/ti/edma.c platform_set_drvdata(pdev, ecc); ecc 2319 drivers/dma/ti/edma.c ret = edma_setup_from_hw(dev, info, ecc); ecc 2324 drivers/dma/ti/edma.c ecc->slave_chans = devm_kcalloc(dev, ecc->num_channels, ecc 2325 drivers/dma/ti/edma.c sizeof(*ecc->slave_chans), GFP_KERNEL); ecc 2326 drivers/dma/ti/edma.c if (!ecc->slave_chans) ecc 2329 drivers/dma/ti/edma.c ecc->slot_inuse = devm_kcalloc(dev, BITS_TO_LONGS(ecc->num_slots), ecc 2331 drivers/dma/ti/edma.c if (!ecc->slot_inuse) ecc 2334 drivers/dma/ti/edma.c ecc->default_queue = info->default_queue; ecc 2341 drivers/dma/ti/edma.c bitmap_set(ecc->slot_inuse, rsv_slots[i][0], ecc 2346 drivers/dma/ti/edma.c for (i = 0; i < ecc->num_slots; i++) { ecc 2348 drivers/dma/ti/edma.c if (!test_bit(i, ecc->slot_inuse)) ecc 2349 drivers/dma/ti/edma.c edma_write_slot(ecc, i, &dummy_paramset); ecc 2368 drivers/dma/ti/edma.c ecc); ecc 2373 drivers/dma/ti/edma.c ecc->ccint = irq; ecc 2384 drivers/dma/ti/edma.c ecc); ecc 2389 drivers/dma/ti/edma.c ecc->ccerrint = irq; ecc 2392 drivers/dma/ti/edma.c ecc->dummy_slot = edma_alloc_slot(ecc, EDMA_SLOT_ANY); ecc 2393 drivers/dma/ti/edma.c if (ecc->dummy_slot < 0) { ecc 2395 drivers/dma/ti/edma.c return ecc->dummy_slot; ecc 2400 drivers/dma/ti/edma.c if (!ecc->legacy_mode) { ecc 2404 drivers/dma/ti/edma.c ecc->tc_list = devm_kcalloc(dev, ecc->num_tc, ecc 2405 drivers/dma/ti/edma.c sizeof(*ecc->tc_list), GFP_KERNEL); ecc 2406 drivers/dma/ti/edma.c if (!ecc->tc_list) { ecc 2414 drivers/dma/ti/edma.c if (ret || i == ecc->num_tc) ecc 2417 drivers/dma/ti/edma.c ecc->tc_list[i].node = tc_args.np; ecc 2418 drivers/dma/ti/edma.c ecc->tc_list[i].id = i; ecc 2429 drivers/dma/ti/edma.c edma_assign_priority_to_queue(ecc, queue_priority_mapping[i][0], ecc 2432 drivers/dma/ti/edma.c edma_write_array2(ecc, EDMA_DRAE, 0, 0, 0x0); ecc 2433 drivers/dma/ti/edma.c edma_write_array2(ecc, EDMA_DRAE, 0, 1, 0x0); ecc 2434 drivers/dma/ti/edma.c edma_write_array(ecc, EDMA_QRAE, 0, 0x0); ecc 2436 drivers/dma/ti/edma.c ecc->info = info; ecc 2439 drivers/dma/ti/edma.c edma_dma_init(ecc, legacy_mode); ecc 2441 drivers/dma/ti/edma.c for (i = 0; i < ecc->num_channels; i++) { ecc 2443 drivers/dma/ti/edma.c edma_assign_channel_eventq(&ecc->slave_chans[i], ecc 2446 drivers/dma/ti/edma.c edma_set_chmap(&ecc->slave_chans[i], ecc->dummy_slot); ecc 2449 drivers/dma/ti/edma.c ecc->dma_slave.filter.map = info->slave_map; ecc 2450 drivers/dma/ti/edma.c ecc->dma_slave.filter.mapcnt = info->slavecnt; ecc 2451 drivers/dma/ti/edma.c ecc->dma_slave.filter.fn = edma_filter_fn; ecc 2453 drivers/dma/ti/edma.c ret = dma_async_device_register(&ecc->dma_slave); ecc 2459 drivers/dma/ti/edma.c if (ecc->dma_memcpy) { ecc 2460 drivers/dma/ti/edma.c ret = dma_async_device_register(ecc->dma_memcpy); ecc 2464 drivers/dma/ti/edma.c dma_async_device_unregister(&ecc->dma_slave); ecc 2470 drivers/dma/ti/edma.c of_dma_controller_register(node, of_edma_xlate, ecc); ecc 2477 drivers/dma/ti/edma.c edma_free_slot(ecc, ecc->dummy_slot); ecc 2495 drivers/dma/ti/edma.c struct edma_cc *ecc = dev_get_drvdata(dev); ecc 2497 drivers/dma/ti/edma.c devm_free_irq(dev, ecc->ccint, ecc); ecc 2498 drivers/dma/ti/edma.c devm_free_irq(dev, ecc->ccerrint, ecc); ecc 2500 drivers/dma/ti/edma.c edma_cleanupp_vchan(&ecc->dma_slave); ecc 2504 drivers/dma/ti/edma.c dma_async_device_unregister(&ecc->dma_slave); ecc 2505 drivers/dma/ti/edma.c if (ecc->dma_memcpy) ecc 2506 drivers/dma/ti/edma.c dma_async_device_unregister(ecc->dma_memcpy); ecc 2507 drivers/dma/ti/edma.c edma_free_slot(ecc, ecc->dummy_slot); ecc 2515 drivers/dma/ti/edma.c struct edma_cc *ecc = dev_get_drvdata(dev); ecc 2516 drivers/dma/ti/edma.c struct edma_chan *echan = ecc->slave_chans; ecc 2519 drivers/dma/ti/edma.c for (i = 0; i < ecc->num_channels; i++) { ecc 2529 drivers/dma/ti/edma.c struct edma_cc *ecc = dev_get_drvdata(dev); ecc 2530 drivers/dma/ti/edma.c struct edma_chan *echan = ecc->slave_chans; ecc 2535 drivers/dma/ti/edma.c edma_write_slot(ecc, ecc->dummy_slot, &dummy_paramset); ecc 2537 drivers/dma/ti/edma.c queue_priority_mapping = ecc->info->queue_priority_mapping; ecc 2541 drivers/dma/ti/edma.c edma_assign_priority_to_queue(ecc, queue_priority_mapping[i][0], ecc 2544 drivers/dma/ti/edma.c for (i = 0; i < ecc->num_channels; i++) { ecc 2547 drivers/dma/ti/edma.c edma_or_array2(ecc, EDMA_DRAE, 0, ecc 197 drivers/edac/fsl_ddr_edac.c u8 ecc = 0; ecc 213 drivers/edac/fsl_ddr_edac.c ecc |= bit_cnt << i; ecc 216 drivers/edac/fsl_ddr_edac.c return ecc; ecc 1040 drivers/edac/mce_amd.c int ecc; ecc 1070 drivers/edac/mce_amd.c ecc = (m->status >> 45) & 0x3; ecc 1071 drivers/edac/mce_amd.c if (ecc) ecc 1072 drivers/edac/mce_amd.c pr_cont("|%sECC", ((ecc == 2) ? "C" : "U")); ecc 2590 drivers/gpu/drm/omapdrm/dss/dsi.c u8 data_type, u16 len, u8 ecc) ecc 2600 drivers/gpu/drm/omapdrm/dss/dsi.c FLD_VAL(ecc, 31, 24); ecc 2619 drivers/gpu/drm/omapdrm/dss/dsi.c u8 *data, u16 len, u8 ecc) ecc 2638 drivers/gpu/drm/omapdrm/dss/dsi.c dsi_vc_write_long_header(dsi, channel, data_type, len, ecc); ecc 2682 drivers/gpu/drm/omapdrm/dss/dsi.c u16 data, u8 ecc) ecc 2703 drivers/gpu/drm/omapdrm/dss/dsi.c r = (data_id << 0) | (data << 8) | (ecc << 24); ecc 228 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c u8 ecc = 0; ecc 248 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c ecc |= val << i; ecc 251 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c return ecc; ecc 88 drivers/mtd/devices/docg3.c .ecc = docg3_ooblayout_ecc, ecc 645 drivers/mtd/devices/docg3.c u8 ecc[DOC_ECC_BCH_SIZE]; ecc 649 drivers/mtd/devices/docg3.c ecc[i] = bitrev8(hwecc[i]); ecc 652 drivers/mtd/devices/docg3.c NULL, ecc, NULL, errorpos); ecc 1322 drivers/mtd/mtdcore.c if (!mtd->ooblayout || !mtd->ooblayout->ecc) ecc 1325 drivers/mtd/mtdcore.c return mtd->ooblayout->ecc(mtd, section, oobecc); ecc 302 drivers/mtd/mtdpart.c .ecc = part_ooblayout_ecc, ecc 267 drivers/mtd/nand/onenand/omap2.c int ecc = read_reg(c, ONENAND_REG_ECC_STATUS); ecc 269 drivers/mtd/nand/onenand/omap2.c if (ecc) { ecc 274 drivers/mtd/nand/onenand/omap2.c if (ecc & ONENAND_ECC_2BIT_ALL) { ecc 277 drivers/mtd/nand/onenand/omap2.c ecc, addr1, addr8); ecc 280 drivers/mtd/nand/onenand/omap2.c } else if (ecc & ONENAND_ECC_1BIT_ALL) { ecc 283 drivers/mtd/nand/onenand/omap2.c "addr8 %#x\n", ecc, addr1, addr8); ecc 91 drivers/mtd/nand/onenand/onenand_base.c .ecc = flexonenand_ooblayout_ecc, ecc 131 drivers/mtd/nand/onenand/onenand_base.c .ecc = onenand_ooblayout_128_ecc, ecc 170 drivers/mtd/nand/onenand/onenand_base.c .ecc = onenand_ooblayout_32_64_ecc, ecc 526 drivers/mtd/nand/onenand/onenand_base.c int ecc, i, result = 0; ecc 532 drivers/mtd/nand/onenand/onenand_base.c ecc = this->read_word(this->base + ONENAND_REG_ECC_STATUS + i*2); ecc 533 drivers/mtd/nand/onenand/onenand_base.c if (likely(!ecc)) ecc 535 drivers/mtd/nand/onenand/onenand_base.c if (ecc & FLEXONENAND_UNCORRECTABLE_ERROR) ecc 583 drivers/mtd/nand/onenand/onenand_base.c int ecc = onenand_read_ecc(this); ecc 584 drivers/mtd/nand/onenand/onenand_base.c if (ecc) { ecc 585 drivers/mtd/nand/onenand/onenand_base.c if (ecc & ONENAND_ECC_2BIT_ALL) { ecc 587 drivers/mtd/nand/onenand/onenand_base.c __func__, ecc); ecc 590 drivers/mtd/nand/onenand/onenand_base.c } else if (ecc & ONENAND_ECC_1BIT_ALL) { ecc 592 drivers/mtd/nand/onenand/onenand_base.c __func__, ecc); ecc 1483 drivers/mtd/nand/onenand/onenand_base.c unsigned int interrupt, ctrl, ecc, addr1, addr8; ecc 1499 drivers/mtd/nand/onenand/onenand_base.c ecc = onenand_read_ecc(this); ecc 1500 drivers/mtd/nand/onenand/onenand_base.c if (ecc & ONENAND_ECC_2BIT_ALL) { ecc 1503 drivers/mtd/nand/onenand/onenand_base.c __func__, ecc, ctrl, interrupt, addr1, addr8); ecc 314 drivers/mtd/nand/onenand/samsung.c unsigned int stat, ecc; ecc 354 drivers/mtd/nand/onenand/samsung.c ecc = s3c_read_reg(ECC_ERR_STAT_OFFSET); ecc 355 drivers/mtd/nand/onenand/samsung.c if (ecc & ONENAND_ECC_4BIT_UNCORRECTABLE) { ecc 357 drivers/mtd/nand/onenand/samsung.c ecc); ecc 716 drivers/mtd/nand/onenand/samsung.c int ecc = s3c_read_reg(ECC_ERR_STAT_OFFSET); ecc 717 drivers/mtd/nand/onenand/samsung.c if (ecc & ONENAND_ECC_4BIT_UNCORRECTABLE) { ecc 249 drivers/mtd/nand/raw/ams-delta.c this->ecc.mode = NAND_ECC_SOFT; ecc 250 drivers/mtd/nand/raw/ams-delta.c this->ecc.algo = NAND_ECC_HAMMING; ecc 769 drivers/mtd/nand/raw/atmel/nand-controller.c for (i = 0; i < chip->ecc.steps; i++) { ecc 772 drivers/mtd/nand/raw/atmel/nand-controller.c eccbuf += chip->ecc.bytes; ecc 805 drivers/mtd/nand/raw/atmel/nand-controller.c for (i = 0; i < chip->ecc.steps; i++) { ecc 810 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.size, ecc 812 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.bytes, ecc 814 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.strength); ecc 821 drivers/mtd/nand/raw/atmel/nand-controller.c databuf += chip->ecc.size; ecc 822 drivers/mtd/nand/raw/atmel/nand-controller.c eccbuf += chip->ecc.bytes; ecc 1063 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.strength = val; ecc 1068 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.size = val; ecc 1071 drivers/mtd/nand/raw/atmel/nand-controller.c if (chip->ecc.options & NAND_ECC_MAXIMIZE) ecc 1072 drivers/mtd/nand/raw/atmel/nand-controller.c req.ecc.strength = ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH; ecc 1073 drivers/mtd/nand/raw/atmel/nand-controller.c else if (chip->ecc.strength) ecc 1074 drivers/mtd/nand/raw/atmel/nand-controller.c req.ecc.strength = chip->ecc.strength; ecc 1076 drivers/mtd/nand/raw/atmel/nand-controller.c req.ecc.strength = chip->base.eccreq.strength; ecc 1078 drivers/mtd/nand/raw/atmel/nand-controller.c req.ecc.strength = ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH; ecc 1080 drivers/mtd/nand/raw/atmel/nand-controller.c if (chip->ecc.size) ecc 1081 drivers/mtd/nand/raw/atmel/nand-controller.c req.ecc.sectorsize = chip->ecc.size; ecc 1083 drivers/mtd/nand/raw/atmel/nand-controller.c req.ecc.sectorsize = chip->base.eccreq.step_size; ecc 1085 drivers/mtd/nand/raw/atmel/nand-controller.c req.ecc.sectorsize = ATMEL_PMECC_SECTOR_SIZE_AUTO; ecc 1091 drivers/mtd/nand/raw/atmel/nand-controller.c req.ecc.bytes = 4; ecc 1092 drivers/mtd/nand/raw/atmel/nand-controller.c req.ecc.ooboffset = 0; ecc 1094 drivers/mtd/nand/raw/atmel/nand-controller.c req.ecc.bytes = mtd->oobsize - 2; ecc 1095 drivers/mtd/nand/raw/atmel/nand-controller.c req.ecc.ooboffset = ATMEL_PMECC_OOBOFFSET_AUTO; ecc 1102 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.algo = NAND_ECC_BCH; ecc 1103 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.size = req.ecc.sectorsize; ecc 1104 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.bytes = req.ecc.bytes / req.ecc.nsectors; ecc 1105 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.strength = req.ecc.strength; ecc 1121 drivers/mtd/nand/raw/atmel/nand-controller.c switch (chip->ecc.mode) { ecc 1134 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.read_page = atmel_nand_pmecc_read_page; ecc 1135 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.write_page = atmel_nand_pmecc_write_page; ecc 1136 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.read_page_raw = atmel_nand_pmecc_read_page_raw; ecc 1137 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.write_page_raw = atmel_nand_pmecc_write_page_raw; ecc 1143 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.mode); ecc 1158 drivers/mtd/nand/raw/atmel/nand-controller.c if (chip->ecc.mode != NAND_ECC_HW) ecc 1162 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.read_page = atmel_hsmc_nand_pmecc_read_page; ecc 1163 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.write_page = atmel_hsmc_nand_pmecc_write_page; ecc 1164 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.read_page_raw = atmel_hsmc_nand_pmecc_read_page_raw; ecc 1165 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.write_page_raw = atmel_hsmc_nand_pmecc_write_page_raw; ecc 1501 drivers/mtd/nand/raw/atmel/nand-controller.c chip->ecc.mode = NAND_ECC_HW; ecc 226 drivers/mtd/nand/raw/atmel/pmecc.c if (req->ecc.sectorsize == 512) { ecc 260 drivers/mtd/nand/raw/atmel/pmecc.c if (req->ecc.sectorsize == 512) ecc 282 drivers/mtd/nand/raw/atmel/pmecc.c if (req->pagesize <= 0 || req->oobsize <= 0 || req->ecc.bytes <= 0) ecc 285 drivers/mtd/nand/raw/atmel/pmecc.c if (req->ecc.ooboffset >= 0 && ecc 286 drivers/mtd/nand/raw/atmel/pmecc.c req->ecc.ooboffset + req->ecc.bytes > req->oobsize) ecc 289 drivers/mtd/nand/raw/atmel/pmecc.c if (req->ecc.sectorsize == ATMEL_PMECC_SECTOR_SIZE_AUTO) { ecc 290 drivers/mtd/nand/raw/atmel/pmecc.c if (req->ecc.strength != ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH) ecc 294 drivers/mtd/nand/raw/atmel/pmecc.c req->ecc.sectorsize = 1024; ecc 296 drivers/mtd/nand/raw/atmel/pmecc.c req->ecc.sectorsize = 512; ecc 299 drivers/mtd/nand/raw/atmel/pmecc.c if (req->ecc.sectorsize != 512 && req->ecc.sectorsize != 1024) ecc 302 drivers/mtd/nand/raw/atmel/pmecc.c if (req->pagesize % req->ecc.sectorsize) ecc 305 drivers/mtd/nand/raw/atmel/pmecc.c req->ecc.nsectors = req->pagesize / req->ecc.sectorsize; ecc 307 drivers/mtd/nand/raw/atmel/pmecc.c max_eccbytes = req->ecc.bytes; ecc 312 drivers/mtd/nand/raw/atmel/pmecc.c if (req->ecc.strength != ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH && ecc 313 drivers/mtd/nand/raw/atmel/pmecc.c strength < req->ecc.strength) ecc 316 drivers/mtd/nand/raw/atmel/pmecc.c nbytes = DIV_ROUND_UP(strength * fls(8 * req->ecc.sectorsize), ecc 318 drivers/mtd/nand/raw/atmel/pmecc.c nbytes *= req->ecc.nsectors; ecc 326 drivers/mtd/nand/raw/atmel/pmecc.c if (req->ecc.strength != ATMEL_PMECC_MAXIMIZE_ECC_STRENGTH) ecc 333 drivers/mtd/nand/raw/atmel/pmecc.c req->ecc.bytes = eccbytes; ecc 334 drivers/mtd/nand/raw/atmel/pmecc.c req->ecc.strength = eccstrength; ecc 336 drivers/mtd/nand/raw/atmel/pmecc.c if (req->ecc.ooboffset < 0) ecc 337 drivers/mtd/nand/raw/atmel/pmecc.c req->ecc.ooboffset = req->oobsize - eccbytes; ecc 357 drivers/mtd/nand/raw/atmel/pmecc.c size += ((2 * req->ecc.strength) + 1) * sizeof(u16) * ecc 358 drivers/mtd/nand/raw/atmel/pmecc.c (2 + req->ecc.strength + 2); ecc 360 drivers/mtd/nand/raw/atmel/pmecc.c size += (req->ecc.strength + 1) * sizeof(u16); ecc 363 drivers/mtd/nand/raw/atmel/pmecc.c size += (req->ecc.strength + 1) * sizeof(s32) * 3; ecc 372 drivers/mtd/nand/raw/atmel/pmecc.c user->si = user->partial_syn + ((2 * req->ecc.strength) + 1); ecc 373 drivers/mtd/nand/raw/atmel/pmecc.c user->lmu = user->si + ((2 * req->ecc.strength) + 1); ecc 374 drivers/mtd/nand/raw/atmel/pmecc.c user->smu = user->lmu + (req->ecc.strength + 1); ecc 376 drivers/mtd/nand/raw/atmel/pmecc.c (((2 * req->ecc.strength) + 1) * ecc 377 drivers/mtd/nand/raw/atmel/pmecc.c (req->ecc.strength + 2)), ecc 379 drivers/mtd/nand/raw/atmel/pmecc.c user->dmu = user->mu + req->ecc.strength + 1; ecc 380 drivers/mtd/nand/raw/atmel/pmecc.c user->delta = user->dmu + req->ecc.strength + 1; ecc 390 drivers/mtd/nand/raw/atmel/pmecc.c user->eccbytes = req->ecc.bytes / req->ecc.nsectors; ecc 393 drivers/mtd/nand/raw/atmel/pmecc.c if (pmecc->caps->strengths[strength] == req->ecc.strength) ecc 398 drivers/mtd/nand/raw/atmel/pmecc.c PMECC_CFG_NSECTORS(req->ecc.nsectors); ecc 400 drivers/mtd/nand/raw/atmel/pmecc.c if (req->ecc.sectorsize == 1024) ecc 404 drivers/mtd/nand/raw/atmel/pmecc.c user->cache.saddr = req->ecc.ooboffset; ecc 405 drivers/mtd/nand/raw/atmel/pmecc.c user->cache.eaddr = req->ecc.ooboffset + req->ecc.bytes - 1; ecc 691 drivers/mtd/nand/raw/atmel/pmecc.c void *data, void *ecc) ecc 726 drivers/mtd/nand/raw/atmel/pmecc.c ptr = ecc + byte - sectorsize; ecc 753 drivers/mtd/nand/raw/atmel/pmecc.c int sector, void *ecc) ecc 756 drivers/mtd/nand/raw/atmel/pmecc.c u8 *ptr = ecc; ecc 50 drivers/mtd/nand/raw/atmel/pmecc.h } ecc; ecc 65 drivers/mtd/nand/raw/atmel/pmecc.h void *data, void *ecc); ecc 68 drivers/mtd/nand/raw/atmel/pmecc.h int sector, void *ecc); ecc 433 drivers/mtd/nand/raw/au1550nd.c this->ecc.mode = NAND_ECC_SOFT; ecc 434 drivers/mtd/nand/raw/au1550nd.c this->ecc.algo = NAND_ECC_HAMMING; ecc 394 drivers/mtd/nand/raw/bcm47xxnflash/ops_bcm4706.c b47n->nand_chip.ecc.mode = NAND_ECC_NONE; /* TODO: implement ECC */ ecc 1034 drivers/mtd/nand/raw/brcmnand/brcmnand.c .ecc = brcmnand_hamming_ooblayout_ecc, ecc 1050 drivers/mtd/nand/raw/brcmnand/brcmnand.c oobregion->offset = ((section + 1) * sas) - chip->ecc.bytes; ecc 1051 drivers/mtd/nand/raw/brcmnand/brcmnand.c oobregion->length = chip->ecc.bytes; ecc 1068 drivers/mtd/nand/raw/brcmnand/brcmnand.c if (sas <= chip->ecc.bytes) ecc 1072 drivers/mtd/nand/raw/brcmnand/brcmnand.c oobregion->length = sas - chip->ecc.bytes; ecc 1090 drivers/mtd/nand/raw/brcmnand/brcmnand.c if (section > 1 || sas - chip->ecc.bytes < 6 || ecc 1091 drivers/mtd/nand/raw/brcmnand/brcmnand.c (section && sas - chip->ecc.bytes == 6)) ecc 1099 drivers/mtd/nand/raw/brcmnand/brcmnand.c oobregion->length = sas - chip->ecc.bytes - 6; ecc 1106 drivers/mtd/nand/raw/brcmnand/brcmnand.c .ecc = brcmnand_bch_ooblayout_ecc, ecc 1111 drivers/mtd/nand/raw/brcmnand/brcmnand.c .ecc = brcmnand_bch_ooblayout_ecc, ecc 1119 drivers/mtd/nand/raw/brcmnand/brcmnand.c struct nand_ecc_ctrl *ecc = &host->chip.ecc; ecc 1128 drivers/mtd/nand/raw/brcmnand/brcmnand.c ecc->bytes = 3 * sectors; ecc 1139 drivers/mtd/nand/raw/brcmnand/brcmnand.c ecc->bytes = DIV_ROUND_UP(ecc_level * 14, 8); ecc 1145 drivers/mtd/nand/raw/brcmnand/brcmnand.c if (ecc->bytes >= sas) { ecc 1148 drivers/mtd/nand/raw/brcmnand/brcmnand.c ecc->bytes, sas); ecc 1800 drivers/mtd/nand/raw/brcmnand/brcmnand.c sas = mtd->oobsize / chip->ecc.steps; ecc 1803 drivers/mtd/nand/raw/brcmnand/brcmnand.c ret = chip->ecc.read_page_raw(chip, buf, true, page); ecc 1807 drivers/mtd/nand/raw/brcmnand/brcmnand.c for (i = 0; i < chip->ecc.steps; i++, oob += sas) { ecc 1808 drivers/mtd/nand/raw/brcmnand/brcmnand.c ecc_chunk = buf + chip->ecc.size * i; ecc 1810 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.size, ecc 1812 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.strength); ecc 2165 drivers/mtd/nand/raw/brcmnand/brcmnand.c brcmnand_wr_corr_thresh(host, DIV_ROUND_UP(chip->ecc.strength * 3, 4)); ecc 2239 drivers/mtd/nand/raw/brcmnand/brcmnand.c if (chip->ecc.mode != NAND_ECC_HW) { ecc 2241 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.mode); ecc 2245 drivers/mtd/nand/raw/brcmnand/brcmnand.c if (chip->ecc.algo == NAND_ECC_UNKNOWN) { ecc 2246 drivers/mtd/nand/raw/brcmnand/brcmnand.c if (chip->ecc.strength == 1 && chip->ecc.size == 512) ecc 2248 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.algo = NAND_ECC_HAMMING; ecc 2251 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.algo = NAND_ECC_BCH; ecc 2254 drivers/mtd/nand/raw/brcmnand/brcmnand.c if (chip->ecc.algo == NAND_ECC_HAMMING && (chip->ecc.strength != 1 || ecc 2255 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.size != 512)) { ecc 2257 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.strength, chip->ecc.size); ecc 2261 drivers/mtd/nand/raw/brcmnand/brcmnand.c if (chip->ecc.mode != NAND_ECC_NONE && ecc 2262 drivers/mtd/nand/raw/brcmnand/brcmnand.c (!chip->ecc.size || !chip->ecc.strength)) { ecc 2265 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.size = chip->base.eccreq.step_size; ecc 2266 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.strength = chip->base.eccreq.strength; ecc 2268 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.size, chip->ecc.strength); ecc 2272 drivers/mtd/nand/raw/brcmnand/brcmnand.c switch (chip->ecc.size) { ecc 2274 drivers/mtd/nand/raw/brcmnand/brcmnand.c if (chip->ecc.algo == NAND_ECC_HAMMING) ecc 2277 drivers/mtd/nand/raw/brcmnand/brcmnand.c cfg->ecc_level = chip->ecc.strength; ecc 2285 drivers/mtd/nand/raw/brcmnand/brcmnand.c if (chip->ecc.strength & 0x1) { ecc 2291 drivers/mtd/nand/raw/brcmnand/brcmnand.c cfg->ecc_level = chip->ecc.strength >> 1; ecc 2296 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.size); ecc 2353 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.size = host->hwcfg.sector_size_1k ? 1024 : 512; ecc 2402 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.mode = NAND_ECC_HW; ecc 2403 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.read_page = brcmnand_read_page; ecc 2404 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.write_page = brcmnand_write_page; ecc 2405 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.read_page_raw = brcmnand_read_page_raw; ecc 2406 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.write_page_raw = brcmnand_write_page_raw; ecc 2407 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.write_oob_raw = brcmnand_write_oob_raw; ecc 2408 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.read_oob_raw = brcmnand_read_oob_raw; ecc 2409 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.read_oob = brcmnand_read_oob; ecc 2410 drivers/mtd/nand/raw/brcmnand/brcmnand.c chip->ecc.write_oob = brcmnand_write_oob; ecc 459 drivers/mtd/nand/raw/cafe_nand.c oobregion->length = chip->ecc.total; ecc 472 drivers/mtd/nand/raw/cafe_nand.c oobregion->offset = chip->ecc.total; ecc 473 drivers/mtd/nand/raw/cafe_nand.c oobregion->length = mtd->oobsize - chip->ecc.total; ecc 479 drivers/mtd/nand/raw/cafe_nand.c .ecc = cafe_ooblayout_ecc, ecc 637 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.mode = NAND_ECC_HW_SYNDROME; ecc 638 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.size = mtd->writesize; ecc 639 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.bytes = 14; ecc 640 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.strength = 4; ecc 641 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.write_page = cafe_nand_write_page_lowlevel; ecc 642 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.write_oob = cafe_nand_write_oob; ecc 643 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.read_page = cafe_nand_read_page; ecc 644 drivers/mtd/nand/raw/cafe_nand.c cafe->nand.ecc.read_oob = cafe_nand_read_oob; ecc 179 drivers/mtd/nand/raw/cmx270_nand.c this->ecc.mode = NAND_ECC_SOFT; ecc 180 drivers/mtd/nand/raw/cmx270_nand.c this->ecc.algo = NAND_ECC_HAMMING; ecc 158 drivers/mtd/nand/raw/cs553x_nand.c uint32_t ecc; ecc 161 drivers/mtd/nand/raw/cs553x_nand.c ecc = readl(mmio_base + MM_NAND_STS); ecc 163 drivers/mtd/nand/raw/cs553x_nand.c ecc_code[1] = ecc >> 8; ecc 164 drivers/mtd/nand/raw/cs553x_nand.c ecc_code[0] = ecc >> 16; ecc 165 drivers/mtd/nand/raw/cs553x_nand.c ecc_code[2] = ecc >> 24; ecc 213 drivers/mtd/nand/raw/cs553x_nand.c this->ecc.mode = NAND_ECC_HW; ecc 214 drivers/mtd/nand/raw/cs553x_nand.c this->ecc.size = 256; ecc 215 drivers/mtd/nand/raw/cs553x_nand.c this->ecc.bytes = 3; ecc 216 drivers/mtd/nand/raw/cs553x_nand.c this->ecc.hwctl = cs_enable_hwecc; ecc 217 drivers/mtd/nand/raw/cs553x_nand.c this->ecc.calculate = cs_calculate_ecc; ecc 218 drivers/mtd/nand/raw/cs553x_nand.c this->ecc.correct = nand_correct_data; ecc 219 drivers/mtd/nand/raw/cs553x_nand.c this->ecc.strength = 1; ecc 186 drivers/mtd/nand/raw/davinci_nand.c if ((diff >> (12 + 3)) < chip->ecc.size) { ecc 501 drivers/mtd/nand/raw/davinci_nand.c .ecc = hwecc4_ooblayout_small_ecc, ecc 600 drivers/mtd/nand/raw/davinci_nand.c switch (info->chip.ecc.mode) { ecc 612 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.algo = NAND_ECC_HAMMING; ecc 632 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.calculate = nand_davinci_calculate_4bit; ecc 633 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.correct = nand_davinci_correct_4bit; ecc 634 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.hwctl = nand_davinci_hwctl_4bit; ecc 635 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.bytes = 10; ecc 636 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.options = NAND_ECC_GENERIC_ERASED_CHECK; ecc 637 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.algo = NAND_ECC_BCH; ecc 640 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.calculate = nand_davinci_calculate_1bit; ecc 641 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.correct = nand_davinci_correct_1bit; ecc 642 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.hwctl = nand_davinci_hwctl_1bit; ecc 643 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.bytes = 3; ecc 644 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.algo = NAND_ECC_HAMMING; ecc 646 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.size = 512; ecc 647 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.strength = pdata->ecc_bits; ecc 675 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.mode = NAND_ECC_HW_OOB_FIRST; ecc 779 drivers/mtd/nand/raw/davinci_nand.c info->chip.ecc.mode = pdata->ecc_mode; ecc 822 drivers/mtd/nand/raw/davinci_nand.c if (info->chip.ecc.mode == NAND_ECC_HW_SYNDROME) ecc 211 drivers/mtd/nand/raw/denali.c FIELD_PREP(ECC_CORRECTION__VALUE, chip->ecc.strength), ecc 213 drivers/mtd/nand/raw/denali.c iowrite32(chip->ecc.size, denali->reg + CFG_DATA_BLOCK_SIZE); ecc 214 drivers/mtd/nand/raw/denali.c iowrite32(chip->ecc.size, denali->reg + CFG_LAST_DATA_BLOCK_SIZE); ecc 215 drivers/mtd/nand/raw/denali.c iowrite32(chip->ecc.steps, denali->reg + CFG_NUM_DATA_BLOCKS); ecc 247 drivers/mtd/nand/raw/denali.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 252 drivers/mtd/nand/raw/denali.c for (i = 0; i < ecc->steps; i++) { ecc 253 drivers/mtd/nand/raw/denali.c pos = i * (ecc->size + ecc->bytes); ecc 254 drivers/mtd/nand/raw/denali.c len = ecc->size; ecc 284 drivers/mtd/nand/raw/denali.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 297 drivers/mtd/nand/raw/denali.c for (i = 0; i < ecc->steps; i++) { ecc 298 drivers/mtd/nand/raw/denali.c pos = ecc->size + i * (ecc->size + ecc->bytes); ecc 300 drivers/mtd/nand/raw/denali.c if (i == ecc->steps - 1) ecc 304 drivers/mtd/nand/raw/denali.c len = ecc->bytes; ecc 414 drivers/mtd/nand/raw/denali.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 418 drivers/mtd/nand/raw/denali.c for (i = 0; i < ecc->steps; i++) { ecc 422 drivers/mtd/nand/raw/denali.c stat = nand_check_erased_ecc_chunk(buf, ecc->size, ecc_code, ecc 423 drivers/mtd/nand/raw/denali.c ecc->bytes, NULL, 0, ecc 424 drivers/mtd/nand/raw/denali.c ecc->strength); ecc 432 drivers/mtd/nand/raw/denali.c buf += ecc->size; ecc 433 drivers/mtd/nand/raw/denali.c ecc_code += ecc->bytes; ecc 457 drivers/mtd/nand/raw/denali.c *uncor_ecc_flags = GENMASK(chip->ecc.steps - 1, 0); ecc 479 drivers/mtd/nand/raw/denali.c unsigned int ecc_size = chip->ecc.size; ecc 910 drivers/mtd/nand/raw/denali.c oobregion->length = chip->ecc.total; ecc 924 drivers/mtd/nand/raw/denali.c oobregion->offset = chip->ecc.total + denali->oob_skip_bytes; ecc 931 drivers/mtd/nand/raw/denali.c .ecc = denali_ooblayout_ecc, ecc 982 drivers/mtd/nand/raw/denali.c chip->ecc.size <<= 1; ecc 983 drivers/mtd/nand/raw/denali.c chip->ecc.bytes <<= 1; ecc 984 drivers/mtd/nand/raw/denali.c chip->ecc.strength <<= 1; ecc 1005 drivers/mtd/nand/raw/denali.c chip->ecc.size, chip->ecc.strength, chip->ecc.bytes); ecc 1218 drivers/mtd/nand/raw/denali.c chip->ecc.mode = NAND_ECC_HW_SYNDROME; ecc 1219 drivers/mtd/nand/raw/denali.c chip->ecc.read_page = denali_read_page; ecc 1220 drivers/mtd/nand/raw/denali.c chip->ecc.write_page = denali_write_page; ecc 1221 drivers/mtd/nand/raw/denali.c chip->ecc.read_page_raw = denali_read_page_raw; ecc 1222 drivers/mtd/nand/raw/denali.c chip->ecc.write_page_raw = denali_write_page_raw; ecc 1223 drivers/mtd/nand/raw/denali.c chip->ecc.read_oob = denali_read_oob; ecc 1224 drivers/mtd/nand/raw/denali.c chip->ecc.write_oob = denali_write_oob; ecc 103 drivers/mtd/nand/raw/denali_pci.c dchip->chip.ecc.options |= NAND_ECC_MAXIMIZE; ecc 137 drivers/mtd/nand/raw/diskonchip.c static int doc_ecc_decode(struct rs_control *rs, uint8_t *data, uint8_t *ecc) ecc 146 drivers/mtd/nand/raw/diskonchip.c ds[0] = ((ecc[4] & 0xff) >> 0) | ((ecc[5] & 0x03) << 8); ecc 147 drivers/mtd/nand/raw/diskonchip.c ds[1] = ((ecc[5] & 0xfc) >> 2) | ((ecc[2] & 0x0f) << 6); ecc 148 drivers/mtd/nand/raw/diskonchip.c ds[2] = ((ecc[2] & 0xf0) >> 4) | ((ecc[3] & 0x3f) << 4); ecc 149 drivers/mtd/nand/raw/diskonchip.c ds[3] = ((ecc[3] & 0xc0) >> 6) | ((ecc[0] & 0xff) << 2); ecc 150 drivers/mtd/nand/raw/diskonchip.c parity = ecc[1]; ecc 975 drivers/mtd/nand/raw/diskonchip.c .ecc = doc200x_ooblayout_ecc, ecc 1400 drivers/mtd/nand/raw/diskonchip.c this->ecc.hwctl = doc2001plus_enable_hwecc; ecc 1582 drivers/mtd/nand/raw/diskonchip.c nand->ecc.hwctl = doc200x_enable_hwecc; ecc 1583 drivers/mtd/nand/raw/diskonchip.c nand->ecc.calculate = doc200x_calculate_ecc; ecc 1584 drivers/mtd/nand/raw/diskonchip.c nand->ecc.correct = doc200x_correct_data; ecc 1586 drivers/mtd/nand/raw/diskonchip.c nand->ecc.mode = NAND_ECC_HW_SYNDROME; ecc 1587 drivers/mtd/nand/raw/diskonchip.c nand->ecc.size = 512; ecc 1588 drivers/mtd/nand/raw/diskonchip.c nand->ecc.bytes = 6; ecc 1589 drivers/mtd/nand/raw/diskonchip.c nand->ecc.strength = 2; ecc 1590 drivers/mtd/nand/raw/diskonchip.c nand->ecc.options = NAND_ECC_GENERIC_ERASED_CHECK; ecc 75 drivers/mtd/nand/raw/fsl_elbc_nand.c if (section >= chip->ecc.steps) ecc 82 drivers/mtd/nand/raw/fsl_elbc_nand.c oobregion->length = chip->ecc.bytes; ecc 93 drivers/mtd/nand/raw/fsl_elbc_nand.c if (section > chip->ecc.steps) ecc 104 drivers/mtd/nand/raw/fsl_elbc_nand.c if (section < chip->ecc.steps) ecc 114 drivers/mtd/nand/raw/fsl_elbc_nand.c .ecc = fsl_elbc_ooblayout_ecc, ecc 247 drivers/mtd/nand/raw/fsl_elbc_nand.c if (chip->ecc.mode != NAND_ECC_HW) ecc 731 drivers/mtd/nand/raw/fsl_elbc_nand.c switch (chip->ecc.mode) { ecc 740 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.read_page = fsl_elbc_read_page; ecc 741 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.write_page = fsl_elbc_write_page; ecc 742 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.write_subpage = fsl_elbc_write_subpage; ecc 744 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.mode = NAND_ECC_HW; ecc 746 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.size = 512; ecc 747 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.bytes = 3; ecc 748 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.strength = 1; ecc 751 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.mode = NAND_ECC_SOFT; ecc 752 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.algo = NAND_ECC_HAMMING; ecc 791 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.mode); ecc 793 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.steps); ecc 795 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.bytes); ecc 797 drivers/mtd/nand/raw/fsl_elbc_nand.c chip->ecc.total); ecc 93 drivers/mtd/nand/raw/fsl_ifc_nand.c oobregion->length = chip->ecc.total; ecc 123 drivers/mtd/nand/raw/fsl_ifc_nand.c oobregion->offset = chip->ecc.total + 8; ecc 131 drivers/mtd/nand/raw/fsl_ifc_nand.c .ecc = fsl_ifc_ooblayout_ecc, ecc 214 drivers/mtd/nand/raw/fsl_ifc_nand.c int sector_start = bufnum * chip->ecc.steps; ecc 215 drivers/mtd/nand/raw/fsl_ifc_nand.c int sector_end = sector_start + chip->ecc.steps - 1; ecc 312 drivers/mtd/nand/raw/fsl_ifc_nand.c if (chip->ecc.mode == NAND_ECC_HW) ecc 641 drivers/mtd/nand/raw/fsl_ifc_nand.c u8 *ecc = chip->oob_poi; ecc 642 drivers/mtd/nand/raw/fsl_ifc_nand.c const int ecc_size = chip->ecc.bytes; ecc 643 drivers/mtd/nand/raw/fsl_ifc_nand.c const int pkt_size = chip->ecc.size; ecc 648 drivers/mtd/nand/raw/fsl_ifc_nand.c ecc += oobregion.offset; ecc 650 drivers/mtd/nand/raw/fsl_ifc_nand.c for (i = 0; i < chip->ecc.steps; ++i) { ecc 651 drivers/mtd/nand/raw/fsl_ifc_nand.c res = nand_check_erased_ecc_chunk(buf, pkt_size, ecc, ecc_size, ecc 653 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.strength); ecc 661 drivers/mtd/nand/raw/fsl_ifc_nand.c ecc += ecc_size; ecc 728 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.mode); ecc 730 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.steps); ecc 732 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.bytes); ecc 734 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.total); ecc 880 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.read_page = fsl_ifc_read_page; ecc 881 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.write_page = fsl_ifc_write_page; ecc 915 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.mode = NAND_ECC_HW; ecc 919 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.size = 512; ecc 921 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.bytes = 8; ecc 922 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.strength = 4; ecc 924 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.bytes = 16; ecc 925 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.strength = 8; ecc 928 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.mode = NAND_ECC_SOFT; ecc 929 drivers/mtd/nand/raw/fsl_ifc_nand.c chip->ecc.algo = NAND_ECC_HAMMING; ecc 166 drivers/mtd/nand/raw/fsl_upm.c fun->chip.ecc.mode = NAND_ECC_SOFT; ecc 167 drivers/mtd/nand/raw/fsl_upm.c fun->chip.ecc.algo = NAND_ECC_HAMMING; ecc 163 drivers/mtd/nand/raw/fsmc_nand.c if (section >= chip->ecc.steps) ecc 177 drivers/mtd/nand/raw/fsmc_nand.c if (section >= chip->ecc.steps) ecc 182 drivers/mtd/nand/raw/fsmc_nand.c if (section < chip->ecc.steps - 1) ecc 191 drivers/mtd/nand/raw/fsmc_nand.c .ecc = fsmc_ecc1_ooblayout_ecc, ecc 206 drivers/mtd/nand/raw/fsmc_nand.c if (section >= chip->ecc.steps) ecc 209 drivers/mtd/nand/raw/fsmc_nand.c oobregion->length = chip->ecc.bytes; ecc 224 drivers/mtd/nand/raw/fsmc_nand.c if (section >= chip->ecc.steps) ecc 229 drivers/mtd/nand/raw/fsmc_nand.c if (section < chip->ecc.steps - 1) ecc 238 drivers/mtd/nand/raw/fsmc_nand.c .ecc = fsmc_ecc4_ooblayout_ecc, ecc 375 drivers/mtd/nand/raw/fsmc_nand.c u8 *ecc) ecc 394 drivers/mtd/nand/raw/fsmc_nand.c ecc[0] = ecc_tmp; ecc 395 drivers/mtd/nand/raw/fsmc_nand.c ecc[1] = ecc_tmp >> 8; ecc 396 drivers/mtd/nand/raw/fsmc_nand.c ecc[2] = ecc_tmp >> 16; ecc 397 drivers/mtd/nand/raw/fsmc_nand.c ecc[3] = ecc_tmp >> 24; ecc 400 drivers/mtd/nand/raw/fsmc_nand.c ecc[4] = ecc_tmp; ecc 401 drivers/mtd/nand/raw/fsmc_nand.c ecc[5] = ecc_tmp >> 8; ecc 402 drivers/mtd/nand/raw/fsmc_nand.c ecc[6] = ecc_tmp >> 16; ecc 403 drivers/mtd/nand/raw/fsmc_nand.c ecc[7] = ecc_tmp >> 24; ecc 406 drivers/mtd/nand/raw/fsmc_nand.c ecc[8] = ecc_tmp; ecc 407 drivers/mtd/nand/raw/fsmc_nand.c ecc[9] = ecc_tmp >> 8; ecc 408 drivers/mtd/nand/raw/fsmc_nand.c ecc[10] = ecc_tmp >> 16; ecc 409 drivers/mtd/nand/raw/fsmc_nand.c ecc[11] = ecc_tmp >> 24; ecc 412 drivers/mtd/nand/raw/fsmc_nand.c ecc[12] = ecc_tmp >> 16; ecc 423 drivers/mtd/nand/raw/fsmc_nand.c u8 *ecc) ecc 429 drivers/mtd/nand/raw/fsmc_nand.c ecc[0] = ecc_tmp; ecc 430 drivers/mtd/nand/raw/fsmc_nand.c ecc[1] = ecc_tmp >> 8; ecc 431 drivers/mtd/nand/raw/fsmc_nand.c ecc[2] = ecc_tmp >> 16; ecc 675 drivers/mtd/nand/raw/fsmc_nand.c int i, j, s, stat, eccsize = chip->ecc.size; ecc 676 drivers/mtd/nand/raw/fsmc_nand.c int eccbytes = chip->ecc.bytes; ecc 677 drivers/mtd/nand/raw/fsmc_nand.c int eccsteps = chip->ecc.steps; ecc 679 drivers/mtd/nand/raw/fsmc_nand.c u8 *ecc_calc = chip->ecc.calc_buf; ecc 680 drivers/mtd/nand/raw/fsmc_nand.c u8 *ecc_code = chip->ecc.code_buf; ecc 693 drivers/mtd/nand/raw/fsmc_nand.c chip->ecc.hwctl(chip, NAND_ECC_READ); ecc 720 drivers/mtd/nand/raw/fsmc_nand.c memcpy(&ecc_code[i], oob, chip->ecc.bytes); ecc 721 drivers/mtd/nand/raw/fsmc_nand.c chip->ecc.calculate(chip, p, &ecc_calc[i]); ecc 723 drivers/mtd/nand/raw/fsmc_nand.c stat = chip->ecc.correct(chip, p, &ecc_code[i], &ecc_calc[i]); ecc 775 drivers/mtd/nand/raw/fsmc_nand.c int bits_ecc = count_written_bits(read_ecc, chip->ecc.bytes, 8); ecc 776 drivers/mtd/nand/raw/fsmc_nand.c int bits_data = count_written_bits(dat, chip->ecc.size, 8); ecc 780 drivers/mtd/nand/raw/fsmc_nand.c memset(dat, 0xff, chip->ecc.size); ecc 815 drivers/mtd/nand/raw/fsmc_nand.c if (err_idx[i] < chip->ecc.size * 8) { ecc 899 drivers/mtd/nand/raw/fsmc_nand.c switch (nand->ecc.mode) { ecc 902 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.calculate = fsmc_read_hwecc_ecc1; ecc 903 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.correct = nand_correct_data; ecc 904 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.bytes = 3; ecc 905 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.strength = 1; ecc 906 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.options |= NAND_ECC_SOFT_HAMMING_SM_ORDER; ecc 910 drivers/mtd/nand/raw/fsmc_nand.c if (nand->ecc.algo == NAND_ECC_BCH) { ecc 928 drivers/mtd/nand/raw/fsmc_nand.c if (nand->ecc.mode == NAND_ECC_HW) { ecc 1058 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.mode = NAND_ECC_HW; ecc 1059 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.hwctl = fsmc_enable_hwecc; ecc 1060 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.size = 512; ecc 1084 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.read_page = fsmc_read_page_hwecc; ecc 1085 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.calculate = fsmc_read_hwecc_ecc4; ecc 1086 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.correct = fsmc_bch8_correct_data; ecc 1087 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.bytes = 13; ecc 1088 drivers/mtd/nand/raw/fsmc_nand.c nand->ecc.strength = 8; ecc 274 drivers/mtd/nand/raw/gpio.c chip->ecc.mode = NAND_ECC_SOFT; ecc 275 drivers/mtd/nand/raw/gpio.c chip->ecc.algo = NAND_ECC_HAMMING; ecc 514 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c if (chip->ecc.strength > 0 && chip->ecc.size > 0) ecc 515 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c return set_geometry_by_ecc_info(this, chip->ecc.strength, ecc 516 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c chip->ecc.size); ecc 1042 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c .ecc = gpmi_ooblayout_ecc, ecc 1499 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c int size = chip->ecc.size; /* ECC chunk size */ ecc 2053 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c status = chip->ecc.write_page_raw(chip, buffer, 0, page); ecc 2168 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 2178 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ecc->read_page = gpmi_ecc_read_page; ecc 2179 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ecc->write_page = gpmi_ecc_write_page; ecc 2180 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ecc->read_oob = gpmi_ecc_read_oob; ecc 2181 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ecc->write_oob = gpmi_ecc_write_oob; ecc 2182 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ecc->read_page_raw = gpmi_ecc_read_page_raw; ecc 2183 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ecc->write_page_raw = gpmi_ecc_write_page_raw; ecc 2184 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ecc->read_oob_raw = gpmi_ecc_read_oob_raw; ecc 2185 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ecc->write_oob_raw = gpmi_ecc_write_oob_raw; ecc 2186 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ecc->mode = NAND_ECC_HW; ecc 2187 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ecc->size = bch_geo->ecc_chunk_size; ecc 2188 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ecc->strength = bch_geo->ecc_strength; ecc 2198 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c ecc->read_subpage = gpmi_ecc_read_subpage; ecc 189 drivers/mtd/nand/raw/hisi504_nand.c if (chip->ecc.mode == NAND_ECC_NONE) { ecc 471 drivers/mtd/nand/raw/hisi504_nand.c if (chip->ecc.mode == NAND_ECC_HW) ecc 534 drivers/mtd/nand/raw/hisi504_nand.c switch (chip->ecc.strength) { ecc 632 drivers/mtd/nand/raw/hisi504_nand.c .ecc = hisi_ooblayout_ecc, ecc 644 drivers/mtd/nand/raw/hisi504_nand.c size = chip->ecc.size; ecc 645 drivers/mtd/nand/raw/hisi504_nand.c strength = chip->ecc.strength; ecc 657 drivers/mtd/nand/raw/hisi504_nand.c chip->ecc.size = size; ecc 658 drivers/mtd/nand/raw/hisi504_nand.c chip->ecc.strength = strength; ecc 660 drivers/mtd/nand/raw/hisi504_nand.c chip->ecc.read_page = hisi_nand_read_page_hwecc; ecc 661 drivers/mtd/nand/raw/hisi504_nand.c chip->ecc.read_oob = hisi_nand_read_oob; ecc 662 drivers/mtd/nand/raw/hisi504_nand.c chip->ecc.write_page = hisi_nand_write_page_hwecc; ecc 664 drivers/mtd/nand/raw/hisi504_nand.c switch (chip->ecc.strength) { ecc 675 drivers/mtd/nand/raw/hisi504_nand.c dev_err(dev, "not support strength: %d\n", chip->ecc.strength); ecc 724 drivers/mtd/nand/raw/hisi504_nand.c if (chip->ecc.mode == NAND_ECC_HW) ecc 27 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c int ingenic_ecc_calculate(struct ingenic_ecc *ecc, ecc 31 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c return ecc->ops->calculate(ecc, params, buf, ecc_code); ecc 47 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c int ingenic_ecc_correct(struct ingenic_ecc *ecc, ecc 51 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c return ecc->ops->correct(ecc, params, buf, ecc_code); ecc 68 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c struct ingenic_ecc *ecc; ecc 76 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c ecc = platform_get_drvdata(pdev); ecc 77 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c clk_prepare_enable(ecc->clk); ecc 79 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c return ecc; ecc 94 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c struct ingenic_ecc *ecc = NULL; ecc 107 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c ecc = ingenic_ecc_get(np); ecc 110 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c return ecc; ecc 117 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c void ingenic_ecc_release(struct ingenic_ecc *ecc) ecc 119 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c clk_disable_unprepare(ecc->clk); ecc 120 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c put_device(ecc->dev); ecc 126 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c struct ingenic_ecc *ecc; ecc 129 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c ecc = devm_kzalloc(dev, sizeof(*ecc), GFP_KERNEL); ecc 130 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c if (!ecc) ecc 133 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c ecc->ops = device_get_match_data(dev); ecc 134 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c if (!ecc->ops) ecc 138 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c ecc->base = devm_ioremap_resource(dev, res); ecc 139 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c if (IS_ERR(ecc->base)) ecc 140 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c return PTR_ERR(ecc->base); ecc 142 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c ecc->ops->disable(ecc); ecc 144 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c ecc->clk = devm_clk_get(dev, NULL); ecc 145 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c if (IS_ERR(ecc->clk)) { ecc 146 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c dev_err(dev, "failed to get clock: %ld\n", PTR_ERR(ecc->clk)); ecc 147 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c return PTR_ERR(ecc->clk); ecc 150 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c mutex_init(&ecc->lock); ecc 152 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c ecc->dev = dev; ecc 153 drivers/mtd/nand/raw/ingenic/ingenic_ecc.c platform_set_drvdata(pdev, ecc); ecc 29 drivers/mtd/nand/raw/ingenic/ingenic_ecc.h int ingenic_ecc_calculate(struct ingenic_ecc *ecc, ecc 32 drivers/mtd/nand/raw/ingenic/ingenic_ecc.h int ingenic_ecc_correct(struct ingenic_ecc *ecc, ecc 36 drivers/mtd/nand/raw/ingenic/ingenic_ecc.h void ingenic_ecc_release(struct ingenic_ecc *ecc); ecc 39 drivers/mtd/nand/raw/ingenic/ingenic_ecc.h int ingenic_ecc_calculate(struct ingenic_ecc *ecc, ecc 46 drivers/mtd/nand/raw/ingenic/ingenic_ecc.h int ingenic_ecc_correct(struct ingenic_ecc *ecc, ecc 53 drivers/mtd/nand/raw/ingenic/ingenic_ecc.h void ingenic_ecc_release(struct ingenic_ecc *ecc) ecc 64 drivers/mtd/nand/raw/ingenic/ingenic_ecc.h void (*disable)(struct ingenic_ecc *ecc); ecc 65 drivers/mtd/nand/raw/ingenic/ingenic_ecc.h int (*calculate)(struct ingenic_ecc *ecc, ecc 68 drivers/mtd/nand/raw/ingenic/ingenic_ecc.h int (*correct)(struct ingenic_ecc *ecc, ecc 47 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct ingenic_ecc *ecc; ecc 79 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 81 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c if (section || !ecc->total) ecc 84 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c oobregion->length = ecc->total; ecc 94 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 99 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c oobregion->length = mtd->oobsize - ecc->total - 12; ecc 100 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c oobregion->offset = 12 + ecc->total; ecc 106 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c .ecc = qi_lb60_ooblayout_ecc, ecc 114 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 116 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c if (section || !ecc->total) ecc 119 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c oobregion->length = ecc->total; ecc 129 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 134 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c oobregion->length = mtd->oobsize - ecc->total - 3; ecc 135 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c oobregion->offset = 3 + ecc->total; ecc 141 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c .ecc = jz4725b_ooblayout_ecc, ecc 211 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c params.size = nand->chip.ecc.size; ecc 212 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c params.bytes = nand->chip.ecc.bytes; ecc 213 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c params.strength = nand->chip.ecc.strength; ecc 215 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c return ingenic_ecc_calculate(nfc->ecc, ¶ms, dat, ecc_code); ecc 225 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c params.size = nand->chip.ecc.size; ecc 226 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c params.bytes = nand->chip.ecc.bytes; ecc 227 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c params.strength = nand->chip.ecc.strength; ecc 229 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c return ingenic_ecc_correct(nfc->ecc, ¶ms, dat, read_ecc); ecc 238 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c if (chip->ecc.strength == 4) { ecc 240 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c chip->ecc.bytes = 9; ecc 242 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c chip->ecc.bytes = fls((1 + 8) * chip->ecc.size) * ecc 243 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c (chip->ecc.strength / 8); ecc 246 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c switch (chip->ecc.mode) { ecc 248 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c if (!nfc->ecc) { ecc 253 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c chip->ecc.hwctl = ingenic_nand_ecc_hwctl; ecc 254 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c chip->ecc.calculate = ingenic_nand_ecc_calculate; ecc 255 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c chip->ecc.correct = ingenic_nand_ecc_correct; ecc 259 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c (nfc->ecc) ? "hardware ECC" : "software ECC", ecc 260 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c chip->ecc.strength, chip->ecc.size, chip->ecc.bytes); ecc 267 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c chip->ecc.mode); ecc 272 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c if (chip->ecc.mode != NAND_ECC_HW) ecc 276 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c eccbytes = mtd->writesize / chip->ecc.size * chip->ecc.bytes; ecc 368 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c chip->ecc.mode = NAND_ECC_HW; ecc 454 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c nfc->ecc = of_ingenic_ecc_get(dev->of_node); ecc 455 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c if (IS_ERR(nfc->ecc)) ecc 456 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c return PTR_ERR(nfc->ecc); ecc 466 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c if (nfc->ecc) ecc 467 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c ingenic_ecc_release(nfc->ecc); ecc 479 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c if (nfc->ecc) ecc 480 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c ingenic_ecc_release(nfc->ecc); ecc 45 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c static void jz4740_ecc_reset(struct ingenic_ecc *ecc, bool calc_ecc) ecc 50 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c writel(0, ecc->base + JZ_REG_NAND_IRQ_STAT); ecc 53 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c reg = readl(ecc->base + JZ_REG_NAND_ECC_CTRL); ecc 62 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c writel(reg, ecc->base + JZ_REG_NAND_ECC_CTRL); ecc 65 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c static int jz4740_ecc_calculate(struct ingenic_ecc *ecc, ecc 73 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c jz4740_ecc_reset(ecc, true); ecc 76 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c status = readl(ecc->base + JZ_REG_NAND_IRQ_STAT); ecc 82 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c reg = readl(ecc->base + JZ_REG_NAND_ECC_CTRL); ecc 84 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c writel(reg, ecc->base + JZ_REG_NAND_ECC_CTRL); ecc 87 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c ecc_code[i] = readb(ecc->base + JZ_REG_NAND_PAR0 + i); ecc 117 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c static int jz4740_ecc_correct(struct ingenic_ecc *ecc, ecc 125 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c jz4740_ecc_reset(ecc, false); ecc 128 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c writeb(ecc_code[i], ecc->base + JZ_REG_NAND_PAR0 + i); ecc 130 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c reg = readl(ecc->base + JZ_REG_NAND_ECC_CTRL); ecc 132 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c writel(reg, ecc->base + JZ_REG_NAND_ECC_CTRL); ecc 135 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c status = readl(ecc->base + JZ_REG_NAND_IRQ_STAT); ecc 141 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c reg = readl(ecc->base + JZ_REG_NAND_ECC_CTRL); ecc 143 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c writel(reg, ecc->base + JZ_REG_NAND_ECC_CTRL); ecc 152 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c error = readl(ecc->base + JZ_REG_NAND_ERR(i)); ecc 164 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c static void jz4740_ecc_disable(struct ingenic_ecc *ecc) ecc 168 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c writel(0, ecc->base + JZ_REG_NAND_IRQ_STAT); ecc 169 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c reg = readl(ecc->base + JZ_REG_NAND_ECC_CTRL); ecc 171 drivers/mtd/nand/raw/ingenic/jz4740_ecc.c writel(reg, ecc->base + JZ_REG_NAND_ECC_CTRL); ecc 136 drivers/mtd/nand/raw/lpc32xx_mlc.c if (section >= nand_chip->ecc.steps) ecc 139 drivers/mtd/nand/raw/lpc32xx_mlc.c oobregion->offset = ((section + 1) * 16) - nand_chip->ecc.bytes; ecc 140 drivers/mtd/nand/raw/lpc32xx_mlc.c oobregion->length = nand_chip->ecc.bytes; ecc 150 drivers/mtd/nand/raw/lpc32xx_mlc.c if (section >= nand_chip->ecc.steps) ecc 154 drivers/mtd/nand/raw/lpc32xx_mlc.c oobregion->length = 16 - nand_chip->ecc.bytes; ecc 160 drivers/mtd/nand/raw/lpc32xx_mlc.c .ecc = lpc32xx_ooblayout_ecc, ecc 659 drivers/mtd/nand/raw/lpc32xx_mlc.c chip->ecc.mode = NAND_ECC_HW; ecc 660 drivers/mtd/nand/raw/lpc32xx_mlc.c chip->ecc.size = 512; ecc 744 drivers/mtd/nand/raw/lpc32xx_mlc.c nand_chip->ecc.hwctl = lpc32xx_ecc_enable; ecc 745 drivers/mtd/nand/raw/lpc32xx_mlc.c nand_chip->ecc.read_page_raw = lpc32xx_read_page; ecc 746 drivers/mtd/nand/raw/lpc32xx_mlc.c nand_chip->ecc.read_page = lpc32xx_read_page; ecc 747 drivers/mtd/nand/raw/lpc32xx_mlc.c nand_chip->ecc.write_page_raw = lpc32xx_write_page_lowlevel; ecc 748 drivers/mtd/nand/raw/lpc32xx_mlc.c nand_chip->ecc.write_page = lpc32xx_write_page_lowlevel; ecc 749 drivers/mtd/nand/raw/lpc32xx_mlc.c nand_chip->ecc.write_oob = lpc32xx_write_oob; ecc 750 drivers/mtd/nand/raw/lpc32xx_mlc.c nand_chip->ecc.read_oob = lpc32xx_read_oob; ecc 751 drivers/mtd/nand/raw/lpc32xx_mlc.c nand_chip->ecc.strength = 4; ecc 752 drivers/mtd/nand/raw/lpc32xx_mlc.c nand_chip->ecc.bytes = 10; ecc 169 drivers/mtd/nand/raw/lpc32xx_slc.c .ecc = lpc32xx_ooblayout_ecc, ecc 407 drivers/mtd/nand/raw/lpc32xx_slc.c static void lpc32xx_slc_ecc_copy(uint8_t *spare, const uint32_t *ecc, int count) ecc 412 drivers/mtd/nand/raw/lpc32xx_slc.c uint32_t ce = ecc[i / 3]; ecc 531 drivers/mtd/nand/raw/lpc32xx_slc.c for (i = 0; i < chip->ecc.steps; i++) { ecc 534 drivers/mtd/nand/raw/lpc32xx_slc.c dma_buf + i * chip->ecc.size, ecc 535 drivers/mtd/nand/raw/lpc32xx_slc.c mtd->writesize / chip->ecc.steps, dir); ecc 540 drivers/mtd/nand/raw/lpc32xx_slc.c if (i == chip->ecc.steps - 1) ecc 572 drivers/mtd/nand/raw/lpc32xx_slc.c host->ecc_buf[chip->ecc.steps - 1] = ecc 615 drivers/mtd/nand/raw/lpc32xx_slc.c status = lpc32xx_xfer(mtd, buf, chip->ecc.steps, 1); ecc 621 drivers/mtd/nand/raw/lpc32xx_slc.c lpc32xx_slc_ecc_copy(tmpecc, (uint32_t *) host->ecc_buf, chip->ecc.steps); ecc 630 drivers/mtd/nand/raw/lpc32xx_slc.c for (i = 0; i < chip->ecc.steps; i++) { ecc 631 drivers/mtd/nand/raw/lpc32xx_slc.c stat = chip->ecc.correct(chip, buf, oobecc, ecc 632 drivers/mtd/nand/raw/lpc32xx_slc.c &tmpecc[i * chip->ecc.bytes]); ecc 638 drivers/mtd/nand/raw/lpc32xx_slc.c buf += chip->ecc.size; ecc 639 drivers/mtd/nand/raw/lpc32xx_slc.c oobecc += chip->ecc.bytes; ecc 659 drivers/mtd/nand/raw/lpc32xx_slc.c chip->legacy.read_buf(chip, buf, chip->ecc.size * chip->ecc.steps); ecc 682 drivers/mtd/nand/raw/lpc32xx_slc.c error = lpc32xx_xfer(mtd, (uint8_t *)buf, chip->ecc.steps, 0); ecc 695 drivers/mtd/nand/raw/lpc32xx_slc.c lpc32xx_slc_ecc_copy(pb, (uint32_t *)host->ecc_buf, chip->ecc.steps); ecc 715 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.size * chip->ecc.steps); ecc 790 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.size = 256; ecc 791 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.bytes = LPC32XX_SLC_DEV_ECC_BYTES; ecc 792 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.prepad = 0; ecc 793 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.postpad = 0; ecc 884 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.mode = NAND_ECC_HW_SYNDROME; ecc 888 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.read_page_raw = lpc32xx_nand_read_page_raw_syndrome; ecc 889 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.read_page = lpc32xx_nand_read_page_syndrome; ecc 890 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.write_page_raw = lpc32xx_nand_write_page_raw_syndrome; ecc 891 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.write_page = lpc32xx_nand_write_page_syndrome; ecc 892 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.write_oob = lpc32xx_nand_write_oob_syndrome; ecc 893 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.read_oob = lpc32xx_nand_read_oob_syndrome; ecc 894 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.calculate = lpc32xx_nand_ecc_calculate; ecc 895 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.correct = nand_correct_data; ecc 896 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.strength = 1; ecc 897 drivers/mtd/nand/raw/lpc32xx_slc.c chip->ecc.hwctl = lpc32xx_nand_ecc_enable; ecc 783 drivers/mtd/nand/raw/marvell_nand.c if (chip->ecc.algo == NAND_ECC_BCH) ecc 795 drivers/mtd/nand/raw/marvell_nand.c if (chip->ecc.algo == NAND_ECC_BCH) ecc 904 drivers/mtd/nand/raw/marvell_nand.c u8 *ecc, int ecc_len, ecc 919 drivers/mtd/nand/raw/marvell_nand.c if (!ecc) ecc 922 drivers/mtd/nand/raw/marvell_nand.c bf = nand_check_erased_ecc_chunk(data, data_len, ecc, ecc_len, ecc 923 drivers/mtd/nand/raw/marvell_nand.c spare, spare_len, chip->ecc.strength); ecc 969 drivers/mtd/nand/raw/marvell_nand.c if (chip->ecc.algo == NAND_ECC_BCH) ecc 1436 drivers/mtd/nand/raw/marvell_nand.c return chip->ecc.read_page_raw(chip, buf, true, page); ecc 1443 drivers/mtd/nand/raw/marvell_nand.c return chip->ecc.read_page(chip, buf, true, page); ecc 1621 drivers/mtd/nand/raw/marvell_nand.c return chip->ecc.write_page_raw(chip, buf, true, page); ecc 1631 drivers/mtd/nand/raw/marvell_nand.c return chip->ecc.write_page(chip, buf, true, page); ecc 2165 drivers/mtd/nand/raw/marvell_nand.c .ecc = marvell_nand_ooblayout_ecc, ecc 2170 drivers/mtd/nand/raw/marvell_nand.c struct nand_ecc_ctrl *ecc) ecc 2189 drivers/mtd/nand/raw/marvell_nand.c ecc->size == l->chunk && ecc->strength == l->strength) { ecc 2196 drivers/mtd/nand/raw/marvell_nand.c (!nfc->caps->is_nfcv2 && ecc->strength > 1)) { ecc 2199 drivers/mtd/nand/raw/marvell_nand.c ecc->strength, mtd->writesize); ecc 2214 drivers/mtd/nand/raw/marvell_nand.c ecc->steps = l->nchunks; ecc 2215 drivers/mtd/nand/raw/marvell_nand.c ecc->size = l->data_bytes; ecc 2217 drivers/mtd/nand/raw/marvell_nand.c if (ecc->strength == 1) { ecc 2218 drivers/mtd/nand/raw/marvell_nand.c chip->ecc.algo = NAND_ECC_HAMMING; ecc 2219 drivers/mtd/nand/raw/marvell_nand.c ecc->read_page_raw = marvell_nfc_hw_ecc_hmg_read_page_raw; ecc 2220 drivers/mtd/nand/raw/marvell_nand.c ecc->read_page = marvell_nfc_hw_ecc_hmg_read_page; ecc 2221 drivers/mtd/nand/raw/marvell_nand.c ecc->read_oob_raw = marvell_nfc_hw_ecc_hmg_read_oob_raw; ecc 2222 drivers/mtd/nand/raw/marvell_nand.c ecc->read_oob = ecc->read_oob_raw; ecc 2223 drivers/mtd/nand/raw/marvell_nand.c ecc->write_page_raw = marvell_nfc_hw_ecc_hmg_write_page_raw; ecc 2224 drivers/mtd/nand/raw/marvell_nand.c ecc->write_page = marvell_nfc_hw_ecc_hmg_write_page; ecc 2225 drivers/mtd/nand/raw/marvell_nand.c ecc->write_oob_raw = marvell_nfc_hw_ecc_hmg_write_oob_raw; ecc 2226 drivers/mtd/nand/raw/marvell_nand.c ecc->write_oob = ecc->write_oob_raw; ecc 2228 drivers/mtd/nand/raw/marvell_nand.c chip->ecc.algo = NAND_ECC_BCH; ecc 2229 drivers/mtd/nand/raw/marvell_nand.c ecc->strength = 16; ecc 2230 drivers/mtd/nand/raw/marvell_nand.c ecc->read_page_raw = marvell_nfc_hw_ecc_bch_read_page_raw; ecc 2231 drivers/mtd/nand/raw/marvell_nand.c ecc->read_page = marvell_nfc_hw_ecc_bch_read_page; ecc 2232 drivers/mtd/nand/raw/marvell_nand.c ecc->read_oob_raw = marvell_nfc_hw_ecc_bch_read_oob_raw; ecc 2233 drivers/mtd/nand/raw/marvell_nand.c ecc->read_oob = marvell_nfc_hw_ecc_bch_read_oob; ecc 2234 drivers/mtd/nand/raw/marvell_nand.c ecc->write_page_raw = marvell_nfc_hw_ecc_bch_write_page_raw; ecc 2235 drivers/mtd/nand/raw/marvell_nand.c ecc->write_page = marvell_nfc_hw_ecc_bch_write_page; ecc 2236 drivers/mtd/nand/raw/marvell_nand.c ecc->write_oob_raw = marvell_nfc_hw_ecc_bch_write_oob_raw; ecc 2237 drivers/mtd/nand/raw/marvell_nand.c ecc->write_oob = marvell_nfc_hw_ecc_bch_write_oob; ecc 2244 drivers/mtd/nand/raw/marvell_nand.c struct nand_ecc_ctrl *ecc) ecc 2250 drivers/mtd/nand/raw/marvell_nand.c if (ecc->mode != NAND_ECC_NONE && (!ecc->size || !ecc->strength)) { ecc 2252 drivers/mtd/nand/raw/marvell_nand.c ecc->size = chip->base.eccreq.step_size; ecc 2253 drivers/mtd/nand/raw/marvell_nand.c ecc->strength = chip->base.eccreq.strength; ecc 2257 drivers/mtd/nand/raw/marvell_nand.c ecc->size = 512; ecc 2258 drivers/mtd/nand/raw/marvell_nand.c ecc->strength = 1; ecc 2262 drivers/mtd/nand/raw/marvell_nand.c switch (ecc->mode) { ecc 2264 drivers/mtd/nand/raw/marvell_nand.c ret = marvell_nand_hw_ecc_ctrl_init(mtd, ecc); ecc 2458 drivers/mtd/nand/raw/marvell_nand.c chip->ecc.size = pdata->ecc_step_size; ecc 2459 drivers/mtd/nand/raw/marvell_nand.c chip->ecc.strength = pdata->ecc_strength; ecc 2462 drivers/mtd/nand/raw/marvell_nand.c ret = marvell_nand_ecc_init(mtd, &chip->ecc); ecc 2468 drivers/mtd/nand/raw/marvell_nand.c if (chip->ecc.mode == NAND_ECC_HW) { ecc 2643 drivers/mtd/nand/raw/marvell_nand.c chip->ecc.mode = NAND_ECC_HW; ecc 274 drivers/mtd/nand/raw/meson_nand.c pagesize = nand->ecc.size; ecc 283 drivers/mtd/nand/raw/meson_nand.c pages = len / nand->ecc.size; ecc 336 drivers/mtd/nand/raw/meson_nand.c len = nand->ecc.size * (i + 1) + (nand->ecc.bytes + 2) * i; ecc 346 drivers/mtd/nand/raw/meson_nand.c temp = nand->ecc.size + nand->ecc.bytes; ecc 358 drivers/mtd/nand/raw/meson_nand.c oob_len = nand->ecc.bytes + 2; ecc 359 drivers/mtd/nand/raw/meson_nand.c for (i = 0; i < nand->ecc.steps; i++) { ecc 362 drivers/mtd/nand/raw/meson_nand.c memcpy(buf, dsrc, nand->ecc.size); ecc 363 drivers/mtd/nand/raw/meson_nand.c buf += nand->ecc.size; ecc 377 drivers/mtd/nand/raw/meson_nand.c oob_len = nand->ecc.bytes + 2; ecc 378 drivers/mtd/nand/raw/meson_nand.c for (i = 0; i < nand->ecc.steps; i++) { ecc 381 drivers/mtd/nand/raw/meson_nand.c memcpy(dsrc, buf, nand->ecc.size); ecc 382 drivers/mtd/nand/raw/meson_nand.c buf += nand->ecc.size; ecc 424 drivers/mtd/nand/raw/meson_nand.c for (i = 0, count = 0; i < nand->ecc.steps; i++, count += 2) { ecc 437 drivers/mtd/nand/raw/meson_nand.c for (i = 0, count = 0; i < nand->ecc.steps; i++, count += 2) { ecc 452 drivers/mtd/nand/raw/meson_nand.c for (i = 0; i < nand->ecc.steps; i++) { ecc 461 drivers/mtd/nand/raw/meson_nand.c ECC_ZERO_CNT(*info) < nand->ecc.strength) { ecc 641 drivers/mtd/nand/raw/meson_nand.c info_len = nand->ecc.steps * PER_INFO_BYTE; ecc 689 drivers/mtd/nand/raw/meson_nand.c memset(meson_chip->info_buf, 0, nand->ecc.steps * PER_INFO_BYTE); ecc 703 drivers/mtd/nand/raw/meson_nand.c neccpages = raw ? 1 : nand->ecc.steps; ecc 725 drivers/mtd/nand/raw/meson_nand.c info_len = nand->ecc.steps * PER_INFO_BYTE; ecc 774 drivers/mtd/nand/raw/meson_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 799 drivers/mtd/nand/raw/meson_nand.c for (i = 0; i < nand->ecc.steps ; i++) { ecc 800 drivers/mtd/nand/raw/meson_nand.c u8 *data = buf + i * ecc->size; ecc 801 drivers/mtd/nand/raw/meson_nand.c u8 *oob = nand->oob_poi + i * (ecc->bytes + 2); ecc 805 drivers/mtd/nand/raw/meson_nand.c ret = nand_check_erased_ecc_chunk(data, ecc->size, ecc 806 drivers/mtd/nand/raw/meson_nand.c oob, ecc->bytes + 2, ecc 808 drivers/mtd/nand/raw/meson_nand.c ecc->strength); ecc 957 drivers/mtd/nand/raw/meson_nand.c if (section >= nand->ecc.steps) ecc 960 drivers/mtd/nand/raw/meson_nand.c oobregion->offset = 2 + (section * (2 + nand->ecc.bytes)); ecc 961 drivers/mtd/nand/raw/meson_nand.c oobregion->length = nand->ecc.bytes; ecc 971 drivers/mtd/nand/raw/meson_nand.c if (section >= nand->ecc.steps) ecc 974 drivers/mtd/nand/raw/meson_nand.c oobregion->offset = section * (2 + nand->ecc.bytes); ecc 981 drivers/mtd/nand/raw/meson_nand.c .ecc = meson_ooblayout_ecc, ecc 1078 drivers/mtd/nand/raw/meson_nand.c nsectors = mtd->writesize / nand->ecc.size; ecc 1144 drivers/mtd/nand/raw/meson_nand.c if (nand->ecc.strength > 60 || nand->ecc.strength < 8) ecc 1148 drivers/mtd/nand/raw/meson_nand.c if (meson_ecc[i].strength == nand->ecc.strength) { ecc 1197 drivers/mtd/nand/raw/meson_nand.c nand->ecc.mode = NAND_ECC_HW; ecc 1198 drivers/mtd/nand/raw/meson_nand.c nand->ecc.write_page_raw = meson_nfc_write_page_raw; ecc 1199 drivers/mtd/nand/raw/meson_nand.c nand->ecc.write_page = meson_nfc_write_page_hwecc; ecc 1200 drivers/mtd/nand/raw/meson_nand.c nand->ecc.write_oob_raw = nand_write_oob_std; ecc 1201 drivers/mtd/nand/raw/meson_nand.c nand->ecc.write_oob = nand_write_oob_std; ecc 1203 drivers/mtd/nand/raw/meson_nand.c nand->ecc.read_page_raw = meson_nfc_read_page_raw; ecc 1204 drivers/mtd/nand/raw/meson_nand.c nand->ecc.read_page = meson_nfc_read_page_hwecc; ecc 1205 drivers/mtd/nand/raw/meson_nand.c nand->ecc.read_oob_raw = meson_nfc_read_oob_raw; ecc 1206 drivers/mtd/nand/raw/meson_nand.c nand->ecc.read_oob = meson_nfc_read_oob; ecc 691 drivers/mtd/nand/raw/mpc5121_nfc.c chip->ecc.mode = NAND_ECC_SOFT; ecc 692 drivers/mtd/nand/raw/mpc5121_nfc.c chip->ecc.algo = NAND_ECC_HAMMING; ecc 118 drivers/mtd/nand/raw/mtk_ecc.c static inline void mtk_ecc_wait_idle(struct mtk_ecc *ecc, ecc 121 drivers/mtd/nand/raw/mtk_ecc.c struct device *dev = ecc->dev; ecc 125 drivers/mtd/nand/raw/mtk_ecc.c ret = readl_poll_timeout_atomic(ecc->regs + ECC_IDLE_REG(op), val, ecc 135 drivers/mtd/nand/raw/mtk_ecc.c struct mtk_ecc *ecc = id; ecc 138 drivers/mtd/nand/raw/mtk_ecc.c dec = readw(ecc->regs + ecc->caps->ecc_regs[ECC_DECIRQ_STA]) ecc 141 drivers/mtd/nand/raw/mtk_ecc.c dec = readw(ecc->regs + ecc->caps->ecc_regs[ECC_DECDONE]); ecc 142 drivers/mtd/nand/raw/mtk_ecc.c if (dec & ecc->sectors) { ecc 147 drivers/mtd/nand/raw/mtk_ecc.c readw(ecc->regs + ecc->caps->ecc_regs[ECC_DECIRQ_STA]); ecc 148 drivers/mtd/nand/raw/mtk_ecc.c ecc->sectors = 0; ecc 149 drivers/mtd/nand/raw/mtk_ecc.c complete(&ecc->done); ecc 154 drivers/mtd/nand/raw/mtk_ecc.c enc = readl(ecc->regs + ecc->caps->ecc_regs[ECC_ENCIRQ_STA]) ecc 157 drivers/mtd/nand/raw/mtk_ecc.c complete(&ecc->done); ecc 165 drivers/mtd/nand/raw/mtk_ecc.c static int mtk_ecc_config(struct mtk_ecc *ecc, struct mtk_ecc_config *config) ecc 170 drivers/mtd/nand/raw/mtk_ecc.c for (i = 0; i < ecc->caps->num_ecc_strength; i++) { ecc 171 drivers/mtd/nand/raw/mtk_ecc.c if (ecc->caps->ecc_strength[i] == config->strength) ecc 175 drivers/mtd/nand/raw/mtk_ecc.c if (i == ecc->caps->num_ecc_strength) { ecc 176 drivers/mtd/nand/raw/mtk_ecc.c dev_err(ecc->dev, "invalid ecc strength %d\n", ecc 187 drivers/mtd/nand/raw/mtk_ecc.c reg = ecc_bit | (config->mode << ecc->caps->ecc_mode_shift); ecc 189 drivers/mtd/nand/raw/mtk_ecc.c writel(reg, ecc->regs + ECC_ENCCNFG); ecc 193 drivers/mtd/nand/raw/mtk_ecc.c ecc->regs + ECC_ENCDIADDR); ecc 198 drivers/mtd/nand/raw/mtk_ecc.c config->strength * ecc->caps->parity_bits; ecc 200 drivers/mtd/nand/raw/mtk_ecc.c reg = ecc_bit | (config->mode << ecc->caps->ecc_mode_shift); ecc 203 drivers/mtd/nand/raw/mtk_ecc.c writel(reg, ecc->regs + ECC_DECCNFG); ecc 206 drivers/mtd/nand/raw/mtk_ecc.c ecc->sectors = 1 << (config->sectors - 1); ecc 212 drivers/mtd/nand/raw/mtk_ecc.c void mtk_ecc_get_stats(struct mtk_ecc *ecc, struct mtk_ecc_stats *stats, ecc 223 drivers/mtd/nand/raw/mtk_ecc.c err = readl(ecc->regs + ECC_DECENUM0 + offset); ecc 225 drivers/mtd/nand/raw/mtk_ecc.c err &= ecc->caps->err_mask; ecc 226 drivers/mtd/nand/raw/mtk_ecc.c if (err == ecc->caps->err_mask) { ecc 240 drivers/mtd/nand/raw/mtk_ecc.c void mtk_ecc_release(struct mtk_ecc *ecc) ecc 242 drivers/mtd/nand/raw/mtk_ecc.c clk_disable_unprepare(ecc->clk); ecc 243 drivers/mtd/nand/raw/mtk_ecc.c put_device(ecc->dev); ecc 247 drivers/mtd/nand/raw/mtk_ecc.c static void mtk_ecc_hw_init(struct mtk_ecc *ecc) ecc 249 drivers/mtd/nand/raw/mtk_ecc.c mtk_ecc_wait_idle(ecc, ECC_ENCODE); ecc 250 drivers/mtd/nand/raw/mtk_ecc.c writew(ECC_OP_DISABLE, ecc->regs + ECC_ENCCON); ecc 252 drivers/mtd/nand/raw/mtk_ecc.c mtk_ecc_wait_idle(ecc, ECC_DECODE); ecc 253 drivers/mtd/nand/raw/mtk_ecc.c writel(ECC_OP_DISABLE, ecc->regs + ECC_DECCON); ecc 259 drivers/mtd/nand/raw/mtk_ecc.c struct mtk_ecc *ecc; ecc 265 drivers/mtd/nand/raw/mtk_ecc.c ecc = platform_get_drvdata(pdev); ecc 266 drivers/mtd/nand/raw/mtk_ecc.c if (!ecc) { ecc 271 drivers/mtd/nand/raw/mtk_ecc.c clk_prepare_enable(ecc->clk); ecc 272 drivers/mtd/nand/raw/mtk_ecc.c mtk_ecc_hw_init(ecc); ecc 274 drivers/mtd/nand/raw/mtk_ecc.c return ecc; ecc 279 drivers/mtd/nand/raw/mtk_ecc.c struct mtk_ecc *ecc = NULL; ecc 284 drivers/mtd/nand/raw/mtk_ecc.c ecc = mtk_ecc_get(np); ecc 288 drivers/mtd/nand/raw/mtk_ecc.c return ecc; ecc 292 drivers/mtd/nand/raw/mtk_ecc.c int mtk_ecc_enable(struct mtk_ecc *ecc, struct mtk_ecc_config *config) ecc 298 drivers/mtd/nand/raw/mtk_ecc.c ret = mutex_lock_interruptible(&ecc->lock); ecc 300 drivers/mtd/nand/raw/mtk_ecc.c dev_err(ecc->dev, "interrupted when attempting to lock\n"); ecc 304 drivers/mtd/nand/raw/mtk_ecc.c mtk_ecc_wait_idle(ecc, op); ecc 306 drivers/mtd/nand/raw/mtk_ecc.c ret = mtk_ecc_config(ecc, config); ecc 308 drivers/mtd/nand/raw/mtk_ecc.c mutex_unlock(&ecc->lock); ecc 313 drivers/mtd/nand/raw/mtk_ecc.c init_completion(&ecc->done); ecc 320 drivers/mtd/nand/raw/mtk_ecc.c if (ecc->caps->pg_irq_sel && config->mode == ECC_NFI_MODE) ecc 323 drivers/mtd/nand/raw/mtk_ecc.c writew(reg_val, ecc->regs + ecc 324 drivers/mtd/nand/raw/mtk_ecc.c ecc->caps->ecc_regs[ECC_ENCIRQ_EN]); ecc 326 drivers/mtd/nand/raw/mtk_ecc.c writew(reg_val, ecc->regs + ecc 327 drivers/mtd/nand/raw/mtk_ecc.c ecc->caps->ecc_regs[ECC_DECIRQ_EN]); ecc 330 drivers/mtd/nand/raw/mtk_ecc.c writew(ECC_OP_ENABLE, ecc->regs + ECC_CTL_REG(op)); ecc 336 drivers/mtd/nand/raw/mtk_ecc.c void mtk_ecc_disable(struct mtk_ecc *ecc) ecc 341 drivers/mtd/nand/raw/mtk_ecc.c if (readw(ecc->regs + ECC_CTL_REG(op)) != ECC_OP_ENABLE) ecc 345 drivers/mtd/nand/raw/mtk_ecc.c mtk_ecc_wait_idle(ecc, op); ecc 351 drivers/mtd/nand/raw/mtk_ecc.c readw(ecc->regs + ecc->caps->ecc_regs[ECC_DECDONE]); ecc 352 drivers/mtd/nand/raw/mtk_ecc.c writew(0, ecc->regs + ecc->caps->ecc_regs[ECC_DECIRQ_EN]); ecc 354 drivers/mtd/nand/raw/mtk_ecc.c writew(0, ecc->regs + ecc->caps->ecc_regs[ECC_ENCIRQ_EN]); ecc 357 drivers/mtd/nand/raw/mtk_ecc.c writew(ECC_OP_DISABLE, ecc->regs + ECC_CTL_REG(op)); ecc 359 drivers/mtd/nand/raw/mtk_ecc.c mutex_unlock(&ecc->lock); ecc 363 drivers/mtd/nand/raw/mtk_ecc.c int mtk_ecc_wait_done(struct mtk_ecc *ecc, enum mtk_ecc_operation op) ecc 367 drivers/mtd/nand/raw/mtk_ecc.c ret = wait_for_completion_timeout(&ecc->done, msecs_to_jiffies(500)); ecc 369 drivers/mtd/nand/raw/mtk_ecc.c dev_err(ecc->dev, "%s timeout - interrupt did not arrive)\n", ecc 378 drivers/mtd/nand/raw/mtk_ecc.c int mtk_ecc_encode(struct mtk_ecc *ecc, struct mtk_ecc_config *config, ecc 385 drivers/mtd/nand/raw/mtk_ecc.c addr = dma_map_single(ecc->dev, data, bytes, DMA_TO_DEVICE); ecc 386 drivers/mtd/nand/raw/mtk_ecc.c ret = dma_mapping_error(ecc->dev, addr); ecc 388 drivers/mtd/nand/raw/mtk_ecc.c dev_err(ecc->dev, "dma mapping error\n"); ecc 394 drivers/mtd/nand/raw/mtk_ecc.c ret = mtk_ecc_enable(ecc, config); ecc 396 drivers/mtd/nand/raw/mtk_ecc.c dma_unmap_single(ecc->dev, addr, bytes, DMA_TO_DEVICE); ecc 400 drivers/mtd/nand/raw/mtk_ecc.c ret = mtk_ecc_wait_done(ecc, ECC_ENCODE); ecc 404 drivers/mtd/nand/raw/mtk_ecc.c mtk_ecc_wait_idle(ecc, ECC_ENCODE); ecc 407 drivers/mtd/nand/raw/mtk_ecc.c len = (config->strength * ecc->caps->parity_bits + 7) >> 3; ecc 410 drivers/mtd/nand/raw/mtk_ecc.c __ioread32_copy(ecc->eccdata, ecc 411 drivers/mtd/nand/raw/mtk_ecc.c ecc->regs + ecc->caps->ecc_regs[ECC_ENCPAR00], ecc 415 drivers/mtd/nand/raw/mtk_ecc.c memcpy(data + bytes, ecc->eccdata, len); ecc 418 drivers/mtd/nand/raw/mtk_ecc.c dma_unmap_single(ecc->dev, addr, bytes, DMA_TO_DEVICE); ecc 419 drivers/mtd/nand/raw/mtk_ecc.c mtk_ecc_disable(ecc); ecc 425 drivers/mtd/nand/raw/mtk_ecc.c void mtk_ecc_adjust_strength(struct mtk_ecc *ecc, u32 *p) ecc 427 drivers/mtd/nand/raw/mtk_ecc.c const u8 *ecc_strength = ecc->caps->ecc_strength; ecc 430 drivers/mtd/nand/raw/mtk_ecc.c for (i = 0; i < ecc->caps->num_ecc_strength; i++) { ecc 440 drivers/mtd/nand/raw/mtk_ecc.c *p = ecc_strength[ecc->caps->num_ecc_strength - 1]; ecc 444 drivers/mtd/nand/raw/mtk_ecc.c unsigned int mtk_ecc_get_parity_bits(struct mtk_ecc *ecc) ecc 446 drivers/mtd/nand/raw/mtk_ecc.c return ecc->caps->parity_bits; ecc 497 drivers/mtd/nand/raw/mtk_ecc.c struct mtk_ecc *ecc; ecc 502 drivers/mtd/nand/raw/mtk_ecc.c ecc = devm_kzalloc(dev, sizeof(*ecc), GFP_KERNEL); ecc 503 drivers/mtd/nand/raw/mtk_ecc.c if (!ecc) ecc 506 drivers/mtd/nand/raw/mtk_ecc.c ecc->caps = of_device_get_match_data(dev); ecc 508 drivers/mtd/nand/raw/mtk_ecc.c max_eccdata_size = ecc->caps->num_ecc_strength - 1; ecc 509 drivers/mtd/nand/raw/mtk_ecc.c max_eccdata_size = ecc->caps->ecc_strength[max_eccdata_size]; ecc 510 drivers/mtd/nand/raw/mtk_ecc.c max_eccdata_size = (max_eccdata_size * ecc->caps->parity_bits + 7) >> 3; ecc 512 drivers/mtd/nand/raw/mtk_ecc.c ecc->eccdata = devm_kzalloc(dev, max_eccdata_size, GFP_KERNEL); ecc 513 drivers/mtd/nand/raw/mtk_ecc.c if (!ecc->eccdata) ecc 517 drivers/mtd/nand/raw/mtk_ecc.c ecc->regs = devm_ioremap_resource(dev, res); ecc 518 drivers/mtd/nand/raw/mtk_ecc.c if (IS_ERR(ecc->regs)) { ecc 519 drivers/mtd/nand/raw/mtk_ecc.c dev_err(dev, "failed to map regs: %ld\n", PTR_ERR(ecc->regs)); ecc 520 drivers/mtd/nand/raw/mtk_ecc.c return PTR_ERR(ecc->regs); ecc 523 drivers/mtd/nand/raw/mtk_ecc.c ecc->clk = devm_clk_get(dev, NULL); ecc 524 drivers/mtd/nand/raw/mtk_ecc.c if (IS_ERR(ecc->clk)) { ecc 525 drivers/mtd/nand/raw/mtk_ecc.c dev_err(dev, "failed to get clock: %ld\n", PTR_ERR(ecc->clk)); ecc 526 drivers/mtd/nand/raw/mtk_ecc.c return PTR_ERR(ecc->clk); ecc 541 drivers/mtd/nand/raw/mtk_ecc.c ret = devm_request_irq(dev, irq, mtk_ecc_irq, 0x0, "mtk-ecc", ecc); ecc 547 drivers/mtd/nand/raw/mtk_ecc.c ecc->dev = dev; ecc 548 drivers/mtd/nand/raw/mtk_ecc.c mutex_init(&ecc->lock); ecc 549 drivers/mtd/nand/raw/mtk_ecc.c platform_set_drvdata(pdev, ecc); ecc 558 drivers/mtd/nand/raw/mtk_ecc.c struct mtk_ecc *ecc = dev_get_drvdata(dev); ecc 560 drivers/mtd/nand/raw/mtk_ecc.c clk_disable_unprepare(ecc->clk); ecc 567 drivers/mtd/nand/raw/mtk_ecc.c struct mtk_ecc *ecc = dev_get_drvdata(dev); ecc 570 drivers/mtd/nand/raw/mtk_ecc.c ret = clk_prepare_enable(ecc->clk); ecc 41 drivers/mtd/nand/raw/mtk_ecc.h void mtk_ecc_adjust_strength(struct mtk_ecc *ecc, u32 *p); ecc 42 drivers/mtd/nand/raw/mtk_ecc.h unsigned int mtk_ecc_get_parity_bits(struct mtk_ecc *ecc); ecc 147 drivers/mtd/nand/raw/mtk_nand.c struct mtk_ecc *ecc; ecc 186 drivers/mtd/nand/raw/mtk_nand.c return (u8 *)p + i * chip->ecc.size; ecc 212 drivers/mtd/nand/raw/mtk_nand.c return chip->ecc.size + mtk_nand->spare_per_sector; ecc 226 drivers/mtd/nand/raw/mtk_nand.c return nfc->buffer + i * mtk_data_len(chip) + chip->ecc.size; ecc 336 drivers/mtd/nand/raw/mtk_nand.c if (chip->ecc.size == 512) ecc 342 drivers/mtd/nand/raw/mtk_nand.c if (chip->ecc.size == 512) ecc 348 drivers/mtd/nand/raw/mtk_nand.c if (chip->ecc.size == 512) ecc 365 drivers/mtd/nand/raw/mtk_nand.c if (chip->ecc.size == 1024) ecc 384 drivers/mtd/nand/raw/mtk_nand.c nfc->ecc_cfg.strength = chip->ecc.strength; ecc 385 drivers/mtd/nand/raw/mtk_nand.c nfc->ecc_cfg.len = chip->ecc.size + mtk_nand->fdm.ecc_size; ecc 616 drivers/mtd/nand/raw/mtk_nand.c int size = chip->ecc.size + mtk_nand->fdm.reg_size; ecc 621 drivers/mtd/nand/raw/mtk_nand.c return mtk_ecc_encode(nfc->ecc, &nfc->ecc_cfg, data, size); ecc 638 drivers/mtd/nand/raw/mtk_nand.c bad_pos += nand->bad_mark.sec * chip->ecc.size; ecc 653 drivers/mtd/nand/raw/mtk_nand.c start = offset / chip->ecc.size; ecc 654 drivers/mtd/nand/raw/mtk_nand.c end = DIV_ROUND_UP(offset + len, chip->ecc.size); ecc 657 drivers/mtd/nand/raw/mtk_nand.c for (i = 0; i < chip->ecc.steps; i++) { ecc 659 drivers/mtd/nand/raw/mtk_nand.c chip->ecc.size); ecc 687 drivers/mtd/nand/raw/mtk_nand.c for (i = 0; i < chip->ecc.steps; i++) { ecc 690 drivers/mtd/nand/raw/mtk_nand.c chip->ecc.size); ecc 728 drivers/mtd/nand/raw/mtk_nand.c for (i = 0; i < chip->ecc.steps; i++) { ecc 764 drivers/mtd/nand/raw/mtk_nand.c nfi_writel(nfc, chip->ecc.steps << CON_SEC_SHIFT, NFI_CON); ecc 783 drivers/mtd/nand/raw/mtk_nand.c ADDRCNTR_SEC(reg) >= chip->ecc.steps, ecc 815 drivers/mtd/nand/raw/mtk_nand.c ret = mtk_ecc_enable(nfc->ecc, &nfc->ecc_cfg); ecc 839 drivers/mtd/nand/raw/mtk_nand.c mtk_ecc_disable(nfc->ecc); ecc 896 drivers/mtd/nand/raw/mtk_nand.c memset(buf, 0xff, sectors * chip->ecc.size); ecc 902 drivers/mtd/nand/raw/mtk_nand.c mtk_ecc_get_stats(nfc->ecc, &stats, sectors); ecc 923 drivers/mtd/nand/raw/mtk_nand.c start = data_offs / chip->ecc.size; ecc 924 drivers/mtd/nand/raw/mtk_nand.c end = DIV_ROUND_UP(data_offs + readlen, chip->ecc.size); ecc 927 drivers/mtd/nand/raw/mtk_nand.c column = start * (chip->ecc.size + spare); ecc 929 drivers/mtd/nand/raw/mtk_nand.c len = sectors * chip->ecc.size + (raw ? sectors * spare : 0); ecc 930 drivers/mtd/nand/raw/mtk_nand.c buf = bufpoi + start * chip->ecc.size; ecc 951 drivers/mtd/nand/raw/mtk_nand.c rc = mtk_ecc_enable(nfc->ecc, &nfc->ecc_cfg); ecc 986 drivers/mtd/nand/raw/mtk_nand.c rc = mtk_ecc_wait_done(nfc->ecc, ECC_DECODE); ecc 997 drivers/mtd/nand/raw/mtk_nand.c mtk_ecc_disable(nfc->ecc); ecc 1037 drivers/mtd/nand/raw/mtk_nand.c for (i = 0; i < chip->ecc.steps; i++) { ecc 1045 drivers/mtd/nand/raw/mtk_nand.c chip->ecc.size); ecc 1124 drivers/mtd/nand/raw/mtk_nand.c eccsteps = mtd->writesize / chip->ecc.size; ecc 1145 drivers/mtd/nand/raw/mtk_nand.c eccsteps = mtd->writesize / chip->ecc.size; ecc 1154 drivers/mtd/nand/raw/mtk_nand.c .ecc = mtk_nfc_ooblayout_ecc, ecc 1164 drivers/mtd/nand/raw/mtk_nand.c ecc_bytes = DIV_ROUND_UP(nand->ecc.strength * ecc 1165 drivers/mtd/nand/raw/mtk_nand.c mtk_ecc_get_parity_bits(nfc->ecc), 8); ecc 1196 drivers/mtd/nand/raw/mtk_nand.c eccsteps = mtd->writesize / nand->ecc.size; ecc 1199 drivers/mtd/nand/raw/mtk_nand.c if (nand->ecc.size == 1024) ecc 1215 drivers/mtd/nand/raw/mtk_nand.c if (nand->ecc.size == 1024) ecc 1229 drivers/mtd/nand/raw/mtk_nand.c if (nand->ecc.mode != NAND_ECC_HW) { ecc 1235 drivers/mtd/nand/raw/mtk_nand.c if (!nand->ecc.size || !nand->ecc.strength) { ecc 1237 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.strength = nand->base.eccreq.strength; ecc 1238 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.size = nand->base.eccreq.step_size; ecc 1244 drivers/mtd/nand/raw/mtk_nand.c if (nand->ecc.size < 1024) { ecc 1247 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.size = 1024; ecc 1248 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.strength <<= 1; ecc 1250 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.size = 512; ecc 1253 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.size = 1024; ecc 1261 drivers/mtd/nand/raw/mtk_nand.c free = (nand->ecc.strength * mtk_ecc_get_parity_bits(nfc->ecc) ecc 1272 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.strength = (spare << 3) / ecc 1273 drivers/mtd/nand/raw/mtk_nand.c mtk_ecc_get_parity_bits(nfc->ecc); ecc 1276 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.strength = (spare << 3) / ecc 1277 drivers/mtd/nand/raw/mtk_nand.c mtk_ecc_get_parity_bits(nfc->ecc); ecc 1281 drivers/mtd/nand/raw/mtk_nand.c mtk_ecc_adjust_strength(nfc->ecc, &nand->ecc.strength); ecc 1284 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.size, nand->ecc.strength); ecc 1393 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.mode = NAND_ECC_HW; ecc 1395 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.write_subpage = mtk_nfc_write_subpage_hwecc; ecc 1396 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.write_page_raw = mtk_nfc_write_page_raw; ecc 1397 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.write_page = mtk_nfc_write_page_hwecc; ecc 1398 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.write_oob_raw = mtk_nfc_write_oob_std; ecc 1399 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.write_oob = mtk_nfc_write_oob_std; ecc 1401 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.read_subpage = mtk_nfc_read_subpage_hwecc; ecc 1402 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.read_page_raw = mtk_nfc_read_page_raw; ecc 1403 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.read_page = mtk_nfc_read_page_hwecc; ecc 1404 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.read_oob_raw = mtk_nfc_read_oob_std; ecc 1405 drivers/mtd/nand/raw/mtk_nand.c nand->ecc.read_oob = mtk_nfc_read_oob_std; ecc 1507 drivers/mtd/nand/raw/mtk_nand.c nfc->ecc = of_mtk_ecc_get(np); ecc 1508 drivers/mtd/nand/raw/mtk_nand.c if (IS_ERR(nfc->ecc)) ecc 1509 drivers/mtd/nand/raw/mtk_nand.c return PTR_ERR(nfc->ecc); ecc 1510 drivers/mtd/nand/raw/mtk_nand.c else if (!nfc->ecc) ecc 1574 drivers/mtd/nand/raw/mtk_nand.c mtk_ecc_release(nfc->ecc); ecc 1591 drivers/mtd/nand/raw/mtk_nand.c mtk_ecc_release(nfc->ecc); ecc 128 drivers/mtd/nand/raw/mxc_nand.c int (*read_page)(struct nand_chip *chip, void *buf, void *oob, bool ecc, ecc 672 drivers/mtd/nand/raw/mxc_nand.c if (chip->ecc.mode != NAND_ECC_HW) ecc 690 drivers/mtd/nand/raw/mxc_nand.c if (chip->ecc.mode != NAND_ECC_HW) ecc 714 drivers/mtd/nand/raw/mxc_nand.c bool ecc, int page) ecc 722 drivers/mtd/nand/raw/mxc_nand.c host->devtype_data->enable_hwecc(chip, ecc); ecc 747 drivers/mtd/nand/raw/mxc_nand.c if (buf && ecc) { ecc 772 drivers/mtd/nand/raw/mxc_nand.c void *oob, bool ecc, int page) ecc 781 drivers/mtd/nand/raw/mxc_nand.c host->devtype_data->enable_hwecc(chip, ecc); ecc 856 drivers/mtd/nand/raw/mxc_nand.c bool ecc, int page) ecc 861 drivers/mtd/nand/raw/mxc_nand.c host->devtype_data->enable_hwecc(chip, ecc); ecc 1010 drivers/mtd/nand/raw/mxc_nand.c if (section >= nand_chip->ecc.steps) ecc 1024 drivers/mtd/nand/raw/mxc_nand.c if (section > nand_chip->ecc.steps) ecc 1037 drivers/mtd/nand/raw/mxc_nand.c if (section < nand_chip->ecc.steps) ecc 1048 drivers/mtd/nand/raw/mxc_nand.c .ecc = mxc_v1_ooblayout_ecc, ecc 1056 drivers/mtd/nand/raw/mxc_nand.c int stepsize = nand_chip->ecc.bytes == 9 ? 16 : 26; ecc 1058 drivers/mtd/nand/raw/mxc_nand.c if (section >= nand_chip->ecc.steps) ecc 1062 drivers/mtd/nand/raw/mxc_nand.c oobregion->length = nand_chip->ecc.bytes; ecc 1071 drivers/mtd/nand/raw/mxc_nand.c int stepsize = nand_chip->ecc.bytes == 9 ? 16 : 26; ecc 1073 drivers/mtd/nand/raw/mxc_nand.c if (section >= nand_chip->ecc.steps) ecc 1093 drivers/mtd/nand/raw/mxc_nand.c .ecc = mxc_v2_ooblayout_ecc, ecc 1120 drivers/mtd/nand/raw/mxc_nand.c if (nand_chip->ecc.mode == NAND_ECC_HW && mtd->writesize) ecc 1230 drivers/mtd/nand/raw/mxc_nand.c if (nand_chip->ecc.mode == NAND_ECC_HW) ecc 1306 drivers/mtd/nand/raw/mxc_nand.c if (chip->ecc.mode == NAND_ECC_HW) ecc 1683 drivers/mtd/nand/raw/mxc_nand.c switch (chip->ecc.mode) { ecc 1685 drivers/mtd/nand/raw/mxc_nand.c chip->ecc.read_page = mxc_nand_read_page; ecc 1686 drivers/mtd/nand/raw/mxc_nand.c chip->ecc.read_page_raw = mxc_nand_read_page_raw; ecc 1687 drivers/mtd/nand/raw/mxc_nand.c chip->ecc.read_oob = mxc_nand_read_oob; ecc 1688 drivers/mtd/nand/raw/mxc_nand.c chip->ecc.write_page = mxc_nand_write_page_ecc; ecc 1689 drivers/mtd/nand/raw/mxc_nand.c chip->ecc.write_page_raw = mxc_nand_write_page_raw; ecc 1690 drivers/mtd/nand/raw/mxc_nand.c chip->ecc.write_oob = mxc_nand_write_oob; ecc 1715 drivers/mtd/nand/raw/mxc_nand.c if (!chip->ecc.bytes) { ecc 1717 drivers/mtd/nand/raw/mxc_nand.c chip->ecc.bytes = 18; ecc 1719 drivers/mtd/nand/raw/mxc_nand.c chip->ecc.bytes = 9; ecc 1731 drivers/mtd/nand/raw/mxc_nand.c if (chip->ecc.mode == NAND_ECC_HW) { ecc 1733 drivers/mtd/nand/raw/mxc_nand.c chip->ecc.strength = 1; ecc 1735 drivers/mtd/nand/raw/mxc_nand.c chip->ecc.strength = (host->eccsize == 4) ? 4 : 8; ecc 1838 drivers/mtd/nand/raw/mxc_nand.c this->ecc.bytes = host->devtype_data->eccbytes; ecc 1842 drivers/mtd/nand/raw/mxc_nand.c this->ecc.size = 512; ecc 1846 drivers/mtd/nand/raw/mxc_nand.c this->ecc.mode = NAND_ECC_HW; ecc 1848 drivers/mtd/nand/raw/mxc_nand.c this->ecc.mode = NAND_ECC_SOFT; ecc 1849 drivers/mtd/nand/raw/mxc_nand.c this->ecc.algo = NAND_ECC_HAMMING; ecc 53 drivers/mtd/nand/raw/nand_base.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 69 drivers/mtd/nand/raw/nand_base.c oobregion->length = ecc->total - 4; ecc 99 drivers/mtd/nand/raw/nand_base.c .ecc = nand_ooblayout_ecc_sp, ecc 108 drivers/mtd/nand/raw/nand_base.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 110 drivers/mtd/nand/raw/nand_base.c if (section || !ecc->total) ecc 113 drivers/mtd/nand/raw/nand_base.c oobregion->length = ecc->total; ecc 123 drivers/mtd/nand/raw/nand_base.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 128 drivers/mtd/nand/raw/nand_base.c oobregion->length = mtd->oobsize - ecc->total - 2; ecc 135 drivers/mtd/nand/raw/nand_base.c .ecc = nand_ooblayout_ecc_lp, ecc 148 drivers/mtd/nand/raw/nand_base.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 164 drivers/mtd/nand/raw/nand_base.c oobregion->length = ecc->total; ecc 175 drivers/mtd/nand/raw/nand_base.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 196 drivers/mtd/nand/raw/nand_base.c oobregion->offset = ecc_offset + ecc->total; ecc 204 drivers/mtd/nand/raw/nand_base.c .ecc = nand_ooblayout_ecc_lp_hamming, ecc 327 drivers/mtd/nand/raw/nand_base.c res = chip->ecc.read_oob(chip, first_page + page_offset); ecc 492 drivers/mtd/nand/raw/nand_base.c status = chip->ecc.write_oob_raw(chip, page & chip->pagemask); ecc 494 drivers/mtd/nand/raw/nand_base.c status = chip->ecc.write_oob(chip, page & chip->pagemask); ecc 2545 drivers/mtd/nand/raw/nand_base.c void *ecc, int ecclen, ecc 2558 drivers/mtd/nand/raw/nand_base.c ecc_bitflips = nand_check_erased_buf(ecc, ecclen, bitflips_threshold); ecc 2573 drivers/mtd/nand/raw/nand_base.c memset(ecc, 0xff, ecclen); ecc 2640 drivers/mtd/nand/raw/nand_base.c int eccsize = chip->ecc.size; ecc 2641 drivers/mtd/nand/raw/nand_base.c int eccbytes = chip->ecc.bytes; ecc 2649 drivers/mtd/nand/raw/nand_base.c for (steps = chip->ecc.steps; steps > 0; steps--) { ecc 2656 drivers/mtd/nand/raw/nand_base.c if (chip->ecc.prepad) { ecc 2657 drivers/mtd/nand/raw/nand_base.c ret = nand_read_data_op(chip, oob, chip->ecc.prepad, ecc 2662 drivers/mtd/nand/raw/nand_base.c oob += chip->ecc.prepad; ecc 2671 drivers/mtd/nand/raw/nand_base.c if (chip->ecc.postpad) { ecc 2672 drivers/mtd/nand/raw/nand_base.c ret = nand_read_data_op(chip, oob, chip->ecc.postpad, ecc 2677 drivers/mtd/nand/raw/nand_base.c oob += chip->ecc.postpad; ecc 2702 drivers/mtd/nand/raw/nand_base.c int i, eccsize = chip->ecc.size, ret; ecc 2703 drivers/mtd/nand/raw/nand_base.c int eccbytes = chip->ecc.bytes; ecc 2704 drivers/mtd/nand/raw/nand_base.c int eccsteps = chip->ecc.steps; ecc 2706 drivers/mtd/nand/raw/nand_base.c uint8_t *ecc_calc = chip->ecc.calc_buf; ecc 2707 drivers/mtd/nand/raw/nand_base.c uint8_t *ecc_code = chip->ecc.code_buf; ecc 2710 drivers/mtd/nand/raw/nand_base.c chip->ecc.read_page_raw(chip, buf, 1, page); ecc 2713 drivers/mtd/nand/raw/nand_base.c chip->ecc.calculate(chip, p, &ecc_calc[i]); ecc 2716 drivers/mtd/nand/raw/nand_base.c chip->ecc.total); ecc 2720 drivers/mtd/nand/raw/nand_base.c eccsteps = chip->ecc.steps; ecc 2726 drivers/mtd/nand/raw/nand_base.c stat = chip->ecc.correct(chip, p, &ecc_code[i], &ecc_calc[i]); ecc 2759 drivers/mtd/nand/raw/nand_base.c start_step = data_offs / chip->ecc.size; ecc 2760 drivers/mtd/nand/raw/nand_base.c end_step = (data_offs + readlen - 1) / chip->ecc.size; ecc 2762 drivers/mtd/nand/raw/nand_base.c index = start_step * chip->ecc.bytes; ecc 2765 drivers/mtd/nand/raw/nand_base.c datafrag_len = num_steps * chip->ecc.size; ecc 2766 drivers/mtd/nand/raw/nand_base.c eccfrag_len = num_steps * chip->ecc.bytes; ecc 2768 drivers/mtd/nand/raw/nand_base.c data_col_addr = start_step * chip->ecc.size; ecc 2776 drivers/mtd/nand/raw/nand_base.c for (i = 0; i < eccfrag_len ; i += chip->ecc.bytes, p += chip->ecc.size) ecc 2777 drivers/mtd/nand/raw/nand_base.c chip->ecc.calculate(chip, p, &chip->ecc.calc_buf[i]); ecc 2805 drivers/mtd/nand/raw/nand_base.c if ((oobregion.offset + (num_steps * chip->ecc.bytes)) & ecc 2817 drivers/mtd/nand/raw/nand_base.c ret = mtd_ooblayout_get_eccbytes(mtd, chip->ecc.code_buf, ecc 2823 drivers/mtd/nand/raw/nand_base.c for (i = 0; i < eccfrag_len ; i += chip->ecc.bytes, p += chip->ecc.size) { ecc 2826 drivers/mtd/nand/raw/nand_base.c stat = chip->ecc.correct(chip, p, &chip->ecc.code_buf[i], ecc 2827 drivers/mtd/nand/raw/nand_base.c &chip->ecc.calc_buf[i]); ecc 2829 drivers/mtd/nand/raw/nand_base.c (chip->ecc.options & NAND_ECC_GENERIC_ERASED_CHECK)) { ecc 2831 drivers/mtd/nand/raw/nand_base.c stat = nand_check_erased_ecc_chunk(p, chip->ecc.size, ecc 2832 drivers/mtd/nand/raw/nand_base.c &chip->ecc.code_buf[i], ecc 2833 drivers/mtd/nand/raw/nand_base.c chip->ecc.bytes, ecc 2835 drivers/mtd/nand/raw/nand_base.c chip->ecc.strength); ecc 2861 drivers/mtd/nand/raw/nand_base.c int i, eccsize = chip->ecc.size, ret; ecc 2862 drivers/mtd/nand/raw/nand_base.c int eccbytes = chip->ecc.bytes; ecc 2863 drivers/mtd/nand/raw/nand_base.c int eccsteps = chip->ecc.steps; ecc 2865 drivers/mtd/nand/raw/nand_base.c uint8_t *ecc_calc = chip->ecc.calc_buf; ecc 2866 drivers/mtd/nand/raw/nand_base.c uint8_t *ecc_code = chip->ecc.code_buf; ecc 2874 drivers/mtd/nand/raw/nand_base.c chip->ecc.hwctl(chip, NAND_ECC_READ); ecc 2880 drivers/mtd/nand/raw/nand_base.c chip->ecc.calculate(chip, p, &ecc_calc[i]); ecc 2888 drivers/mtd/nand/raw/nand_base.c chip->ecc.total); ecc 2892 drivers/mtd/nand/raw/nand_base.c eccsteps = chip->ecc.steps; ecc 2898 drivers/mtd/nand/raw/nand_base.c stat = chip->ecc.correct(chip, p, &ecc_code[i], &ecc_calc[i]); ecc 2900 drivers/mtd/nand/raw/nand_base.c (chip->ecc.options & NAND_ECC_GENERIC_ERASED_CHECK)) { ecc 2905 drivers/mtd/nand/raw/nand_base.c chip->ecc.strength); ecc 2935 drivers/mtd/nand/raw/nand_base.c int i, eccsize = chip->ecc.size, ret; ecc 2936 drivers/mtd/nand/raw/nand_base.c int eccbytes = chip->ecc.bytes; ecc 2937 drivers/mtd/nand/raw/nand_base.c int eccsteps = chip->ecc.steps; ecc 2939 drivers/mtd/nand/raw/nand_base.c uint8_t *ecc_code = chip->ecc.code_buf; ecc 2940 drivers/mtd/nand/raw/nand_base.c uint8_t *ecc_calc = chip->ecc.calc_buf; ecc 2953 drivers/mtd/nand/raw/nand_base.c chip->ecc.total); ecc 2960 drivers/mtd/nand/raw/nand_base.c chip->ecc.hwctl(chip, NAND_ECC_READ); ecc 2966 drivers/mtd/nand/raw/nand_base.c chip->ecc.calculate(chip, p, &ecc_calc[i]); ecc 2968 drivers/mtd/nand/raw/nand_base.c stat = chip->ecc.correct(chip, p, &ecc_code[i], NULL); ecc 2970 drivers/mtd/nand/raw/nand_base.c (chip->ecc.options & NAND_ECC_GENERIC_ERASED_CHECK)) { ecc 2975 drivers/mtd/nand/raw/nand_base.c chip->ecc.strength); ecc 3002 drivers/mtd/nand/raw/nand_base.c int ret, i, eccsize = chip->ecc.size; ecc 3003 drivers/mtd/nand/raw/nand_base.c int eccbytes = chip->ecc.bytes; ecc 3004 drivers/mtd/nand/raw/nand_base.c int eccsteps = chip->ecc.steps; ecc 3005 drivers/mtd/nand/raw/nand_base.c int eccpadbytes = eccbytes + chip->ecc.prepad + chip->ecc.postpad; ecc 3017 drivers/mtd/nand/raw/nand_base.c chip->ecc.hwctl(chip, NAND_ECC_READ); ecc 3023 drivers/mtd/nand/raw/nand_base.c if (chip->ecc.prepad) { ecc 3024 drivers/mtd/nand/raw/nand_base.c ret = nand_read_data_op(chip, oob, chip->ecc.prepad, ecc 3029 drivers/mtd/nand/raw/nand_base.c oob += chip->ecc.prepad; ecc 3032 drivers/mtd/nand/raw/nand_base.c chip->ecc.hwctl(chip, NAND_ECC_READSYN); ecc 3038 drivers/mtd/nand/raw/nand_base.c stat = chip->ecc.correct(chip, p, oob, NULL); ecc 3042 drivers/mtd/nand/raw/nand_base.c if (chip->ecc.postpad) { ecc 3043 drivers/mtd/nand/raw/nand_base.c ret = nand_read_data_op(chip, oob, chip->ecc.postpad, ecc 3048 drivers/mtd/nand/raw/nand_base.c oob += chip->ecc.postpad; ecc 3052 drivers/mtd/nand/raw/nand_base.c (chip->ecc.options & NAND_ECC_GENERIC_ERASED_CHECK)) { ecc 3054 drivers/mtd/nand/raw/nand_base.c stat = nand_check_erased_ecc_chunk(p, chip->ecc.size, ecc 3058 drivers/mtd/nand/raw/nand_base.c chip->ecc.strength); ecc 3210 drivers/mtd/nand/raw/nand_base.c ret = chip->ecc.read_page_raw(chip, bufpoi, ecc 3215 drivers/mtd/nand/raw/nand_base.c ret = chip->ecc.read_subpage(chip, col, bytes, ecc 3218 drivers/mtd/nand/raw/nand_base.c ret = chip->ecc.read_page(chip, bufpoi, ecc 3343 drivers/mtd/nand/raw/nand_base.c int chunk = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad; ecc 3344 drivers/mtd/nand/raw/nand_base.c int eccsize = chip->ecc.size; ecc 3348 drivers/mtd/nand/raw/nand_base.c ret = nand_read_page_op(chip, page, chip->ecc.size, NULL, 0); ecc 3352 drivers/mtd/nand/raw/nand_base.c for (i = 0; i < chip->ecc.steps; i++) { ecc 3410 drivers/mtd/nand/raw/nand_base.c int chunk = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad; ecc 3411 drivers/mtd/nand/raw/nand_base.c int eccsize = chip->ecc.size, length = mtd->oobsize; ecc 3412 drivers/mtd/nand/raw/nand_base.c int ret, i, len, pos, sndcmd = 0, steps = chip->ecc.steps; ecc 3420 drivers/mtd/nand/raw/nand_base.c if (!chip->ecc.prepad && !chip->ecc.postpad) { ecc 3510 drivers/mtd/nand/raw/nand_base.c ret = chip->ecc.read_oob_raw(chip, page); ecc 3512 drivers/mtd/nand/raw/nand_base.c ret = chip->ecc.read_oob(chip, page); ecc 3645 drivers/mtd/nand/raw/nand_base.c int eccsize = chip->ecc.size; ecc 3646 drivers/mtd/nand/raw/nand_base.c int eccbytes = chip->ecc.bytes; ecc 3654 drivers/mtd/nand/raw/nand_base.c for (steps = chip->ecc.steps; steps > 0; steps--) { ecc 3661 drivers/mtd/nand/raw/nand_base.c if (chip->ecc.prepad) { ecc 3662 drivers/mtd/nand/raw/nand_base.c ret = nand_write_data_op(chip, oob, chip->ecc.prepad, ecc 3667 drivers/mtd/nand/raw/nand_base.c oob += chip->ecc.prepad; ecc 3676 drivers/mtd/nand/raw/nand_base.c if (chip->ecc.postpad) { ecc 3677 drivers/mtd/nand/raw/nand_base.c ret = nand_write_data_op(chip, oob, chip->ecc.postpad, ecc 3682 drivers/mtd/nand/raw/nand_base.c oob += chip->ecc.postpad; ecc 3706 drivers/mtd/nand/raw/nand_base.c int i, eccsize = chip->ecc.size, ret; ecc 3707 drivers/mtd/nand/raw/nand_base.c int eccbytes = chip->ecc.bytes; ecc 3708 drivers/mtd/nand/raw/nand_base.c int eccsteps = chip->ecc.steps; ecc 3709 drivers/mtd/nand/raw/nand_base.c uint8_t *ecc_calc = chip->ecc.calc_buf; ecc 3714 drivers/mtd/nand/raw/nand_base.c chip->ecc.calculate(chip, p, &ecc_calc[i]); ecc 3717 drivers/mtd/nand/raw/nand_base.c chip->ecc.total); ecc 3721 drivers/mtd/nand/raw/nand_base.c return chip->ecc.write_page_raw(chip, buf, 1, page); ecc 3735 drivers/mtd/nand/raw/nand_base.c int i, eccsize = chip->ecc.size, ret; ecc 3736 drivers/mtd/nand/raw/nand_base.c int eccbytes = chip->ecc.bytes; ecc 3737 drivers/mtd/nand/raw/nand_base.c int eccsteps = chip->ecc.steps; ecc 3738 drivers/mtd/nand/raw/nand_base.c uint8_t *ecc_calc = chip->ecc.calc_buf; ecc 3746 drivers/mtd/nand/raw/nand_base.c chip->ecc.hwctl(chip, NAND_ECC_WRITE); ecc 3752 drivers/mtd/nand/raw/nand_base.c chip->ecc.calculate(chip, p, &ecc_calc[i]); ecc 3756 drivers/mtd/nand/raw/nand_base.c chip->ecc.total); ecc 3783 drivers/mtd/nand/raw/nand_base.c uint8_t *ecc_calc = chip->ecc.calc_buf; ecc 3784 drivers/mtd/nand/raw/nand_base.c int ecc_size = chip->ecc.size; ecc 3785 drivers/mtd/nand/raw/nand_base.c int ecc_bytes = chip->ecc.bytes; ecc 3786 drivers/mtd/nand/raw/nand_base.c int ecc_steps = chip->ecc.steps; ecc 3798 drivers/mtd/nand/raw/nand_base.c chip->ecc.hwctl(chip, NAND_ECC_WRITE); ecc 3809 drivers/mtd/nand/raw/nand_base.c chip->ecc.calculate(chip, buf, ecc_calc); ecc 3823 drivers/mtd/nand/raw/nand_base.c ecc_calc = chip->ecc.calc_buf; ecc 3825 drivers/mtd/nand/raw/nand_base.c chip->ecc.total); ecc 3852 drivers/mtd/nand/raw/nand_base.c int i, eccsize = chip->ecc.size; ecc 3853 drivers/mtd/nand/raw/nand_base.c int eccbytes = chip->ecc.bytes; ecc 3854 drivers/mtd/nand/raw/nand_base.c int eccsteps = chip->ecc.steps; ecc 3864 drivers/mtd/nand/raw/nand_base.c chip->ecc.hwctl(chip, NAND_ECC_WRITE); ecc 3870 drivers/mtd/nand/raw/nand_base.c if (chip->ecc.prepad) { ecc 3871 drivers/mtd/nand/raw/nand_base.c ret = nand_write_data_op(chip, oob, chip->ecc.prepad, ecc 3876 drivers/mtd/nand/raw/nand_base.c oob += chip->ecc.prepad; ecc 3879 drivers/mtd/nand/raw/nand_base.c chip->ecc.calculate(chip, p, oob); ecc 3887 drivers/mtd/nand/raw/nand_base.c if (chip->ecc.postpad) { ecc 3888 drivers/mtd/nand/raw/nand_base.c ret = nand_write_data_op(chip, oob, chip->ecc.postpad, ecc 3893 drivers/mtd/nand/raw/nand_base.c oob += chip->ecc.postpad; ecc 3926 drivers/mtd/nand/raw/nand_base.c chip->ecc.write_subpage) ecc 3932 drivers/mtd/nand/raw/nand_base.c status = chip->ecc.write_page_raw(chip, buf, oob_required, ecc 3935 drivers/mtd/nand/raw/nand_base.c status = chip->ecc.write_subpage(chip, offset, data_len, buf, ecc 3938 drivers/mtd/nand/raw/nand_base.c status = chip->ecc.write_page(chip, buf, oob_required, page); ecc 4965 drivers/mtd/nand/raw/nand_base.c chip->ecc.mode = ecc_mode; ecc 4968 drivers/mtd/nand/raw/nand_base.c chip->ecc.algo = ecc_algo; ecc 4971 drivers/mtd/nand/raw/nand_base.c chip->ecc.strength = ecc_strength; ecc 4974 drivers/mtd/nand/raw/nand_base.c chip->ecc.size = ecc_step; ecc 4977 drivers/mtd/nand/raw/nand_base.c chip->ecc.options |= NAND_ECC_MAXIMIZE; ecc 5085 drivers/mtd/nand/raw/nand_base.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 5087 drivers/mtd/nand/raw/nand_base.c if (WARN_ON(ecc->mode != NAND_ECC_SOFT)) ecc 5090 drivers/mtd/nand/raw/nand_base.c switch (ecc->algo) { ecc 5092 drivers/mtd/nand/raw/nand_base.c ecc->calculate = nand_calculate_ecc; ecc 5093 drivers/mtd/nand/raw/nand_base.c ecc->correct = nand_correct_data; ecc 5094 drivers/mtd/nand/raw/nand_base.c ecc->read_page = nand_read_page_swecc; ecc 5095 drivers/mtd/nand/raw/nand_base.c ecc->read_subpage = nand_read_subpage; ecc 5096 drivers/mtd/nand/raw/nand_base.c ecc->write_page = nand_write_page_swecc; ecc 5097 drivers/mtd/nand/raw/nand_base.c ecc->read_page_raw = nand_read_page_raw; ecc 5098 drivers/mtd/nand/raw/nand_base.c ecc->write_page_raw = nand_write_page_raw; ecc 5099 drivers/mtd/nand/raw/nand_base.c ecc->read_oob = nand_read_oob_std; ecc 5100 drivers/mtd/nand/raw/nand_base.c ecc->write_oob = nand_write_oob_std; ecc 5101 drivers/mtd/nand/raw/nand_base.c if (!ecc->size) ecc 5102 drivers/mtd/nand/raw/nand_base.c ecc->size = 256; ecc 5103 drivers/mtd/nand/raw/nand_base.c ecc->bytes = 3; ecc 5104 drivers/mtd/nand/raw/nand_base.c ecc->strength = 1; ecc 5107 drivers/mtd/nand/raw/nand_base.c ecc->options |= NAND_ECC_SOFT_HAMMING_SM_ORDER; ecc 5115 drivers/mtd/nand/raw/nand_base.c ecc->calculate = nand_bch_calculate_ecc; ecc 5116 drivers/mtd/nand/raw/nand_base.c ecc->correct = nand_bch_correct_data; ecc 5117 drivers/mtd/nand/raw/nand_base.c ecc->read_page = nand_read_page_swecc; ecc 5118 drivers/mtd/nand/raw/nand_base.c ecc->read_subpage = nand_read_subpage; ecc 5119 drivers/mtd/nand/raw/nand_base.c ecc->write_page = nand_write_page_swecc; ecc 5120 drivers/mtd/nand/raw/nand_base.c ecc->read_page_raw = nand_read_page_raw; ecc 5121 drivers/mtd/nand/raw/nand_base.c ecc->write_page_raw = nand_write_page_raw; ecc 5122 drivers/mtd/nand/raw/nand_base.c ecc->read_oob = nand_read_oob_std; ecc 5123 drivers/mtd/nand/raw/nand_base.c ecc->write_oob = nand_write_oob_std; ecc 5130 drivers/mtd/nand/raw/nand_base.c if (!ecc->size && (mtd->oobsize >= 64)) { ecc 5131 drivers/mtd/nand/raw/nand_base.c ecc->size = 512; ecc 5132 drivers/mtd/nand/raw/nand_base.c ecc->strength = 4; ecc 5156 drivers/mtd/nand/raw/nand_base.c ecc->options & NAND_ECC_MAXIMIZE) { ecc 5160 drivers/mtd/nand/raw/nand_base.c ecc->size = 1024; ecc 5161 drivers/mtd/nand/raw/nand_base.c steps = mtd->writesize / ecc->size; ecc 5165 drivers/mtd/nand/raw/nand_base.c ecc->strength = bytes * 8 / fls(8 * ecc->size); ecc 5169 drivers/mtd/nand/raw/nand_base.c ecc->bytes = 0; ecc 5170 drivers/mtd/nand/raw/nand_base.c ecc->priv = nand_bch_init(mtd); ecc 5171 drivers/mtd/nand/raw/nand_base.c if (!ecc->priv) { ecc 5198 drivers/mtd/nand/raw/nand_base.c int preset_step = chip->ecc.size; ecc 5199 drivers/mtd/nand/raw/nand_base.c int preset_strength = chip->ecc.strength; ecc 5224 drivers/mtd/nand/raw/nand_base.c chip->ecc.bytes = ecc_bytes; ecc 5311 drivers/mtd/nand/raw/nand_base.c chip->ecc.size = best_step; ecc 5312 drivers/mtd/nand/raw/nand_base.c chip->ecc.strength = best_strength; ecc 5313 drivers/mtd/nand/raw/nand_base.c chip->ecc.bytes = best_ecc_bytes; ecc 5344 drivers/mtd/nand/raw/nand_base.c if (chip->ecc.size && step_size != chip->ecc.size) ecc 5381 drivers/mtd/nand/raw/nand_base.c chip->ecc.size = best_step; ecc 5382 drivers/mtd/nand/raw/nand_base.c chip->ecc.strength = best_strength; ecc 5383 drivers/mtd/nand/raw/nand_base.c chip->ecc.bytes = best_ecc_bytes; ecc 5413 drivers/mtd/nand/raw/nand_base.c if (chip->ecc.size && chip->ecc.strength) ecc 5416 drivers/mtd/nand/raw/nand_base.c if (chip->ecc.options & NAND_ECC_MAXIMIZE) ecc 5443 drivers/mtd/nand/raw/nand_base.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 5446 drivers/mtd/nand/raw/nand_base.c if (ecc->size == 0 || chip->base.eccreq.step_size == 0) ecc 5454 drivers/mtd/nand/raw/nand_base.c corr = (mtd->writesize * ecc->strength) / ecc->size; ecc 5458 drivers/mtd/nand/raw/nand_base.c return corr >= ds_corr && ecc->strength >= chip->base.eccreq.strength; ecc 5516 drivers/mtd/nand/raw/nand_base.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 5548 drivers/mtd/nand/raw/nand_base.c !(ecc->mode == NAND_ECC_SOFT && ecc->algo == NAND_ECC_BCH)) { ecc 5566 drivers/mtd/nand/raw/nand_base.c if (ecc->mode == NAND_ECC_NONE) { ecc 5584 drivers/mtd/nand/raw/nand_base.c switch (ecc->mode) { ecc 5587 drivers/mtd/nand/raw/nand_base.c if (!ecc->calculate || !ecc->correct || !ecc->hwctl) { ecc 5592 drivers/mtd/nand/raw/nand_base.c if (!ecc->read_page) ecc 5593 drivers/mtd/nand/raw/nand_base.c ecc->read_page = nand_read_page_hwecc_oob_first; ecc 5598 drivers/mtd/nand/raw/nand_base.c if (!ecc->read_page) ecc 5599 drivers/mtd/nand/raw/nand_base.c ecc->read_page = nand_read_page_hwecc; ecc 5600 drivers/mtd/nand/raw/nand_base.c if (!ecc->write_page) ecc 5601 drivers/mtd/nand/raw/nand_base.c ecc->write_page = nand_write_page_hwecc; ecc 5602 drivers/mtd/nand/raw/nand_base.c if (!ecc->read_page_raw) ecc 5603 drivers/mtd/nand/raw/nand_base.c ecc->read_page_raw = nand_read_page_raw; ecc 5604 drivers/mtd/nand/raw/nand_base.c if (!ecc->write_page_raw) ecc 5605 drivers/mtd/nand/raw/nand_base.c ecc->write_page_raw = nand_write_page_raw; ecc 5606 drivers/mtd/nand/raw/nand_base.c if (!ecc->read_oob) ecc 5607 drivers/mtd/nand/raw/nand_base.c ecc->read_oob = nand_read_oob_std; ecc 5608 drivers/mtd/nand/raw/nand_base.c if (!ecc->write_oob) ecc 5609 drivers/mtd/nand/raw/nand_base.c ecc->write_oob = nand_write_oob_std; ecc 5610 drivers/mtd/nand/raw/nand_base.c if (!ecc->read_subpage) ecc 5611 drivers/mtd/nand/raw/nand_base.c ecc->read_subpage = nand_read_subpage; ecc 5612 drivers/mtd/nand/raw/nand_base.c if (!ecc->write_subpage && ecc->hwctl && ecc->calculate) ecc 5613 drivers/mtd/nand/raw/nand_base.c ecc->write_subpage = nand_write_subpage_hwecc; ecc 5617 drivers/mtd/nand/raw/nand_base.c if ((!ecc->calculate || !ecc->correct || !ecc->hwctl) && ecc 5618 drivers/mtd/nand/raw/nand_base.c (!ecc->read_page || ecc 5619 drivers/mtd/nand/raw/nand_base.c ecc->read_page == nand_read_page_hwecc || ecc 5620 drivers/mtd/nand/raw/nand_base.c !ecc->write_page || ecc 5621 drivers/mtd/nand/raw/nand_base.c ecc->write_page == nand_write_page_hwecc)) { ecc 5627 drivers/mtd/nand/raw/nand_base.c if (!ecc->read_page) ecc 5628 drivers/mtd/nand/raw/nand_base.c ecc->read_page = nand_read_page_syndrome; ecc 5629 drivers/mtd/nand/raw/nand_base.c if (!ecc->write_page) ecc 5630 drivers/mtd/nand/raw/nand_base.c ecc->write_page = nand_write_page_syndrome; ecc 5631 drivers/mtd/nand/raw/nand_base.c if (!ecc->read_page_raw) ecc 5632 drivers/mtd/nand/raw/nand_base.c ecc->read_page_raw = nand_read_page_raw_syndrome; ecc 5633 drivers/mtd/nand/raw/nand_base.c if (!ecc->write_page_raw) ecc 5634 drivers/mtd/nand/raw/nand_base.c ecc->write_page_raw = nand_write_page_raw_syndrome; ecc 5635 drivers/mtd/nand/raw/nand_base.c if (!ecc->read_oob) ecc 5636 drivers/mtd/nand/raw/nand_base.c ecc->read_oob = nand_read_oob_syndrome; ecc 5637 drivers/mtd/nand/raw/nand_base.c if (!ecc->write_oob) ecc 5638 drivers/mtd/nand/raw/nand_base.c ecc->write_oob = nand_write_oob_syndrome; ecc 5640 drivers/mtd/nand/raw/nand_base.c if (mtd->writesize >= ecc->size) { ecc 5641 drivers/mtd/nand/raw/nand_base.c if (!ecc->strength) { ecc 5649 drivers/mtd/nand/raw/nand_base.c ecc->size, mtd->writesize); ecc 5650 drivers/mtd/nand/raw/nand_base.c ecc->mode = NAND_ECC_SOFT; ecc 5651 drivers/mtd/nand/raw/nand_base.c ecc->algo = NAND_ECC_HAMMING; ecc 5663 drivers/mtd/nand/raw/nand_base.c if (!ecc->read_page || !ecc->write_page) { ecc 5668 drivers/mtd/nand/raw/nand_base.c if (!ecc->read_oob) ecc 5669 drivers/mtd/nand/raw/nand_base.c ecc->read_oob = nand_read_oob_std; ecc 5670 drivers/mtd/nand/raw/nand_base.c if (!ecc->write_oob) ecc 5671 drivers/mtd/nand/raw/nand_base.c ecc->write_oob = nand_write_oob_std; ecc 5676 drivers/mtd/nand/raw/nand_base.c ecc->read_page = nand_read_page_raw; ecc 5677 drivers/mtd/nand/raw/nand_base.c ecc->write_page = nand_write_page_raw; ecc 5678 drivers/mtd/nand/raw/nand_base.c ecc->read_oob = nand_read_oob_std; ecc 5679 drivers/mtd/nand/raw/nand_base.c ecc->read_page_raw = nand_read_page_raw; ecc 5680 drivers/mtd/nand/raw/nand_base.c ecc->write_page_raw = nand_write_page_raw; ecc 5681 drivers/mtd/nand/raw/nand_base.c ecc->write_oob = nand_write_oob_std; ecc 5682 drivers/mtd/nand/raw/nand_base.c ecc->size = mtd->writesize; ecc 5683 drivers/mtd/nand/raw/nand_base.c ecc->bytes = 0; ecc 5684 drivers/mtd/nand/raw/nand_base.c ecc->strength = 0; ecc 5688 drivers/mtd/nand/raw/nand_base.c WARN(1, "Invalid NAND_ECC_MODE %d\n", ecc->mode); ecc 5693 drivers/mtd/nand/raw/nand_base.c if (ecc->correct || ecc->calculate) { ecc 5694 drivers/mtd/nand/raw/nand_base.c ecc->calc_buf = kmalloc(mtd->oobsize, GFP_KERNEL); ecc 5695 drivers/mtd/nand/raw/nand_base.c ecc->code_buf = kmalloc(mtd->oobsize, GFP_KERNEL); ecc 5696 drivers/mtd/nand/raw/nand_base.c if (!ecc->calc_buf || !ecc->code_buf) { ecc 5703 drivers/mtd/nand/raw/nand_base.c if (!ecc->read_oob_raw) ecc 5704 drivers/mtd/nand/raw/nand_base.c ecc->read_oob_raw = ecc->read_oob; ecc 5705 drivers/mtd/nand/raw/nand_base.c if (!ecc->write_oob_raw) ecc 5706 drivers/mtd/nand/raw/nand_base.c ecc->write_oob_raw = ecc->write_oob; ecc 5709 drivers/mtd/nand/raw/nand_base.c mtd->ecc_strength = ecc->strength; ecc 5710 drivers/mtd/nand/raw/nand_base.c mtd->ecc_step_size = ecc->size; ecc 5716 drivers/mtd/nand/raw/nand_base.c ecc->steps = mtd->writesize / ecc->size; ecc 5717 drivers/mtd/nand/raw/nand_base.c if (ecc->steps * ecc->size != mtd->writesize) { ecc 5722 drivers/mtd/nand/raw/nand_base.c ecc->total = ecc->steps * ecc->bytes; ecc 5723 drivers/mtd/nand/raw/nand_base.c if (ecc->total > mtd->oobsize) { ecc 5746 drivers/mtd/nand/raw/nand_base.c switch (ecc->steps) { ecc 5763 drivers/mtd/nand/raw/nand_base.c switch (ecc->mode) { ecc 5839 drivers/mtd/nand/raw/nand_base.c kfree(ecc->code_buf); ecc 5840 drivers/mtd/nand/raw/nand_base.c kfree(ecc->calc_buf); ecc 5906 drivers/mtd/nand/raw/nand_base.c if (chip->ecc.mode == NAND_ECC_SOFT && ecc 5907 drivers/mtd/nand/raw/nand_base.c chip->ecc.algo == NAND_ECC_BCH) ecc 5908 drivers/mtd/nand/raw/nand_base.c nand_bch_free((struct nand_bch_control *)chip->ecc.priv); ecc 5915 drivers/mtd/nand/raw/nand_base.c kfree(chip->ecc.code_buf); ecc 5916 drivers/mtd/nand/raw/nand_base.c kfree(chip->ecc.calc_buf); ecc 40 drivers/mtd/nand/raw/nand_bch.c struct nand_bch_control *nbc = chip->ecc.priv; ecc 43 drivers/mtd/nand/raw/nand_bch.c memset(code, 0, chip->ecc.bytes); ecc 44 drivers/mtd/nand/raw/nand_bch.c encode_bch(nbc->bch, buf, chip->ecc.size, code); ecc 47 drivers/mtd/nand/raw/nand_bch.c for (i = 0; i < chip->ecc.bytes; i++) ecc 66 drivers/mtd/nand/raw/nand_bch.c struct nand_bch_control *nbc = chip->ecc.priv; ecc 70 drivers/mtd/nand/raw/nand_bch.c count = decode_bch(nbc->bch, NULL, chip->ecc.size, read_ecc, calc_ecc, ecc 74 drivers/mtd/nand/raw/nand_bch.c if (errloc[i] < (chip->ecc.size*8)) ecc 112 drivers/mtd/nand/raw/nand_bch.c unsigned int eccsize = nand->ecc.size; ecc 113 drivers/mtd/nand/raw/nand_bch.c unsigned int eccbytes = nand->ecc.bytes; ecc 114 drivers/mtd/nand/raw/nand_bch.c unsigned int eccstrength = nand->ecc.strength; ecc 118 drivers/mtd/nand/raw/nand_bch.c nand->ecc.bytes = eccbytes; ecc 166 drivers/mtd/nand/raw/nand_bch.c nand->ecc.steps = eccsteps; ecc 167 drivers/mtd/nand/raw/nand_bch.c nand->ecc.total = eccsteps * eccbytes; ecc 192 drivers/mtd/nand/raw/nand_bch.c nand->ecc.strength = (eccbytes * 8) / fls(8 * eccsize); ecc 372 drivers/mtd/nand/raw/nand_ecc.c bool sm_order = chip->ecc.options & NAND_ECC_SOFT_HAMMING_SM_ORDER; ecc 374 drivers/mtd/nand/raw/nand_ecc.c __nand_calculate_ecc(buf, chip->ecc.size, code, sm_order); ecc 475 drivers/mtd/nand/raw/nand_ecc.c bool sm_order = chip->ecc.options & NAND_ECC_SOFT_HAMMING_SM_ORDER; ecc 477 drivers/mtd/nand/raw/nand_ecc.c return __nand_correct_data(buf, read_ecc, calc_ecc, chip->ecc.size, ecc 27 drivers/mtd/nand/raw/nand_jedec.c struct jedec_ecc_info *ecc; ecc 110 drivers/mtd/nand/raw/nand_jedec.c ecc = &p->ecc_info[0]; ecc 112 drivers/mtd/nand/raw/nand_jedec.c if (ecc->codeword_size >= 9) { ecc 113 drivers/mtd/nand/raw/nand_jedec.c chip->base.eccreq.strength = ecc->ecc_bits; ecc 114 drivers/mtd/nand/raw/nand_jedec.c chip->base.eccreq.step_size = 1 << ecc->codeword_size; ecc 66 drivers/mtd/nand/raw/nand_micron.c struct micron_on_die_ecc ecc; ecc 127 drivers/mtd/nand/raw/nand_micron.c .ecc = micron_nand_on_die_4_ooblayout_ecc, ecc 140 drivers/mtd/nand/raw/nand_micron.c oobregion->offset = mtd->oobsize - chip->ecc.total; ecc 141 drivers/mtd/nand/raw/nand_micron.c oobregion->length = chip->ecc.total; ecc 156 drivers/mtd/nand/raw/nand_micron.c oobregion->length = mtd->oobsize - chip->ecc.total - 2; ecc 162 drivers/mtd/nand/raw/nand_micron.c .ecc = micron_nand_on_die_8_ooblayout_ecc, ecc 172 drivers/mtd/nand/raw/nand_micron.c if (micron->ecc.forced) ecc 175 drivers/mtd/nand/raw/nand_micron.c if (micron->ecc.enabled == enable) ecc 183 drivers/mtd/nand/raw/nand_micron.c micron->ecc.enabled = enable; ecc 222 drivers/mtd/nand/raw/nand_micron.c ret = nand_read_page_op(chip, page, 0, micron->ecc.rawbuf, ecc 227 drivers/mtd/nand/raw/nand_micron.c for (step = 0; step < chip->ecc.steps; step++) { ecc 231 drivers/mtd/nand/raw/nand_micron.c offs = step * chip->ecc.size; ecc 232 drivers/mtd/nand/raw/nand_micron.c rawbuf = micron->ecc.rawbuf + offs; ecc 235 drivers/mtd/nand/raw/nand_micron.c for (i = 0; i < chip->ecc.size; i++) ecc 239 drivers/mtd/nand/raw/nand_micron.c rawbuf = micron->ecc.rawbuf + mtd->writesize + offs; ecc 242 drivers/mtd/nand/raw/nand_micron.c for (i = 0; i < chip->ecc.bytes + 4; i++) ecc 245 drivers/mtd/nand/raw/nand_micron.c if (WARN_ON(nbitflips > chip->ecc.strength)) ecc 312 drivers/mtd/nand/raw/nand_micron.c if (chip->ecc.strength == 4) ecc 457 drivers/mtd/nand/raw/nand_micron.c chip->ecc.mode != NAND_ECC_ON_DIE) { ecc 463 drivers/mtd/nand/raw/nand_micron.c if (chip->ecc.mode == NAND_ECC_ON_DIE) { ecc 471 drivers/mtd/nand/raw/nand_micron.c micron->ecc.forced = true; ecc 472 drivers/mtd/nand/raw/nand_micron.c micron->ecc.enabled = true; ecc 484 drivers/mtd/nand/raw/nand_micron.c micron->ecc.rawbuf = kmalloc(mtd->writesize + ecc 487 drivers/mtd/nand/raw/nand_micron.c if (!micron->ecc.rawbuf) { ecc 500 drivers/mtd/nand/raw/nand_micron.c chip->ecc.bytes = chip->base.eccreq.strength * 2; ecc 501 drivers/mtd/nand/raw/nand_micron.c chip->ecc.size = 512; ecc 502 drivers/mtd/nand/raw/nand_micron.c chip->ecc.strength = chip->base.eccreq.strength; ecc 503 drivers/mtd/nand/raw/nand_micron.c chip->ecc.algo = NAND_ECC_BCH; ecc 504 drivers/mtd/nand/raw/nand_micron.c chip->ecc.read_page = micron_nand_read_page_on_die_ecc; ecc 505 drivers/mtd/nand/raw/nand_micron.c chip->ecc.write_page = micron_nand_write_page_on_die_ecc; ecc 508 drivers/mtd/nand/raw/nand_micron.c chip->ecc.read_page_raw = nand_read_page_raw_notsupp; ecc 509 drivers/mtd/nand/raw/nand_micron.c chip->ecc.write_page_raw = nand_write_page_raw_notsupp; ecc 511 drivers/mtd/nand/raw/nand_micron.c chip->ecc.read_page_raw = nand_read_page_raw; ecc 512 drivers/mtd/nand/raw/nand_micron.c chip->ecc.write_page_raw = nand_write_page_raw; ecc 519 drivers/mtd/nand/raw/nand_micron.c kfree(micron->ecc.rawbuf); ecc 529 drivers/mtd/nand/raw/nand_micron.c kfree(micron->ecc.rawbuf); ecc 37 drivers/mtd/nand/raw/nand_onfi.c struct onfi_ext_ecc_info *ecc; ecc 90 drivers/mtd/nand/raw/nand_onfi.c ecc = (struct onfi_ext_ecc_info *)cursor; ecc 92 drivers/mtd/nand/raw/nand_onfi.c if (!ecc->codeword_size) { ecc 97 drivers/mtd/nand/raw/nand_onfi.c chip->base.eccreq.strength = ecc->ecc_bits; ecc 98 drivers/mtd/nand/raw/nand_onfi.c chip->base.eccreq.step_size = 1 << ecc->codeword_size; ecc 78 drivers/mtd/nand/raw/nand_toshiba.c chip->ecc.bytes = 0; ecc 79 drivers/mtd/nand/raw/nand_toshiba.c chip->ecc.size = 512; ecc 80 drivers/mtd/nand/raw/nand_toshiba.c chip->ecc.strength = 8; ecc 81 drivers/mtd/nand/raw/nand_toshiba.c chip->ecc.read_page = toshiba_nand_read_page_benand; ecc 82 drivers/mtd/nand/raw/nand_toshiba.c chip->ecc.read_subpage = toshiba_nand_read_subpage_benand; ecc 83 drivers/mtd/nand/raw/nand_toshiba.c chip->ecc.write_page = nand_write_page_raw; ecc 84 drivers/mtd/nand/raw/nand_toshiba.c chip->ecc.read_page_raw = nand_read_page_raw_notsupp; ecc 85 drivers/mtd/nand/raw/nand_toshiba.c chip->ecc.write_page_raw = nand_write_page_raw_notsupp; ecc 149 drivers/mtd/nand/raw/nand_toshiba.c if (nand_is_slc(chip) && chip->ecc.mode == NAND_ECC_ON_DIE && ecc 2206 drivers/mtd/nand/raw/nandsim.c chip->ecc.mode = NAND_ECC_SOFT; ecc 2207 drivers/mtd/nand/raw/nandsim.c chip->ecc.algo = NAND_ECC_BCH; ecc 2208 drivers/mtd/nand/raw/nandsim.c chip->ecc.size = 512; ecc 2209 drivers/mtd/nand/raw/nandsim.c chip->ecc.strength = bch; ecc 2210 drivers/mtd/nand/raw/nandsim.c chip->ecc.bytes = eccbytes; ecc 2212 drivers/mtd/nand/raw/nandsim.c NS_INFO("Using %u-bit/%u bytes BCH ECC\n", bch, chip->ecc.size); ecc 2245 drivers/mtd/nand/raw/nandsim.c chip->ecc.mode = NAND_ECC_SOFT; ecc 2246 drivers/mtd/nand/raw/nandsim.c chip->ecc.algo = NAND_ECC_HAMMING; ecc 91 drivers/mtd/nand/raw/ndfc.c uint32_t ecc; ecc 92 drivers/mtd/nand/raw/ndfc.c uint8_t *p = (uint8_t *)&ecc; ecc 95 drivers/mtd/nand/raw/ndfc.c ecc = in_be32(ndfc->ndfcbase + NDFC_ECC); ecc 149 drivers/mtd/nand/raw/ndfc.c chip->ecc.correct = nand_correct_data; ecc 150 drivers/mtd/nand/raw/ndfc.c chip->ecc.hwctl = ndfc_enable_hwecc; ecc 151 drivers/mtd/nand/raw/ndfc.c chip->ecc.calculate = ndfc_calculate_ecc; ecc 152 drivers/mtd/nand/raw/ndfc.c chip->ecc.mode = NAND_ECC_HW; ecc 153 drivers/mtd/nand/raw/ndfc.c chip->ecc.size = 256; ecc 154 drivers/mtd/nand/raw/ndfc.c chip->ecc.bytes = 3; ecc 155 drivers/mtd/nand/raw/ndfc.c chip->ecc.strength = 1; ecc 887 drivers/mtd/nand/raw/omap2.c if ((info->nand.ecc.mode == NAND_ECC_HW) && ecc 888 drivers/mtd/nand/raw/omap2.c (info->nand.ecc.size == 2048)) ecc 956 drivers/mtd/nand/raw/omap2.c val = ((((info->nand.ecc.size >> 1) - 1) << ECCSIZE1_SHIFT) | ecc 1055 drivers/mtd/nand/raw/omap2.c nsectors = chip->ecc.steps; ecc 1075 drivers/mtd/nand/raw/omap2.c nsectors = chip->ecc.steps; ecc 1088 drivers/mtd/nand/raw/omap2.c nsectors = chip->ecc.steps; ecc 1144 drivers/mtd/nand/raw/omap2.c int eccbytes = info->nand.ecc.bytes; ecc 1286 drivers/mtd/nand/raw/omap2.c int eccbytes = info->nand.ecc.bytes; ecc 1317 drivers/mtd/nand/raw/omap2.c for (i = 0; i < info->nand.ecc.size; i++) { ecc 1319 drivers/mtd/nand/raw/omap2.c if (flip_bits > info->nand.ecc.strength) ecc 1323 drivers/mtd/nand/raw/omap2.c for (i = 0; i < info->nand.ecc.bytes - 1; i++) { ecc 1325 drivers/mtd/nand/raw/omap2.c if (flip_bits > info->nand.ecc.strength) ecc 1334 drivers/mtd/nand/raw/omap2.c memset(data, 0xFF, info->nand.ecc.size); ecc 1335 drivers/mtd/nand/raw/omap2.c memset(oob, 0xFF, info->nand.ecc.bytes); ecc 1356 drivers/mtd/nand/raw/omap2.c struct nand_ecc_ctrl *ecc = &info->nand.ecc; ecc 1357 drivers/mtd/nand/raw/omap2.c int eccsteps = info->nand.ecc.steps; ecc 1373 drivers/mtd/nand/raw/omap2.c actual_eccbytes = ecc->bytes - 1; ecc 1378 drivers/mtd/nand/raw/omap2.c actual_eccbytes = ecc->bytes - 1; ecc 1382 drivers/mtd/nand/raw/omap2.c actual_eccbytes = ecc->bytes; ecc 1415 drivers/mtd/nand/raw/omap2.c buf = &data[info->nand.ecc.size * i]; ecc 1443 drivers/mtd/nand/raw/omap2.c calc_ecc += ecc->bytes; ecc 1444 drivers/mtd/nand/raw/omap2.c read_ecc += ecc->bytes; ecc 1475 drivers/mtd/nand/raw/omap2.c error_max = (ecc->size + actual_eccbytes) * 8; ecc 1507 drivers/mtd/nand/raw/omap2.c data += ecc->size; ecc 1508 drivers/mtd/nand/raw/omap2.c spare_ecc += ecc->bytes; ecc 1528 drivers/mtd/nand/raw/omap2.c uint8_t *ecc_calc = chip->ecc.calc_buf; ecc 1533 drivers/mtd/nand/raw/omap2.c chip->ecc.hwctl(chip, NAND_ECC_WRITE); ecc 1542 drivers/mtd/nand/raw/omap2.c chip->ecc.total); ecc 1568 drivers/mtd/nand/raw/omap2.c u8 *ecc_calc = chip->ecc.calc_buf; ecc 1569 drivers/mtd/nand/raw/omap2.c int ecc_size = chip->ecc.size; ecc 1570 drivers/mtd/nand/raw/omap2.c int ecc_bytes = chip->ecc.bytes; ecc 1571 drivers/mtd/nand/raw/omap2.c int ecc_steps = chip->ecc.steps; ecc 1585 drivers/mtd/nand/raw/omap2.c chip->ecc.hwctl(chip, NAND_ECC_WRITE); ecc 1606 drivers/mtd/nand/raw/omap2.c ecc_calc = chip->ecc.calc_buf; ecc 1608 drivers/mtd/nand/raw/omap2.c chip->ecc.total); ecc 1636 drivers/mtd/nand/raw/omap2.c uint8_t *ecc_calc = chip->ecc.calc_buf; ecc 1637 drivers/mtd/nand/raw/omap2.c uint8_t *ecc_code = chip->ecc.code_buf; ecc 1644 drivers/mtd/nand/raw/omap2.c chip->ecc.hwctl(chip, NAND_ECC_READ); ecc 1653 drivers/mtd/nand/raw/omap2.c chip->ecc.total, false); ecc 1659 drivers/mtd/nand/raw/omap2.c chip->ecc.total); ecc 1663 drivers/mtd/nand/raw/omap2.c stat = chip->ecc.correct(chip, buf, ecc_code, ecc_calc); ecc 1831 drivers/mtd/nand/raw/omap2.c oobregion->length = chip->ecc.total; ecc 1850 drivers/mtd/nand/raw/omap2.c off += chip->ecc.total; ecc 1861 drivers/mtd/nand/raw/omap2.c .ecc = omap_ooblayout_ecc, ecc 1871 drivers/mtd/nand/raw/omap2.c if (section >= chip->ecc.steps) ecc 1878 drivers/mtd/nand/raw/omap2.c oobregion->offset = off + (section * (chip->ecc.bytes + 1)); ecc 1879 drivers/mtd/nand/raw/omap2.c oobregion->length = chip->ecc.bytes; ecc 1897 drivers/mtd/nand/raw/omap2.c off += ((chip->ecc.bytes + 1) * chip->ecc.steps); ecc 1908 drivers/mtd/nand/raw/omap2.c .ecc = omap_sw_ooblayout_ecc, ecc 2017 drivers/mtd/nand/raw/omap2.c chip->ecc.mode = NAND_ECC_SOFT; ecc 2018 drivers/mtd/nand/raw/omap2.c chip->ecc.algo = NAND_ECC_HAMMING; ecc 2026 drivers/mtd/nand/raw/omap2.c chip->ecc.mode = NAND_ECC_HW; ecc 2027 drivers/mtd/nand/raw/omap2.c chip->ecc.bytes = 3; ecc 2028 drivers/mtd/nand/raw/omap2.c chip->ecc.size = 512; ecc 2029 drivers/mtd/nand/raw/omap2.c chip->ecc.strength = 1; ecc 2030 drivers/mtd/nand/raw/omap2.c chip->ecc.calculate = omap_calculate_ecc; ecc 2031 drivers/mtd/nand/raw/omap2.c chip->ecc.hwctl = omap_enable_hwecc; ecc 2032 drivers/mtd/nand/raw/omap2.c chip->ecc.correct = omap_correct_data; ecc 2034 drivers/mtd/nand/raw/omap2.c oobbytes_per_step = chip->ecc.bytes; ecc 2043 drivers/mtd/nand/raw/omap2.c chip->ecc.mode = NAND_ECC_HW; ecc 2044 drivers/mtd/nand/raw/omap2.c chip->ecc.size = 512; ecc 2045 drivers/mtd/nand/raw/omap2.c chip->ecc.bytes = 7; ecc 2046 drivers/mtd/nand/raw/omap2.c chip->ecc.strength = 4; ecc 2047 drivers/mtd/nand/raw/omap2.c chip->ecc.hwctl = omap_enable_hwecc_bch; ecc 2048 drivers/mtd/nand/raw/omap2.c chip->ecc.correct = nand_bch_correct_data; ecc 2049 drivers/mtd/nand/raw/omap2.c chip->ecc.calculate = omap_calculate_ecc_bch_sw; ecc 2052 drivers/mtd/nand/raw/omap2.c oobbytes_per_step = chip->ecc.bytes + 1; ecc 2054 drivers/mtd/nand/raw/omap2.c chip->ecc.priv = nand_bch_init(mtd); ecc 2055 drivers/mtd/nand/raw/omap2.c if (!chip->ecc.priv) { ecc 2063 drivers/mtd/nand/raw/omap2.c chip->ecc.mode = NAND_ECC_HW; ecc 2064 drivers/mtd/nand/raw/omap2.c chip->ecc.size = 512; ecc 2066 drivers/mtd/nand/raw/omap2.c chip->ecc.bytes = 7 + 1; ecc 2067 drivers/mtd/nand/raw/omap2.c chip->ecc.strength = 4; ecc 2068 drivers/mtd/nand/raw/omap2.c chip->ecc.hwctl = omap_enable_hwecc_bch; ecc 2069 drivers/mtd/nand/raw/omap2.c chip->ecc.correct = omap_elm_correct_data; ecc 2070 drivers/mtd/nand/raw/omap2.c chip->ecc.read_page = omap_read_page_bch; ecc 2071 drivers/mtd/nand/raw/omap2.c chip->ecc.write_page = omap_write_page_bch; ecc 2072 drivers/mtd/nand/raw/omap2.c chip->ecc.write_subpage = omap_write_subpage_bch; ecc 2074 drivers/mtd/nand/raw/omap2.c oobbytes_per_step = chip->ecc.bytes; ecc 2077 drivers/mtd/nand/raw/omap2.c mtd->writesize / chip->ecc.size, ecc 2078 drivers/mtd/nand/raw/omap2.c chip->ecc.size, chip->ecc.bytes); ecc 2085 drivers/mtd/nand/raw/omap2.c chip->ecc.mode = NAND_ECC_HW; ecc 2086 drivers/mtd/nand/raw/omap2.c chip->ecc.size = 512; ecc 2087 drivers/mtd/nand/raw/omap2.c chip->ecc.bytes = 13; ecc 2088 drivers/mtd/nand/raw/omap2.c chip->ecc.strength = 8; ecc 2089 drivers/mtd/nand/raw/omap2.c chip->ecc.hwctl = omap_enable_hwecc_bch; ecc 2090 drivers/mtd/nand/raw/omap2.c chip->ecc.correct = nand_bch_correct_data; ecc 2091 drivers/mtd/nand/raw/omap2.c chip->ecc.calculate = omap_calculate_ecc_bch_sw; ecc 2094 drivers/mtd/nand/raw/omap2.c oobbytes_per_step = chip->ecc.bytes + 1; ecc 2096 drivers/mtd/nand/raw/omap2.c chip->ecc.priv = nand_bch_init(mtd); ecc 2097 drivers/mtd/nand/raw/omap2.c if (!chip->ecc.priv) { ecc 2105 drivers/mtd/nand/raw/omap2.c chip->ecc.mode = NAND_ECC_HW; ecc 2106 drivers/mtd/nand/raw/omap2.c chip->ecc.size = 512; ecc 2108 drivers/mtd/nand/raw/omap2.c chip->ecc.bytes = 13 + 1; ecc 2109 drivers/mtd/nand/raw/omap2.c chip->ecc.strength = 8; ecc 2110 drivers/mtd/nand/raw/omap2.c chip->ecc.hwctl = omap_enable_hwecc_bch; ecc 2111 drivers/mtd/nand/raw/omap2.c chip->ecc.correct = omap_elm_correct_data; ecc 2112 drivers/mtd/nand/raw/omap2.c chip->ecc.read_page = omap_read_page_bch; ecc 2113 drivers/mtd/nand/raw/omap2.c chip->ecc.write_page = omap_write_page_bch; ecc 2114 drivers/mtd/nand/raw/omap2.c chip->ecc.write_subpage = omap_write_subpage_bch; ecc 2116 drivers/mtd/nand/raw/omap2.c oobbytes_per_step = chip->ecc.bytes; ecc 2119 drivers/mtd/nand/raw/omap2.c mtd->writesize / chip->ecc.size, ecc 2120 drivers/mtd/nand/raw/omap2.c chip->ecc.size, chip->ecc.bytes); ecc 2128 drivers/mtd/nand/raw/omap2.c chip->ecc.mode = NAND_ECC_HW; ecc 2129 drivers/mtd/nand/raw/omap2.c chip->ecc.size = 512; ecc 2130 drivers/mtd/nand/raw/omap2.c chip->ecc.bytes = 26; ecc 2131 drivers/mtd/nand/raw/omap2.c chip->ecc.strength = 16; ecc 2132 drivers/mtd/nand/raw/omap2.c chip->ecc.hwctl = omap_enable_hwecc_bch; ecc 2133 drivers/mtd/nand/raw/omap2.c chip->ecc.correct = omap_elm_correct_data; ecc 2134 drivers/mtd/nand/raw/omap2.c chip->ecc.read_page = omap_read_page_bch; ecc 2135 drivers/mtd/nand/raw/omap2.c chip->ecc.write_page = omap_write_page_bch; ecc 2136 drivers/mtd/nand/raw/omap2.c chip->ecc.write_subpage = omap_write_subpage_bch; ecc 2138 drivers/mtd/nand/raw/omap2.c oobbytes_per_step = chip->ecc.bytes; ecc 2141 drivers/mtd/nand/raw/omap2.c mtd->writesize / chip->ecc.size, ecc 2142 drivers/mtd/nand/raw/omap2.c chip->ecc.size, chip->ecc.bytes); ecc 2154 drivers/mtd/nand/raw/omap2.c (mtd->writesize / chip->ecc.size)); ecc 2202 drivers/mtd/nand/raw/omap2.c nand_chip->ecc.priv = NULL; ecc 2278 drivers/mtd/nand/raw/omap2.c if (nand_chip->ecc.priv) { ecc 2279 drivers/mtd/nand/raw/omap2.c nand_bch_free(nand_chip->ecc.priv); ecc 2280 drivers/mtd/nand/raw/omap2.c nand_chip->ecc.priv = NULL; ecc 2290 drivers/mtd/nand/raw/omap2.c if (nand_chip->ecc.priv) { ecc 2291 drivers/mtd/nand/raw/omap2.c nand_bch_free(nand_chip->ecc.priv); ecc 2292 drivers/mtd/nand/raw/omap2.c nand_chip->ecc.priv = NULL; ecc 162 drivers/mtd/nand/raw/omap_elm.c struct elm_errorvec *err_vec, u8 *ecc) ecc 177 drivers/mtd/nand/raw/omap_elm.c val = cpu_to_be32(*(u32 *) &ecc[9]); ecc 182 drivers/mtd/nand/raw/omap_elm.c val = cpu_to_be32(*(u32 *) &ecc[5]); ecc 187 drivers/mtd/nand/raw/omap_elm.c val = cpu_to_be32(*(u32 *) &ecc[1]); ecc 192 drivers/mtd/nand/raw/omap_elm.c val = ecc[0]; ecc 197 drivers/mtd/nand/raw/omap_elm.c val = (cpu_to_be32(*(u32 *) &ecc[3]) >> 4) | ecc 198 drivers/mtd/nand/raw/omap_elm.c ((ecc[2] & 0xf) << 28); ecc 203 drivers/mtd/nand/raw/omap_elm.c val = cpu_to_be32(*(u32 *) &ecc[0]) >> 12; ecc 207 drivers/mtd/nand/raw/omap_elm.c val = cpu_to_be32(*(u32 *) &ecc[22]); ecc 210 drivers/mtd/nand/raw/omap_elm.c val = cpu_to_be32(*(u32 *) &ecc[18]); ecc 213 drivers/mtd/nand/raw/omap_elm.c val = cpu_to_be32(*(u32 *) &ecc[14]); ecc 216 drivers/mtd/nand/raw/omap_elm.c val = cpu_to_be32(*(u32 *) &ecc[10]); ecc 219 drivers/mtd/nand/raw/omap_elm.c val = cpu_to_be32(*(u32 *) &ecc[6]); ecc 222 drivers/mtd/nand/raw/omap_elm.c val = cpu_to_be32(*(u32 *) &ecc[2]); ecc 225 drivers/mtd/nand/raw/omap_elm.c val = cpu_to_be32(*(u32 *) &ecc[0]) >> 16; ecc 234 drivers/mtd/nand/raw/omap_elm.c ecc += info->ecc_syndrome_size; ecc 142 drivers/mtd/nand/raw/orion_nand.c nc->ecc.mode = NAND_ECC_SOFT; ecc 143 drivers/mtd/nand/raw/orion_nand.c nc->ecc.algo = NAND_ECC_HAMMING; ecc 135 drivers/mtd/nand/raw/pasemi_nand.c chip->ecc.mode = NAND_ECC_SOFT; ecc 136 drivers/mtd/nand/raw/pasemi_nand.c chip->ecc.algo = NAND_ECC_HAMMING; ecc 69 drivers/mtd/nand/raw/plat_nand.c data->chip.ecc.mode = NAND_ECC_SOFT; ecc 70 drivers/mtd/nand/raw/plat_nand.c data->chip.ecc.algo = NAND_ECC_HAMMING; ecc 1390 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 1394 drivers/mtd/nand/raw/qcom_nandc.c num_cw = command == NAND_CMD_PAGEPROG ? ecc->steps : 1; ecc 1440 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 1475 drivers/mtd/nand/raw/qcom_nandc.c update_rw_regs(host, ecc->steps, true); ecc 1588 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 1600 drivers/mtd/nand/raw/qcom_nandc.c data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1); ecc 1603 drivers/mtd/nand/raw/qcom_nandc.c if (cw == (ecc->steps - 1)) { ecc 1604 drivers/mtd/nand/raw/qcom_nandc.c data_size2 = ecc->size - data_size1 - ecc 1605 drivers/mtd/nand/raw/qcom_nandc.c ((ecc->steps - 1) * 4); ecc 1606 drivers/mtd/nand/raw/qcom_nandc.c oob_size2 = (ecc->steps * 4) + host->ecc_bytes_hw + ecc 1671 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 1683 drivers/mtd/nand/raw/qcom_nandc.c for_each_set_bit(cw, &uncorrectable_cws, ecc->steps) { ecc 1684 drivers/mtd/nand/raw/qcom_nandc.c if (cw == (ecc->steps - 1)) { ecc 1685 drivers/mtd/nand/raw/qcom_nandc.c data_size = ecc->size - ((ecc->steps - 1) * 4); ecc 1686 drivers/mtd/nand/raw/qcom_nandc.c oob_size = (ecc->steps * 4) + host->ecc_bytes_hw; ecc 1694 drivers/mtd/nand/raw/qcom_nandc.c cw_oob_buf = oob_buf + (cw * ecc->bytes); ecc 1708 drivers/mtd/nand/raw/qcom_nandc.c 0, ecc->strength); ecc 1730 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 1740 drivers/mtd/nand/raw/qcom_nandc.c for (i = 0; i < ecc->steps; i++, buf++) { ecc 1744 drivers/mtd/nand/raw/qcom_nandc.c if (i == (ecc->steps - 1)) { ecc 1745 drivers/mtd/nand/raw/qcom_nandc.c data_len = ecc->size - ((ecc->steps - 1) << 2); ecc 1746 drivers/mtd/nand/raw/qcom_nandc.c oob_len = ecc->steps << 2; ecc 1810 drivers/mtd/nand/raw/qcom_nandc.c oob_buf += oob_len + ecc->bytes; ecc 1833 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 1840 drivers/mtd/nand/raw/qcom_nandc.c for (i = 0; i < ecc->steps; i++) { ecc 1843 drivers/mtd/nand/raw/qcom_nandc.c if (i == (ecc->steps - 1)) { ecc 1844 drivers/mtd/nand/raw/qcom_nandc.c data_size = ecc->size - ((ecc->steps - 1) << 2); ecc 1845 drivers/mtd/nand/raw/qcom_nandc.c oob_size = (ecc->steps << 2) + host->ecc_bytes_hw + ecc 1913 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 1924 drivers/mtd/nand/raw/qcom_nandc.c set_address(host, host->cw_size * (ecc->steps - 1), page); ecc 1963 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 1967 drivers/mtd/nand/raw/qcom_nandc.c for (cw = 0; cw < ecc->steps; cw++) { ecc 1974 drivers/mtd/nand/raw/qcom_nandc.c oob_buf += ecc->bytes; ecc 1985 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 1992 drivers/mtd/nand/raw/qcom_nandc.c update_rw_regs(host, ecc->steps, true); ecc 2003 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 2016 drivers/mtd/nand/raw/qcom_nandc.c update_rw_regs(host, ecc->steps, false); ecc 2019 drivers/mtd/nand/raw/qcom_nandc.c for (i = 0; i < ecc->steps; i++) { ecc 2022 drivers/mtd/nand/raw/qcom_nandc.c if (i == (ecc->steps - 1)) { ecc 2023 drivers/mtd/nand/raw/qcom_nandc.c data_size = ecc->size - ((ecc->steps - 1) << 2); ecc 2024 drivers/mtd/nand/raw/qcom_nandc.c oob_size = (ecc->steps << 2) + host->ecc_bytes_hw + ecc 2028 drivers/mtd/nand/raw/qcom_nandc.c oob_size = ecc->bytes; ecc 2033 drivers/mtd/nand/raw/qcom_nandc.c i == (ecc->steps - 1) ? NAND_BAM_NO_EOT : 0); ecc 2042 drivers/mtd/nand/raw/qcom_nandc.c if (i == (ecc->steps - 1)) { ecc 2075 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 2087 drivers/mtd/nand/raw/qcom_nandc.c update_rw_regs(host, ecc->steps, false); ecc 2090 drivers/mtd/nand/raw/qcom_nandc.c for (i = 0; i < ecc->steps; i++) { ecc 2094 drivers/mtd/nand/raw/qcom_nandc.c data_size1 = mtd->writesize - host->cw_size * (ecc->steps - 1); ecc 2097 drivers/mtd/nand/raw/qcom_nandc.c if (i == (ecc->steps - 1)) { ecc 2098 drivers/mtd/nand/raw/qcom_nandc.c data_size2 = ecc->size - data_size1 - ecc 2099 drivers/mtd/nand/raw/qcom_nandc.c ((ecc->steps - 1) << 2); ecc 2100 drivers/mtd/nand/raw/qcom_nandc.c oob_size2 = (ecc->steps << 2) + host->ecc_bytes_hw + ecc 2152 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 2161 drivers/mtd/nand/raw/qcom_nandc.c data_size = ecc->size - ((ecc->steps - 1) << 2); ecc 2169 drivers/mtd/nand/raw/qcom_nandc.c set_address(host, host->cw_size * (ecc->steps - 1), page); ecc 2194 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 2217 drivers/mtd/nand/raw/qcom_nandc.c bbpos = mtd->writesize - host->cw_size * (ecc->steps - 1); ecc 2231 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 2248 drivers/mtd/nand/raw/qcom_nandc.c set_address(host, host->cw_size * (ecc->steps - 1), page); ecc 2416 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 2422 drivers/mtd/nand/raw/qcom_nandc.c oobregion->length = (ecc->bytes * (ecc->steps - 1)) + ecc 2438 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 2443 drivers/mtd/nand/raw/qcom_nandc.c oobregion->length = ecc->steps * 4; ecc 2444 drivers/mtd/nand/raw/qcom_nandc.c oobregion->offset = ((ecc->steps - 1) * ecc->bytes) + host->bbm_size; ecc 2450 drivers/mtd/nand/raw/qcom_nandc.c .ecc = qcom_nand_ooblayout_ecc, ecc 2466 drivers/mtd/nand/raw/qcom_nandc.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 2473 drivers/mtd/nand/raw/qcom_nandc.c ecc->size = NANDC_STEP_SIZE; ecc 2488 drivers/mtd/nand/raw/qcom_nandc.c if (ecc->strength >= 8) { ecc 2542 drivers/mtd/nand/raw/qcom_nandc.c ecc->bytes = host->ecc_bytes_hw + host->spare_bytes + host->bbm_size; ecc 2544 drivers/mtd/nand/raw/qcom_nandc.c ecc->read_page = qcom_nandc_read_page; ecc 2545 drivers/mtd/nand/raw/qcom_nandc.c ecc->read_page_raw = qcom_nandc_read_page_raw; ecc 2546 drivers/mtd/nand/raw/qcom_nandc.c ecc->read_oob = qcom_nandc_read_oob; ecc 2547 drivers/mtd/nand/raw/qcom_nandc.c ecc->write_page = qcom_nandc_write_page; ecc 2548 drivers/mtd/nand/raw/qcom_nandc.c ecc->write_page_raw = qcom_nandc_write_page_raw; ecc 2549 drivers/mtd/nand/raw/qcom_nandc.c ecc->write_oob = qcom_nandc_write_oob; ecc 2551 drivers/mtd/nand/raw/qcom_nandc.c ecc->mode = NAND_ECC_HW; ecc 2569 drivers/mtd/nand/raw/qcom_nandc.c host->cw_size = host->cw_data + ecc->bytes; ecc 2621 drivers/mtd/nand/raw/qcom_nandc.c host->cw_size, host->cw_data, ecc->strength, ecc->bytes, ecc 860 drivers/mtd/nand/raw/r852.c chip->ecc.mode = NAND_ECC_HW_SYNDROME; ecc 861 drivers/mtd/nand/raw/r852.c chip->ecc.size = R852_DMA_LEN; ecc 862 drivers/mtd/nand/raw/r852.c chip->ecc.bytes = SM_OOB_SIZE; ecc 863 drivers/mtd/nand/raw/r852.c chip->ecc.strength = 2; ecc 864 drivers/mtd/nand/raw/r852.c chip->ecc.hwctl = r852_ecc_hwctl; ecc 865 drivers/mtd/nand/raw/r852.c chip->ecc.calculate = r852_ecc_calculate; ecc 866 drivers/mtd/nand/raw/r852.c chip->ecc.correct = r852_ecc_correct; ecc 869 drivers/mtd/nand/raw/r852.c chip->ecc.read_oob = r852_read_oob; ecc 100 drivers/mtd/nand/raw/s3c2410.c .ecc = s3c2410_ooblayout_ecc, ecc 638 drivers/mtd/nand/raw/s3c2410.c unsigned long ecc = readl(info->regs + S3C2412_NFMECC0); ecc 640 drivers/mtd/nand/raw/s3c2410.c ecc_code[0] = ecc; ecc 641 drivers/mtd/nand/raw/s3c2410.c ecc_code[1] = ecc >> 8; ecc 642 drivers/mtd/nand/raw/s3c2410.c ecc_code[2] = ecc >> 16; ecc 654 drivers/mtd/nand/raw/s3c2410.c unsigned long ecc = readl(info->regs + S3C2440_NFMECC0); ecc 656 drivers/mtd/nand/raw/s3c2410.c ecc_code[0] = ecc; ecc 657 drivers/mtd/nand/raw/s3c2410.c ecc_code[1] = ecc >> 8; ecc 658 drivers/mtd/nand/raw/s3c2410.c ecc_code[2] = ecc >> 16; ecc 660 drivers/mtd/nand/raw/s3c2410.c pr_debug("%s: returning ecc %06lx\n", __func__, ecc & 0xffffff); ecc 906 drivers/mtd/nand/raw/s3c2410.c chip->ecc.mode = info->platform->ecc_mode; ecc 931 drivers/mtd/nand/raw/s3c2410.c switch (chip->ecc.mode) { ecc 944 drivers/mtd/nand/raw/s3c2410.c chip->ecc.algo = NAND_ECC_HAMMING; ecc 949 drivers/mtd/nand/raw/s3c2410.c chip->ecc.calculate = s3c2410_nand_calculate_ecc; ecc 950 drivers/mtd/nand/raw/s3c2410.c chip->ecc.correct = s3c2410_nand_correct_data; ecc 951 drivers/mtd/nand/raw/s3c2410.c chip->ecc.strength = 1; ecc 955 drivers/mtd/nand/raw/s3c2410.c chip->ecc.hwctl = s3c2410_nand_enable_hwecc; ecc 956 drivers/mtd/nand/raw/s3c2410.c chip->ecc.calculate = s3c2410_nand_calculate_ecc; ecc 960 drivers/mtd/nand/raw/s3c2410.c chip->ecc.hwctl = s3c2412_nand_enable_hwecc; ecc 961 drivers/mtd/nand/raw/s3c2410.c chip->ecc.calculate = s3c2412_nand_calculate_ecc; ecc 965 drivers/mtd/nand/raw/s3c2410.c chip->ecc.hwctl = s3c2440_nand_enable_hwecc; ecc 966 drivers/mtd/nand/raw/s3c2410.c chip->ecc.calculate = s3c2440_nand_calculate_ecc; ecc 976 drivers/mtd/nand/raw/s3c2410.c chip->ecc.size = 256; ecc 977 drivers/mtd/nand/raw/s3c2410.c chip->ecc.bytes = 3; ecc 979 drivers/mtd/nand/raw/s3c2410.c chip->ecc.size = 512; ecc 980 drivers/mtd/nand/raw/s3c2410.c chip->ecc.bytes = 3; ecc 41 drivers/mtd/nand/raw/sh_flctl.c oobregion->length = chip->ecc.bytes; ecc 59 drivers/mtd/nand/raw/sh_flctl.c .ecc = flctl_4secc_ooblayout_sp_ecc, ecc 68 drivers/mtd/nand/raw/sh_flctl.c if (section >= chip->ecc.steps) ecc 72 drivers/mtd/nand/raw/sh_flctl.c oobregion->length = chip->ecc.bytes; ecc 82 drivers/mtd/nand/raw/sh_flctl.c if (section >= chip->ecc.steps) ecc 97 drivers/mtd/nand/raw/sh_flctl.c .ecc = flctl_4secc_ooblayout_lp_ecc, ecc 1037 drivers/mtd/nand/raw/sh_flctl.c chip->ecc.size = 512; ecc 1038 drivers/mtd/nand/raw/sh_flctl.c chip->ecc.bytes = 10; ecc 1039 drivers/mtd/nand/raw/sh_flctl.c chip->ecc.strength = 4; ecc 1040 drivers/mtd/nand/raw/sh_flctl.c chip->ecc.read_page = flctl_read_page_hwecc; ecc 1041 drivers/mtd/nand/raw/sh_flctl.c chip->ecc.write_page = flctl_write_page_hwecc; ecc 1042 drivers/mtd/nand/raw/sh_flctl.c chip->ecc.mode = NAND_ECC_HW; ecc 1047 drivers/mtd/nand/raw/sh_flctl.c chip->ecc.mode = NAND_ECC_SOFT; ecc 1048 drivers/mtd/nand/raw/sh_flctl.c chip->ecc.algo = NAND_ECC_HAMMING; ecc 160 drivers/mtd/nand/raw/sharpsl.c this->ecc.mode = NAND_ECC_HW; ecc 161 drivers/mtd/nand/raw/sharpsl.c this->ecc.size = 256; ecc 162 drivers/mtd/nand/raw/sharpsl.c this->ecc.bytes = 3; ecc 163 drivers/mtd/nand/raw/sharpsl.c this->ecc.strength = 1; ecc 165 drivers/mtd/nand/raw/sharpsl.c this->ecc.hwctl = sharpsl_nand_enable_hwecc; ecc 166 drivers/mtd/nand/raw/sharpsl.c this->ecc.calculate = sharpsl_nand_calculate_ecc; ecc 167 drivers/mtd/nand/raw/sharpsl.c this->ecc.correct = nand_correct_data; ecc 51 drivers/mtd/nand/raw/sm_common.c .ecc = oob_sm_ooblayout_ecc, ecc 95 drivers/mtd/nand/raw/sm_common.c .ecc = oob_sm_small_ooblayout_ecc, ecc 156 drivers/mtd/nand/raw/socrates_nand.c nand_chip->ecc.mode = NAND_ECC_SOFT; /* enable ECC */ ecc 157 drivers/mtd/nand/raw/socrates_nand.c nand_chip->ecc.algo = NAND_ECC_HAMMING; ecc 325 drivers/mtd/nand/raw/stm32_fmc2_nand.c if (chip->ecc.strength == FMC2_ECC_BCH8) { ecc 328 drivers/mtd/nand/raw/stm32_fmc2_nand.c } else if (chip->ecc.strength == FMC2_ECC_BCH4) { ecc 392 drivers/mtd/nand/raw/stm32_fmc2_nand.c dma_cfg.src_addr += chip->ecc.strength == FMC2_ECC_HAM ? ecc 403 drivers/mtd/nand/raw/stm32_fmc2_nand.c fmc2->dma_ecc_len = chip->ecc.strength == FMC2_ECC_HAM ? ecc 507 drivers/mtd/nand/raw/stm32_fmc2_nand.c if (chip->ecc.strength != FMC2_ECC_HAM) { ecc 529 drivers/mtd/nand/raw/stm32_fmc2_nand.c static inline void stm32_fmc2_ham_set_ecc(const u32 ecc_sta, u8 *ecc) ecc 531 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[0] = ecc_sta; ecc 532 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[1] = ecc_sta >> 8; ecc 533 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[2] = ecc_sta >> 16; ecc 537 drivers/mtd/nand/raw/stm32_fmc2_nand.c u8 *ecc) ecc 553 drivers/mtd/nand/raw/stm32_fmc2_nand.c stm32_fmc2_ham_set_ecc(heccr, ecc); ecc 619 drivers/mtd/nand/raw/stm32_fmc2_nand.c u8 *ecc) ecc 634 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[0] = bchpbr; ecc 635 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[1] = bchpbr >> 8; ecc 636 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[2] = bchpbr >> 16; ecc 637 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[3] = bchpbr >> 24; ecc 640 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[4] = bchpbr; ecc 641 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[5] = bchpbr >> 8; ecc 642 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[6] = bchpbr >> 16; ecc 644 drivers/mtd/nand/raw/stm32_fmc2_nand.c if (chip->ecc.strength == FMC2_ECC_BCH8) { ecc 645 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[7] = bchpbr >> 24; ecc 648 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[8] = bchpbr; ecc 649 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[9] = bchpbr >> 8; ecc 650 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[10] = bchpbr >> 16; ecc 651 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[11] = bchpbr >> 24; ecc 654 drivers/mtd/nand/raw/stm32_fmc2_nand.c ecc[12] = bchpbr; ecc 726 drivers/mtd/nand/raw/stm32_fmc2_nand.c return stm32_fmc2_bch_decode(chip->ecc.size, dat, ecc_sta); ecc 733 drivers/mtd/nand/raw/stm32_fmc2_nand.c int ret, i, s, stat, eccsize = chip->ecc.size; ecc 734 drivers/mtd/nand/raw/stm32_fmc2_nand.c int eccbytes = chip->ecc.bytes; ecc 735 drivers/mtd/nand/raw/stm32_fmc2_nand.c int eccsteps = chip->ecc.steps; ecc 736 drivers/mtd/nand/raw/stm32_fmc2_nand.c int eccstrength = chip->ecc.strength; ecc 738 drivers/mtd/nand/raw/stm32_fmc2_nand.c u8 *ecc_calc = chip->ecc.calc_buf; ecc 739 drivers/mtd/nand/raw/stm32_fmc2_nand.c u8 *ecc_code = chip->ecc.code_buf; ecc 748 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.hwctl(chip, NAND_ECC_READ); ecc 763 drivers/mtd/nand/raw/stm32_fmc2_nand.c stat = chip->ecc.correct(chip, p, ecc_code, ecc_calc); ecc 845 drivers/mtd/nand/raw/stm32_fmc2_nand.c csqcfgr3 = FMC2_CSQCFGR3_SNBR(chip->ecc.steps - 1); ecc 903 drivers/mtd/nand/raw/stm32_fmc2_nand.c int eccsteps = chip->ecc.steps; ecc 904 drivers/mtd/nand/raw/stm32_fmc2_nand.c int eccsize = chip->ecc.size; ecc 1093 drivers/mtd/nand/raw/stm32_fmc2_nand.c int eccbytes = chip->ecc.bytes; ecc 1094 drivers/mtd/nand/raw/stm32_fmc2_nand.c int eccsteps = chip->ecc.steps; ecc 1095 drivers/mtd/nand/raw/stm32_fmc2_nand.c int eccstrength = chip->ecc.strength; ecc 1096 drivers/mtd/nand/raw/stm32_fmc2_nand.c int i, s, eccsize = chip->ecc.size; ecc 1151 drivers/mtd/nand/raw/stm32_fmc2_nand.c u8 *ecc_calc = chip->ecc.calc_buf; ecc 1152 drivers/mtd/nand/raw/stm32_fmc2_nand.c u8 *ecc_code = chip->ecc.code_buf; ecc 1188 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.total); ecc 1193 drivers/mtd/nand/raw/stm32_fmc2_nand.c return chip->ecc.correct(chip, buf, ecc_code, ecc_calc); ecc 1651 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.correct = stm32_fmc2_sequencer_correct; ecc 1652 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.write_page = stm32_fmc2_sequencer_write_page; ecc 1653 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.read_page = stm32_fmc2_sequencer_read_page; ecc 1654 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.write_page_raw = stm32_fmc2_sequencer_write_page_raw; ecc 1655 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.read_page_raw = stm32_fmc2_sequencer_read_page_raw; ecc 1658 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.hwctl = stm32_fmc2_hwctl; ecc 1659 drivers/mtd/nand/raw/stm32_fmc2_nand.c if (chip->ecc.strength == FMC2_ECC_HAM) { ecc 1661 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.calculate = stm32_fmc2_ham_calculate; ecc 1662 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.correct = stm32_fmc2_ham_correct; ecc 1663 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.options |= NAND_ECC_GENERIC_ERASED_CHECK; ecc 1666 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.calculate = stm32_fmc2_bch_calculate; ecc 1667 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.correct = stm32_fmc2_bch_correct; ecc 1668 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.read_page = stm32_fmc2_read_page; ecc 1673 drivers/mtd/nand/raw/stm32_fmc2_nand.c if (chip->ecc.strength == FMC2_ECC_HAM) ecc 1674 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.bytes = chip->options & NAND_BUSWIDTH_16 ? 4 : 3; ecc 1675 drivers/mtd/nand/raw/stm32_fmc2_nand.c else if (chip->ecc.strength == FMC2_ECC_BCH8) ecc 1676 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.bytes = chip->options & NAND_BUSWIDTH_16 ? 14 : 13; ecc 1678 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.bytes = chip->options & NAND_BUSWIDTH_16 ? 8 : 7; ecc 1686 drivers/mtd/nand/raw/stm32_fmc2_nand.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 1691 drivers/mtd/nand/raw/stm32_fmc2_nand.c oobregion->length = ecc->total; ecc 1701 drivers/mtd/nand/raw/stm32_fmc2_nand.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 1706 drivers/mtd/nand/raw/stm32_fmc2_nand.c oobregion->length = mtd->oobsize - ecc->total - FMC2_BBM_LEN; ecc 1707 drivers/mtd/nand/raw/stm32_fmc2_nand.c oobregion->offset = ecc->total + FMC2_BBM_LEN; ecc 1713 drivers/mtd/nand/raw/stm32_fmc2_nand.c .ecc = stm32_fmc2_nand_ooblayout_ecc, ecc 1750 drivers/mtd/nand/raw/stm32_fmc2_nand.c if (chip->ecc.mode != NAND_ECC_HW) { ecc 1762 drivers/mtd/nand/raw/stm32_fmc2_nand.c if (mtd->writesize / chip->ecc.size > FMC2_MAX_SG) { ecc 1966 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.mode = NAND_ECC_HW; ecc 1967 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.size = FMC2_ECC_STEP_SIZE; ecc 1968 drivers/mtd/nand/raw/stm32_fmc2_nand.c chip->ecc.strength = FMC2_ECC_BCH8; ecc 593 drivers/mtd/nand/raw/sunxi_nand.c bool ecc) ecc 602 drivers/mtd/nand/raw/sunxi_nand.c if (ecc) { ecc 613 drivers/mtd/nand/raw/sunxi_nand.c bool ecc) ecc 623 drivers/mtd/nand/raw/sunxi_nand.c state = sunxi_nfc_randomizer_state(nand, page, ecc); ecc 660 drivers/mtd/nand/raw/sunxi_nand.c bool ecc, int page) ecc 662 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_config(nand, page, ecc); ecc 669 drivers/mtd/nand/raw/sunxi_nand.c int len, bool ecc, int page) ecc 671 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_config(nand, page, ecc); ecc 680 drivers/mtd/nand/raw/sunxi_nand.c struct sunxi_nand_hw_ecc *data = nand->ecc.priv; ecc 689 drivers/mtd/nand/raw/sunxi_nand.c if (nand->ecc.size == 512) ecc 764 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 783 drivers/mtd/nand/raw/sunxi_nand.c memset(data, pattern, ecc->size); ecc 786 drivers/mtd/nand/raw/sunxi_nand.c memset(oob, pattern, ecc->bytes + 4); ecc 804 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 812 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_read_buf(nand, NULL, ecc->size, false, page); ecc 814 drivers/mtd/nand/raw/sunxi_nand.c if (data_off + ecc->size != oob_off) ecc 830 drivers/mtd/nand/raw/sunxi_nand.c *cur_off = oob_off + ecc->bytes + 4; ecc 845 drivers/mtd/nand/raw/sunxi_nand.c ecc->size, false); ecc 848 drivers/mtd/nand/raw/sunxi_nand.c ecc->size); ecc 850 drivers/mtd/nand/raw/sunxi_nand.c nand_change_read_column_op(nand, oob_off, oob, ecc->bytes + 4, ecc 853 drivers/mtd/nand/raw/sunxi_nand.c ret = nand_check_erased_ecc_chunk(data, ecc->size, ecc 854 drivers/mtd/nand/raw/sunxi_nand.c oob, ecc->bytes + 4, ecc 855 drivers/mtd/nand/raw/sunxi_nand.c NULL, 0, ecc->strength); ecc 859 drivers/mtd/nand/raw/sunxi_nand.c memcpy_fromio(data, nfc->regs + NFC_RAM0_BASE, ecc->size); ecc 864 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_read_buf(nand, oob, ecc->bytes + 4, ecc 882 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 883 drivers/mtd/nand/raw/sunxi_nand.c int offset = ((ecc->bytes + 4) * ecc->steps); ecc 910 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 920 drivers/mtd/nand/raw/sunxi_nand.c ret = sunxi_nfc_dma_op_prepare(nfc, buf, ecc->size, nchunks, ecc 952 drivers/mtd/nand/raw/sunxi_nand.c int data_off = i * ecc->size; ecc 953 drivers/mtd/nand/raw/sunxi_nand.c int oob_off = i * (ecc->bytes + 4); ecc 970 drivers/mtd/nand/raw/sunxi_nand.c oob, ecc->bytes + 4, false); ecc 984 drivers/mtd/nand/raw/sunxi_nand.c int data_off = i * ecc->size; ecc 985 drivers/mtd/nand/raw/sunxi_nand.c int oob_off = i * (ecc->bytes + 4); ecc 999 drivers/mtd/nand/raw/sunxi_nand.c data, ecc->size, ecc 1005 drivers/mtd/nand/raw/sunxi_nand.c oob, ecc->bytes + 4, false); ecc 1007 drivers/mtd/nand/raw/sunxi_nand.c ret = nand_check_erased_ecc_chunk(data, ecc->size, ecc 1008 drivers/mtd/nand/raw/sunxi_nand.c oob, ecc->bytes + 4, ecc 1010 drivers/mtd/nand/raw/sunxi_nand.c ecc->strength); ecc 1033 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 1039 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nfc_randomizer_write_buf(nand, data, ecc->size, false, page); ecc 1041 drivers/mtd/nand/raw/sunxi_nand.c if (data_off + ecc->size != oob_off) ecc 1060 drivers/mtd/nand/raw/sunxi_nand.c *cur_off = oob_off + ecc->bytes + 4; ecc 1070 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 1071 drivers/mtd/nand/raw/sunxi_nand.c int offset = ((ecc->bytes + 4) * ecc->steps); ecc 1091 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 1102 drivers/mtd/nand/raw/sunxi_nand.c for (i = 0; i < ecc->steps; i++) { ecc 1103 drivers/mtd/nand/raw/sunxi_nand.c int data_off = i * ecc->size; ecc 1104 drivers/mtd/nand/raw/sunxi_nand.c int oob_off = i * (ecc->bytes + 4); ecc 1137 drivers/mtd/nand/raw/sunxi_nand.c nand->ecc.steps); ecc 1150 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 1160 drivers/mtd/nand/raw/sunxi_nand.c for (i = data_offs / ecc->size; ecc 1161 drivers/mtd/nand/raw/sunxi_nand.c i < DIV_ROUND_UP(data_offs + readlen, ecc->size); i++) { ecc 1162 drivers/mtd/nand/raw/sunxi_nand.c int data_off = i * ecc->size; ecc 1163 drivers/mtd/nand/raw/sunxi_nand.c int oob_off = i * (ecc->bytes + 4); ecc 1185 drivers/mtd/nand/raw/sunxi_nand.c int nchunks = DIV_ROUND_UP(data_offs + readlen, nand->ecc.size); ecc 1206 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 1215 drivers/mtd/nand/raw/sunxi_nand.c for (i = 0; i < ecc->steps; i++) { ecc 1216 drivers/mtd/nand/raw/sunxi_nand.c int data_off = i * ecc->size; ecc 1217 drivers/mtd/nand/raw/sunxi_nand.c int oob_off = i * (ecc->bytes + 4); ecc 1243 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 1252 drivers/mtd/nand/raw/sunxi_nand.c for (i = data_offs / ecc->size; ecc 1253 drivers/mtd/nand/raw/sunxi_nand.c i < DIV_ROUND_UP(data_offs + data_len, ecc->size); i++) { ecc 1254 drivers/mtd/nand/raw/sunxi_nand.c int data_off = i * ecc->size; ecc 1255 drivers/mtd/nand/raw/sunxi_nand.c int oob_off = i * (ecc->bytes + 4); ecc 1277 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 1287 drivers/mtd/nand/raw/sunxi_nand.c ret = sunxi_nfc_dma_op_prepare(nfc, buf, ecc->size, ecc->steps, ecc 1292 drivers/mtd/nand/raw/sunxi_nand.c for (i = 0; i < ecc->steps; i++) { ecc 1293 drivers/mtd/nand/raw/sunxi_nand.c const u8 *oob = nand->oob_poi + (i * (ecc->bytes + 4)); ecc 1340 drivers/mtd/nand/raw/sunxi_nand.c return nand->ecc.read_page(nand, buf, 1, page); ecc 1350 drivers/mtd/nand/raw/sunxi_nand.c ret = nand->ecc.write_page(nand, buf, 1, page); ecc 1553 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 1555 drivers/mtd/nand/raw/sunxi_nand.c if (section >= ecc->steps) ecc 1558 drivers/mtd/nand/raw/sunxi_nand.c oobregion->offset = section * (ecc->bytes + 4) + 4; ecc 1559 drivers/mtd/nand/raw/sunxi_nand.c oobregion->length = ecc->bytes; ecc 1568 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 1570 drivers/mtd/nand/raw/sunxi_nand.c if (section > ecc->steps) ecc 1578 drivers/mtd/nand/raw/sunxi_nand.c if (!section && ecc->mode == NAND_ECC_HW) { ecc 1585 drivers/mtd/nand/raw/sunxi_nand.c oobregion->offset = section * (ecc->bytes + 4); ecc 1587 drivers/mtd/nand/raw/sunxi_nand.c if (section < ecc->steps) ecc 1596 drivers/mtd/nand/raw/sunxi_nand.c .ecc = sunxi_nand_ooblayout_ecc, ecc 1600 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nand_hw_ecc_ctrl_cleanup(struct nand_ecc_ctrl *ecc) ecc 1602 drivers/mtd/nand/raw/sunxi_nand.c kfree(ecc->priv); ecc 1606 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc, ecc 1617 drivers/mtd/nand/raw/sunxi_nand.c if (ecc->options & NAND_ECC_MAXIMIZE) { ecc 1620 drivers/mtd/nand/raw/sunxi_nand.c ecc->size = 1024; ecc 1621 drivers/mtd/nand/raw/sunxi_nand.c nsectors = mtd->writesize / ecc->size; ecc 1633 drivers/mtd/nand/raw/sunxi_nand.c ecc->strength = bytes * 8 / fls(8 * ecc->size); ecc 1636 drivers/mtd/nand/raw/sunxi_nand.c if (strengths[i] > ecc->strength) ecc 1641 drivers/mtd/nand/raw/sunxi_nand.c ecc->strength = 0; ecc 1643 drivers/mtd/nand/raw/sunxi_nand.c ecc->strength = strengths[i - 1]; ecc 1646 drivers/mtd/nand/raw/sunxi_nand.c if (ecc->size != 512 && ecc->size != 1024) ecc 1654 drivers/mtd/nand/raw/sunxi_nand.c if (ecc->size == 512 && mtd->writesize > 512) { ecc 1655 drivers/mtd/nand/raw/sunxi_nand.c ecc->size = 1024; ecc 1656 drivers/mtd/nand/raw/sunxi_nand.c ecc->strength *= 2; ecc 1661 drivers/mtd/nand/raw/sunxi_nand.c if (ecc->strength <= strengths[i]) { ecc 1666 drivers/mtd/nand/raw/sunxi_nand.c ecc->strength = strengths[i]; ecc 1680 drivers/mtd/nand/raw/sunxi_nand.c ecc->bytes = DIV_ROUND_UP(ecc->strength * fls(8 * 1024), 8); ecc 1683 drivers/mtd/nand/raw/sunxi_nand.c ecc->bytes = ALIGN(ecc->bytes, 2); ecc 1685 drivers/mtd/nand/raw/sunxi_nand.c nsectors = mtd->writesize / ecc->size; ecc 1687 drivers/mtd/nand/raw/sunxi_nand.c if (mtd->oobsize < ((ecc->bytes + 4) * nsectors)) { ecc 1692 drivers/mtd/nand/raw/sunxi_nand.c ecc->read_oob = sunxi_nfc_hw_ecc_read_oob; ecc 1693 drivers/mtd/nand/raw/sunxi_nand.c ecc->write_oob = sunxi_nfc_hw_ecc_write_oob; ecc 1695 drivers/mtd/nand/raw/sunxi_nand.c ecc->priv = data; ecc 1698 drivers/mtd/nand/raw/sunxi_nand.c ecc->read_page = sunxi_nfc_hw_ecc_read_page_dma; ecc 1699 drivers/mtd/nand/raw/sunxi_nand.c ecc->read_subpage = sunxi_nfc_hw_ecc_read_subpage_dma; ecc 1700 drivers/mtd/nand/raw/sunxi_nand.c ecc->write_page = sunxi_nfc_hw_ecc_write_page_dma; ecc 1703 drivers/mtd/nand/raw/sunxi_nand.c ecc->read_page = sunxi_nfc_hw_ecc_read_page; ecc 1704 drivers/mtd/nand/raw/sunxi_nand.c ecc->read_subpage = sunxi_nfc_hw_ecc_read_subpage; ecc 1705 drivers/mtd/nand/raw/sunxi_nand.c ecc->write_page = sunxi_nfc_hw_ecc_write_page; ecc 1709 drivers/mtd/nand/raw/sunxi_nand.c ecc->write_subpage = sunxi_nfc_hw_ecc_write_subpage; ecc 1710 drivers/mtd/nand/raw/sunxi_nand.c ecc->read_oob_raw = nand_read_oob_std; ecc 1711 drivers/mtd/nand/raw/sunxi_nand.c ecc->write_oob_raw = nand_write_oob_std; ecc 1721 drivers/mtd/nand/raw/sunxi_nand.c static void sunxi_nand_ecc_cleanup(struct nand_ecc_ctrl *ecc) ecc 1723 drivers/mtd/nand/raw/sunxi_nand.c switch (ecc->mode) { ecc 1725 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nand_hw_ecc_ctrl_cleanup(ecc); ecc 1735 drivers/mtd/nand/raw/sunxi_nand.c struct nand_ecc_ctrl *ecc = &nand->ecc; ecc 1747 drivers/mtd/nand/raw/sunxi_nand.c if (!ecc->size) { ecc 1748 drivers/mtd/nand/raw/sunxi_nand.c ecc->size = nand->base.eccreq.step_size; ecc 1749 drivers/mtd/nand/raw/sunxi_nand.c ecc->strength = nand->base.eccreq.strength; ecc 1752 drivers/mtd/nand/raw/sunxi_nand.c if (!ecc->size || !ecc->strength) ecc 1755 drivers/mtd/nand/raw/sunxi_nand.c switch (ecc->mode) { ecc 1757 drivers/mtd/nand/raw/sunxi_nand.c ret = sunxi_nand_hw_ecc_ctrl_init(nand, ecc, np); ecc 1993 drivers/mtd/nand/raw/sunxi_nand.c nand->ecc.mode = NAND_ECC_HW; ecc 2047 drivers/mtd/nand/raw/sunxi_nand.c sunxi_nand_ecc_cleanup(&sunxi_nand->nand.ecc); ecc 179 drivers/mtd/nand/raw/tango_nand.c u8 *ecc = chip->oob_poi + BBM_SIZE + METADATA_SIZE; ecc 180 drivers/mtd/nand/raw/tango_nand.c const int ecc_size = chip->ecc.bytes; ecc 181 drivers/mtd/nand/raw/tango_nand.c const int pkt_size = chip->ecc.size; ecc 184 drivers/mtd/nand/raw/tango_nand.c for (i = 0; i < chip->ecc.steps; ++i) { ecc 186 drivers/mtd/nand/raw/tango_nand.c res = nand_check_erased_ecc_chunk(buf, pkt_size, ecc, ecc_size, ecc 188 drivers/mtd/nand/raw/tango_nand.c chip->ecc.strength); ecc 196 drivers/mtd/nand/raw/tango_nand.c ecc += ecc_size; ecc 283 drivers/mtd/nand/raw/tango_nand.c chip->ecc.read_oob(chip, page); ecc 291 drivers/mtd/nand/raw/tango_nand.c chip->ecc.read_oob_raw(chip, page); ecc 371 drivers/mtd/nand/raw/tango_nand.c const int ecc_size = chip->ecc.bytes; ecc 372 drivers/mtd/nand/raw/tango_nand.c const int pkt_size = chip->ecc.size; ecc 398 drivers/mtd/nand/raw/tango_nand.c const int ecc_size = chip->ecc.bytes; ecc 399 drivers/mtd/nand/raw/tango_nand.c const int pkt_size = chip->ecc.size; ecc 453 drivers/mtd/nand/raw/tango_nand.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 455 drivers/mtd/nand/raw/tango_nand.c if (idx >= ecc->steps) ecc 458 drivers/mtd/nand/raw/tango_nand.c res->offset = BBM_SIZE + METADATA_SIZE + ecc->bytes * idx; ecc 459 drivers/mtd/nand/raw/tango_nand.c res->length = ecc->bytes; ecc 470 drivers/mtd/nand/raw/tango_nand.c .ecc = oob_ecc, ecc 512 drivers/mtd/nand/raw/tango_nand.c struct nand_ecc_ctrl *ecc = &chip->ecc; ecc 514 drivers/mtd/nand/raw/tango_nand.c ecc->mode = NAND_ECC_HW; ecc 515 drivers/mtd/nand/raw/tango_nand.c ecc->algo = NAND_ECC_BCH; ecc 516 drivers/mtd/nand/raw/tango_nand.c ecc->bytes = DIV_ROUND_UP(ecc->strength * FIELD_ORDER, BITS_PER_BYTE); ecc 518 drivers/mtd/nand/raw/tango_nand.c ecc->read_page_raw = tango_read_page_raw; ecc 519 drivers/mtd/nand/raw/tango_nand.c ecc->write_page_raw = tango_write_page_raw; ecc 520 drivers/mtd/nand/raw/tango_nand.c ecc->read_page = tango_read_page; ecc 521 drivers/mtd/nand/raw/tango_nand.c ecc->write_page = tango_write_page; ecc 522 drivers/mtd/nand/raw/tango_nand.c ecc->read_oob = tango_read_oob; ecc 523 drivers/mtd/nand/raw/tango_nand.c ecc->write_oob = tango_write_oob; ecc 540 drivers/mtd/nand/raw/tango_nand.c struct nand_ecc_ctrl *ecc; ecc 562 drivers/mtd/nand/raw/tango_nand.c ecc = &chip->ecc; ecc 585 drivers/mtd/nand/raw/tango_nand.c tchip->xfer_cfg = XFER_CFG(cs, 1, ecc->steps, METADATA_SIZE); ecc 586 drivers/mtd/nand/raw/tango_nand.c tchip->pkt_0_cfg = PKT_CFG(ecc->size + METADATA_SIZE, ecc->strength); ecc 587 drivers/mtd/nand/raw/tango_nand.c tchip->pkt_n_cfg = PKT_CFG(ecc->size, ecc->strength); ecc 182 drivers/mtd/nand/raw/tegra_nand.c struct mtd_oob_region ecc; ecc 204 drivers/mtd/nand/raw/tegra_nand.c int bytes_per_step = DIV_ROUND_UP(BITS_PER_STEP_RS * chip->ecc.strength, ecc 211 drivers/mtd/nand/raw/tegra_nand.c oobregion->length = round_up(bytes_per_step * chip->ecc.steps, 4); ecc 223 drivers/mtd/nand/raw/tegra_nand.c .ecc = tegra_nand_ooblayout_rs_ecc, ecc 231 drivers/mtd/nand/raw/tegra_nand.c int bytes_per_step = DIV_ROUND_UP(BITS_PER_STEP_BCH * chip->ecc.strength, ecc 238 drivers/mtd/nand/raw/tegra_nand.c oobregion->length = round_up(bytes_per_step * chip->ecc.steps, 4); ecc 244 drivers/mtd/nand/raw/tegra_nand.c .ecc = tegra_nand_ooblayout_bch_ecc, ecc 480 drivers/mtd/nand/raw/tegra_nand.c if (chip->ecc.algo == NAND_ECC_BCH && enable) ecc 705 drivers/mtd/nand/raw/tegra_nand.c if (fail_sec_flag ^ GENMASK(chip->ecc.steps - 1, 0)) { ecc 721 drivers/mtd/nand/raw/tegra_nand.c for_each_set_bit(bit, &fail_sec_flag, chip->ecc.steps) { ecc 722 drivers/mtd/nand/raw/tegra_nand.c u8 *data = buf + (chip->ecc.size * bit); ecc 723 drivers/mtd/nand/raw/tegra_nand.c u8 *oob = chip->oob_poi + nand->ecc.offset + ecc 724 drivers/mtd/nand/raw/tegra_nand.c (chip->ecc.bytes * bit); ecc 726 drivers/mtd/nand/raw/tegra_nand.c ret = nand_check_erased_ecc_chunk(data, chip->ecc.size, ecc 727 drivers/mtd/nand/raw/tegra_nand.c oob, chip->ecc.bytes, ecc 729 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.strength); ecc 841 drivers/mtd/nand/raw/tegra_nand.c bool maximize = chip->ecc.options & NAND_ECC_MAXIMIZE; ecc 862 drivers/mtd/nand/raw/tegra_nand.c bytes_per_page = round_up(bytes_per_step * chip->ecc.steps, 4); ecc 877 drivers/mtd/nand/raw/tegra_nand.c switch (chip->ecc.algo) { ecc 917 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.mode = NAND_ECC_HW; ecc 918 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.size = 512; ecc 919 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.steps = mtd->writesize / chip->ecc.size; ecc 926 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.read_page = tegra_nand_read_page_hwecc; ecc 927 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.write_page = tegra_nand_write_page_hwecc; ecc 928 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.read_page_raw = tegra_nand_read_page_raw; ecc 929 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.write_page_raw = tegra_nand_write_page_raw; ecc 930 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.read_oob = tegra_nand_read_oob; ecc 931 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.write_oob = tegra_nand_write_oob; ecc 936 drivers/mtd/nand/raw/tegra_nand.c if (chip->ecc.algo == NAND_ECC_UNKNOWN) { ecc 938 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.algo = NAND_ECC_RS; ecc 940 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.algo = NAND_ECC_BCH; ecc 943 drivers/mtd/nand/raw/tegra_nand.c if (chip->ecc.algo == NAND_ECC_BCH && mtd->writesize < 2048) { ecc 948 drivers/mtd/nand/raw/tegra_nand.c if (!chip->ecc.strength) { ecc 957 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.strength = ret; ecc 963 drivers/mtd/nand/raw/tegra_nand.c switch (chip->ecc.algo) { ecc 965 drivers/mtd/nand/raw/tegra_nand.c bits_per_step = BITS_PER_STEP_RS * chip->ecc.strength; ecc 969 drivers/mtd/nand/raw/tegra_nand.c switch (chip->ecc.strength) { ecc 981 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.strength); ecc 986 drivers/mtd/nand/raw/tegra_nand.c bits_per_step = BITS_PER_STEP_BCH * chip->ecc.strength; ecc 989 drivers/mtd/nand/raw/tegra_nand.c switch (chip->ecc.strength) { ecc 1004 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.strength); ecc 1014 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.algo == NAND_ECC_BCH ? "BCH" : "RS", ecc 1015 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.strength); ecc 1017 drivers/mtd/nand/raw/tegra_nand.c chip->ecc.bytes = DIV_ROUND_UP(bits_per_step, BITS_PER_BYTE); ecc 1122 drivers/mtd/nand/raw/tegra_nand.c mtd_ooblayout_ecc(mtd, 0, &nand->ecc); ecc 270 drivers/mtd/nand/raw/tmio_nand.c unsigned int ecc; ecc 274 drivers/mtd/nand/raw/tmio_nand.c ecc = tmio_ioread16(tmio->fcr + FCR_DATA); ecc 275 drivers/mtd/nand/raw/tmio_nand.c ecc_code[1] = ecc; /* 000-255 LP7-0 */ ecc 276 drivers/mtd/nand/raw/tmio_nand.c ecc_code[0] = ecc >> 8; /* 000-255 LP15-8 */ ecc 277 drivers/mtd/nand/raw/tmio_nand.c ecc = tmio_ioread16(tmio->fcr + FCR_DATA); ecc 278 drivers/mtd/nand/raw/tmio_nand.c ecc_code[2] = ecc; /* 000-255 CP5-0,11b */ ecc 279 drivers/mtd/nand/raw/tmio_nand.c ecc_code[4] = ecc >> 8; /* 256-511 LP7-0 */ ecc 280 drivers/mtd/nand/raw/tmio_nand.c ecc = tmio_ioread16(tmio->fcr + FCR_DATA); ecc 281 drivers/mtd/nand/raw/tmio_nand.c ecc_code[3] = ecc; /* 256-511 LP15-8 */ ecc 282 drivers/mtd/nand/raw/tmio_nand.c ecc_code[5] = ecc >> 8; /* 256-511 CP5-0,11b */ ecc 413 drivers/mtd/nand/raw/tmio_nand.c nand_chip->ecc.mode = NAND_ECC_HW; ecc 414 drivers/mtd/nand/raw/tmio_nand.c nand_chip->ecc.size = 512; ecc 415 drivers/mtd/nand/raw/tmio_nand.c nand_chip->ecc.bytes = 6; ecc 416 drivers/mtd/nand/raw/tmio_nand.c nand_chip->ecc.strength = 2; ecc 417 drivers/mtd/nand/raw/tmio_nand.c nand_chip->ecc.hwctl = tmio_nand_enable_hwecc; ecc 418 drivers/mtd/nand/raw/tmio_nand.c nand_chip->ecc.calculate = tmio_nand_calculate_ecc; ecc 419 drivers/mtd/nand/raw/tmio_nand.c nand_chip->ecc.correct = tmio_nand_correct_data; ecc 178 drivers/mtd/nand/raw/txx9ndfmc.c for (eccbytes = chip->ecc.bytes; eccbytes > 0; eccbytes -= 3) { ecc 196 drivers/mtd/nand/raw/txx9ndfmc.c for (eccsize = chip->ecc.size; eccsize > 0; eccsize -= 256) { ecc 257 drivers/mtd/nand/raw/txx9ndfmc.c chip->ecc.size = 512; ecc 258 drivers/mtd/nand/raw/txx9ndfmc.c chip->ecc.bytes = 6; ecc 260 drivers/mtd/nand/raw/txx9ndfmc.c chip->ecc.size = 256; ecc 261 drivers/mtd/nand/raw/txx9ndfmc.c chip->ecc.bytes = 3; ecc 329 drivers/mtd/nand/raw/txx9ndfmc.c chip->ecc.calculate = txx9ndfmc_calculate_ecc; ecc 330 drivers/mtd/nand/raw/txx9ndfmc.c chip->ecc.correct = txx9ndfmc_correct_data; ecc 331 drivers/mtd/nand/raw/txx9ndfmc.c chip->ecc.hwctl = txx9ndfmc_enable_hwecc; ecc 332 drivers/mtd/nand/raw/txx9ndfmc.c chip->ecc.mode = NAND_ECC_HW; ecc 333 drivers/mtd/nand/raw/txx9ndfmc.c chip->ecc.strength = 1; ecc 518 drivers/mtd/nand/raw/vf610_nfc.c int flips_threshold = nfc->chip.ecc.strength / 2; ecc 534 drivers/mtd/nand/raw/vf610_nfc.c return nand_check_erased_ecc_chunk(dat, nfc->chip.ecc.size, oob, ecc 733 drivers/mtd/nand/raw/vf610_nfc.c if (nfc->chip.ecc.mode == NAND_ECC_HW) { ecc 762 drivers/mtd/nand/raw/vf610_nfc.c if (chip->ecc.mode != NAND_ECC_HW) ecc 770 drivers/mtd/nand/raw/vf610_nfc.c if (chip->ecc.size != mtd->writesize) { ecc 781 drivers/mtd/nand/raw/vf610_nfc.c if (chip->ecc.strength == 32) { ecc 783 drivers/mtd/nand/raw/vf610_nfc.c chip->ecc.bytes = 60; ecc 784 drivers/mtd/nand/raw/vf610_nfc.c } else if (chip->ecc.strength == 24) { ecc 786 drivers/mtd/nand/raw/vf610_nfc.c chip->ecc.bytes = 45; ecc 792 drivers/mtd/nand/raw/vf610_nfc.c chip->ecc.read_page = vf610_nfc_read_page; ecc 793 drivers/mtd/nand/raw/vf610_nfc.c chip->ecc.write_page = vf610_nfc_write_page; ecc 794 drivers/mtd/nand/raw/vf610_nfc.c chip->ecc.read_page_raw = vf610_nfc_read_page_raw; ecc 795 drivers/mtd/nand/raw/vf610_nfc.c chip->ecc.write_page_raw = vf610_nfc_write_page_raw; ecc 796 drivers/mtd/nand/raw/vf610_nfc.c chip->ecc.read_oob = vf610_nfc_read_oob; ecc 797 drivers/mtd/nand/raw/vf610_nfc.c chip->ecc.write_oob = vf610_nfc_write_oob; ecc 799 drivers/mtd/nand/raw/vf610_nfc.c chip->ecc.size = PAGE_2K; ecc 183 drivers/mtd/nand/raw/xway_nand.c data->chip.ecc.mode = NAND_ECC_SOFT; ecc 184 drivers/mtd/nand/raw/xway_nand.c data->chip.ecc.algo = NAND_ECC_HAMMING; ecc 948 drivers/mtd/nand/spi/core.c .ecc = spinand_noecc_ooblayout_ecc, ecc 77 drivers/mtd/nand/spi/gigadevice.c .ecc = gd5fxgq4xa_ooblayout_ecc, ecc 131 drivers/mtd/nand/spi/gigadevice.c .ecc = gd5fxgq4_variant2_ooblayout_ecc, ecc 48 drivers/mtd/nand/spi/macronix.c .ecc = mx35lfxge4ab_ooblayout_ecc, ecc 63 drivers/mtd/nand/spi/micron.c .ecc = mt29f2g01abagd_ooblayout_ecc, ecc 94 drivers/mtd/nand/spi/paragon.c .ecc = pn26g0xa_ooblayout_ecc, ecc 54 drivers/mtd/nand/spi/toshiba.c .ecc = tc58cxgxsx_ooblayout_ecc, ecc 59 drivers/mtd/nand/spi/winbond.c .ecc = w25m02gv_ooblayout_ecc, ecc 219 drivers/mtd/sm_ftl.c uint8_t ecc[3]; ecc 221 drivers/mtd/sm_ftl.c __nand_calculate_ecc(buffer, SM_SMALL_PAGE, ecc, ecc 223 drivers/mtd/sm_ftl.c if (__nand_correct_data(buffer, ecc, oob->ecc1, SM_SMALL_PAGE, ecc 229 drivers/mtd/sm_ftl.c __nand_calculate_ecc(buffer, SM_SMALL_PAGE, ecc, ecc 231 drivers/mtd/sm_ftl.c if (__nand_correct_data(buffer, ecc, oob->ecc2, SM_SMALL_PAGE, ecc 1037 drivers/net/can/janz-ican3.c u8 isrc, ecc, status, rxerr, txerr; ecc 1054 drivers/net/can/janz-ican3.c ecc = msg->data[2]; ecc 1074 drivers/net/can/janz-ican3.c if (!(ecc & ECC_DIR)) { ecc 1132 drivers/net/can/janz-ican3.c switch (ecc & ECC_MASK) { ecc 1143 drivers/net/can/janz-ican3.c cf->data[3] = ecc & ECC_SEG; ecc 1147 drivers/net/can/janz-ican3.c if (!(ecc & ECC_DIR)) ecc 399 drivers/net/can/sja1000/sja1000.c uint8_t ecc, alc; ecc 437 drivers/net/can/sja1000/sja1000.c ecc = priv->read_reg(priv, SJA1000_ECC); ecc 442 drivers/net/can/sja1000/sja1000.c switch (ecc & ECC_MASK) { ecc 457 drivers/net/can/sja1000/sja1000.c cf->data[3] = ecc & ECC_SEG; ecc 460 drivers/net/can/sja1000/sja1000.c if ((ecc & ECC_DIR) == 0) ecc 519 drivers/net/can/sun4i_can.c u32 ecc, alc; ecc 570 drivers/net/can/sun4i_can.c ecc = readl(priv->base + SUN4I_REG_STA_ADDR); ecc 574 drivers/net/can/sun4i_can.c switch (ecc & SUN4I_STA_MASK_ERR) { ecc 585 drivers/net/can/sun4i_can.c cf->data[3] = (ecc & SUN4I_STA_ERR_SEG_CODE) ecc 590 drivers/net/can/sun4i_can.c if ((ecc & SUN4I_STA_ERR_DIR) == 0) ecc 161 drivers/net/can/usb/ems_usb.c u8 ecc; ecc 355 drivers/net/can/usb/ems_usb.c u8 ecc = msg->msg.error.cc.regs.sja1000.ecc; ecc 365 drivers/net/can/usb/ems_usb.c switch (ecc & SJA1000_ECC_MASK) { ecc 376 drivers/net/can/usb/ems_usb.c cf->data[3] = ecc & SJA1000_ECC_SEG; ecc 381 drivers/net/can/usb/ems_usb.c if ((ecc & SJA1000_ECC_DIR) == 0) ecc 224 drivers/net/can/usb/esd_usb2.c u8 ecc = msg->msg.rx.data[1]; ecc 262 drivers/net/can/usb/esd_usb2.c switch (ecc & SJA1000_ECC_MASK) { ecc 273 drivers/net/can/usb/esd_usb2.c cf->data[3] = ecc & SJA1000_ECC_SEG; ecc 278 drivers/net/can/usb/esd_usb2.c if (!(ecc & SJA1000_ECC_DIR)) ecc 313 drivers/net/ethernet/netronome/nfp/nfp_asm.c u8 ecc = 0; ecc 317 drivers/net/ethernet/netronome/nfp/nfp_asm.c ecc |= parity(nfp_ustore_ecc_polynomials[i] & insn) << i; ecc 319 drivers/net/ethernet/netronome/nfp/nfp_asm.c return insn | (u64)ecc << NFP_USTORE_OP_BITS; ecc 147 drivers/scsi/csiostor/csio_hw_t5.c uint64_t *ecc) ecc 175 drivers/scsi/csiostor/csio_hw_t5.c if (ecc) ecc 176 drivers/scsi/csiostor/csio_hw_t5.c *ecc = csio_rd_reg64(hw, MC_DATA(16)); ecc 195 drivers/scsi/csiostor/csio_hw_t5.c uint64_t *ecc) ecc 231 drivers/scsi/csiostor/csio_hw_t5.c if (ecc) ecc 232 drivers/scsi/csiostor/csio_hw_t5.c *ecc = csio_rd_reg64(hw, EDC_DATA(16)); ecc 1775 drivers/scsi/libsas/sas_expander.c static int sas_get_ex_change_count(struct domain_device *dev, int *ecc) ecc 1802 drivers/scsi/libsas/sas_expander.c *ecc = be16_to_cpu(rg_resp->rg.change_count); ecc 2188 drivers/scsi/megaraid/megaraid_sas.h } __attribute__ ((packed)) ecc; ecc 243 drivers/usb/storage/alauda.c static void nand_compute_ecc(unsigned char *data, unsigned char *ecc) ecc 259 drivers/usb/storage/alauda.c ecc[0] = ~(a ^ (a<<1) ^ (parity[par] ? 0xaa : 0)); ecc 262 drivers/usb/storage/alauda.c ecc[1] = ~(a ^ (a<<1) ^ (parity[par] ? 0xaa : 0)); ecc 264 drivers/usb/storage/alauda.c ecc[2] = ecc2[par]; ecc 267 drivers/usb/storage/alauda.c static int nand_compare_ecc(unsigned char *data, unsigned char *ecc) ecc 269 drivers/usb/storage/alauda.c return (data[0] == ecc[0] && data[1] == ecc[1] && data[2] == ecc[2]); ecc 272 drivers/usb/storage/alauda.c static void nand_store_ecc(unsigned char *data, unsigned char *ecc) ecc 274 drivers/usb/storage/alauda.c memcpy(data, ecc, 3); ecc 806 drivers/usb/storage/alauda.c unsigned char ecc[3]; ecc 854 drivers/usb/storage/alauda.c nand_compute_ecc(bptr, ecc); ecc 855 drivers/usb/storage/alauda.c if (!nand_compare_ecc(cptr+13, ecc)) { ecc 858 drivers/usb/storage/alauda.c nand_store_ecc(cptr+13, ecc); ecc 860 drivers/usb/storage/alauda.c nand_compute_ecc(bptr + (pagesize / 2), ecc); ecc 861 drivers/usb/storage/alauda.c if (!nand_compare_ecc(cptr+8, ecc)) { ecc 864 drivers/usb/storage/alauda.c nand_store_ecc(cptr+8, ecc); ecc 877 drivers/usb/storage/alauda.c nand_compute_ecc(bptr, ecc); ecc 878 drivers/usb/storage/alauda.c nand_store_ecc(cptr+13, ecc); ecc 879 drivers/usb/storage/alauda.c nand_compute_ecc(bptr + (pagesize / 2), ecc); ecc 880 drivers/usb/storage/alauda.c nand_store_ecc(cptr+8, ecc); ecc 212 drivers/usb/storage/sddr09.c static void nand_compute_ecc(unsigned char *data, unsigned char *ecc) { ecc 227 drivers/usb/storage/sddr09.c ecc[0] = ~(a ^ (a<<1) ^ (parity[par] ? 0xaa : 0)); ecc 230 drivers/usb/storage/sddr09.c ecc[1] = ~(a ^ (a<<1) ^ (parity[par] ? 0xaa : 0)); ecc 232 drivers/usb/storage/sddr09.c ecc[2] = ecc2[par]; ecc 235 drivers/usb/storage/sddr09.c static int nand_compare_ecc(unsigned char *data, unsigned char *ecc) { ecc 236 drivers/usb/storage/sddr09.c return (data[0] == ecc[0] && data[1] == ecc[1] && data[2] == ecc[2]); ecc 239 drivers/usb/storage/sddr09.c static void nand_store_ecc(unsigned char *data, unsigned char *ecc) { ecc 240 drivers/usb/storage/sddr09.c memcpy(data, ecc, 3); ecc 860 drivers/usb/storage/sddr09.c unsigned char ecc[3]; ecc 901 drivers/usb/storage/sddr09.c nand_compute_ecc(bptr, ecc); ecc 902 drivers/usb/storage/sddr09.c if (!nand_compare_ecc(cptr+13, ecc)) { ecc 905 drivers/usb/storage/sddr09.c nand_store_ecc(cptr+13, ecc); ecc 907 drivers/usb/storage/sddr09.c nand_compute_ecc(bptr+(info->pagesize / 2), ecc); ecc 908 drivers/usb/storage/sddr09.c if (!nand_compare_ecc(cptr+8, ecc)) { ecc 911 drivers/usb/storage/sddr09.c nand_store_ecc(cptr+8, ecc); ecc 924 drivers/usb/storage/sddr09.c nand_compute_ecc(bptr, ecc); ecc 925 drivers/usb/storage/sddr09.c nand_store_ecc(cptr+13, ecc); ecc 926 drivers/usb/storage/sddr09.c nand_compute_ecc(bptr+(info->pagesize / 2), ecc); ecc 927 drivers/usb/storage/sddr09.c nand_store_ecc(cptr+8, ecc); ecc 2652 drivers/video/fbdev/omap2/omapfb/dss/dsi.c int channel, u8 data_type, u16 len, u8 ecc) ecc 2663 drivers/video/fbdev/omap2/omapfb/dss/dsi.c FLD_VAL(ecc, 31, 24); ecc 2682 drivers/video/fbdev/omap2/omapfb/dss/dsi.c u8 data_type, u8 *data, u16 len, u8 ecc) ecc 2702 drivers/video/fbdev/omap2/omapfb/dss/dsi.c dsi_vc_write_long_header(dsidev, channel, data_type, len, ecc); ecc 2746 drivers/video/fbdev/omap2/omapfb/dss/dsi.c u8 data_type, u16 data, u8 ecc) ecc 2768 drivers/video/fbdev/omap2/omapfb/dss/dsi.c r = (data_id << 0) | (data << 8) | (ecc << 24); ecc 355 fs/ocfs2/blockcheck.c u32 ecc; ecc 360 fs/ocfs2/blockcheck.c ecc = ocfs2_hamming_encode_block(data, blocksize); ecc 366 fs/ocfs2/blockcheck.c BUG_ON(ecc > USHRT_MAX); ecc 369 fs/ocfs2/blockcheck.c bc->bc_ecc = cpu_to_le16((u16)ecc); ecc 387 fs/ocfs2/blockcheck.c u32 crc, ecc; ecc 407 fs/ocfs2/blockcheck.c ecc = ocfs2_hamming_encode_block(data, blocksize); ecc 408 fs/ocfs2/blockcheck.c ocfs2_hamming_fix_block(data, blocksize, ecc ^ bc_ecc); ecc 447 fs/ocfs2/blockcheck.c u32 crc, ecc; ecc 456 fs/ocfs2/blockcheck.c for (i = 0, crc = ~0, ecc = 0; i < nr; i++) { ecc 463 fs/ocfs2/blockcheck.c ecc = (u16)ocfs2_hamming_encode(ecc, bhs[i]->b_data, ecc 472 fs/ocfs2/blockcheck.c BUG_ON(ecc > USHRT_MAX); ecc 475 fs/ocfs2/blockcheck.c bc->bc_ecc = cpu_to_le16((u16)ecc); ecc 494 fs/ocfs2/blockcheck.c u32 crc, ecc, fix; ecc 520 fs/ocfs2/blockcheck.c for (i = 0, ecc = 0; i < nr; i++) { ecc 526 fs/ocfs2/blockcheck.c ecc = (u16)ocfs2_hamming_encode(ecc, bhs[i]->b_data, ecc 530 fs/ocfs2/blockcheck.c fix = ecc ^ bc_ecc; ecc 66 fs/pstore/ram.c module_param_named(ecc, ramoops_ecc, int, 0600); ecc 99 fs/pstore/ram_core.c uint8_t *data, size_t len, uint8_t *ecc) ecc 108 fs/pstore/ram_core.c ecc[i] = prz->ecc_info.par[i]; ecc 112 fs/pstore/ram_core.c void *data, size_t len, uint8_t *ecc) ecc 117 fs/pstore/ram_core.c prz->ecc_info.par[i] = ecc[i]; ecc 61 include/linux/bch.h unsigned int len, uint8_t *ecc); ecc 658 include/linux/ccp.h struct ccp_ecc_engine ecc; ecc 101 include/linux/mtd/mtd.h int (*ecc)(struct mtd_info *mtd, int section, ecc 1124 include/linux/mtd/rawnand.h struct nand_ecc_ctrl ecc; ecc 1211 include/linux/mtd/rawnand.h #define NAND_ECC_STRENGTH(type) ((type)->ecc.strength_ds) ecc 1212 include/linux/mtd/rawnand.h #define NAND_ECC_STEP(type) ((type)->ecc.step_ds) ecc 1261 include/linux/mtd/rawnand.h } ecc; ecc 1298 include/linux/mtd/rawnand.h void *ecc, int ecclen, ecc 122 lib/bch.c uint32_t *ecc) ecc 129 lib/bch.c p = bch->mod8_tab + (l+1)*(((ecc[0] >> 24)^(*data++)) & 0xff); ecc 132 lib/bch.c ecc[i] = ((ecc[i] << 8)|(ecc[i+1] >> 24))^(*p++); ecc 134 lib/bch.c ecc[l] = (ecc[l] << 8)^(*p); ecc 191 lib/bch.c unsigned int len, uint8_t *ecc) ecc 207 lib/bch.c if (ecc) { ecc 209 lib/bch.c load_ecc8(bch, bch->ecc_buf, ecc); ecc 261 lib/bch.c if (ecc) ecc 262 lib/bch.c store_ecc8(bch, ecc, bch->ecc_buf); ecc 347 lib/bch.c static void compute_syndromes(struct bch_control *bch, uint32_t *ecc, ecc 360 lib/bch.c ecc[s/32] &= ~((1u << (32-m))-1); ecc 365 lib/bch.c poly = *ecc++;