From: Richard Genoud Date: Fri, 23 Jan 2026 11:44:54 +0000 (+0100) Subject: mtd: rawnand: sunxi_spl: use NFC_ECC_MODE and NFC_RANDOM_SEED macros X-Git-Tag: v2026.04-rc2~24^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01c5b0ec50b24cda83340426c8487e72c02c6910;p=thirdparty%2Fu-boot.git 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 Signed-off-by: Michael Trimarchi --- 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,