diff options
| author | Richard Genoud <[email protected]> | 2026-01-23 12:44:54 +0100 |
|---|---|---|
| committer | Michael Trimarchi <[email protected]> | 2026-02-03 21:45:09 +0100 |
| commit | 01c5b0ec50b24cda83340426c8487e72c02c6910 (patch) | |
| tree | 4725b23a265ff98cdbd792c5847ffae6c759d229 /drivers | |
| parent | 442eb06c92eba87b63dcd7222088a18e951e024d (diff) | |
mtd: rawnand: sunxi_spl: use NFC_ECC_MODE and NFC_RANDOM_SEED macros
Use generic macros for ECC_MODE and RANDOM_SEED
As H6/H616 registers are different, use more generic macros than hard
coded values specific to A10-like SoC.
No functional changes.
Signed-off-by: Richard Genoud <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/mtd/nand/raw/sunxi_nand_spl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/nand/raw/sunxi_nand_spl.c b/drivers/mtd/nand/raw/sunxi_nand_spl.c index 9a6286b015d..76458c2063e 100644 --- a/drivers/mtd/nand/raw/sunxi_nand_spl.c +++ b/drivers/mtd/nand/raw/sunxi_nand_spl.c @@ -57,6 +57,7 @@ __maybe_unused static const struct sunxi_nfc_caps sunxi_nfc_a10_caps = { .reg_spare_area = NFC_REG_A10_SPARE_AREA, .reg_pat_found = NFC_REG_ECC_ST, .pat_found_mask = GENMASK(31, 16), + .ecc_mode_mask = GENMASK(15, 12), .ecc_err_mask = GENMASK(15, 0), .random_en_mask = BIT(9), }; @@ -237,7 +238,9 @@ static int nand_read_page(const struct nfc_config *conf, u32 offs, /* Clear ECC status and restart ECC engine */ writel(0, SUNXI_NFC_BASE + NFC_REG_ECC_ST); - writel((rand_seed << 16) | (conf->ecc_strength << 12) | + + writel(NFC_RANDOM_SEED(rand_seed) | + NFC_ECC_MODE(conf, conf->ecc_strength) | (conf->randomize ? NFC_RANDOM_EN(conf) : 0) | ecc512_bit | NFC_ECC_EN | NFC_ECC_EXCEPTION, |
