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

The H6/H616 spare area 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
6208274d ee61bba4

+7 -2
+7 -2
drivers/mtd/nand/raw/sunxi_nand.c
··· 54 54 #define NFC_REG_ECC_ERR_CNT(nfc, x) ((nfc->caps->reg_ecc_err_cnt + (x)) & ~0x3) 55 55 #define NFC_REG_A10_USER_DATA 0x0050 56 56 #define NFC_REG_USER_DATA(nfc, x) (nfc->caps->reg_user_data + ((x) * 4)) 57 - #define NFC_REG_SPARE_AREA 0x00A0 57 + #define NFC_REG_SPARE_AREA(nfc) (nfc->caps->reg_spare_area) 58 + #define NFC_REG_A10_SPARE_AREA 0x00A0 58 59 #define NFC_REG_PAT_ID(nfc) (nfc->caps->reg_pat_id) 59 60 #define NFC_REG_A10_PAT_ID 0x00A4 60 61 #define NFC_REG_MDMA_ADDR 0x00C0 ··· 240 239 * @reg_io_data: I/O data register 241 240 * @reg_ecc_err_cnt: ECC error counter register 242 241 * @reg_user_data: User data register 242 + * @reg_spare_area: Spare Area Register 243 243 * @reg_pat_id: Pattern ID Register 244 244 * @reg_pat_found: Data Pattern Status Register 245 245 * @random_en_mask: RANDOM_EN mask in NFC_ECC_CTL register ··· 257 255 unsigned int reg_io_data; 258 256 unsigned int reg_ecc_err_cnt; 259 257 unsigned int reg_user_data; 258 + unsigned int reg_spare_area; 260 259 unsigned int reg_pat_id; 261 260 unsigned int reg_pat_found; 262 261 unsigned int random_en_mask; ··· 480 477 if (sel->rb >= 0) 481 478 ctl |= NFC_RB_SEL(sel->rb); 482 479 483 - writel(mtd->writesize, nfc->regs + NFC_REG_SPARE_AREA); 480 + writel(mtd->writesize, nfc->regs + NFC_REG_SPARE_AREA(nfc)); 484 481 485 482 if (nfc->clk_rate != sunxi_nand->clk_rate) { 486 483 clk_set_rate(nfc->mod_clk, sunxi_nand->clk_rate); ··· 2239 2236 .reg_io_data = NFC_REG_A10_IO_DATA, 2240 2237 .reg_ecc_err_cnt = NFC_REG_A10_ECC_ERR_CNT, 2241 2238 .reg_user_data = NFC_REG_A10_USER_DATA, 2239 + .reg_spare_area = NFC_REG_A10_SPARE_AREA, 2242 2240 .reg_pat_id = NFC_REG_A10_PAT_ID, 2243 2241 .reg_pat_found = NFC_REG_ECC_ST, 2244 2242 .random_en_mask = BIT(9), ··· 2257 2253 .reg_io_data = NFC_REG_A23_IO_DATA, 2258 2254 .reg_ecc_err_cnt = NFC_REG_A10_ECC_ERR_CNT, 2259 2255 .reg_user_data = NFC_REG_A10_USER_DATA, 2256 + .reg_spare_area = NFC_REG_A10_SPARE_AREA, 2260 2257 .reg_pat_id = NFC_REG_A10_PAT_ID, 2261 2258 .reg_pat_found = NFC_REG_ECC_ST, 2262 2259 .random_en_mask = BIT(9),