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

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:
- 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:
- 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

Hi Pantelis,
Indeed this is bogus. What is the reset value of the fifoth register?
Below is a description for the register in question with default
values specified. ---------------------------------------------- FIFO Threshold Watermark Register ---------------------------------------------- x - reserved 000 - Burst size of multiple transaction yyyyyyyyyyy - Rx watermark = (FIFO_DEPTH - 1) xxxx - reserved 000000000000 - Tx watermark ----------------------------------------------
Also databook says: ---------------------------------------------- During end of packet, request is generated regardless of threshold programming in order to complete any remaining data. ---------------------------------------------- So it's safe to leave watermark = 0.
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.
In other words both Rx and Tx watermarks should be sane for usage as they are on power-on.
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.
So I'll submit v2 shortly.
-Alexey
participants (2)
-
Alexey Brodkin
-
Pantelis Antoniou