public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Gérald Kerma" <gerald@gk2.net>
To: u-boot@lists.denx.de
Subject: [PATCH] mmc: xenon_sdhci: Add missing common host capabilities
Date: Fri, 11 Sep 2020 14:51:35 +0200	[thread overview]
Message-ID: <9ba63550-decb-399c-e125-8580c55f98c6@gk2.net> (raw)
In-Reply-To: <20200911143836.20713459@dellmb.labs.office.nic.cz>


Le 11/09/2020 ? 14:38, Marek Beh?n a ?crit?:
> On Thu, 10 Sep 2020 19:53:40 +0200
> Andre Heider <a.heider@gmail.com> wrote:
>
>> Use mmc_of_parse() to set the common host properties. That includes
>> "bus-width", so parsing it can be removed from the driver.
>>
>> But more importantly, "non-removable" is now respected, which fixes
>> the usage of eMMC.
>>
>> Signed-off-by: Andre Heider <a.heider@gmail.com>
>> ---
>>
>> Tested myself on v5 without emmc, `mmc info` is unchanged for my sd
>> card
>>
>> Tested by G?rald on v7 emmc, which started working with this patch:
>> => mmc info
>> Device: sdhci at d8000
>> Manufacturer ID: 45
>> OEM: 100
>> Name: SEM04
>> Bus Speed: 52000000
>> Mode: MMC High Speed (52MHz)
>> Rd Block Len: 512
>> MMC version 4.5
>> High Capacity: Yes
>> Capacity: 3.7 GiB
>> Bus Width: 8-bit
>> Erase Group Size: 256 KiB
>> HC WP Group Size: 8 MiB
>> User Capacity: 3.7 GiB WRREL
>> Boot Capacity: 2 MiB
>> RPMB Capacity: 2 MiB
>> Boot area 0 is not write protected
>> Boot area 1 is not write protected
>>
>>   drivers/mmc/xenon_sdhci.c | 18 ++++--------------
>>   1 file changed, 4 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c
>> index 7f9a579c83..6ce9d00d0a 100644
>> --- a/drivers/mmc/xenon_sdhci.c
>> +++ b/drivers/mmc/xenon_sdhci.c
>> @@ -485,20 +485,10 @@ static int xenon_sdhci_probe(struct udevice
>> *dev) armada_3700_soc_pad_voltage_set(host);
>>   
>>   	host->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz |
>> MMC_MODE_DDR_52MHz;
>> -	switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
>> "bus-width",
>> -		1)) {
>> -	case 8:
>> -		host->host_caps |= MMC_MODE_8BIT;
>> -		break;
>> -	case 4:
>> -		host->host_caps |= MMC_MODE_4BIT;
>> -		break;
>> -	case 1:
>> -		break;
>> -	default:
>> -		printf("Invalid \"bus-width\" value\n");
>> -		return -EINVAL;
>> -	}
>> +
>> +	ret = mmc_of_parse(dev, &plat->cfg);
>> +	if (ret)
>> +		return ret;
>>   
>>   	host->ops = &xenon_sdhci_ops;
>>   
> Tested-by: Marek Beh?n <marek.behun@nic.cz>
|Tested-by: G?rald Kerma <gandalf@gk2.net>| ||

      reply	other threads:[~2020-09-11 12:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10 17:53 [PATCH] mmc: xenon_sdhci: Add missing common host capabilities Andre Heider
2020-09-10 18:19 ` [EXT] " Kostya Porotchkin
2020-09-10 19:04 ` Pali Rohár
2020-09-11  6:43   ` Stefan Roese
2020-09-11  8:37     ` Andre Heider
2020-09-11 12:09       ` Marek Behún
2020-09-11 12:21         ` Stefan Roese
2020-09-11 12:30           ` Marek Behún
2020-09-11 15:54           ` Andre Heider
2020-09-11 12:38 ` Marek Behún
2020-09-11 12:51   ` Gérald Kerma [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ba63550-decb-399c-e125-8580c55f98c6@gk2.net \
    --to=gerald@gk2.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox