aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2022-03-09 20:46:21 +0100
committerFelix Fietkau <nbd@nbd.name>2022-10-10 18:14:22 +0200
commitcc8326443d4e02dfddb7595cbdd4001020fd64cb (patch)
treea2a2fb3f6d0ae8a421ffec87ee6d5332bacda0ee
parent1918404b1d57f12719f4668cf7f841ecafbe0aa7 (diff)
downloadupstream-cc8326443d4e02dfddb7595cbdd4001020fd64cb.tar.gz
upstream-cc8326443d4e02dfddb7595cbdd4001020fd64cb.tar.bz2
upstream-cc8326443d4e02dfddb7595cbdd4001020fd64cb.zip
ramips: mt7621_nand: initialize ECC_FDMADDR
This is needed for the ECC controller to access FDM data Signed-off-by: Felix Fietkau <nbd@nbd.name> (cherry-picked from commit 73b2a4ca033bbd84d3e0373d4fd21c559ddc090b)
-rw-r--r--target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
index 04bc6040c6..b9c2dfb911 100644
--- a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
+++ b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
@@ -214,6 +214,7 @@ struct mt7621_nfc {
struct clk *nfi_clk;
struct device *dev;
+ u32 nfi_base;
void __iomem *nfi_regs;
void __iomem *ecc_regs;
@@ -860,6 +861,8 @@ static int mt7621_nfc_ecc_init(struct mt7621_nfc *nfc)
(decode_block_size << DEC_CS_S) |
(DEC_CON_EL << DEC_CON_S) | DEC_EMPTY_EN;
+ ecc_write32(nfc, ECC_FDMADDR, nfc->nfi_base + NFI_FDML(0));
+
mt7621_ecc_encoder_op(nfc, false);
ecc_write32(nfc, ECC_ENCCNFG, ecc_enccfg);
@@ -1277,6 +1280,7 @@ static int mt7621_nfc_probe(struct platform_device *pdev)
nfc->dev = dev;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nfi");
+ nfc->nfi_base = res->start;
nfc->nfi_regs = devm_ioremap_resource(dev, res);
if (IS_ERR(nfc->nfi_regs)) {
ret = PTR_ERR(nfc->nfi_regs);