diff options
author | Arindam Nath <arindam.nath@amd.com> | 2011-05-05 02:48:59 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-05-24 23:53:24 -0400 |
commit | d6d50a15a2897d4133d536dd4343b5cf21163db3 (patch) | |
tree | b56723c1b3e74ae2ae9e9d7fb39e916cdfa74958 /include/linux/mmc | |
parent | 013909c4ffd16ded4895528b856fd8782df04dc6 (diff) |
mmc: sd: add support for driver type selection
This patch adds support for setting driver strength during UHS-I
initialization procedure. Since UHS-I cards set S18A (bit 24) in
response to ACMD41, we use this as a base for UHS-I initialization.
We modify the parameter list of mmc_sd_get_cid() so that we can
save the ROCR from ACMD41 to check whether bit 24 is set.
We decide whether the Host Controller supports A, C, or D driver
type depending on the Capabilities register. Driver type B is
suported by default. We then set the appropriate driver type for
the card using CMD6 mode 1. As per Host Controller spec v3.00, we
set driver type for the host only if Preset Value Enable in the
Host Control2 register is not set. SDHCI_HOST_CONTROL has been
renamed to SDHCI_HOST_CONTROL1 to conform to the spec.
Tested by Zhangfei Gao with a Toshiba uhs card and general hs card,
on mmp2 in SDMA mode.
Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Reviewed-by: Philip Rakity <prakity@marvell.com>
Tested-by: Philip Rakity <prakity@marvell.com>
Acked-by: Zhangfei Gao <zhangfei.gao@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'include/linux/mmc')
-rw-r--r-- | include/linux/mmc/card.h | 4 | ||||
-rw-r--r-- | include/linux/mmc/host.h | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 56f4d9234a66..539327260dc1 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -83,6 +83,10 @@ struct sd_switch_caps { | |||
83 | unsigned int hs_max_dtr; | 83 | unsigned int hs_max_dtr; |
84 | unsigned int sd3_bus_mode; | 84 | unsigned int sd3_bus_mode; |
85 | unsigned int sd3_drv_type; | 85 | unsigned int sd3_drv_type; |
86 | #define SD_DRIVER_TYPE_B 0x01 | ||
87 | #define SD_DRIVER_TYPE_A 0x02 | ||
88 | #define SD_DRIVER_TYPE_C 0x04 | ||
89 | #define SD_DRIVER_TYPE_D 0x08 | ||
86 | unsigned int sd3_curr_limit; | 90 | unsigned int sd3_curr_limit; |
87 | }; | 91 | }; |
88 | 92 | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index bde5a0b1c47e..949e4d525989 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -61,6 +61,13 @@ struct mmc_ios { | |||
61 | 61 | ||
62 | #define MMC_SIGNAL_VOLTAGE_330 0 | 62 | #define MMC_SIGNAL_VOLTAGE_330 0 |
63 | #define MMC_SIGNAL_VOLTAGE_180 1 | 63 | #define MMC_SIGNAL_VOLTAGE_180 1 |
64 | |||
65 | unsigned char drv_type; /* driver type (A, B, C, D) */ | ||
66 | |||
67 | #define MMC_SET_DRIVER_TYPE_B 0 | ||
68 | #define MMC_SET_DRIVER_TYPE_A 1 | ||
69 | #define MMC_SET_DRIVER_TYPE_C 2 | ||
70 | #define MMC_SET_DRIVER_TYPE_D 3 | ||
64 | }; | 71 | }; |
65 | 72 | ||
66 | struct mmc_host_ops { | 73 | struct mmc_host_ops { |
@@ -188,6 +195,9 @@ struct mmc_host { | |||
188 | #define MMC_CAP_SET_XPC_330 (1 << 20) /* Host supports >150mA current at 3.3V */ | 195 | #define MMC_CAP_SET_XPC_330 (1 << 20) /* Host supports >150mA current at 3.3V */ |
189 | #define MMC_CAP_SET_XPC_300 (1 << 21) /* Host supports >150mA current at 3.0V */ | 196 | #define MMC_CAP_SET_XPC_300 (1 << 21) /* Host supports >150mA current at 3.0V */ |
190 | #define MMC_CAP_SET_XPC_180 (1 << 22) /* Host supports >150mA current at 1.8V */ | 197 | #define MMC_CAP_SET_XPC_180 (1 << 22) /* Host supports >150mA current at 1.8V */ |
198 | #define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ | ||
199 | #define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ | ||
200 | #define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ | ||
191 | 201 | ||
192 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 202 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
193 | 203 | ||