[U-Boot] Cache function change breaks zmx25

Hi
commit 2f3427ccb915c6f6774f0bcebb67c648dc25dcfd Author: Ilya Yanok yanok@emcraft.com 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

Hi Matthias,
On 09.12.2011 18:24, Matthias Weißer wrote:
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
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.

Am 09.12.2011 16:03, schrieb Ilya Yanok:
Hi Matthias,
On 09.12.2011 18:24, Matthias Weißer wrote:
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
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.

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.
Signed-off-by: Ilya Yanok yanok@emcraft.com ---
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(-)
diff --git a/arch/arm/cpu/arm926ejs/cache.c b/arch/arm/cpu/arm926ejs/cache.c index 4415642..ee90ab7 100644 --- a/arch/arm/cpu/arm926ejs/cache.c +++ b/arch/arm/cpu/arm926ejs/cache.c @@ -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();

Am 12.12.2011 00:09, schrieb Ilya Yanok:
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.
Signed-off-by: Ilya Yanokyanok@emcraft.com
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.
Tested-by: Matthias Weisser weisserm@arcor.de
Matthias

2011/12/12 Matthias Weißer weisserm@arcor.de:
Am 12.12.2011 00:09, schrieb Ilya Yanok:
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.
Signed-off-by: Ilya Yanokyanok@emcraft.com
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.
Tested-by: Matthias Weisser weisserm@arcor.de
Merged to u-boot-ti/master, thanks!
participants (4)
-
Ilya Yanok
-
Matthias Weisser
-
Matthias Weißer
-
Tom Rini