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_user_data in sunxi_nfc_caps

The H6/H616 USER_DATA 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
f53c74d0 4a3a0568

+8 -4
+8 -4
drivers/mtd/nand/raw/sunxi_nand.c
··· 48 48 #define NFC_REG_DEBUG 0x003C 49 49 #define NFC_REG_A10_ECC_ERR_CNT 0x0040 50 50 #define NFC_REG_ECC_ERR_CNT(nfc, x) ((nfc->caps->reg_ecc_err_cnt + (x)) & ~0x3) 51 - #define NFC_REG_USER_DATA(x) (0x0050 + ((x) * 4)) 51 + #define NFC_REG_A10_USER_DATA 0x0050 52 + #define NFC_REG_USER_DATA(nfc, x) (nfc->caps->reg_user_data + ((x) * 4)) 52 53 #define NFC_REG_SPARE_AREA 0x00A0 53 54 #define NFC_REG_PAT_ID 0x00A4 54 55 #define NFC_REG_MDMA_ADDR 0x00C0 ··· 226 225 * through MBUS on A23/A33 needs extra configuration. 227 226 * @reg_io_data: I/O data register 228 227 * @reg_ecc_err_cnt: ECC error counter register 228 + * @reg_user_data: User data register 229 229 * @dma_maxburst: DMA maxburst 230 230 * @ecc_strengths: Available ECC strengths array 231 231 * @nstrengths: Size of @ecc_strengths ··· 235 233 bool has_mdma; 236 234 unsigned int reg_io_data; 237 235 unsigned int reg_ecc_err_cnt; 236 + unsigned int reg_user_data; 238 237 unsigned int dma_maxburst; 239 238 const u8 *ecc_strengths; 240 239 unsigned int nstrengths; ··· 737 734 { 738 735 struct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller); 739 736 740 - sunxi_nfc_user_data_to_buf(readl(nfc->regs + NFC_REG_USER_DATA(step)), 741 - oob); 737 + sunxi_nfc_user_data_to_buf(readl(nfc->regs + NFC_REG_USER_DATA(nfc, step)), oob); 742 738 743 739 /* De-randomize the Bad Block Marker. */ 744 740 if (bbm && (nand->options & NAND_NEED_SCRAMBLING)) ··· 759 757 } 760 758 761 759 writel(sunxi_nfc_buf_to_user_data(oob), 762 - nfc->regs + NFC_REG_USER_DATA(step)); 760 + nfc->regs + NFC_REG_USER_DATA(nfc, step)); 763 761 } 764 762 765 763 static void sunxi_nfc_hw_ecc_update_stats(struct nand_chip *nand, ··· 2194 2192 static const struct sunxi_nfc_caps sunxi_nfc_a10_caps = { 2195 2193 .reg_io_data = NFC_REG_A10_IO_DATA, 2196 2194 .reg_ecc_err_cnt = NFC_REG_A10_ECC_ERR_CNT, 2195 + .reg_user_data = NFC_REG_A10_USER_DATA, 2197 2196 .dma_maxburst = 4, 2198 2197 .ecc_strengths = sunxi_ecc_strengths_a10, 2199 2198 .nstrengths = ARRAY_SIZE(sunxi_ecc_strengths_a10), ··· 2204 2201 .has_mdma = true, 2205 2202 .reg_io_data = NFC_REG_A23_IO_DATA, 2206 2203 .reg_ecc_err_cnt = NFC_REG_A10_ECC_ERR_CNT, 2204 + .reg_user_data = NFC_REG_A10_USER_DATA, 2207 2205 .dma_maxburst = 8, 2208 2206 .ecc_strengths = sunxi_ecc_strengths_a10, 2209 2207 .nstrengths = ARRAY_SIZE(sunxi_ecc_strengths_a10),