diff mbox

[U-Boot,4/6] mmc: fsl_esdhc: Add support to force VSELECT set

Message ID 1402879613-21362-4-git-send-email-otavio@ossystems.com.br
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Otavio Salvador June 16, 2014, 12:46 a.m. UTC
There are board were we cannot do voltage negotiation but want to set
the VSELECT bit forcely to ensure it to work at 1.8V.

This commit adds CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT flag for this use.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---

 drivers/mmc/fsl_esdhc.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Marek Vasut June 16, 2014, 12:51 a.m. UTC | #1
On Monday, June 16, 2014 at 02:46:51 AM, Otavio Salvador wrote:
> There are board were

Please fix your English and send a patch, thanks :)

> we cannot do voltage negotiation but want to set
> the VSELECT bit forcely to ensure it to work at 1.8V.
> 
> This commit adds CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT flag for this use.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> 
>  drivers/mmc/fsl_esdhc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> index c75b38f..b3870e2 100644
> --- a/drivers/mmc/fsl_esdhc.c
> +++ b/drivers/mmc/fsl_esdhc.c
> @@ -517,6 +517,10 @@ static int esdhc_init(struct mmc *mmc)
>  	/* Set timout to the maximum value */
>  	esdhc_clrsetbits32(&regs->sysctl, SYSCTL_TIMEOUT_MASK, 14 << 16);
> 
> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
> +	esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
> +#endif

Documentation is missing.

Best regards,
Marek Vasut
Otavio Salvador June 16, 2014, 1:22 a.m. UTC | #2
On Sun, Jun 15, 2014 at 9:51 PM, Marek Vasut <marex@denx.de> wrote:
> On Monday, June 16, 2014 at 02:46:51 AM, Otavio Salvador wrote:
>> There are board were
>
> Please fix your English and send a patch, thanks :)

I fixed the commit log, thanks.

...
>> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
>> +     esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
>> +#endif
>
> Documentation is missing.

There is no FSL ESDHC README file so that's why I didn't include it anywhere.
Marek Vasut June 16, 2014, 1:27 a.m. UTC | #3
On Monday, June 16, 2014 at 03:22:22 AM, Otavio Salvador wrote:

[...]

> >> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
> >> +     esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
> >> +#endif
> > 
> > Documentation is missing.
> 
> There is no FSL ESDHC README file so that's why I didn't include it
> anywhere.

I'm at loss for words here, really...

I think you know what needs to be done (hint: write the documentation), right ?

Best regards,
Marek Vasut
Otavio Salvador June 16, 2014, 1:39 a.m. UTC | #4
On Sun, Jun 15, 2014 at 10:27 PM, Marek Vasut <marex@denx.de> wrote:
> On Monday, June 16, 2014 at 03:22:22 AM, Otavio Salvador wrote:
>
> [...]
>
>> >> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
>> >> +     esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
>> >> +#endif
>> >
>> > Documentation is missing.
>>
>> There is no FSL ESDHC README file so that's why I didn't include it
>> anywhere.
>
> I'm at loss for words here, really...
>
> I think you know what needs to be done (hint: write the documentation), right ?

I won't write the full documentation for it. I am sorry.
Marek Vasut June 16, 2014, 2:03 a.m. UTC | #5
On Monday, June 16, 2014 at 03:39:08 AM, Otavio Salvador wrote:
> On Sun, Jun 15, 2014 at 10:27 PM, Marek Vasut <marex@denx.de> wrote:
> > On Monday, June 16, 2014 at 03:22:22 AM, Otavio Salvador wrote:
> > 
> > [...]
> > 
> >> >> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
> >> >> +     esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
> >> >> +#endif
> >> > 
> >> > Documentation is missing.
> >> 
> >> There is no FSL ESDHC README file so that's why I didn't include it
> >> anywhere.
> > 
> > I'm at loss for words here, really...
> > 
> > I think you know what needs to be done (hint: write the documentation),
> > right ?
> 
> I won't write the full documentation for it. I am sorry.

Undocumented configuration option is not acceptable, period.

Best regards,
Marek Vasut
Otavio Salvador June 16, 2014, 2:24 a.m. UTC | #6
On Sun, Jun 15, 2014 at 11:03 PM, Marek Vasut <marex@denx.de> wrote:
> On Monday, June 16, 2014 at 03:39:08 AM, Otavio Salvador wrote:
>> On Sun, Jun 15, 2014 at 10:27 PM, Marek Vasut <marex@denx.de> wrote:
>> > On Monday, June 16, 2014 at 03:22:22 AM, Otavio Salvador wrote:
>> >
>> > [...]
>> >
>> >> >> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
>> >> >> +     esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
>> >> >> +#endif
>> >> >
>> >> > Documentation is missing.
>> >>
>> >> There is no FSL ESDHC README file so that's why I didn't include it
>> >> anywhere.
>> >
>> > I'm at loss for words here, really...
>> >
>> > I think you know what needs to be done (hint: write the documentation),
>> > right ?
>>
>> I won't write the full documentation for it. I am sorry.
>
> Undocumented configuration option is not acceptable, period.

Who accepted the driver in the first version, without Doc?

I am not in the position to write the full doc.
Igor Grinberg June 16, 2014, 7:03 a.m. UTC | #7
Hi Otavio,

On 06/16/14 05:24, Otavio Salvador wrote:
> On Sun, Jun 15, 2014 at 11:03 PM, Marek Vasut <marex@denx.de> wrote:
>> On Monday, June 16, 2014 at 03:39:08 AM, Otavio Salvador wrote:
>>> On Sun, Jun 15, 2014 at 10:27 PM, Marek Vasut <marex@denx.de> wrote:
>>>> On Monday, June 16, 2014 at 03:22:22 AM, Otavio Salvador wrote:
>>>>
>>>> [...]
>>>>
>>>>>>> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
>>>>>>> +     esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
>>>>>>> +#endif
>>>>>>
>>>>>> Documentation is missing.
>>>>>
>>>>> There is no FSL ESDHC README file so that's why I didn't include it
>>>>> anywhere.
>>>>
>>>> I'm at loss for words here, really...
>>>>
>>>> I think you know what needs to be done (hint: write the documentation),
>>>> right ?
>>>
>>> I won't write the full documentation for it. I am sorry.
>>
>> Undocumented configuration option is not acceptable, period.
> 
> Who accepted the driver in the first version, without Doc?
> 
> I am not in the position to write the full doc.

I think there is a misunderstanding here...
I think Marek does not want to say that you need to write the full
documentation for the driver, but only document the CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT configuration option (what does it
do when you define it and why should one define it).
Otavio Salvador June 16, 2014, 11:48 a.m. UTC | #8
On Mon, Jun 16, 2014 at 4:03 AM, Igor Grinberg <grinberg@compulab.co.il> wrote:
> Hi Otavio,
>
> On 06/16/14 05:24, Otavio Salvador wrote:
>> On Sun, Jun 15, 2014 at 11:03 PM, Marek Vasut <marex@denx.de> wrote:
>>> On Monday, June 16, 2014 at 03:39:08 AM, Otavio Salvador wrote:
>>>> On Sun, Jun 15, 2014 at 10:27 PM, Marek Vasut <marex@denx.de> wrote:
>>>>> On Monday, June 16, 2014 at 03:22:22 AM, Otavio Salvador wrote:
>>>>>
>>>>> [...]
>>>>>
>>>>>>>> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
>>>>>>>> +     esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
>>>>>>>> +#endif
>>>>>>>
>>>>>>> Documentation is missing.
>>>>>>
>>>>>> There is no FSL ESDHC README file so that's why I didn't include it
>>>>>> anywhere.
>>>>>
>>>>> I'm at loss for words here, really...
>>>>>
>>>>> I think you know what needs to be done (hint: write the documentation),
>>>>> right ?
>>>>
>>>> I won't write the full documentation for it. I am sorry.
>>>
>>> Undocumented configuration option is not acceptable, period.
>>
>> Who accepted the driver in the first version, without Doc?
>>
>> I am not in the position to write the full doc.
>
> I think there is a misunderstanding here...
> I think Marek does not want to say that you need to write the full
> documentation for the driver, but only document the CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT configuration option (what does it
> do when you define it and why should one define it).

Great but where if it does not exist?

should I make a README.fsl-esdhc and include just it?
Marek Vasut June 17, 2014, 6 a.m. UTC | #9
On Monday, June 16, 2014 at 01:48:11 PM, Otavio Salvador wrote:
> On Mon, Jun 16, 2014 at 4:03 AM, Igor Grinberg <grinberg@compulab.co.il> 
wrote:
> > Hi Otavio,
> > 
> > On 06/16/14 05:24, Otavio Salvador wrote:
> >> On Sun, Jun 15, 2014 at 11:03 PM, Marek Vasut <marex@denx.de> wrote:
> >>> On Monday, June 16, 2014 at 03:39:08 AM, Otavio Salvador wrote:
> >>>> On Sun, Jun 15, 2014 at 10:27 PM, Marek Vasut <marex@denx.de> wrote:
> >>>>> On Monday, June 16, 2014 at 03:22:22 AM, Otavio Salvador wrote:
> >>>>> 
> >>>>> [...]
> >>>>> 
> >>>>>>>> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
> >>>>>>>> +     esdhc_setbits32(&regs->vendorspec,
> >>>>>>>> ESDHC_VENDORSPEC_VSELECT); +#endif
> >>>>>>> 
> >>>>>>> Documentation is missing.
> >>>>>> 
> >>>>>> There is no FSL ESDHC README file so that's why I didn't include it
> >>>>>> anywhere.
> >>>>> 
> >>>>> I'm at loss for words here, really...
> >>>>> 
> >>>>> I think you know what needs to be done (hint: write the
> >>>>> documentation), right ?
> >>>> 
> >>>> I won't write the full documentation for it. I am sorry.
> >>> 
> >>> Undocumented configuration option is not acceptable, period.
> >> 
> >> Who accepted the driver in the first version, without Doc?
> >> 
> >> I am not in the position to write the full doc.
> > 
> > I think there is a misunderstanding here...
> > I think Marek does not want to say that you need to write the full
> > documentation for the driver, but only document the
> > CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT configuration option (what does it do
> > when you define it and why should one define it).
> 
> Great but where if it does not exist?
> 
> should I make a README.fsl-esdhc and include just it?

I briefly looked over the options in the driver, prefixed with hash are the ones 
which are not driver specific:

CONFIG_ESDHC_DETECT_8_BIT_QUIRK
CONFIG_ESDHC_DETECT_QUIRK
CONFIG_FSL_ESDHC_PIN_MUX
CONFIG_FSL_USDHC
#CONFIG_MX53
#CONFIG_OF_LIBFDT
CONFIG_SYS_FSL_ERRATUM_ESDHC111
CONFIG_SYS_FSL_ERRATUM_ESDHC135
CONFIG_SYS_FSL_ERRATUM_ESDHC_A001
CONFIG_SYS_FSL_ESDHC_ADDR
CONFIG_SYS_FSL_ESDHC_USE_PIO
CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
#CONFIG_SYS_MMC_MAX_BLK_COUNT
#CONFIG_SYS_SD_VOLTAGE
#CONFIG_T4240QDS

It looks like completely ad-hoc addition of new and new config options as 
whoever seen fit to me, both from their names and git log of the driver. This 
makes the driver completely unmaintainable. I would like to see them documented 
before any new config options are added, so please instead of fighting the 
mailing list, spend 10 minutes of your time and document them.

Best regards,
Marek Vasut
Michael Nazzareno Trimarchi June 17, 2014, 6:06 a.m. UTC | #10
Hi Marek

Il 17/giu/2014 08:03 "Marek Vasut" <marex@denx.de> ha scritto:
>
> On Monday, June 16, 2014 at 01:48:11 PM, Otavio Salvador wrote:
> > On Mon, Jun 16, 2014 at 4:03 AM, Igor Grinberg <grinberg@compulab.co.il>
> wrote:
> > > Hi Otavio,
> > >
> > > On 06/16/14 05:24, Otavio Salvador wrote:
> > >> On Sun, Jun 15, 2014 at 11:03 PM, Marek Vasut <marex@denx.de> wrote:
> > >>> On Monday, June 16, 2014 at 03:39:08 AM, Otavio Salvador wrote:
> > >>>> On Sun, Jun 15, 2014 at 10:27 PM, Marek Vasut <marex@denx.de>
wrote:
> > >>>>> On Monday, June 16, 2014 at 03:22:22 AM, Otavio Salvador wrote:
> > >>>>>
> > >>>>> [...]
> > >>>>>
> > >>>>>>>> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
> > >>>>>>>> +     esdhc_setbits32(&regs->vendorspec,
> > >>>>>>>> ESDHC_VENDORSPEC_VSELECT); +#endif
> > >>>>>>>
> > >>>>>>> Documentation is missing.
> > >>>>>>
> > >>>>>> There is no FSL ESDHC README file so that's why I didn't include
it
> > >>>>>> anywhere.
> > >>>>>
> > >>>>> I'm at loss for words here, really...
> > >>>>>
> > >>>>> I think you know what needs to be done (hint: write the
> > >>>>> documentation), right ?
> > >>>>
> > >>>> I won't write the full documentation for it. I am sorry.
> > >>>
> > >>> Undocumented configuration option is not acceptable, period.
> > >>
> > >> Who accepted the driver in the first version, without Doc?
> > >>
> > >> I am not in the position to write the full doc.
> > >
> > > I think there is a misunderstanding here...
> > > I think Marek does not want to say that you need to write the full
> > > documentation for the driver, but only document the
> > > CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT configuration option (what does it
do
> > > when you define it and why should one define it).
> >
> > Great but where if it does not exist?
> >
> > should I make a README.fsl-esdhc and include just it?
>
> I briefly looked over the options in the driver, prefixed with hash are
the ones
> which are not driver specific:
>
> CONFIG_ESDHC_DETECT_8_BIT_QUIRK
> CONFIG_ESDHC_DETECT_QUIRK
> CONFIG_FSL_ESDHC_PIN_MUX
> CONFIG_FSL_USDHC
> #CONFIG_MX53
> #CONFIG_OF_LIBFDT
> CONFIG_SYS_FSL_ERRATUM_ESDHC111
> CONFIG_SYS_FSL_ERRATUM_ESDHC135
> CONFIG_SYS_FSL_ERRATUM_ESDHC_A001
> CONFIG_SYS_FSL_ESDHC_ADDR
> CONFIG_SYS_FSL_ESDHC_USE_PIO
> CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
> #CONFIG_SYS_MMC_MAX_BLK_COUNT
> #CONFIG_SYS_SD_VOLTAGE
> #CONFIG_T4240QDS
>
> It looks like completely ad-hoc addition of new and new config options as
> whoever seen fit to me, both from their names and git log of the driver.
This
> makes the driver completely unmaintainable. I would like to see them
documented

Do you think that could be a better option to use flags and runtime detect
instead having hundred of define?

Michael

> before any new config options are added, so please instead of fighting the
> mailing list, spend 10 minutes of your time and document them.
>
> Best regards,
> Marek Vasut
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Igor Grinberg June 17, 2014, 6:42 a.m. UTC | #11
Hi Otavio,

On 06/16/14 14:48, Otavio Salvador wrote:
> On Mon, Jun 16, 2014 at 4:03 AM, Igor Grinberg <grinberg@compulab.co.il> wrote:
>> Hi Otavio,
>>
>> On 06/16/14 05:24, Otavio Salvador wrote:
>>> On Sun, Jun 15, 2014 at 11:03 PM, Marek Vasut <marex@denx.de> wrote:
>>>> On Monday, June 16, 2014 at 03:39:08 AM, Otavio Salvador wrote:
>>>>> On Sun, Jun 15, 2014 at 10:27 PM, Marek Vasut <marex@denx.de> wrote:
>>>>>> On Monday, June 16, 2014 at 03:22:22 AM, Otavio Salvador wrote:
>>>>>>
>>>>>> [...]
>>>>>>
>>>>>>>>> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
>>>>>>>>> +     esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
>>>>>>>>> +#endif
>>>>>>>>
>>>>>>>> Documentation is missing.
>>>>>>>
>>>>>>> There is no FSL ESDHC README file so that's why I didn't include it
>>>>>>> anywhere.
>>>>>>
>>>>>> I'm at loss for words here, really...
>>>>>>
>>>>>> I think you know what needs to be done (hint: write the documentation),
>>>>>> right ?
>>>>>
>>>>> I won't write the full documentation for it. I am sorry.
>>>>
>>>> Undocumented configuration option is not acceptable, period.
>>>
>>> Who accepted the driver in the first version, without Doc?
>>>
>>> I am not in the position to write the full doc.
>>
>> I think there is a misunderstanding here...
>> I think Marek does not want to say that you need to write the full
>> documentation for the driver, but only document the CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT configuration option (what does it
>> do when you define it and why should one define it).
> 
> Great but where if it does not exist?
> 
> should I make a README.fsl-esdhc and include just it?

Hmmm... May be.
I would make a decision and start something, then send an RFC.
Writing some words should not be hard especially for configuration
options that you introduce yourself, but if you find some stuff
currently hard or time consuming for some reason, a "TODO: ..."
might be an acceptable compromise.
Stefano Babic June 17, 2014, 3:11 p.m. UTC | #12
Hi Otavio,

On 16/06/2014 02:46, Otavio Salvador wrote:
> There are board were we cannot do voltage negotiation but want to set
> the VSELECT bit forcely to ensure it to work at 1.8V.
> 
> This commit adds CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT flag for this use.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> 
>  drivers/mmc/fsl_esdhc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> index c75b38f..b3870e2 100644
> --- a/drivers/mmc/fsl_esdhc.c
> +++ b/drivers/mmc/fsl_esdhc.c
> @@ -517,6 +517,10 @@ static int esdhc_init(struct mmc *mmc)
>  	/* Set timout to the maximum value */
>  	esdhc_clrsetbits32(&regs->sysctl, SYSCTL_TIMEOUT_MASK, 14 << 16);
>  
> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
> +	esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
> +#endif

Instead of adding a new compiler switch that should be documented (I
have already read Marek's comments), what do you think to extend struct
fsl_esdhc_cfg, putting for exmaple an "options" field with this kind of
specialization ?

I see also a CONFIG_SYS_FSL_ESDHC_USE_PIO that slipped into mainline
(you are both right : Otavio is not the first to add such kind of
configuration switches that are still undocumented, but according to
rules should be documented as Marek said).

I would suggest to get rid as much as possible with these CONFIG_
switches. If we have some specialization for this driver before calling
esdhc_init (better: fsl_esdhc_initialize), they are self explaining and
we do not need further documentation. What do you think ?

Best regards,
Stefano
Otavio Salvador June 17, 2014, 3:12 p.m. UTC | #13
On Tue, Jun 17, 2014 at 12:11 PM, Stefano Babic <sbabic@denx.de> wrote:
> On 16/06/2014 02:46, Otavio Salvador wrote:
>> There are board were we cannot do voltage negotiation but want to set
>> the VSELECT bit forcely to ensure it to work at 1.8V.
>>
>> This commit adds CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT flag for this use.
>>
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>>
>>  drivers/mmc/fsl_esdhc.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
>> index c75b38f..b3870e2 100644
>> --- a/drivers/mmc/fsl_esdhc.c
>> +++ b/drivers/mmc/fsl_esdhc.c
>> @@ -517,6 +517,10 @@ static int esdhc_init(struct mmc *mmc)
>>       /* Set timout to the maximum value */
>>       esdhc_clrsetbits32(&regs->sysctl, SYSCTL_TIMEOUT_MASK, 14 << 16);
>>
>> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
>> +     esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
>> +#endif
>
> Instead of adding a new compiler switch that should be documented (I
> have already read Marek's comments), what do you think to extend struct
> fsl_esdhc_cfg, putting for exmaple an "options" field with this kind of
> specialization ?

I will try to cook something in this direction.
Michael Nazzareno Trimarchi June 17, 2014, 3:14 p.m. UTC | #14
Hi Stefano

On Tue, Jun 17, 2014 at 5:12 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> On Tue, Jun 17, 2014 at 12:11 PM, Stefano Babic <sbabic@denx.de> wrote:
>> On 16/06/2014 02:46, Otavio Salvador wrote:
>>> There are board were we cannot do voltage negotiation but want to set
>>> the VSELECT bit forcely to ensure it to work at 1.8V.
>>>
>>> This commit adds CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT flag for this use.
>>>
>>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>>> ---
>>>
>>>  drivers/mmc/fsl_esdhc.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
>>> index c75b38f..b3870e2 100644
>>> --- a/drivers/mmc/fsl_esdhc.c
>>> +++ b/drivers/mmc/fsl_esdhc.c
>>> @@ -517,6 +517,10 @@ static int esdhc_init(struct mmc *mmc)
>>>       /* Set timout to the maximum value */
>>>       esdhc_clrsetbits32(&regs->sysctl, SYSCTL_TIMEOUT_MASK, 14 << 16);
>>>
>>> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
>>> +     esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
>>> +#endif
>>
>> Instead of adding a new compiler switch that should be documented (I
>> have already read Marek's comments), what do you think to extend struct
>> fsl_esdhc_cfg, putting for exmaple an "options" field with this kind of
>> specialization ?
>
> I will try to cook something in this direction.
>

Well I already said some emails ago ;).

Michael

> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://code.ossystems.com.br
> Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Stefano Babic June 17, 2014, 3:19 p.m. UTC | #15
Hi Michael,

On 17/06/2014 17:14, Michael Trimarchi wrote:

>>> Instead of adding a new compiler switch that should be documented (I
>>> have already read Marek's comments), what do you think to extend struct
>>> fsl_esdhc_cfg, putting for exmaple an "options" field with this kind of
>>> specialization ?
>>
>> I will try to cook something in this direction.
>>
> 
> Well I already said some emails ago ;).

Nice I am not alone to think it in this way :-). Sorry, I have not read
your answer, I was dropped from the CC list and I missed that you have
already said the same.

Best regards,
Stefano
Marek Vasut June 17, 2014, 3:49 p.m. UTC | #16
On Tuesday, June 17, 2014 at 08:06:38 AM, Michael Trimarchi wrote:
> Hi Marek
> 
> Il 17/giu/2014 08:03 "Marek Vasut" <marex@denx.de> ha scritto:
> > On Monday, June 16, 2014 at 01:48:11 PM, Otavio Salvador wrote:
> > > On Mon, Jun 16, 2014 at 4:03 AM, Igor Grinberg
> > > <grinberg@compulab.co.il>
> > 
> > wrote:
> > > > Hi Otavio,
> > > > 
> > > > On 06/16/14 05:24, Otavio Salvador wrote:
> > > >> On Sun, Jun 15, 2014 at 11:03 PM, Marek Vasut <marex@denx.de> wrote:
> > > >>> On Monday, June 16, 2014 at 03:39:08 AM, Otavio Salvador wrote:
> > > >>>> On Sun, Jun 15, 2014 at 10:27 PM, Marek Vasut <marex@denx.de>
> 
> wrote:
> > > >>>>> On Monday, June 16, 2014 at 03:22:22 AM, Otavio Salvador wrote:
> > > >>>>> 
> > > >>>>> [...]
> > > >>>>> 
> > > >>>>>>>> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
> > > >>>>>>>> +     esdhc_setbits32(&regs->vendorspec,
> > > >>>>>>>> ESDHC_VENDORSPEC_VSELECT); +#endif
> > > >>>>>>> 
> > > >>>>>>> Documentation is missing.
> > > >>>>>> 
> > > >>>>>> There is no FSL ESDHC README file so that's why I didn't include
> 
> it
> 
> > > >>>>>> anywhere.
> > > >>>>> 
> > > >>>>> I'm at loss for words here, really...
> > > >>>>> 
> > > >>>>> I think you know what needs to be done (hint: write the
> > > >>>>> documentation), right ?
> > > >>>> 
> > > >>>> I won't write the full documentation for it. I am sorry.
> > > >>> 
> > > >>> Undocumented configuration option is not acceptable, period.
> > > >> 
> > > >> Who accepted the driver in the first version, without Doc?
> > > >> 
> > > >> I am not in the position to write the full doc.
> > > > 
> > > > I think there is a misunderstanding here...
> > > > I think Marek does not want to say that you need to write the full
> > > > documentation for the driver, but only document the
> > > > CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT configuration option (what does it
> 
> do
> 
> > > > when you define it and why should one define it).
> > > 
> > > Great but where if it does not exist?
> > > 
> > > should I make a README.fsl-esdhc and include just it?
> > 
> > I briefly looked over the options in the driver, prefixed with hash are
> 
> the ones
> 
> > which are not driver specific:
> > 
> > CONFIG_ESDHC_DETECT_8_BIT_QUIRK
> > CONFIG_ESDHC_DETECT_QUIRK
> > CONFIG_FSL_ESDHC_PIN_MUX
> > CONFIG_FSL_USDHC
> > #CONFIG_MX53
> > #CONFIG_OF_LIBFDT
> > CONFIG_SYS_FSL_ERRATUM_ESDHC111
> > CONFIG_SYS_FSL_ERRATUM_ESDHC135
> > CONFIG_SYS_FSL_ERRATUM_ESDHC_A001
> > CONFIG_SYS_FSL_ESDHC_ADDR
> > CONFIG_SYS_FSL_ESDHC_USE_PIO
> > CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
> > #CONFIG_SYS_MMC_MAX_BLK_COUNT
> > #CONFIG_SYS_SD_VOLTAGE
> > #CONFIG_T4240QDS
> > 
> > It looks like completely ad-hoc addition of new and new config options as
> > whoever seen fit to me, both from their names and git log of the driver.
> 
> This
> 
> > makes the driver completely unmaintainable. I would like to see them
> 
> documented
> 
> Do you think that could be a better option to use flags and runtime detect
> instead having hundred of define?

Eventually, when we transition to DT, this will be indeed needed anyway. But 
before that, we need to understand what those flags do (which we don't because 
previous patches neglected adding proper documentation).
Michael Nazzareno Trimarchi June 17, 2014, 4 p.m. UTC | #17
Hi

On Tue, Jun 17, 2014 at 5:49 PM, Marek Vasut <marex@denx.de> wrote:
> On Tuesday, June 17, 2014 at 08:06:38 AM, Michael Trimarchi wrote:
>> Hi Marek
>>
>> Il 17/giu/2014 08:03 "Marek Vasut" <marex@denx.de> ha scritto:
>> > On Monday, June 16, 2014 at 01:48:11 PM, Otavio Salvador wrote:
>> > > On Mon, Jun 16, 2014 at 4:03 AM, Igor Grinberg
>> > > <grinberg@compulab.co.il>
>> >
>> > wrote:
>> > > > Hi Otavio,
>> > > >
>> > > > On 06/16/14 05:24, Otavio Salvador wrote:
>> > > >> On Sun, Jun 15, 2014 at 11:03 PM, Marek Vasut <marex@denx.de> wrote:
>> > > >>> On Monday, June 16, 2014 at 03:39:08 AM, Otavio Salvador wrote:
>> > > >>>> On Sun, Jun 15, 2014 at 10:27 PM, Marek Vasut <marex@denx.de>
>>
>> wrote:
>> > > >>>>> On Monday, June 16, 2014 at 03:22:22 AM, Otavio Salvador wrote:
>> > > >>>>>
>> > > >>>>> [...]
>> > > >>>>>
>> > > >>>>>>>> +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
>> > > >>>>>>>> +     esdhc_setbits32(&regs->vendorspec,
>> > > >>>>>>>> ESDHC_VENDORSPEC_VSELECT); +#endif
>> > > >>>>>>>
>> > > >>>>>>> Documentation is missing.
>> > > >>>>>>
>> > > >>>>>> There is no FSL ESDHC README file so that's why I didn't include
>>
>> it
>>
>> > > >>>>>> anywhere.
>> > > >>>>>
>> > > >>>>> I'm at loss for words here, really...
>> > > >>>>>
>> > > >>>>> I think you know what needs to be done (hint: write the
>> > > >>>>> documentation), right ?
>> > > >>>>
>> > > >>>> I won't write the full documentation for it. I am sorry.
>> > > >>>
>> > > >>> Undocumented configuration option is not acceptable, period.
>> > > >>
>> > > >> Who accepted the driver in the first version, without Doc?
>> > > >>
>> > > >> I am not in the position to write the full doc.
>> > > >
>> > > > I think there is a misunderstanding here...
>> > > > I think Marek does not want to say that you need to write the full
>> > > > documentation for the driver, but only document the
>> > > > CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT configuration option (what does it
>>
>> do
>>
>> > > > when you define it and why should one define it).
>> > >
>> > > Great but where if it does not exist?
>> > >
>> > > should I make a README.fsl-esdhc and include just it?
>> >
>> > I briefly looked over the options in the driver, prefixed with hash are
>>
>> the ones
>>
>> > which are not driver specific:
>> >
>> > CONFIG_ESDHC_DETECT_8_BIT_QUIRK
>> > CONFIG_ESDHC_DETECT_QUIRK
>> > CONFIG_FSL_ESDHC_PIN_MUX
>> > CONFIG_FSL_USDHC
>> > #CONFIG_MX53
>> > #CONFIG_OF_LIBFDT
>> > CONFIG_SYS_FSL_ERRATUM_ESDHC111
>> > CONFIG_SYS_FSL_ERRATUM_ESDHC135
>> > CONFIG_SYS_FSL_ERRATUM_ESDHC_A001
>> > CONFIG_SYS_FSL_ESDHC_ADDR
>> > CONFIG_SYS_FSL_ESDHC_USE_PIO
>> > CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
>> > #CONFIG_SYS_MMC_MAX_BLK_COUNT
>> > #CONFIG_SYS_SD_VOLTAGE
>> > #CONFIG_T4240QDS
>> >
>> > It looks like completely ad-hoc addition of new and new config options as
>> > whoever seen fit to me, both from their names and git log of the driver.
>>
>> This
>>
>> > makes the driver completely unmaintainable. I would like to see them
>>
>> documented
>>
>> Do you think that could be a better option to use flags and runtime detect
>> instead having hundred of define?
>
> Eventually, when we transition to DT, this will be indeed needed anyway. But
> before that, we need to understand what those flags do (which we don't because
> previous patches neglected adding proper documentation).

I suggest as Stefano said to add this option/flags now in preparation
of DT transition
and start to document flags as you said.

Michael
diff mbox

Patch

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index c75b38f..b3870e2 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -517,6 +517,10 @@  static int esdhc_init(struct mmc *mmc)
 	/* Set timout to the maximum value */
 	esdhc_clrsetbits32(&regs->sysctl, SYSCTL_TIMEOUT_MASK, 14 << 16);
 
+#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
+	esdhc_setbits32(&regs->vendorspec, ESDHC_VENDORSPEC_VSELECT);
+#endif
+
 	return 0;
 }