public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: trini@konsulko.com
Cc: dario.binacchi@amarulasolutions.com, nm@ti.com, praneeth@ti.com,
	vigneshr@ti.com, u-boot@lists.denx.de,
	Roger Quadros <rogerq@kernel.org>
Subject: [PATCH] memory: ti-gpmc: Fix lock up at A53 SPL during NAND boot on AM64-EVM
Date: Tue,  6 Feb 2024 16:02:51 +0200	[thread overview]
Message-ID: <20240206140251.44155-1-rogerq@kernel.org> (raw)

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 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/memory/ti-gpmc.c b/drivers/memory/ti-gpmc.c
index 0b8674339e..8877b8f438 100644
--- a/drivers/memory/ti-gpmc.c
+++ b/drivers/memory/ti-gpmc.c
@@ -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);

base-commit: 28760ce8640ff6266bd1c1c568a4a231576f3919
-- 
2.34.1


             reply	other threads:[~2024-02-06 14:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 14:02 Roger Quadros [this message]
2024-02-13 22:33 ` [PATCH] memory: ti-gpmc: Fix lock up at A53 SPL during NAND boot on AM64-EVM Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240206140251.44155-1-rogerq@kernel.org \
    --to=rogerq@kernel.org \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=nm@ti.com \
    --cc=praneeth@ti.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox