From 09a544e7b6a0f2b4202d54a8c5279204f271918b Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 17 Feb 2020 08:14:59 +0100 Subject: mci: imx-esdhc-pbl: Add instance 2 for i.MX8MM Unlike the i.MX8MQ the i.MX8MM has three SDHCI controllers. Add support for picking the base address of the third controller from the instance number. While at it use the IMX8M_ base addresses rather than the IMX8MQ_ base addresses. Signed-off-by: Sascha Hauer --- drivers/mci/imx-esdhc-pbl.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/mci/imx-esdhc-pbl.c b/drivers/mci/imx-esdhc-pbl.c index 6610cee3b5..caaf1ac9b5 100644 --- a/drivers/mci/imx-esdhc-pbl.c +++ b/drivers/mci/imx-esdhc-pbl.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #endif #include "sdhci.h" @@ -207,10 +208,14 @@ static int imx8m_esdhc_init(struct fsl_esdhc_host *host, { switch (instance) { case 0: - host->regs = IOMEM(MX8MQ_USDHC1_BASE_ADDR); + host->regs = IOMEM(MX8M_USDHC1_BASE_ADDR); break; case 1: - host->regs = IOMEM(MX8MQ_USDHC2_BASE_ADDR); + host->regs = IOMEM(MX8M_USDHC2_BASE_ADDR); + break; + case 2: + /* Only exists on i.MX8MM, not on i.MX8MQ */ + host->regs = IOMEM(MX8MM_USDHC3_BASE_ADDR); break; default: return -EINVAL; @@ -283,7 +288,7 @@ int imx8m_esdhc_load_image(int instance, bool start) if (ret) return ret; - return esdhc_load_image(&host, MX8MQ_DDR_CSD1_BASE_ADDR, + return esdhc_load_image(&host, MX8M_DDR_CSD1_BASE_ADDR, MX8MQ_ATF_BL33_BASE_ADDR, SZ_32K, start); } #endif -- cgit v1.2.3