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

The H6/H616 error mask register is bigger than the A10/A23 one, so move
its mask into sunxi_nfc_caps.

No functional change

Signed-off-by: Richard Genoud <richard.genoud@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Richard Genoud and committed by
Miquel Raynal
97d13bce 6208274d

+6 -2
+6 -2
drivers/mtd/nand/raw/sunxi_nand.c
··· 155 155 156 156 /* define bit use in NFC_ECC_ST */ 157 157 #define NFC_ECC_ERR(x) BIT(x) 158 - #define NFC_ECC_ERR_MSK GENMASK(15, 0) 158 + #define NFC_ECC_ERR_MSK(nfc) (nfc->caps->ecc_err_mask) 159 159 160 160 /* 161 161 * define bit use in NFC_REG_PAT_FOUND ··· 246 246 * @random_en_mask: RANDOM_EN mask in NFC_ECC_CTL register 247 247 * @random_dir_mask: RANDOM_DIRECTION mask in NFC_ECC_CTL register 248 248 * @ecc_mode_mask: ECC_MODE mask in NFC_ECC_CTL register 249 + * @ecc_err_mask: NFC_ECC_ERR mask in NFC_ECC_ST register 249 250 * @pat_found_mask: ECC_PAT_FOUND mask in NFC_REG_PAT_FOUND register 250 251 * @dma_maxburst: DMA maxburst 251 252 * @ecc_strengths: Available ECC strengths array ··· 264 263 unsigned int random_en_mask; 265 264 unsigned int random_dir_mask; 266 265 unsigned int ecc_mode_mask; 266 + unsigned int ecc_err_mask; 267 267 unsigned int pat_found_mask; 268 268 unsigned int dma_maxburst; 269 269 const u8 *ecc_strengths; ··· 1042 1040 sunxi_nfc_hw_ecc_update_stats(nand, &max_bitflips, ret); 1043 1041 } 1044 1042 1045 - if (status & NFC_ECC_ERR_MSK) { 1043 + if (status & NFC_ECC_ERR_MSK(nfc)) { 1046 1044 for (i = 0; i < nchunks; i++) { 1047 1045 int data_off = i * ecc->size; 1048 1046 int oob_off = i * (ecc->bytes + USER_DATA_SZ); ··· 2247 2245 .random_en_mask = BIT(9), 2248 2246 .random_dir_mask = BIT(10), 2249 2247 .ecc_mode_mask = GENMASK(15, 12), 2248 + .ecc_err_mask = GENMASK(15, 0), 2250 2249 .pat_found_mask = GENMASK(31, 16), 2251 2250 .dma_maxburst = 4, 2252 2251 .ecc_strengths = sunxi_ecc_strengths_a10, ··· 2266 2263 .random_en_mask = BIT(9), 2267 2264 .random_dir_mask = BIT(10), 2268 2265 .ecc_mode_mask = GENMASK(15, 12), 2266 + .ecc_err_mask = GENMASK(15, 0), 2269 2267 .pat_found_mask = GENMASK(31, 16), 2270 2268 .dma_maxburst = 8, 2271 2269 .ecc_strengths = sunxi_ecc_strengths_a10,