mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Yann Sionneau <ysionneau@kalrayinc.com>, barebox@lists.infradead.org
Cc: Jonathan Borne <jborne@kalrayinc.com>,
	Julian Vetter <jvetter@kalrayinc.com>,
	Jules Maselbas <jmaselbas@zdiv.net>
Subject: Re: [PATCH 4/4] mci: dwcmshc-sdhci: add support for Kalray Coolidge v2 SoC eMMC controller
Date: Fri, 1 Mar 2024 08:49:53 +0100	[thread overview]
Message-ID: <f5bcdd23-c5e6-4c43-8936-410052837eb6@pengutronix.de> (raw)
In-Reply-To: <46562300-8056-95c5-da6e-af247efbe62f@kalrayinc.com>

Hello Yann,

On 29.02.24 17:31, Yann Sionneau wrote:
> On 2/29/24 17:19, Ahmad Fatoum wrote:
>> On 29.02.24 16:57, Yann Sionneau wrote:
>>> Kalray Coolidge v2 SoC eMMC controller needs static tx delay tuning even
>>> for basic standard or high speed modes.
>>> +struct dwcmshc_callbacks {
>>> +    void (*init)(struct mci_host *mci, struct device *dev);
>> Why is dev needed? There's already mci->hw_dev and mci->mci->dev
> 
> dev is not needed per se, but I thought that since the callback is used to extend dwcmshc_mci_init() called from generic code:
> 
> https://elixir.bootlin.com/barebox/latest/source/drivers/mci/mci-core.c#L2015
> 
> Then it would be a good idea to provide the same arguments.
> 
> But I can remove it.

No, I agree with your reasoning. No need to change it.

>>> +    void (*set_ios)(struct mci_host *mci, struct mci_ios *ios);
>> You don't actually use set_ios. But I assume you intend to add in future?
>> Maybe add it when it's actually needed?
> 
> Ok indeed it's for the future, in the future to support HS200/HS400 high speed modes
> 
> vendor specific tuning (tx/rx delay lines tuning) would take place in such callback.

I'd prefer you add it when it's needed.

> 
>>
>>> +static void dwcmshc_coolidgev2_init(struct mci_host *mci, struct device *dev)
>>> +{
>>> +    struct dwcmshc_host *host = priv_from_mci_host(mci);
>>> +
>>> +    // configure TX delay to set correct setup/hold for Coolidge V2
>> Nite: If you are going to send v2, please change into /* */ comments
>> for uniformity.
> Ok!

Thanks,
Ahmad

>>
>>
>> Cheers,
>> Ahmad
>>
>>> +    sdhci_write32(&host->sdhci,
>>> +              host->vendor_specific_area + DWCMSHC_GPIO_OUT,
>>> +              tx_delay_static_cfg(0xf) | tx_tuning_clk_sel(4));
>>> +}
>>> +
>>> +struct dwcmshc_callbacks kalray_coolidgev2_callbacks = {
>>> +    .init = dwcmshc_coolidgev2_init,
>>> +};
>>> +
>>>   static struct of_device_id dwcmshc_dt_ids[] = {
>>>       { .compatible = "snps,dwcmshc-sdhci", },
>>> +    { .compatible = "kalray,coolidge-v2-dwcmshc-sdhci", .data = &kalray_coolidgev2_callbacks },
>>>       { }
>>>   };
>>>   
> 
> 
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




  reply	other threads:[~2024-03-01  7:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 15:56 [PATCH 1/4] mci: dwcmshc-sdhci: Remove superfluous call to sdhci_enable_v4_mode Yann Sionneau
2024-02-29 15:56 ` [PATCH 2/4] mci: dwcmshc-sdhci: Fix f_max computation Yann Sionneau
2024-02-29 16:19   ` Ahmad Fatoum
2024-02-29 15:56 ` [PATCH 3/4] mci: sdhci: add register define for P_VENDOR_SPECIFIC_AREA Yann Sionneau
2024-02-29 15:57 ` [PATCH 4/4] mci: dwcmshc-sdhci: add support for Kalray Coolidge v2 SoC eMMC controller Yann Sionneau
2024-02-29 16:19   ` Ahmad Fatoum
2024-02-29 16:31     ` Yann Sionneau
2024-03-01  7:49       ` Ahmad Fatoum [this message]
2024-03-04  9:18 ` (subset) [PATCH 1/4] mci: dwcmshc-sdhci: Remove superfluous call to sdhci_enable_v4_mode Sascha Hauer

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=f5bcdd23-c5e6-4c43-8936-410052837eb6@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jborne@kalrayinc.com \
    --cc=jmaselbas@zdiv.net \
    --cc=jvetter@kalrayinc.com \
    --cc=ysionneau@kalrayinc.com \
    /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