diff options
| author | Richard Genoud <[email protected]> | 2026-01-23 12:44:43 +0100 |
|---|---|---|
| committer | Michael Trimarchi <[email protected]> | 2026-02-03 21:44:41 +0100 |
| commit | 6124050e53d109ba6e73dfbace3b8252570debac (patch) | |
| tree | 218afcf5029ff94e96de9a5072391a5bab4842a0 | |
| parent | bd9944c74f6974d9a08665783f3b31c6c7c883d4 (diff) | |
mtd: rawnand: sunxi: move ECC_ERR_CNT register offset in SoC caps
ECC_ERR_CNT register offset moved in H616, so let's make it a SoC cap
Reviewed-by: Andre Przywara <[email protected]>
Signed-off-by: Richard Genoud <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
| -rw-r--r-- | drivers/mtd/nand/raw/sunxi_nand.c | 3 | ||||
| -rw-r--r-- | drivers/mtd/nand/raw/sunxi_nand.h | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c index 41262b089cb..6699a577958 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -736,7 +736,7 @@ static int sunxi_nfc_hw_ecc_read_chunk(struct mtd_info *mtd, return 1; } - ret = NFC_ECC_ERR_CNT(0, readl(nfc->regs + NFC_REG_ECC_ERR_CNT(0))); + ret = NFC_ECC_ERR_CNT(0, readl(nfc->regs + NFC_REG_ECC_ERR_CNT(nfc, 0))); memcpy_fromio(data, nfc->regs + NFC_RAM0_BASE, ecc->size); @@ -1712,6 +1712,7 @@ static int sunxi_nand_probe(struct udevice *dev) static const struct sunxi_nfc_caps sunxi_nfc_a10_caps = { .nstrengths = 9, + .reg_ecc_err_cnt = NFC_REG_A10_ECC_ERR_CNT, }; static const struct udevice_id sunxi_nand_ids[] = { diff --git a/drivers/mtd/nand/raw/sunxi_nand.h b/drivers/mtd/nand/raw/sunxi_nand.h index 80fbc8df009..b961f2ef3bf 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.h +++ b/drivers/mtd/nand/raw/sunxi_nand.h @@ -41,7 +41,8 @@ #define NFC_REG_ECC_CTL 0x0034 #define NFC_REG_ECC_ST 0x0038 #define NFC_REG_DEBUG 0x003C -#define NFC_REG_ECC_ERR_CNT(x) ((0x0040 + (x)) & ~0x3) +#define NFC_REG_A10_ECC_ERR_CNT 0x0040 +#define NFC_REG_ECC_ERR_CNT(nfc, x) (((nfc)->caps->reg_ecc_err_cnt + (x)) & ~0x3) #define NFC_REG_USER_DATA(x) (0x0050 + ((x) * 4)) #define NFC_REG_SPARE_AREA 0x00A0 #define NFC_REG_PAT_ID 0x00A4 @@ -158,9 +159,11 @@ * for distinction between compatible strings. * * @nstrengths: Number of element of ECC strengths array + * @reg_ecc_err_cnt: ECC error counter register */ struct sunxi_nfc_caps { unsigned int nstrengths; + unsigned int reg_ecc_err_cnt; }; #endif |
