Lines Matching refs:ecc

45 static void jz4740_ecc_reset(struct ingenic_ecc *ecc, bool calc_ecc)  in jz4740_ecc_reset()  argument
50 writel(0, ecc->base + JZ_REG_NAND_IRQ_STAT); in jz4740_ecc_reset()
53 reg = readl(ecc->base + JZ_REG_NAND_ECC_CTRL); in jz4740_ecc_reset()
62 writel(reg, ecc->base + JZ_REG_NAND_ECC_CTRL); in jz4740_ecc_reset()
65 static int jz4740_ecc_calculate(struct ingenic_ecc *ecc, in jz4740_ecc_calculate() argument
73 jz4740_ecc_reset(ecc, true); in jz4740_ecc_calculate()
76 status = readl(ecc->base + JZ_REG_NAND_IRQ_STAT); in jz4740_ecc_calculate()
82 reg = readl(ecc->base + JZ_REG_NAND_ECC_CTRL); in jz4740_ecc_calculate()
84 writel(reg, ecc->base + JZ_REG_NAND_ECC_CTRL); in jz4740_ecc_calculate()
87 ecc_code[i] = readb(ecc->base + JZ_REG_NAND_PAR0 + i); in jz4740_ecc_calculate()
117 static int jz4740_ecc_correct(struct ingenic_ecc *ecc, in jz4740_ecc_correct() argument
125 jz4740_ecc_reset(ecc, false); in jz4740_ecc_correct()
128 writeb(ecc_code[i], ecc->base + JZ_REG_NAND_PAR0 + i); in jz4740_ecc_correct()
130 reg = readl(ecc->base + JZ_REG_NAND_ECC_CTRL); in jz4740_ecc_correct()
132 writel(reg, ecc->base + JZ_REG_NAND_ECC_CTRL); in jz4740_ecc_correct()
135 status = readl(ecc->base + JZ_REG_NAND_IRQ_STAT); in jz4740_ecc_correct()
141 reg = readl(ecc->base + JZ_REG_NAND_ECC_CTRL); in jz4740_ecc_correct()
143 writel(reg, ecc->base + JZ_REG_NAND_ECC_CTRL); in jz4740_ecc_correct()
152 error = readl(ecc->base + JZ_REG_NAND_ERR(i)); in jz4740_ecc_correct()
164 static void jz4740_ecc_disable(struct ingenic_ecc *ecc) in jz4740_ecc_disable() argument
168 writel(0, ecc->base + JZ_REG_NAND_IRQ_STAT); in jz4740_ecc_disable()
169 reg = readl(ecc->base + JZ_REG_NAND_ECC_CTRL); in jz4740_ecc_disable()
171 writel(reg, ecc->base + JZ_REG_NAND_ECC_CTRL); in jz4740_ecc_disable()