[U-Boot] [PATCH v2 2/4] mmc: dump card and host capabilities if debug is enabled
Jean-Jacques Hiblot
jjhiblot at ti.com
Tue Nov 28 09:27:23 UTC 2017
On 27/11/2017 11:10, Jaehoon Chung wrote:
> Hi JJ,
>
> On 11/27/2017 06:59 PM, Jean-Jacques Hiblot wrote:
>> This is a useful information while debugging the initialization process or
>> performance issues.
>>
>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
>> Reviewed-by: Lukasz Majewski <lukma at denx.de>
>> ---
>>
>> no change since v1
>>
>> drivers/mmc/mmc.c | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
>> index a5a521e..a30b6a2 100644
>> --- a/drivers/mmc/mmc.c
>> +++ b/drivers/mmc/mmc.c
>> @@ -1502,6 +1502,10 @@ void mmc_dump_capabilities(const char *text, uint caps)
>> printf("%s, ", mmc_mode_name(mode));
>> printf("\b\b]\n");
>> }
>> +#else
>> +void mmc_dump_capabilities(const char *text, uint caps)
>> +{
>> +}
>> #endif
>>
>> struct mode_width_tuning {
>> @@ -1582,6 +1586,8 @@ static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps)
>> bool uhs_en = (mmc->ocr & OCR_S18R) ? true : false;
>> uint caps;
>>
>> + mmc_dump_capabilities("sd card", card_caps);
>> + mmc_dump_capabilities("host", mmc->host_caps | MMC_MODE_1BIT);
>>
>> /* Restrict card's capabilities by what the host can do */
>> caps = card_caps & (mmc->host_caps | MMC_MODE_1BIT);
>> @@ -1764,6 +1770,9 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps)
>> const struct mode_width_tuning *mwt;
>> const struct ext_csd_bus_width *ecbw;
>>
>> + mmc_dump_capabilities("mmc", card_caps);
>> + mmc_dump_capabilities("host", mmc->host_caps | MMC_MODE_1BIT);
>> +
> I'm not sure...but
> MMC_VERBOSE is enabled by default. So this dump message is always displayed.
Yes you're right. I'll fix that by printing it only if debug is enabled
Thanks
>
> Best Regards,
> Jaehoon Chung
>
>> /* Restrict card's capabilities by what the host can do */
>> card_caps &= (mmc->host_caps | MMC_MODE_1BIT);
>>
>>
>
More information about the U-Boot
mailing list