summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-02-12 15:14:30 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-02-14 08:47:41 +0100
commitd587d9d79aa4ce30f083c56f631df63fb8586ebe (patch)
tree6ff547f23b18ec11d00b07590f9e8e2ae2e38ee2 /include
parent6f474985ca1048e39d4f33ed373631136650a086 (diff)
downloadbarebox-d587d9d79aa4ce30f083c56f631df63fb8586ebe.tar.gz
barebox-d587d9d79aa4ce30f083c56f631df63fb8586ebe.tar.xz
mci: core: populate mci_ios.timing member
So far we passed an uninitialized timing member in the ios to the ->set_ios of the host controller drivers. To allow extension for new modes that need MCI host support beyond the usual clock rate change, make the member useful: - populate is with the correct value - add some type safety by using an enum - print it in the devinfo output Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/mci.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/include/mci.h b/include/mci.h
index a45d744761..57a4629d12 100644
--- a/include/mci.h
+++ b/include/mci.h
@@ -367,6 +367,18 @@ struct mci_data {
unsigned blocksize; /**< block size in bytes (mostly 512) */
};
+enum mci_timing {
+ MMC_TIMING_LEGACY = 0,
+ MMC_TIMING_MMC_HS = 1,
+ MMC_TIMING_SD_HS = 2,
+ MMC_TIMING_UHS_SDR12 = MMC_TIMING_LEGACY,
+ MMC_TIMING_UHS_SDR25 = MMC_TIMING_SD_HS,
+ MMC_TIMING_UHS_SDR50 = 3,
+ MMC_TIMING_UHS_SDR104 = 4,
+ MMC_TIMING_UHS_DDR50 = 5,
+ MMC_TIMING_MMC_HS200 = 6,
+};
+
struct mci_ios {
unsigned int clock; /* clock rate */
@@ -376,17 +388,7 @@ struct mci_ios {
#define MMC_BUS_WIDTH_4 2
#define MMC_BUS_WIDTH_8 3
- unsigned char timing; /* timing specification used */
-
-#define MMC_TIMING_LEGACY 0
-#define MMC_TIMING_MMC_HS 1
-#define MMC_TIMING_SD_HS 2
-#define MMC_TIMING_UHS_SDR12 MMC_TIMING_LEGACY
-#define MMC_TIMING_UHS_SDR25 MMC_TIMING_SD_HS
-#define MMC_TIMING_UHS_SDR50 3
-#define MMC_TIMING_UHS_SDR104 4
-#define MMC_TIMING_UHS_DDR50 5
-#define MMC_TIMING_MMC_HS200 6
+ enum mci_timing timing; /* timing specification used */
#define MMC_SDR_MODE 0
#define MMC_1_2V_DDR_MODE 1
@@ -408,6 +410,7 @@ struct mci_host {
unsigned f_max; /**< host interface upper limit */
unsigned clock; /**< Current clock used to talk to the card */
unsigned bus_width; /**< used data bus width to the card */
+ enum mci_timing timing; /**< used timing specification to the card */
unsigned max_req_size;
unsigned dsr_val; /**< optional dsr value */
int use_dsr; /**< optional dsr usage flag */