• Arindam Nath's avatar
    mmc: sdhci: add support for retuning mode 1 · cf2b5eea
    Arindam Nath authored
    Host Controller v3.00 can support retuning modes 1,2 or 3 depending on
    the bits 46-47 of the Capabilities register. Also, the timer count for
    retuning is indicated by bits 40-43 of the same register. We initialize
    timer_list for retuning the first time we execute tuning procedure. This
    condition is indicated by SDHCI_NEEDS_RETUNING not being set. Since
    retuning mode 1 sets a limit of 4MB on the maximum data length, we set
    max_blk_count appropriately. Once the tuning timer expires, we set
    SDHCI_NEEDS_RETUNING flag, and if the flag is set, we execute tuning
    procedure before sending the next command. We need to restore mmc_request
    structure after executing retuning procedure since host->mrq is used
    inside the procedure to send CMD19. We also disable and re-enable this
    flag during suspend and resume respectively, as per the spec v3.00.
    
    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>
    cf2b5eea
sdhci.c 71 KB