[PATCH] mmc: dw_mmc: set host_caps mmc modes to equivalent and lower buswidth

Jaehoon Chung jh80.chung at samsung.com
Wed Mar 16 09:00:48 CET 2022


Hi,

On 3/8/22 08:18, Jan Havran wrote:
> dwmci_setup_cfg was clearing all modes except the mode equivalent to
> required bus width. Moreover, for buswidth = 1 was set the 4-bit mode.
> 
> This sets host caps to all modes from 1-bit up to the required mode.
> 
> Signed-off-by: Jan Havran <havran.jan at email.cz>
> ---
>  drivers/mmc/dw_mmc.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 4232c5eb8c..9c139140e4 100644
> --- a/drivers/mmc/dw_mmc.c
> +++ b/drivers/mmc/dw_mmc.c
> @@ -602,11 +602,13 @@ void dwmci_setup_cfg(struct mmc_config *cfg, struct dwmci_host *host,
>  	cfg->host_caps = host->caps;
>  
>  	if (host->buswidth == 8) {
> -		cfg->host_caps |= MMC_MODE_8BIT;
> -		cfg->host_caps &= ~MMC_MODE_4BIT;

I don't remember exactly. But when i had added this line, there was some issue.
I will check again. Thanks!

Best Regards,
Jaehoon Chung

> -	} else {
> -		cfg->host_caps |= MMC_MODE_4BIT;
> +		cfg->host_caps |= MMC_MODE_8BIT | MMC_MODE_4BIT | MMC_MODE_1BIT> +	} else if (host->buswidth == 4) {
>  		cfg->host_caps &= ~MMC_MODE_8BIT;
> +		cfg->host_caps |= MMC_MODE_4BIT | MMC_MODE_1BIT;
> +	} else {
> +		cfg->host_caps &= ~MMC_MODE_8BIT & ~MMC_MODE_4BIT;
> +		cfg->host_caps |= MMC_MODE_1BIT;
>  	}
>  	cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;
>  



More information about the U-Boot mailing list