[PATCH 2/2] mmc: f_sdh30: Add support for F_SDH30_E51

Kunihiko Hayashi hayashi.kunihiko at socionext.com
Fri Sep 9 08:33:12 CEST 2022


Hi Jaehoon,
Thank you for checking.

On 2022/09/08 20:35, Jaehoon Chung wrote:
> 
> 
> On 9/6/22 09:39, Kunihiko Hayashi wrote:
>> Add Socionext F_SDH30_E51 IP support. The features of this IP includes
>> CMD/DAT line delay and force card insertion mode for non-removable cards.
>> And the IP needs to add some quirks.
>>
>> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko at socionext.com>
>> ---
>>   drivers/mmc/Kconfig   |  4 +--
>>   drivers/mmc/f_sdh30.c | 64 +++++++++++++++++++++++++++++++++++++++++--
>>   2 files changed, 64 insertions(+), 4 deletions(-)

(snip)

>> +static void f_sdh30_e51_init(struct udevice *dev)
>> +{
>> +	struct f_sdh30_plat *plat = dev_get_plat(dev);
>> +	struct sdhci_host *host = dev_get_priv(dev);
>> +	u32 val;
>> +
>> +	if (plat->enable_cmd_dat_delay) {
>> +		val = sdhci_readl(host, F_SDH30_ESD_CONTROL);
>> +		val |= F_SDH30_CMD_DAT_DELAY;
> 
> Is there a case to set its regardless of enable_cmd_dat_delay?
> 
> how about below?
> 
> if (plat->enable_cmd_dat_delay)
> 	val |= F_SDH30_CMD_DAT_DELAY;
> else
> 	val &= ~F_SDH30_CMD_DAT_DELAY;

Yes, I forgot the false case. Need to add it.

>> +		sdhci_writel(host, val, F_SDH30_ESD_CONTROL);
>> +	}
>> +
>> +	if (plat->cfg.host_caps & MMC_CAP_NONREMOVABLE) {
>> +		val = sdhci_readl(host, F_SDH30_TEST);
>> +		val |= F_SDH30_FORCE_CARD_INSERT;
> 
> Ditto.

I'll fix it too.

>> +		sdhci_writel(host, val, F_SDH30_TEST);
>> +	}
>> +}
>> +
>>   static int f_sdh30_sdhci_probe(struct udevice *dev)
>>   {
>>   	struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
>> @@ -25,6 +58,8 @@ static int f_sdh30_sdhci_probe(struct udevice *dev)
>>   	struct sdhci_host *host = dev_get_priv(dev);
>>   	int ret;
>>   
>> +	plat->data = (const struct f_sdh30_data *)dev_get_driver_data(dev);
>> +
>>   	ret = mmc_of_parse(dev, &plat->cfg);
>>   	if (ret)
>>   		return ret;
>> @@ -33,6 +68,9 @@ static int f_sdh30_sdhci_probe(struct udevice *dev)
>>   	host->mmc->dev = dev;
>>   	host->mmc->priv = host;
>>   
>> +	if (plat->data && plat->data->quirks)
>> +		host->quirks |= plat->data->quirks;
> 
> Doesn't need to use "|" ?

I thought there was some premise in "host", however, this is a private
structure allocated by calloc() before probing the driver.
I can remove "|".

Thank you,

---
Best Regards
Kunihiko Hayashi


More information about the U-Boot mailing list