From: Andre Przywara <andre.przywara@arm.com>
To: Peng Fan <peng.fan@nxp.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de, linux-sunxi@lists.linux.dev
Subject: FIXUP! sunxi: mmc: Improve reset procedure
Date: Tue, 25 Mar 2025 14:27:37 +0000 [thread overview]
Message-ID: <20250325142737.1702796-1-andre.przywara@arm.com> (raw)
In-Reply-To: <20250325133953.1dab37c8@donnerap.manchester.arm.com>
Hi Jernej,
what do you think about this solution the A10 compilation problem?
That looks like a simple change, somewhat half of the way to the proper
solution.
If you agree, I'd squash that into your patch, then push it for U-Boot
next.
Cheers,
Andre
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
drivers/mmc/sunxi_mmc.c | 10 +++++-----
drivers/mmc/sunxi_mmc.h | 4 ++++
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index 31dbfb10c59..951e6acd34d 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -449,23 +449,23 @@ out:
return error;
}
-static void sunxi_mmc_reset(struct sunxi_mmc *regs)
+static void sunxi_mmc_reset(void *regs)
{
/* Reset controller */
- writel(SUNXI_MMC_GCTRL_RESET, ®s->gctrl);
+ writel(SUNXI_MMC_GCTRL_RESET, regs + SUNXI_MMC_GCTRL);
udelay(1000);
if (IS_ENABLED(CONFIG_SUN50I_GEN_H6) || IS_ENABLED(CONFIG_SUNXI_GEN_NCAT2)) {
/* Reset card */
- writel(SUNXI_MMC_HWRST_ASSERT, ®s->hwrst);
+ writel(SUNXI_MMC_HWRST_ASSERT, regs + SUNXI_MMC_HWRST);
udelay(10);
- writel(SUNXI_MMC_HWRST_DEASSERT, ®s->hwrst);
+ writel(SUNXI_MMC_HWRST_DEASSERT, regs + SUNXI_MMC_HWRST);
udelay(300);
/* Setup FIFO R/W threshold. Needed on H616. */
writel(SUNXI_MMC_THLDC_READ_THLD(512) |
SUNXI_MMC_THLDC_WRITE_EN |
- SUNXI_MMC_THLDC_READ_EN, ®s->thldc);
+ SUNXI_MMC_THLDC_READ_EN, regs + SUNXI_MMC_THLDC);
}
}
diff --git a/drivers/mmc/sunxi_mmc.h b/drivers/mmc/sunxi_mmc.h
index 9d55904c213..bc313dcabe0 100644
--- a/drivers/mmc/sunxi_mmc.h
+++ b/drivers/mmc/sunxi_mmc.h
@@ -12,6 +12,10 @@
#include <linux/types.h>
+#define SUNXI_MMC_GCTRL 0x000
+#define SUNXI_MMC_HWRST 0x078
+#define SUNXI_MMC_THLDC 0x100
+
struct sunxi_mmc {
u32 gctrl; /* 0x00 global control */
u32 clkcr; /* 0x04 clock control */
--
2.25.1
next prev parent reply other threads:[~2025-03-25 14:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-09 6:12 [PATCH] sunxi: mmc: Improve reset procedure Jernej Skrabec
2025-03-25 1:16 ` Andre Przywara
2025-03-25 13:39 ` Andre Przywara
2025-03-25 14:27 ` Andre Przywara [this message]
2025-03-25 16:13 ` FIXUP! " Jernej Škrabec
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=20250325142737.1702796-1-andre.przywara@arm.com \
--to=andre.przywara@arm.com \
--cc=jh80.chung@samsung.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=peng.fan@nxp.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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