• Arindam Nath's avatar
    mmc: sd: add support for driver type selection · d6d50a15
    Arindam Nath authored
    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: default avatarArindam Nath <arindam.nath@amd.com>
    Reviewed-by: default avatarPhilip Rakity <prakity@marvell.com>
    Tested-by: default avatarPhilip Rakity <prakity@marvell.com>
    Acked-by: default avatarZhangfei Gao <zhangfei.gao@marvell.com>
    Signed-off-by: default avatarChris Ball <cjb@laptop.org>
    d6d50a15
sdio.c 17.4 KB