From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 21 Jul 2017 23:24:33 +0200 Subject: [U-Boot] [PATCH 2/5] mmc: uniphier-sd: Add support for 64bit controller In-Reply-To: <20170721212436.26073-1-marek.vasut+renesas@gmail.com> References: <20170721212436.26073-1-marek.vasut+renesas@gmail.com> Message-ID: <20170721212436.26073-2-marek.vasut+renesas@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Cc: Masahiro Yamada Cc: Jaehoon Chung --- 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 70090522bd..93a2c6becd 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, const u32 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, const u32 val, const u32 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