Skip to contentSkip to conversation

common/board_r: Fix booting issue on T4240QDS

PATCH In review York Sun 4 participants 6 messages Oct 2, 2014 – Oct 10, 2014

lore
Share & tools
lore

York Sun

author
#0 lore raw

PATCH 1/1 common/board_r: Fix booting issue on T4240QDS

Commit 294b91a5817147d4b7f47be2ac69bac2a1f26491 moved initr_malloc earlier than initr_unlock_ram_in_cache. This causes issue on T4240. It may be related to locked L1 d-cache and unlocked L2 cache. D- cache could and should be unlock earlier for normal operation.

This patch moves initr_unlock_ram_in_cache before initr_malloc. It has been verified on the following boards, in which only T4240QDS suffered and has been since fixed: T4240QDS, T2080QDS, P5040DS, P4080DS, MPC8572DS, MPC8536DS, MPC8641HPCN, B4860QDS.

CC Scott Wood <[email protected]>
CC Simon Glass <[email protected]>

---
The root cause of the this failure wasn't identified. It may be hidden too deep to be dug out in time. This fix preserves the order of original code between initr_malloc and initr_unlock_ram_in_cache.

 common/board_r.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
common/board_r.c +3 -3
index 231c6d6..c339aad 100644
@@ -717,6 +717,9 @@ init_fnc_t init_sequence_r[] = {
 	initr_caches,
 #endif
 	initr_reloc_global_data,
+#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
+	initr_unlock_ram_in_cache,
+#endif
 	initr_barrier,
 	initr_malloc,
 	bootstage_relocate,
@@ -759,9 +762,6 @@ init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_SYS_DELAYED_ICACHE
 	initr_icache_enable,
 #endif
-#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
-	initr_unlock_ram_in_cache,
-#endif
 #if defined(CONFIG_PCI) && defined(CONFIG_SYS_EARLY_PCI_INIT)
 	/*
 	 * Do early PCI configuration _before_ the flash gets initialised,
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 common/board_r: Fix booting issue on T4240QDS

Quoted 26 lines · York Sun

Commit 294b91a5817147d4b7f47be2ac69bac2a1f26491 moved initr_malloc earlier than initr_unlock_ram_in_cache. This causes issue on T4240. It may be related to locked L1 d-cache and unlocked L2 cache. D- cache could and should be unlock earlier for normal operation.

This patch moves initr_unlock_ram_in_cache before initr_malloc. It has been verified on the following boards, in which only T4240QDS suffered and has been since fixed: T4240QDS, T2080QDS, P5040DS, P4080DS, MPC8572DS, MPC8536DS, MPC8641HPCN, B4860QDS.

CC Scott Wood <[email protected]>
CC Simon Glass <[email protected]>

---
The root cause of the this failure wasn't identified. It may be hidden too deep to be dug out in time. This fix preserves the order of original code between initr_malloc and initr_unlock_ram_in_cache.

 common/board_r.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
common/board_r.c +0 -0
index 231c6d6..c339aad 100644

common/board_r.c init_fnc_t init_sequence_r[] = { · line 722

Quoted 6 lines
common/board_r.c +3 -0
@@ -717,6 +717,9 @@ init_fnc_t init_sequence_r[] = {
        initr_caches,
 #endif
        initr_reloc_global_data,
+#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
+       initr_unlock_ram_in_cache,
+#endif

The code looks fine. Are we sure it shouldn't go above initr_reloc_global_data()?

Quoted 14 lines
common/board_r.c +0 -4
        initr_barrier,
        initr_malloc,
        bootstage_relocate,
@@ -759,9 +762,6 @@ init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_SYS_DELAYED_ICACHE
        initr_icache_enable,
 #endif
-#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
-       initr_unlock_ram_in_cache,
-#endif
 #if defined(CONFIG_PCI) && defined(CONFIG_SYS_EARLY_PCI_INIT)
        /*
         * Do early PCI configuration _before_ the flash gets initialised,
--
Quoted 2 lines

1.7.9.5

Regards,
Simon

author
#2 lore raw

PATCH 1/1 common/board_r: Fix booting issue on T4240QDS

Quoted 37 lines · Simon Glass
Quoted 26 lines · York Sun

Commit 294b91a5817147d4b7f47be2ac69bac2a1f26491 moved initr_malloc earlier than initr_unlock_ram_in_cache. This causes issue on T4240. It may be related to locked L1 d-cache and unlocked L2 cache. D- cache could and should be unlock earlier for normal operation.

This patch moves initr_unlock_ram_in_cache before initr_malloc. It has been verified on the following boards, in which only T4240QDS suffered and has been since fixed: T4240QDS, T2080QDS, P5040DS, P4080DS, MPC8572DS, MPC8536DS, MPC8641HPCN, B4860QDS.

CC Scott Wood <[email protected]>
CC Simon Glass <[email protected]>

---
The root cause of the this failure wasn't identified. It may be hidden too deep to be dug out in time. This fix preserves the order of original code between initr_malloc and initr_unlock_ram_in_cache.

 common/board_r.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
common/board_r.c +0 -0
index 231c6d6..c339aad 100644

common/board_r.c init_fnc_t init_sequence_r[] = { · line 722

Quoted 6 lines
common/board_r.c +3 -0
@@ -717,6 +717,9 @@ init_fnc_t init_sequence_r[] = {
        initr_caches,
 #endif
        initr_reloc_global_data,
+#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
+       initr_unlock_ram_in_cache,
+#endif

The code looks fine. Are we sure it shouldn't go above initr_reloc_global_data()?

Quoted 1 line

Simon,

From the code, I don't see why it can't be moved above. But since we didn't identify the root cause, I am less confident to do so. I was focusing on fixing this issue and test.

York

#3 lore raw

PATCH 1/1 common/board_r: Fix booting issue on T4240QDS

Quoted 40 lines · On Fri, 2014-10-03 at 21:31 -0500, Sun York-R58495 wrote:
Quoted 37 lines · Simon Glass
Quoted 26 lines · York Sun

Commit 294b91a5817147d4b7f47be2ac69bac2a1f26491 moved initr_malloc earlier than initr_unlock_ram_in_cache. This causes issue on T4240. It may be related to locked L1 d-cache and unlocked L2 cache. D- cache could and should be unlock earlier for normal operation.

This patch moves initr_unlock_ram_in_cache before initr_malloc. It has been verified on the following boards, in which only T4240QDS suffered and has been since fixed: T4240QDS, T2080QDS, P5040DS, P4080DS, MPC8572DS, MPC8536DS, MPC8641HPCN, B4860QDS.

CC Scott Wood <[email protected]>
CC Simon Glass <[email protected]>

---
The root cause of the this failure wasn't identified. It may be hidden too deep to be dug out in time. This fix preserves the order of original code between initr_malloc and initr_unlock_ram_in_cache.

 common/board_r.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
common/board_r.c +0 -0
index 231c6d6..c339aad 100644

common/board_r.c init_fnc_t init_sequence_r[] = { · line 722

Quoted 6 lines
common/board_r.c +3 -0
@@ -717,6 +717,9 @@ init_fnc_t init_sequence_r[] = {
        initr_caches,
 #endif
        initr_reloc_global_data,
+#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
+       initr_unlock_ram_in_cache,
+#endif

The code looks fine. Are we sure it shouldn't go above initr_reloc_global_data()?

Quoted 7 lines
Quoted 1 line

Simon,

From the code, I don't see why it can't be moved above. But since we didn't identify the root cause, I am less confident to do so. I was focusing on fixing this issue and test.

It could be called as soon as we've stopped using the init ram area.

In the long term, though, a more robust fix would be to stop abusing L1 cache on e6500, and use CPC SRAM instead.

-Scott

author
#4 lore raw

PATCH 1/1 common/board_r: Fix booting issue on T4240QDS

In reply to Simon Glass
Quoted 37 lines · Simon Glass
Quoted 26 lines · York Sun

Commit 294b91a5817147d4b7f47be2ac69bac2a1f26491 moved initr_malloc earlier than initr_unlock_ram_in_cache. This causes issue on T4240. It may be related to locked L1 d-cache and unlocked L2 cache. D- cache could and should be unlock earlier for normal operation.

This patch moves initr_unlock_ram_in_cache before initr_malloc. It has been verified on the following boards, in which only T4240QDS suffered and has been since fixed: T4240QDS, T2080QDS, P5040DS, P4080DS, MPC8572DS, MPC8536DS, MPC8641HPCN, B4860QDS.

CC Scott Wood <[email protected]>
CC Simon Glass <[email protected]>

---
The root cause of the this failure wasn't identified. It may be hidden too deep to be dug out in time. This fix preserves the order of original code between initr_malloc and initr_unlock_ram_in_cache.

 common/board_r.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
common/board_r.c +0 -0
index 231c6d6..c339aad 100644

common/board_r.c init_fnc_t init_sequence_r[] = { · line 722

Quoted 6 lines
common/board_r.c +3 -0
@@ -717,6 +717,9 @@ init_fnc_t init_sequence_r[] = {
        initr_caches,
 #endif
        initr_reloc_global_data,
+#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
+       initr_unlock_ram_in_cache,
+#endif

The code looks fine. Are we sure it shouldn't go above initr_reloc_global_data()?

Quoted 2 lines

Tom,

Can you pick up this one? I don't have patches pending for 2014.10 for now.

York

#5 lore raw
In reply to York Sun
Quoted 10 lines · York Sun

Commit 294b91a5817147d4b7f47be2ac69bac2a1f26491 moved initr_malloc earlier than initr_unlock_ram_in_cache. This causes issue on T4240. It may be related to locked L1 d-cache and unlocked L2 cache. D- cache could and should be unlock earlier for normal operation.

This patch moves initr_unlock_ram_in_cache before initr_malloc. It has been verified on the following boards, in which only T4240QDS suffered and has been since fixed: T4240QDS, T2080QDS, P5040DS, P4080DS, MPC8572DS, MPC8536DS, MPC8641HPCN, B4860QDS.

Quoted 4 lines

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141010/6577a19f/attachment.pgp>