All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] DDR training code for Armada 38x
@ 2017-09-19 18:58 Chris Packham
  2017-09-20  5:31 ` Stefan Roese
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Packham @ 2017-09-19 18:58 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

When you did the port from Marvell's source did you script any of the
tidy-up that you did along the way?

I'm running up a new board and with the upstream u-boot DDR training
occasionally fails. But with the Marvell bootloader it doesn't fail.
The initial port was done from TIP-1.29 but Marvell are now up to
TIP-1.55 so there is probably some difference that results in my board
working.

One difference I've spotted so far is that Marvell enable 2T timing
mode for all Armada 38x boards (the comment says "resolve low freq
instability"). But doing that doesn't magically make my board work.
I'm thinking I need to compare TIP-1.29 with TIP-1.55 to look for
other differences but obviously that's going to be hard given the
style changes. If you have any scripts (or even just a record of the
regexes) that you used would you be able to share them?

Thanks,
Chris

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] DDR training code for Armada 38x
  2017-09-19 18:58 [U-Boot] DDR training code for Armada 38x Chris Packham
@ 2017-09-20  5:31 ` Stefan Roese
  2017-09-21  4:25   ` Chris Packham
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Roese @ 2017-09-20  5:31 UTC (permalink / raw)
  To: u-boot

Hi Chris,

On 19.09.2017 20:58, Chris Packham wrote:
> When you did the port from Marvell's source did you script any of the
> tidy-up that you did along the way?

Not really. At least not in a reproducible way. I spent long
hours running Lindent, recursive-replace tools and especially
manual code inspection and re-formatting on this huge code.
Still the outcome is far from perfect, but hopefully better
that the original version.

> I'm running up a new board and with the upstream u-boot DDR training
> occasionally fails. But with the Marvell bootloader it doesn't fail.
> The initial port was done from TIP-1.29 but Marvell are now up to
> TIP-1.55 so there is probably some difference that results in my board
> working.
> 
> One difference I've spotted so far is that Marvell enable 2T timing
> mode for all Armada 38x boards (the comment says "resolve low freq
> instability"). But doing that doesn't magically make my board work.

Did you compare all DDR register values (the "good" ones and the "bad"
ones) and only the the 2T timing is different?

> I'm thinking I need to compare TIP-1.29 with TIP-1.55 to look for
> other differences but obviously that's going to be hard given the
> style changes.

Has the style changed in between the Marvell versions as well? I
have not looked into this code for quite some time.

> If you have any scripts (or even just a record of the
> regexes) that you used would you be able to share them?

Please find some scripts attached, I've located that I have used while
doing this porting.

Thanks,
Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: replace-recursive.sh
Type: application/x-sh
Size: 265 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170920/18c3e060/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: replace-common-marvell-stuff.sh
Type: application/x-sh
Size: 839 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170920/18c3e060/attachment-0001.sh>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] DDR training code for Armada 38x
  2017-09-20  5:31 ` Stefan Roese
@ 2017-09-21  4:25   ` Chris Packham
  2017-09-25 22:29     ` Chris Packham
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Packham @ 2017-09-21  4:25 UTC (permalink / raw)
  To: u-boot

On Wed, Sep 20, 2017 at 5:31 PM, Stefan Roese <sr@denx.de> wrote:
> Hi Chris,
>
> On 19.09.2017 20:58, Chris Packham wrote:
>>
>> When you did the port from Marvell's source did you script any of the
>> tidy-up that you did along the way?
>
>
> Not really. At least not in a reproducible way. I spent long
> hours running Lindent, recursive-replace tools and especially
> manual code inspection and re-formatting on this huge code.
> Still the outcome is far from perfect, but hopefully better
> that the original version.
>
>> I'm running up a new board and with the upstream u-boot DDR training
>> occasionally fails. But with the Marvell bootloader it doesn't fail.
>> The initial port was done from TIP-1.29 but Marvell are now up to
>> TIP-1.55 so there is probably some difference that results in my board
>> working.
>>
>> One difference I've spotted so far is that Marvell enable 2T timing
>> mode for all Armada 38x boards (the comment says "resolve low freq
>> instability"). But doing that doesn't magically make my board work.
>
>
> Did you compare all DDR register values (the "good" ones and the "bad"
> ones) and only the the 2T timing is different?
>

There are more differences. 2T was the one that stuckout. As you know
working backwards from register values to where the code sets them can
be tricky with this code.

>> I'm thinking I need to compare TIP-1.29 with TIP-1.55 to look for
>> other differences but obviously that's going to be hard given the
>> style changes.
>
>
> Has the style changed in between the Marvell versions as well? I
> have not looked into this code for quite some time.
>

What I meant was u-boot has 1.29 and I have 1.55 from Marvell. The
oldest Marvell version I have is 1.34 which helped me find the 2T
thing. I'm wondering what differences exist between 1.29 and 1.34.
1.55 also has support for some newer integrated switch+CPU chips so it
is a little hard to separate those bits from the A38X code.

>> If you have any scripts (or even just a record of the
>> regexes) that you used would you be able to share them?
>
>
> Please find some scripts attached, I've located that I have used while
> doing this porting.

Thanks. That's a start at least.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] DDR training code for Armada 38x
  2017-09-21  4:25   ` Chris Packham
@ 2017-09-25 22:29     ` Chris Packham
  2017-09-26  5:10       ` Stefan Roese
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Packham @ 2017-09-25 22:29 UTC (permalink / raw)
  To: u-boot

For the internet historians,

On Thu, Sep 21, 2017 at 4:25 PM, Chris Packham <judge.packham@gmail.com> wrote:
> On Wed, Sep 20, 2017 at 5:31 PM, Stefan Roese <sr@denx.de> wrote:
>> Hi Chris,
>>
>> On 19.09.2017 20:58, Chris Packham wrote:
>>>
>>> When you did the port from Marvell's source did you script any of the
>>> tidy-up that you did along the way?
>>
>>
>> Not really. At least not in a reproducible way. I spent long
>> hours running Lindent, recursive-replace tools and especially
>> manual code inspection and re-formatting on this huge code.
>> Still the outcome is far from perfect, but hopefully better
>> that the original version.
>>
>>> I'm running up a new board and with the upstream u-boot DDR training
>>> occasionally fails. But with the Marvell bootloader it doesn't fail.
>>> The initial port was done from TIP-1.29 but Marvell are now up to
>>> TIP-1.55 so there is probably some difference that results in my board
>>> working.
>>>
>>> One difference I've spotted so far is that Marvell enable 2T timing
>>> mode for all Armada 38x boards (the comment says "resolve low freq
>>> instability"). But doing that doesn't magically make my board work.
>>
>>
>> Did you compare all DDR register values (the "good" ones and the "bad"
>> ones) and only the the 2T timing is different?
>>
>
> There are more differences. 2T was the one that stuckout. As you know
> working backwards from register values to where the code sets them can
> be tricky with this code.
>
>>> I'm thinking I need to compare TIP-1.29 with TIP-1.55 to look for
>>> other differences but obviously that's going to be hard given the
>>> style changes.
>>
>>
>> Has the style changed in between the Marvell versions as well? I
>> have not looked into this code for quite some time.
>>
>
> What I meant was u-boot has 1.29 and I have 1.55 from Marvell. The
> oldest Marvell version I have is 1.34 which helped me find the 2T
> thing. I'm wondering what differences exist between 1.29 and 1.34.
> 1.55 also has support for some newer integrated switch+CPU chips so it
> is a little hard to separate those bits from the A38X code.
>
>>> If you have any scripts (or even just a record of the
>>> regexes) that you used would you be able to share them?
>>
>>
>> Please find some scripts attached, I've located that I have used while
>> doing this porting.
>
> Thanks. That's a start at least.

In the end once I fixed the ecc_scrubbing[1] I stopped seeing the
training failures so I've basically stopped looking at the differences
between the Marvell bootloader and u-boot. But in the meantime I can
summarize the differences I have identified in case they might help
someone in the future.

* Marvell unconditionally enable 2T timing for A38X
* Different settings for RD/WR ODT particularly in situations using
only one chip-select.

There are more differences in the register dumps but I haven't looked
into the meaning of them.

--
[1] - https://lists.denx.de/pipermail/u-boot/2017-September/307243.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] DDR training code for Armada 38x
  2017-09-25 22:29     ` Chris Packham
@ 2017-09-26  5:10       ` Stefan Roese
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Roese @ 2017-09-26  5:10 UTC (permalink / raw)
  To: u-boot

Hi Chris,

On 26.09.2017 00:29, Chris Packham wrote:
> For the internet historians,
> 
> On Thu, Sep 21, 2017 at 4:25 PM, Chris Packham <judge.packham@gmail.com> wrote:
>> On Wed, Sep 20, 2017 at 5:31 PM, Stefan Roese <sr@denx.de> wrote:
>>> Hi Chris,
>>>
>>> On 19.09.2017 20:58, Chris Packham wrote:
>>>>
>>>> When you did the port from Marvell's source did you script any of the
>>>> tidy-up that you did along the way?
>>>
>>>
>>> Not really. At least not in a reproducible way. I spent long
>>> hours running Lindent, recursive-replace tools and especially
>>> manual code inspection and re-formatting on this huge code.
>>> Still the outcome is far from perfect, but hopefully better
>>> that the original version.
>>>
>>>> I'm running up a new board and with the upstream u-boot DDR training
>>>> occasionally fails. But with the Marvell bootloader it doesn't fail.
>>>> The initial port was done from TIP-1.29 but Marvell are now up to
>>>> TIP-1.55 so there is probably some difference that results in my board
>>>> working.
>>>>
>>>> One difference I've spotted so far is that Marvell enable 2T timing
>>>> mode for all Armada 38x boards (the comment says "resolve low freq
>>>> instability"). But doing that doesn't magically make my board work.
>>>
>>>
>>> Did you compare all DDR register values (the "good" ones and the "bad"
>>> ones) and only the the 2T timing is different?
>>>
>>
>> There are more differences. 2T was the one that stuckout. As you know
>> working backwards from register values to where the code sets them can
>> be tricky with this code.
>>
>>>> I'm thinking I need to compare TIP-1.29 with TIP-1.55 to look for
>>>> other differences but obviously that's going to be hard given the
>>>> style changes.
>>>
>>>
>>> Has the style changed in between the Marvell versions as well? I
>>> have not looked into this code for quite some time.
>>>
>>
>> What I meant was u-boot has 1.29 and I have 1.55 from Marvell. The
>> oldest Marvell version I have is 1.34 which helped me find the 2T
>> thing. I'm wondering what differences exist between 1.29 and 1.34.
>> 1.55 also has support for some newer integrated switch+CPU chips so it
>> is a little hard to separate those bits from the A38X code.
>>
>>>> If you have any scripts (or even just a record of the
>>>> regexes) that you used would you be able to share them?
>>>
>>>
>>> Please find some scripts attached, I've located that I have used while
>>> doing this porting.
>>
>> Thanks. That's a start at least.
> 
> In the end once I fixed the ecc_scrubbing[1] I stopped seeing the
> training failures so I've basically stopped looking at the differences
> between the Marvell bootloader and u-boot. But in the meantime I can
> summarize the differences I have identified in case they might help
> someone in the future.
> 
> * Marvell unconditionally enable 2T timing for A38X
> * Different settings for RD/WR ODT particularly in situations using
> only one chip-select.
> 
> There are more differences in the register dumps but I haven't looked
> into the meaning of them.

Thanks for the update Chris. I'm currently build-testing the MVEBU
patches in Travis and will send the pull request, once this completes
without issues.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-26  5:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-19 18:58 [U-Boot] DDR training code for Armada 38x Chris Packham
2017-09-20  5:31 ` Stefan Roese
2017-09-21  4:25   ` Chris Packham
2017-09-25 22:29     ` Chris Packham
2017-09-26  5:10       ` Stefan Roese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.