ctl |= NFC_RB_SEL(sel->rb.info.nativeid);
}
- writel(mtd->writesize, nfc->regs + NFC_REG_SPARE_AREA);
+ writel(mtd->writesize, nfc->regs + NFC_REG_SPARE_AREA(nfc));
if (nfc->clk_rate != sunxi_nand->clk_rate) {
sunxi_nfc_set_clk_rate(sunxi_nand->clk_rate);
.reg_ecc_err_cnt = NFC_REG_A10_ECC_ERR_CNT,
.reg_user_data = NFC_REG_A10_USER_DATA,
.reg_pat_found = NFC_REG_ECC_ST,
+ .reg_spare_area = NFC_REG_A10_SPARE_AREA,
.reg_pat_id = NFC_REG_A10_PAT_ID,
.pat_found_mask = GENMASK(31, 16),
.ecc_mode_mask = GENMASK(15, 12),
#define NFC_REG_ECC_ERR_CNT(nfc, x) (((nfc)->caps->reg_ecc_err_cnt + (x)) & ~0x3)
#define NFC_REG_A10_USER_DATA 0x0050
#define NFC_REG_USER_DATA(nfc, x) ((nfc)->caps->reg_user_data + ((x) * 4))
-#define NFC_REG_SPARE_AREA 0x00A0
-#define NFC_REG_PAT_ID(nfc) ((nfc)->caps->reg_pat_id)
+#define NFC_REG_SPARE_AREA(nfc) ((nfc)->caps->reg_spare_area)
+#define NFC_REG_A10_SPARE_AREA 0x00A0
+#define NFC_REG_PAT_ID(nfc) ((nfc)->caps->reg_pat_id)
#define NFC_REG_A10_PAT_ID 0x00A4
#define NFC_RAM0_BASE 0x0400
#define NFC_RAM1_BASE 0x0800
* @nstrengths: Number of element of ECC strengths array
* @reg_ecc_err_cnt: ECC error counter register
* @reg_user_data: User data register
+ * @reg_spare_area: Spare Area Register
* @reg_pat_id: Pattern ID Register
* @reg_pat_found: Data Pattern Status Register
* @pat_found_mask: ECC_PAT_FOUND mask in NFC_REG_PAT_FOUND register
unsigned int nstrengths;
unsigned int reg_ecc_err_cnt;
unsigned int reg_user_data;
+ unsigned int reg_spare_area;
unsigned int reg_pat_id;
unsigned int reg_pat_found;
unsigned int pat_found_mask;
__maybe_unused static const struct sunxi_nfc_caps sunxi_nfc_a10_caps = {
.has_ecc_block_512 = true,
+ .reg_spare_area = NFC_REG_A10_SPARE_AREA,
.random_en_mask = BIT(9),
};
writel(val | NFC_PAGE_SIZE(conf->page_size),
SUNXI_NFC_BASE + NFC_REG_CTL);
writel(conf->ecc_size, SUNXI_NFC_BASE + NFC_REG_CNT);
- writel(conf->page_size, SUNXI_NFC_BASE + NFC_REG_SPARE_AREA);
+ writel(conf->page_size, SUNXI_NFC_BASE + NFC_REG_SPARE_AREA(conf));
}
static int nand_load_page(const struct nfc_config *conf, u32 offs)