From 2daf451df50209e7626c2bf424d50ff23055784a Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Wed, 18 May 2016 10:52:38 +0800 Subject: [PATCH 33/93] mmc: fsl_esdhc: support two esdhc host controllers This patch is to support two esdhc host controllers with the macro CONFIG_FSL_ESDHC_TWO_CONTROLLERS_SUPPORT. Signed-off-by: Yangbo Lu --- drivers/mmc/fsl_esdhc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 7cc61a0..cacf879 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -748,11 +748,26 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) int fsl_esdhc_mmc_init(bd_t *bis) { struct fsl_esdhc_cfg *cfg; +#ifdef CONFIG_FSL_ESDHC_TWO_CONTROLLERS_SUPPORT + struct fsl_esdhc_cfg *cfg_1; +#endif cfg = calloc(sizeof(struct fsl_esdhc_cfg), 1); cfg->esdhc_base = CONFIG_SYS_FSL_ESDHC_ADDR; cfg->sdhc_clk = gd->arch.sdhc_clk; +#ifdef CONFIG_FSL_ESDHC_TWO_CONTROLLERS_SUPPORT + cfg_1 = calloc(sizeof(struct fsl_esdhc_cfg), 1); + cfg_1->esdhc_base = CONFIG_SYS_FSL_ESDHC_1_ADDR; + cfg_1->sdhc_clk = gd->arch.sdhc_clk; + + if (fsl_esdhc_initialize(bis, cfg)) + return -1; + if (fsl_esdhc_initialize(bis, cfg_1)) + return -1; + return 0; +#else return fsl_esdhc_initialize(bis, cfg); +#endif } #ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -- 1.7.9.5