00c44496309054f607e5f7df2ba5e3675e9b7e5f
[openwrt/staging/linusw.git] /
1 From e3e641993a1a5148e71bdd3f7b3cb5da695b1632 Mon Sep 17 00:00:00 2001
2 From: Yangbo Lu <yangbo.lu@nxp.com>
3 Date: Fri, 20 May 2016 11:17:30 +0800
4 Subject: [PATCH 34/93] mmc: fsl_esdhc: add workaround for non-removable card
5 of esdhc-2
6
7 The esdhc-2 usually uses some on-board memory devices such as eMMC
8 card or SDIO wifi module, and it doesn't support SDHC_CD_B. So we
9 could only assume it always has a card instead of detecting SDHC_CD_B
10 status. This patch is to add workaround for these non-removable
11 cards which are used by esdhc-2.
12
13 Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
14 ---
15 drivers/mmc/fsl_esdhc.c | 6 +++++-
16 include/fsl_esdhc.h | 1 +
17 2 files changed, 6 insertions(+), 1 deletion(-)
18
19 diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
20 index cacf879..2c6e175 100644
21 --- a/drivers/mmc/fsl_esdhc.c
22 +++ b/drivers/mmc/fsl_esdhc.c
23 @@ -628,6 +628,8 @@ static int esdhc_getcd(struct mmc *mmc)
24 struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg->esdhc_base;
25 int timeout = 1000;
26
27 + if (cfg->non_removable_card)
28 + return 1;
29 #ifdef CONFIG_ESDHC_DETECT_QUIRK
30 if (CONFIG_ESDHC_DETECT_QUIRK)
31 return 1;
32 @@ -759,7 +761,9 @@ int fsl_esdhc_mmc_init(bd_t *bis)
33 cfg_1 = calloc(sizeof(struct fsl_esdhc_cfg), 1);
34 cfg_1->esdhc_base = CONFIG_SYS_FSL_ESDHC_1_ADDR;
35 cfg_1->sdhc_clk = gd->arch.sdhc_clk;
36 -
37 +#ifdef CONFIG_FSL_ESDHC_1_NON_REMOVABLE_CARD
38 + cfg_1->non_removable_card = true;
39 +#endif
40 if (fsl_esdhc_initialize(bis, cfg))
41 return -1;
42 if (fsl_esdhc_initialize(bis, cfg_1))
43 diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h
44 index 073048f..8335106 100644
45 --- a/include/fsl_esdhc.h
46 +++ b/include/fsl_esdhc.h
47 @@ -175,6 +175,7 @@ struct fsl_esdhc_cfg {
48 #endif
49 u32 sdhc_clk;
50 u8 max_bus_width;
51 + bool non_removable_card;
52 struct mmc_config cfg;
53 };
54
55 --
56 1.7.9.5
57