From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/5] mmc: uniphier-sd: Add support for 64bit controller
Date: Sun, 20 Aug 2017 17:11:16 +0200 [thread overview]
Message-ID: <20170820151119.2303-2-marek.vasut+renesas@gmail.com> (raw)
In-Reply-To: <20170820151119.2303-1-marek.vasut+renesas@gmail.com>
The Renesas RCar Gen3 contains the same controller, originally
Matsushita, yet the register addresses are shifted by 1 to the
left. The whole controller is also 64bit, including the data
FIFOs and RSP registers. This patch adds support for handling
the register IO by shifting the register offset by 1 in the IO
accessor functions.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
---
drivers/mmc/uniphier-sd.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/uniphier-sd.c b/drivers/mmc/uniphier-sd.c
index cb53b28737..bb9b2c4e04 100644
--- a/drivers/mmc/uniphier-sd.c
+++ b/drivers/mmc/uniphier-sd.c
@@ -132,17 +132,24 @@ struct uniphier_sd_priv {
#define UNIPHIER_SD_CAP_NONREMOVABLE BIT(0) /* Nonremovable e.g. eMMC */
#define UNIPHIER_SD_CAP_DMA_INTERNAL BIT(1) /* have internal DMA engine */
#define UNIPHIER_SD_CAP_DIV1024 BIT(2) /* divisor 1024 is available */
+#define UNIPHIER_SD_CAP_64BIT BIT(3) /* Controller is 64bit */
};
static u32 uniphier_sd_readl(struct uniphier_sd_priv *priv, unsigned int reg)
{
- return readl(priv->regbase + reg);
+ if (priv->caps & UNIPHIER_SD_CAP_64BIT)
+ return readl(priv->regbase + (reg << 1));
+ else
+ return readl(priv->regbase + reg);
}
static void uniphier_sd_writel(struct uniphier_sd_priv *priv,
u32 val, unsigned int reg)
{
- writel(val, priv->regbase + reg);
+ if (priv->caps & UNIPHIER_SD_CAP_64BIT)
+ writel(val, priv->regbase + (reg << 1));
+ else
+ writel(val, priv->regbase + reg);
}
static dma_addr_t __dma_map_single(void *ptr, size_t size,
--
2.11.0
next prev parent reply other threads:[~2017-08-20 15:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170820152705epcas2p374259bc866fbe62c31d667deb101cc2f@epcas2p3.samsung.com>
2017-08-20 15:11 ` [U-Boot] [PATCH V3 1/5] mmc: uniphier-sd: Factor out register IO Marek Vasut
2017-08-20 15:11 ` Marek Vasut [this message]
2017-08-20 15:44 ` [U-Boot] [PATCH 2/5] mmc: uniphier-sd: Add support for 64bit controller Masahiro Yamada
2017-08-20 15:11 ` [U-Boot] [PATCH V3 3/5] mmc: uniphier-sd: Add support for 64bit FIFO Marek Vasut
2017-08-20 15:44 ` Masahiro Yamada
2017-08-20 15:11 ` [U-Boot] [PATCH 4/5] mmc: uniphier-sd: Add support for quirks Marek Vasut
2017-08-20 15:45 ` Masahiro Yamada
2017-08-20 15:11 ` [U-Boot] [PATCH 5/5] mmc: uniphier-sd: Add support for R8A7795 and R7A7796 Marek Vasut
2017-08-20 15:45 ` Masahiro Yamada
2017-08-20 15:43 ` [U-Boot] [PATCH V3 1/5] mmc: uniphier-sd: Factor out register IO Masahiro Yamada
2017-09-12 17:04 ` Marek Vasut
2017-09-19 19:39 ` Marek Vasut
2017-09-22 13:54 ` Jaehoon Chung
2017-09-26 15:56 ` Masahiro Yamada
2017-08-07 9:24 [U-Boot] [PATCH V2 " Marek Vasut
2017-08-07 9:24 ` [U-Boot] [PATCH 2/5] mmc: uniphier-sd: Add support for 64bit controller Marek Vasut
-- strict thread matches above, loose matches on Subject: below --
2017-07-21 21:24 [U-Boot] [PATCH 1/5] mmc: uniphier-sd: Factor out register IO Marek Vasut
2017-07-21 21:24 ` [U-Boot] [PATCH 2/5] mmc: uniphier-sd: Add support for 64bit controller Marek Vasut
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=20170820151119.2303-2-marek.vasut+renesas@gmail.com \
--to=marek.vasut@gmail.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