Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mtd: rawnand: sunxi: introduce reg_ecc_err_cnt in sunxi_nfc_caps

The H6/H616 ECC_ERR_CNT register is not at the same offset as the
A10/A23 one, so move its offset into sunxi_nfc_caps

No functional change.

Signed-off-by: Richard Genoud <richard.genoud@bootlin.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Richard Genoud and committed by
Miquel Raynal
4a3a0568 94dc08ad

+7 -2
+7 -2
drivers/mtd/nand/raw/sunxi_nand.c
··· 46 46 #define NFC_REG_ECC_CTL 0x0034 47 47 #define NFC_REG_ECC_ST 0x0038 48 48 #define NFC_REG_DEBUG 0x003C 49 - #define NFC_REG_ECC_ERR_CNT(x) ((0x0040 + (x)) & ~0x3) 49 + #define NFC_REG_A10_ECC_ERR_CNT 0x0040 50 + #define NFC_REG_ECC_ERR_CNT(nfc, x) ((nfc->caps->reg_ecc_err_cnt + (x)) & ~0x3) 50 51 #define NFC_REG_USER_DATA(x) (0x0050 + ((x) * 4)) 51 52 #define NFC_REG_SPARE_AREA 0x00A0 52 53 #define NFC_REG_PAT_ID 0x00A4 ··· 224 223 * @has_mdma: Use mbus dma mode, otherwise general dma 225 224 * through MBUS on A23/A33 needs extra configuration. 226 225 * @reg_io_data: I/O data register 226 + * @reg_ecc_err_cnt: ECC error counter register 227 227 * @dma_maxburst: DMA maxburst 228 228 * @ecc_strengths: Available ECC strengths array 229 229 * @nstrengths: Size of @ecc_strengths ··· 232 230 struct sunxi_nfc_caps { 233 231 bool has_mdma; 234 232 unsigned int reg_io_data; 233 + unsigned int reg_ecc_err_cnt; 235 234 unsigned int dma_maxburst; 236 235 const u8 *ecc_strengths; 237 236 unsigned int nstrengths; ··· 804 801 return 0; 805 802 } 806 803 807 - tmp = readl(nfc->regs + NFC_REG_ECC_ERR_CNT(step)); 804 + tmp = readl(nfc->regs + NFC_REG_ECC_ERR_CNT(nfc, step)); 808 805 809 806 return NFC_ECC_ERR_CNT(step, tmp); 810 807 } ··· 2191 2188 2192 2189 static const struct sunxi_nfc_caps sunxi_nfc_a10_caps = { 2193 2190 .reg_io_data = NFC_REG_A10_IO_DATA, 2191 + .reg_ecc_err_cnt = NFC_REG_A10_ECC_ERR_CNT, 2194 2192 .dma_maxburst = 4, 2195 2193 .ecc_strengths = sunxi_ecc_strengths_a10, 2196 2194 .nstrengths = ARRAY_SIZE(sunxi_ecc_strengths_a10), ··· 2200 2196 static const struct sunxi_nfc_caps sunxi_nfc_a23_caps = { 2201 2197 .has_mdma = true, 2202 2198 .reg_io_data = NFC_REG_A23_IO_DATA, 2199 + .reg_ecc_err_cnt = NFC_REG_A10_ECC_ERR_CNT, 2203 2200 .dma_maxburst = 8, 2204 2201 .ecc_strengths = sunxi_ecc_strengths_a10, 2205 2202 .nstrengths = ARRAY_SIZE(sunxi_ecc_strengths_a10),