diff options
author | Jean-Jacques Hiblot <jjhiblot@ti.com> | 2017-09-21 16:29:58 +0200 |
---|---|---|
committer | Jaehoon Chung <jh80.chung@samsung.com> | 2018-01-12 18:11:04 +0900 |
commit | 3862b854740d296356a5cfd3146b270ad3501d97 (patch) | |
tree | 8680b374866a481d3cabad19e4f8173fa769b006 /include/mmc.h | |
parent | d0c221fe7336fc7d9ada57d96f4a8911a3aac041 (diff) | |
download | u-boot-3862b854740d296356a5cfd3146b270ad3501d97.tar.gz |
mmc: refactor MMC startup to make it easier to support new modes
The MMC startup process currently handles 4 modes. To make it easier to
add support for more modes, let's make the process more generic and use a
list of the modes to try.
The major functional change is that when a mode fails we try the next one.
Not all modes are tried, only those supported by the card and the host.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/mmc.h')
-rw-r--r-- | include/mmc.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/mmc.h b/include/mmc.h index 9fe6a87e88..988bf177d7 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -215,7 +215,10 @@ #define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */ #define EXT_CSD_DDR_BUS_WIDTH_4 5 /* Card is in 4 bit DDR mode */ #define EXT_CSD_DDR_BUS_WIDTH_8 6 /* Card is in 8 bit DDR mode */ +#define EXT_CSD_DDR_FLAG BIT(2) /* Flag for DDR mode */ +#define EXT_CSD_TIMING_LEGACY 0 /* no high speed */ +#define EXT_CSD_TIMING_HS 1 /* HS */ #define EXT_CSD_BOOT_ACK_ENABLE (1 << 6) #define EXT_CSD_BOOT_PARTITION_ENABLE (1 << 3) #define EXT_CSD_PARTITION_ACCESS_ENABLE (1 << 0) @@ -429,6 +432,14 @@ enum bus_mode { const char *mmc_mode_name(enum bus_mode mode); void mmc_dump_capabilities(const char *text, uint caps); +static inline bool mmc_is_mode_ddr(enum bus_mode mode) +{ + if ((mode == MMC_DDR_52) || (mode == UHS_DDR50)) + return true; + else + return false; +} + /* * With CONFIG_DM_MMC enabled, struct mmc can be accessed from the MMC device * with mmc_get_mmc_dev(). |