[U-Boot] [PATCH] mmc/dwmmc: remove recursive FIFO threshold setup

Pantelis Antoniou panto at antoniou-consulting.com
Wed Nov 27 09:04:32 CET 2013


Hi Alexey,

On Nov 27, 2013, at 9:45 AM, Alexey Brodkin wrote:

> Hi Pantelis,
> 
> On Wed, 2013-11-27 at 09:21 +0200, Pantelis Antoniou wrote:
>> Hi Alexey,
>> 
>> On Nov 27, 2013, at 9:11 AM, Alexey Brodkin wrote:
>> 
> 
>> ATM if no host->fifoth_val value is provided the code will calculate one and write it.
>> Otherwise it will write the one configured.
> 
> Indeed. But what I faced - if you try to run U-Boot more than 1 time
> after powering up your board then this calculated value will be
> calculated improperly. And in my comment to the patch itself I described
> it.
> 
> So there're 2 options:
> 1. Re-implement calculation in such a way so it gets the same value on
> 2nd, 3rd and other U-Boot runs. Moreover it's not clear to me how this
> calculation is intended to work?
> 
> We take some initial value and then modify it - note it's not simply
> overrided with some value, but initial/default value is read from the
> register, then goes some math, and then we put new value back.
> 
> How do we know which value/configuration was by default so we do
> particular modifications later? What is a logic behind this?
> 

Indeed this is bogus. What is the reset value of the fifoth register?

Instead of reading the register, and doing the weird calculations, just
use the reset value of the register as if out of power on reset. 

> So why we need this functionality (unclear reconfiguration) if default
> register value works flawlessly in majority of cases and for some corner
> cases users may specify their custom value that will simply override
> default value.
> 

Beats me. Let's fix this properly.

>>> Still I have a couple of questions to you:
>>> 1. Why there's no example/instance of "host->fifoth_val" setup/usage in
>>> U-Boot source tree? If there was at least one I would leave
>>> "host->fifoth_val".
>>> 
>> 
>> I would guess it's because everyone uses the default setting of 0 which
>> results in a somewhat sane value.
> 
> Regards,
> Alexey

Regards

-- Pantelis



More information about the U-Boot mailing list