Skip to contentSkip to conversation

Cache function change breaks zmx25

U-Boot New Matthias Weißer 3 participants 6 messages Dec 9, 2011 – Dec 13, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

Hi

commit 2f3427ccb915c6f6774f0bcebb67c648dc25dcfd

Author: Ilya Yanok <[email protected]>
Date:   Mon Nov 28 06:37:32 2011 +0000

arm926ejs: add noop implementation for dcache ops

breaks zmx25 booting with the following command:

tftpboot 0x82000000 foo.img; dcache on; bootm 0x82000000

It is stuck then in an endless loop after dcache is disabled before jumping to the OS.

------------------------------------------------
WARNING: cache operations are not implemented!
WARNING: disabling D-Cache now, you can re-enable itlater with 'dcache on' command
------------------------------------------------

Switching on dcache after the tftp worked without problems until this patch. I think this should be fixed before the release as it may have effects on other boards doing similar things.

Matthias

#1 lore raw

Hi Matthias,

Quoted 4 lines · Matthias Wei?er

breaks zmx25 booting with the following command:

tftpboot 0x82000000 foo.img; dcache on; bootm 0x82000000

Quoted 8 lines

It is stuck then in an endless loop after dcache is disabled before jumping to the OS.

------------------------------------------------
WARNING: cache operations are not implemented!
WARNING: disabling D-Cache now, you can re-enable itlater with 'dcache on' command
------------------------------------------------

Argh.. That's really bad. May I ask you to debug this a little bit?

What is exact cache function being called? Where from?
How comes that dcache_status() returns true after dcache_disable()? Or does somebody call dcache_enable() in between?

Regards, Ilya.

#2 lore raw

Am 09.12.2011 16:03, schrieb Ilya Yanok:

Quoted 16 lines

Hi Matthias,

Quoted 4 lines · Matthias Wei?er

breaks zmx25 booting with the following command:

tftpboot 0x82000000 foo.img; dcache on; bootm 0x82000000

Quoted 8 lines

It is stuck then in an endless loop after dcache is disabled before jumping to the OS.

------------------------------------------------
WARNING: cache operations are not implemented!
WARNING: disabling D-Cache now, you can re-enable itlater with 'dcache on' command
------------------------------------------------

Quoted 5 lines

Argh.. That's really bad. May I ask you to debug this a little bit?

What is exact cache function being called? Where from?
How comes that dcache_status() returns true after dcache_disable()? Or does somebody call dcache_enable() in between?

The call trace in may case should be something like (not debuged, only looked at the code):

cmd_elf.c : do_bootelf()
cmd_elf.c : do_bootelf_exec()
cache-cp15.c : dcache_disable()
cache-cp15.c : cache_disable(CR_C); -> Cache is not disabled in this
function before
cache.c : flush_dcache_all(); is called
cache.c : dcache_noop();
cache-cp15.c : dcache_status() -> returns true cache-cp15.c : dcache_disable()
cache-cp15.c : cache_disable(CR_C)
cache.c : flush_dcache_all();
....

And we have the endless loop. I think this impacts not only zmx25 but other boards enabling dcache.

If you need additional informations: I will have access to the board on monday again.

Signature · 1 line
Matthias
#3 lore raw

PATCH 1/1 arm926ejs: remove noop flush_dcache_all function

Commit 2f3427c added noop cache functions implementation for arm926ejs to fix compilation of drivers depending on these functions (DaVinci EMAC in particular).

Unfortunately, the bug was introduced: noop implementation calls dcache_disable which calls flush_dcache_all which in turn calls dcache_disable thus creating an infinite loop.

This patch removes noop implementation for flush_dcache_all, we already have default one in arch/arm/lib/cache.c and it should be used instead.

---

Hi Matthias,

thanks for cathing this. Surely my initial patch was totally wrong. Could you please test this one?

Regards, Ilya.

 arch/arm/cpu/arm926ejs/cache.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)
arch/arm/cpu/arm926ejs/cache.c +0 -5
index 4415642..ee90ab7 100644
@@ -38,11 +38,6 @@ void invalidate_dcache_all(void)
 	dcache_noop();
 }
 
-void flush_dcache_all(void)
-{
-	dcache_noop();
-}
-
 void invalidate_dcache_range(unsigned long start, unsigned long stop)
 {
 	dcache_noop();
Signature · 1 line
1.7.6.4
#4 lore raw

PATCH 1/1 arm926ejs: remove noop flush_dcache_all function

Am 12.12.2011 00:09, schrieb Ilya Yanok:

Quoted 11 lines

Commit 2f3427c added noop cache functions implementation for arm926ejs to fix compilation of drivers depending on these functions (DaVinci EMAC in particular).

Unfortunately, the bug was introduced: noop implementation calls dcache_disable which calls flush_dcache_all which in turn calls dcache_disable thus creating an infinite loop.

This patch removes noop implementation for flush_dcache_all, we already have default one in arch/arm/lib/cache.c and it should be used instead.

Quoted 7 lines

---

Hi Matthias,

thanks for cathing this. Surely my initial patch was totally wrong. Could you please test this one?

This patches solves at least my problem. Thanks.

Matthias

#5 lore raw

PATCH 1/1 arm926ejs: remove noop flush_dcache_all function

2011/12/12 Matthias Wei?er <[email protected]>:

Quoted 16 lines

Am 12.12.2011 00:09, schrieb Ilya Yanok:

Quoted 14 lines

Commit 2f3427c added noop cache functions implementation for arm926ejs to fix compilation of drivers depending on these functions (DaVinci EMAC in particular).

Unfortunately, the bug was introduced: noop implementation calls dcache_disable which calls flush_dcache_all which in turn calls dcache_disable thus creating an infinite loop.

This patch removes noop implementation for flush_dcache_all, we already have default one in arch/arm/lib/cache.c and it should be used instead.

---

Quoted 8 lines
Quoted 4 lines

Hi Matthias,

thanks for cathing this. Surely my initial patch was totally wrong. Could you please test this one?

This patches solves at least my problem. Thanks.

Merged to u-boot-ti/master, thanks!

Signature · 1 line
Tom