summaryrefslogtreecommitdiff
path: root/include/mmc.h
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2017-09-21 16:30:11 +0200
committerJaehoon Chung <jh80.chung@samsung.com>2018-01-12 18:11:04 +0900
commitbc1e3272ff3437f7cfc5e8bf1d1f2767f6d78262 (patch)
treec4a4aff53f61ae4733c23d643a0d85cf7ca3aa6b /include/mmc.h
parent83dc42271f79202b746bc9614817b41a6911c88f (diff)
mmc: use the right voltage level for MMC DDR and HS200 modes
HS200 only supports 1.2v and 1.8v signal voltages. DDR52 supports 3.3v/1.8v or 1.2v signal voltages. Select the lowest voltage available when using those modes. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Diffstat (limited to 'include/mmc.h')
-rw-r--r--include/mmc.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/mmc.h b/include/mmc.h
index a9ebc880cb..c11f69859e 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -311,11 +311,15 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx)
enum mmc_voltage {
MMC_SIGNAL_VOLTAGE_000 = 0,
- MMC_SIGNAL_VOLTAGE_120,
- MMC_SIGNAL_VOLTAGE_180,
- MMC_SIGNAL_VOLTAGE_330
+ MMC_SIGNAL_VOLTAGE_120 = 1,
+ MMC_SIGNAL_VOLTAGE_180 = 2,
+ MMC_SIGNAL_VOLTAGE_330 = 4,
};
+#define MMC_ALL_SIGNAL_VOLTAGE (MMC_SIGNAL_VOLTAGE_120 |\
+ MMC_SIGNAL_VOLTAGE_180 |\
+ MMC_SIGNAL_VOLTAGE_330)
+
/* Maximum block size for MMC */
#define MMC_MAX_BLOCK_LEN 512
@@ -588,6 +592,8 @@ struct mmc {
#endif
#endif
u8 *ext_csd;
+ u32 cardtype; /* cardtype read from the MMC */
+ enum mmc_voltage current_voltage;
enum bus_mode selected_mode; /* mode currently used */
enum bus_mode best_mode; /* best mode is the supported mode with the
* highest bandwidth. It may not always be the
@@ -647,6 +653,14 @@ int mmc_init(struct mmc *mmc);
int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size);
/**
+ * mmc_voltage_to_mv() - Convert a mmc_voltage in mV
+ *
+ * @voltage: The mmc_voltage to convert
+ * @return the value in mV if OK, -EINVAL on error (invalid mmc_voltage value)
+ */
+int mmc_voltage_to_mv(enum mmc_voltage voltage);
+
+/**
* mmc_set_clock() - change the bus clock
* @mmc: MMC struct
* @clock: bus frequency in Hz