diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-02-08 15:49:14 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-02-09 12:40:11 +0100 |
commit | 0f9892cce8792b2d44b07ba8431c2876290e1ac1 (patch) | |
tree | d4efdfdf3a4a10849e0abcbdedbe78b5c421f4af /include/mci.h | |
parent | 74b83f91198c8dd81ba3afac2b83f10723bd39b5 (diff) | |
download | barebox-0f9892cce8792b2d44b07ba8431c2876290e1ac1.tar.gz |
mci core: replace discrete ios values with struct ios
As we'll need more arguments to set_ios over time put them
in a struct mci_ios like the kernel does.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/mci.h')
-rw-r--r-- | include/mci.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/include/mci.h b/include/mci.h index 6d8468cc3e..3473aaaae5 100644 --- a/include/mci.h +++ b/include/mci.h @@ -168,6 +168,8 @@ #define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ #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 R1_ILLEGAL_COMMAND (1 << 22) #define R1_APP_CMD (1 << 5) @@ -217,6 +219,34 @@ struct mci_data { unsigned blocksize; /**< block size in bytes (mostly 512) */ }; +struct mci_ios { + unsigned int clock; /* clock rate */ + + unsigned char bus_width; /* data bus width */ + +#define MMC_BUS_WIDTH_1 0 +#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 + +#define MMC_SDR_MODE 0 +#define MMC_1_2V_DDR_MODE 1 +#define MMC_1_8V_DDR_MODE 2 +#define MMC_1_2V_SDR_MODE 3 +#define MMC_1_8V_SDR_MODE 4 +}; + /** host information */ struct mci_host { struct device_d *hw_dev; /**< the host MCI hardware device */ @@ -230,7 +260,7 @@ struct mci_host { /** init the host interface */ int (*init)(struct mci_host*, struct device_d*); /** change host interface settings */ - void (*set_ios)(struct mci_host*, struct device_d*, unsigned, unsigned); + void (*set_ios)(struct mci_host*, struct device_d*, struct mci_ios *); /** handle a command */ int (*send_cmd)(struct mci_host*, struct mci_cmd*, struct mci_data*); }; |