All of lore.kernel.org
 help / color / mirror / Atom feed
* U-Boot Fails w/ Memory Test
@ 2020-08-06 22:50 Brownlie, Lewis
  2020-08-07 10:05 ` Heinrich Schuchardt
  0 siblings, 1 reply; 3+ messages in thread
From: Brownlie, Lewis @ 2020-08-06 22:50 UTC (permalink / raw)
  To: u-boot

Hello all,

I am trying to enable memory POST test for my ARM-based processor.  I have reached the point where the U-Boot runs the test and it passes.  However, U-Boot later hangs after the following lines:

DDR    31.9 GiB (DDR4, 64-bit, CL=22, ECC on)
                              DDR Controller Interleaving Mode: 256B
                              DDR Chip-Select Interleaving Mode: CS0+CS1

My guess is that the memory test is somehow messing something up, even though it passes, but I don't know how.  My attempts to debug and figure out the issue have led me to discover that the issue occurs in the relocate_code function.  Other than that, I have not been able to figure anything out.  If I build and run U-Boot without the memory test, it works fine, so I know the issue has something to do with the test.  (The test is called from the board_init_f function.)

Does anyone have any ideas what may be wrong and/or what I could do to find the issue?

Thank you
-Lewis

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

* U-Boot Fails w/ Memory Test
  2020-08-06 22:50 U-Boot Fails w/ Memory Test Brownlie, Lewis
@ 2020-08-07 10:05 ` Heinrich Schuchardt
  0 siblings, 0 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2020-08-07 10:05 UTC (permalink / raw)
  To: u-boot

On 07.08.20 00:50, Brownlie, Lewis wrote:
> Hello all,
>
> I am trying to enable memory POST test for my ARM-based processor.  I have reached the point where the U-Boot runs the test and it passes.  However, U-Boot later hangs after the following lines:
>
> DDR    31.9 GiB (DDR4, 64-bit, CL=22, ECC on)
>                               DDR Controller Interleaving Mode: 256B
>                               DDR Chip-Select Interleaving Mode: CS0+CS1
>
> My guess is that the memory test is somehow messing something up, even though it passes, but I don't know how.  My attempts to debug and figure out the issue have led me to discover that the issue occurs in the relocate_code function.  Other than that, I have not been able to figure anything out.  If I build and run U-Boot without the memory test, it works fine, so I know the issue has something to do with the test.  (The test is called from the board_init_f function.)
>
> Does anyone have any ideas what may be wrong and/or what I could do to find the issue?
>
> Thank you
> -Lewis
>

Have a look at arch_memory_test_prepare(). The function blindly asks to
test and thereby overwrite up to 256 MiB from CONFIG_SYS_SDRAM_BASE to
gd->bd.

The test must run *after* relocation. Otherwise we will overwrite U-Boot.

The end of the memory range tested should be
((uintptr_t)map_sysmem(gd->start_addr_sp, 0) - CONFIG_STACK_SIZE.

All memory areas marked as reserved in the device tree have to be excluded.

Best regards

Heinrich

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

* U-Boot Fails w/ Memory Test
@ 2020-08-07 15:17 Brownlie, Lewis
  0 siblings, 0 replies; 3+ messages in thread
From: Brownlie, Lewis @ 2020-08-07 15:17 UTC (permalink / raw)
  To: u-boot

Thank you for your response Heinrich.  I tried running the memory test after relocation instead of before and it seems to have worked.  I'm going to debug more to make sure it really did, but in the meantime a couple questions:

You wrote:


> Have a look at arch_memory_test_prepare(). The function blindly asks to test and thereby overwrite up to 256 MiB from CONFIG_SYS_SDRAM_BASE to

gd->bd.

>

> The test must run *after* relocation. Otherwise we will overwrite U-Boot.

>

> The end of the memory range tested should be ((uintptr_t)map_sysmem(gd->start_addr_sp, 0) - CONFIG_STACK_SIZE.

>

> All memory areas marked as reserved in the device tree have to be excluded.



  1.  Why does the test run after relocation?  Everything I've seen has said to do it before, unless I'm completely misunderstanding.  For example, in README.post it states (emphasis added by me):



Also, all tests will be discriminated by the moment they run at.

Specifically, the following groups will be singled out:



  1) Tests running before relocating to RAM



     These tests will run immediately after initializing RAM

     as to enable modifying it without taking care of its

     contents. Basically, this group will contain memory tests

     only.



  2) Tests running after relocating to RAM



     These tests will run immediately before entering the main

     loop as to guarantee full hardware initialization.



  1.  Are you suggesting that I need to make any changes to arch_memory_test_prepare()?  Or are you just pointing out that function to show that I need to run the test after relocation?  The test seems to be working fine now without changing arch_memory_test_prepare(), but I want to make sure.



Thank you again for your time,

-Lewis

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

end of thread, other threads:[~2020-08-07 15:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 22:50 U-Boot Fails w/ Memory Test Brownlie, Lewis
2020-08-07 10:05 ` Heinrich Schuchardt
2020-08-07 15:17 Brownlie, Lewis

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.