All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH u-boot-marvell RFC] PLEASE TEST: ddr: marvell: a38x: fix BYTE_HOMOGENEOUS_SPLIT_OUT decision
@ 2022-02-10 16:25 Marek Behún
  2022-02-15 22:21 ` Chris Packham
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Behún @ 2022-02-10 16:25 UTC (permalink / raw)
  To: Chris Packham, Stefan Roese
  Cc: u-boot, Mario Six, Dennis Gilmore, Marek Behún

From: Marek Behún <marek.behun@nic.cz>

In commit 3fc92a215b69 ("ddr: marvell: a38x: fix SPLIT_OUT_MIX state
decision") I ported a cleaned up and changed version of patch
  mv_ddr: a380: fix SPLIT_OUT_MIX state decision

In the port we removed checking for BYTE_HOMOGENEOUS_SPLIT_OUT bit,
because:
- the fix seemed to work without it
- the bit was checked for only at one place out of two, while the second
  bit, BYTE_SPLIT_OUT_MIX, was checked for in both cases
- without the removal it didn't work on Allied Telesis' x530 board

We recently had a chance to test on more boards, and it seems that the
change needs to be opposite: instead of removing the check for
BYTE_HOMOGENEOUS_SPLIT_OUT from the first if() statement, the check
needs to be added also to the second one - it needs to be at both
places.

With this change all the Turris Omnia boards I have had available to
test seem to work, I didn't encounter not even one failed DDR training.

As last time, I am noting that I do not understand what this code is
actually doing, I haven't studied the DDR training algorithm and
I suspect that no one will be able to explain it to U-Boot contributors,
so we are left with this blind poking in the code with testing whether
it works on several boards and hoping it doesn't break anything for
anyone :-(.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
---
 drivers/ddr/marvell/a38x/ddr3_training_centralization.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/ddr/marvell/a38x/ddr3_training_centralization.c b/drivers/ddr/marvell/a38x/ddr3_training_centralization.c
index 42308b6965..be9f985f22 100644
--- a/drivers/ddr/marvell/a38x/ddr3_training_centralization.c
+++ b/drivers/ddr/marvell/a38x/ddr3_training_centralization.c
@@ -180,7 +180,8 @@ static int ddr3_tip_centralization(u32 dev_num, u32 mode)
 							       [bit_id],
 							       EDGE_1);
 					if (current_byte_status &
-					    BYTE_SPLIT_OUT_MIX) {
+					    (BYTE_SPLIT_OUT_MIX |
+					     BYTE_HOMOGENEOUS_SPLIT_OUT)) {
 						if (cur_start_win[bit_id] >= 64)
 							cur_start_win[bit_id] -= 64;
 						else
@@ -197,7 +198,8 @@ static int ddr3_tip_centralization(u32 dev_num, u32 mode)
 							       EDGE_1);
 					if (cur_end_win[bit_id] >= 64 &&
 					    (current_byte_status &
-					     BYTE_SPLIT_OUT_MIX)) {
+					     (BYTE_SPLIT_OUT_MIX |
+					      BYTE_HOMOGENEOUS_SPLIT_OUT))) {
 						cur_end_win[bit_id] -= 64;
 						DEBUG_CENTRALIZATION_ENGINE
 							(DEBUG_LEVEL_INFO,
-- 
2.34.1


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

* Re: [PATCH u-boot-marvell RFC] PLEASE TEST: ddr: marvell: a38x: fix BYTE_HOMOGENEOUS_SPLIT_OUT decision
  2022-02-10 16:25 [PATCH u-boot-marvell RFC] PLEASE TEST: ddr: marvell: a38x: fix BYTE_HOMOGENEOUS_SPLIT_OUT decision Marek Behún
@ 2022-02-15 22:21 ` Chris Packham
  2022-02-16  8:41   ` Stefan Roese
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Packham @ 2022-02-15 22:21 UTC (permalink / raw)
  To: Marek Behún
  Cc: Stefan Roese, u-boot, Mario Six, Dennis Gilmore, Marek Behún

On Fri, Feb 11, 2022 at 5:25 AM Marek Behún <kabel@kernel.org> wrote:
>
> From: Marek Behún <marek.behun@nic.cz>
>
> In commit 3fc92a215b69 ("ddr: marvell: a38x: fix SPLIT_OUT_MIX state
> decision") I ported a cleaned up and changed version of patch
>   mv_ddr: a380: fix SPLIT_OUT_MIX state decision
>
> In the port we removed checking for BYTE_HOMOGENEOUS_SPLIT_OUT bit,
> because:
> - the fix seemed to work without it
> - the bit was checked for only at one place out of two, while the second
>   bit, BYTE_SPLIT_OUT_MIX, was checked for in both cases
> - without the removal it didn't work on Allied Telesis' x530 board
>
> We recently had a chance to test on more boards, and it seems that the
> change needs to be opposite: instead of removing the check for
> BYTE_HOMOGENEOUS_SPLIT_OUT from the first if() statement, the check
> needs to be added also to the second one - it needs to be at both
> places.
>
> With this change all the Turris Omnia boards I have had available to
> test seem to work, I didn't encounter not even one failed DDR training.
>
> As last time, I am noting that I do not understand what this code is
> actually doing, I haven't studied the DDR training algorithm and
> I suspect that no one will be able to explain it to U-Boot contributors,
> so we are left with this blind poking in the code with testing whether
> it works on several boards and hoping it doesn't break anything for
> anyone :-(.
>
> Signed-off-by: Marek Behún <marek.behun@nic.cz>

Tested-by: Chris Packham <judge.packham@gmail.com>

> ---
>  drivers/ddr/marvell/a38x/ddr3_training_centralization.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ddr/marvell/a38x/ddr3_training_centralization.c b/drivers/ddr/marvell/a38x/ddr3_training_centralization.c
> index 42308b6965..be9f985f22 100644
> --- a/drivers/ddr/marvell/a38x/ddr3_training_centralization.c
> +++ b/drivers/ddr/marvell/a38x/ddr3_training_centralization.c
> @@ -180,7 +180,8 @@ static int ddr3_tip_centralization(u32 dev_num, u32 mode)
>                                                                [bit_id],
>                                                                EDGE_1);
>                                         if (current_byte_status &
> -                                           BYTE_SPLIT_OUT_MIX) {
> +                                           (BYTE_SPLIT_OUT_MIX |
> +                                            BYTE_HOMOGENEOUS_SPLIT_OUT)) {
>                                                 if (cur_start_win[bit_id] >= 64)
>                                                         cur_start_win[bit_id] -= 64;
>                                                 else
> @@ -197,7 +198,8 @@ static int ddr3_tip_centralization(u32 dev_num, u32 mode)
>                                                                EDGE_1);
>                                         if (cur_end_win[bit_id] >= 64 &&
>                                             (current_byte_status &
> -                                            BYTE_SPLIT_OUT_MIX)) {
> +                                            (BYTE_SPLIT_OUT_MIX |
> +                                             BYTE_HOMOGENEOUS_SPLIT_OUT))) {
>                                                 cur_end_win[bit_id] -= 64;
>                                                 DEBUG_CENTRALIZATION_ENGINE
>                                                         (DEBUG_LEVEL_INFO,
> --
> 2.34.1
>

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

* Re: [PATCH u-boot-marvell RFC] PLEASE TEST: ddr: marvell: a38x: fix BYTE_HOMOGENEOUS_SPLIT_OUT decision
  2022-02-15 22:21 ` Chris Packham
@ 2022-02-16  8:41   ` Stefan Roese
  2022-02-16 13:26     ` Marek Behún
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Roese @ 2022-02-16  8:41 UTC (permalink / raw)
  To: Chris Packham, Marek Behún
  Cc: u-boot, Mario Six, Dennis Gilmore, Marek Behún

On 2/15/22 23:21, Chris Packham wrote:
> On Fri, Feb 11, 2022 at 5:25 AM Marek Behún <kabel@kernel.org> wrote:
>>
>> From: Marek Behún <marek.behun@nic.cz>
>>
>> In commit 3fc92a215b69 ("ddr: marvell: a38x: fix SPLIT_OUT_MIX state
>> decision") I ported a cleaned up and changed version of patch
>>    mv_ddr: a380: fix SPLIT_OUT_MIX state decision
>>
>> In the port we removed checking for BYTE_HOMOGENEOUS_SPLIT_OUT bit,
>> because:
>> - the fix seemed to work without it
>> - the bit was checked for only at one place out of two, while the second
>>    bit, BYTE_SPLIT_OUT_MIX, was checked for in both cases
>> - without the removal it didn't work on Allied Telesis' x530 board
>>
>> We recently had a chance to test on more boards, and it seems that the
>> change needs to be opposite: instead of removing the check for
>> BYTE_HOMOGENEOUS_SPLIT_OUT from the first if() statement, the check
>> needs to be added also to the second one - it needs to be at both
>> places.
>>
>> With this change all the Turris Omnia boards I have had available to
>> test seem to work, I didn't encounter not even one failed DDR training.
>>
>> As last time, I am noting that I do not understand what this code is
>> actually doing, I haven't studied the DDR training algorithm and
>> I suspect that no one will be able to explain it to U-Boot contributors,
>> so we are left with this blind poking in the code with testing whether
>> it works on several boards and hoping it doesn't break anything for
>> anyone :-(.
>>
>> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> 
> Tested-by: Chris Packham <judge.packham@gmail.com>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> 
>> ---
>>   drivers/ddr/marvell/a38x/ddr3_training_centralization.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/ddr/marvell/a38x/ddr3_training_centralization.c b/drivers/ddr/marvell/a38x/ddr3_training_centralization.c
>> index 42308b6965..be9f985f22 100644
>> --- a/drivers/ddr/marvell/a38x/ddr3_training_centralization.c
>> +++ b/drivers/ddr/marvell/a38x/ddr3_training_centralization.c
>> @@ -180,7 +180,8 @@ static int ddr3_tip_centralization(u32 dev_num, u32 mode)
>>                                                                 [bit_id],
>>                                                                 EDGE_1);
>>                                          if (current_byte_status &
>> -                                           BYTE_SPLIT_OUT_MIX) {
>> +                                           (BYTE_SPLIT_OUT_MIX |
>> +                                            BYTE_HOMOGENEOUS_SPLIT_OUT)) {
>>                                                  if (cur_start_win[bit_id] >= 64)
>>                                                          cur_start_win[bit_id] -= 64;
>>                                                  else
>> @@ -197,7 +198,8 @@ static int ddr3_tip_centralization(u32 dev_num, u32 mode)
>>                                                                 EDGE_1);
>>                                          if (cur_end_win[bit_id] >= 64 &&
>>                                              (current_byte_status &
>> -                                            BYTE_SPLIT_OUT_MIX)) {
>> +                                            (BYTE_SPLIT_OUT_MIX |
>> +                                             BYTE_HOMOGENEOUS_SPLIT_OUT))) {
>>                                                  cur_end_win[bit_id] -= 64;
>>                                                  DEBUG_CENTRALIZATION_ENGINE
>>                                                          (DEBUG_LEVEL_INFO,
>> --
>> 2.34.1
>>

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

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

* Re: [PATCH u-boot-marvell RFC] PLEASE TEST: ddr: marvell: a38x: fix BYTE_HOMOGENEOUS_SPLIT_OUT decision
  2022-02-16  8:41   ` Stefan Roese
@ 2022-02-16 13:26     ` Marek Behún
  2022-02-16 13:41       ` Stefan Roese
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Behún @ 2022-02-16 13:26 UTC (permalink / raw)
  To: Stefan Roese
  Cc: Chris Packham, u-boot, Mario Six, Dennis Gilmore, Marek Behún

On Wed, 16 Feb 2022 09:41:44 +0100
Stefan Roese <sr@denx.de> wrote:

> On 2/15/22 23:21, Chris Packham wrote:
> > On Fri, Feb 11, 2022 at 5:25 AM Marek Behún <kabel@kernel.org> wrote:  
> >>
> >> From: Marek Behún <marek.behun@nic.cz>
> >>
> >> In commit 3fc92a215b69 ("ddr: marvell: a38x: fix SPLIT_OUT_MIX state
> >> decision") I ported a cleaned up and changed version of patch
> >>    mv_ddr: a380: fix SPLIT_OUT_MIX state decision
> >>
> >> In the port we removed checking for BYTE_HOMOGENEOUS_SPLIT_OUT bit,
> >> because:
> >> - the fix seemed to work without it
> >> - the bit was checked for only at one place out of two, while the second
> >>    bit, BYTE_SPLIT_OUT_MIX, was checked for in both cases
> >> - without the removal it didn't work on Allied Telesis' x530 board
> >>
> >> We recently had a chance to test on more boards, and it seems that the
> >> change needs to be opposite: instead of removing the check for
> >> BYTE_HOMOGENEOUS_SPLIT_OUT from the first if() statement, the check
> >> needs to be added also to the second one - it needs to be at both
> >> places.
> >>
> >> With this change all the Turris Omnia boards I have had available to
> >> test seem to work, I didn't encounter not even one failed DDR training.
> >>
> >> As last time, I am noting that I do not understand what this code is
> >> actually doing, I haven't studied the DDR training algorithm and
> >> I suspect that no one will be able to explain it to U-Boot contributors,
> >> so we are left with this blind poking in the code with testing whether
> >> it works on several boards and hoping it doesn't break anything for
> >> anyone :-(.
> >>
> >> Signed-off-by: Marek Behún <marek.behun@nic.cz>  
> > 
> > Tested-by: Chris Packham <judge.packham@gmail.com>  
> 
> Reviewed-by: Stefan Roese <sr@denx.de>

Dear Stefan,

will you apply this (removing the PLEASE TEST: prefix) or should I send
it again without it?

I am going to send another patch which will reset the board immediately
if DDR training fails, so I can send with that one.

Marek

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

* Re: [PATCH u-boot-marvell RFC] PLEASE TEST: ddr: marvell: a38x: fix BYTE_HOMOGENEOUS_SPLIT_OUT decision
  2022-02-16 13:26     ` Marek Behún
@ 2022-02-16 13:41       ` Stefan Roese
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Roese @ 2022-02-16 13:41 UTC (permalink / raw)
  To: Marek Behún
  Cc: Chris Packham, u-boot, Mario Six, Dennis Gilmore, Marek Behún

On 2/16/22 14:26, Marek Behún wrote:
> On Wed, 16 Feb 2022 09:41:44 +0100
> Stefan Roese <sr@denx.de> wrote:
> 
>> On 2/15/22 23:21, Chris Packham wrote:
>>> On Fri, Feb 11, 2022 at 5:25 AM Marek Behún <kabel@kernel.org> wrote:
>>>>
>>>> From: Marek Behún <marek.behun@nic.cz>
>>>>
>>>> In commit 3fc92a215b69 ("ddr: marvell: a38x: fix SPLIT_OUT_MIX state
>>>> decision") I ported a cleaned up and changed version of patch
>>>>     mv_ddr: a380: fix SPLIT_OUT_MIX state decision
>>>>
>>>> In the port we removed checking for BYTE_HOMOGENEOUS_SPLIT_OUT bit,
>>>> because:
>>>> - the fix seemed to work without it
>>>> - the bit was checked for only at one place out of two, while the second
>>>>     bit, BYTE_SPLIT_OUT_MIX, was checked for in both cases
>>>> - without the removal it didn't work on Allied Telesis' x530 board
>>>>
>>>> We recently had a chance to test on more boards, and it seems that the
>>>> change needs to be opposite: instead of removing the check for
>>>> BYTE_HOMOGENEOUS_SPLIT_OUT from the first if() statement, the check
>>>> needs to be added also to the second one - it needs to be at both
>>>> places.
>>>>
>>>> With this change all the Turris Omnia boards I have had available to
>>>> test seem to work, I didn't encounter not even one failed DDR training.
>>>>
>>>> As last time, I am noting that I do not understand what this code is
>>>> actually doing, I haven't studied the DDR training algorithm and
>>>> I suspect that no one will be able to explain it to U-Boot contributors,
>>>> so we are left with this blind poking in the code with testing whether
>>>> it works on several boards and hoping it doesn't break anything for
>>>> anyone :-(.
>>>>
>>>> Signed-off-by: Marek Behún <marek.behun@nic.cz>
>>>
>>> Tested-by: Chris Packham <judge.packham@gmail.com>
>>
>> Reviewed-by: Stefan Roese <sr@denx.de>
> 
> Dear Stefan,
> 
> will you apply this (removing the PLEASE TEST: prefix) or should I send
> it again without it?
> 
> I am going to send another patch which will reset the board immediately
> if DDR training fails, so I can send with that one.

Whatever you prefer. Plan is to apply/push some of the pending patches
in the next few days.

Thanks,
Stefan

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

end of thread, other threads:[~2022-02-16 13:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 16:25 [PATCH u-boot-marvell RFC] PLEASE TEST: ddr: marvell: a38x: fix BYTE_HOMOGENEOUS_SPLIT_OUT decision Marek Behún
2022-02-15 22:21 ` Chris Packham
2022-02-16  8:41   ` Stefan Roese
2022-02-16 13:26     ` Marek Behún
2022-02-16 13:41       ` 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.