]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
memory: ti-gpmc: Fix lock up at A53 SPL during NAND boot on AM64-EVM
authorRoger Quadros <rogerq@kernel.org>
Tue, 6 Feb 2024 14:02:51 +0000 (16:02 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 13 Feb 2024 20:38:11 +0000 (15:38 -0500)
AM64 ES2.0 bootrom seems to enable WAIT0EDGEDETECTION interrupt.
This causes a lockup at A53 SPL when accessing NAND controller
or ELM registers.

A good option would be to softrest GPMC block at probe
but this cannot be done for AM64 as SOFTRESET bit is marked
as reserved in SYSCONFIG register.

Fix the issue by disabling all IRQs at probe.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
drivers/memory/ti-gpmc.c

index 0b8674339ecd4bb3613b5d1d2ac73a321781b053..8877b8f4385b9bb220dfcb0e9f603253dc7d453c 100644 (file)
@@ -1196,6 +1196,12 @@ static int gpmc_probe(struct udevice *dev)
        gpmc_cfg = (struct gpmc *)priv->base;
        gpmc_base = priv->base;
 
+       /*
+        * Disable all IRQs as some bootroms might leave them enabled
+        * and that will cause a lock-up later
+        */
+       gpmc_write_reg(GPMC_IRQENABLE, 0);
+
        priv->l3_clk = devm_clk_get(dev, "fck");
        if (IS_ERR(priv->l3_clk))
                return PTR_ERR(priv->l3_clk);