public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Cache function change breaks zmx25
@ 2011-12-09 14:24 Matthias Weißer
  2011-12-09 15:03 ` Ilya Yanok
  0 siblings, 1 reply; 6+ messages in thread
From: Matthias Weißer @ 2011-12-09 14:24 UTC (permalink / raw)
  To: u-boot

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

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

* [U-Boot] Cache function change breaks zmx25
  2011-12-09 14:24 [U-Boot] Cache function change breaks zmx25 Matthias Weißer
@ 2011-12-09 15:03 ` Ilya Yanok
  2011-12-10 16:36   ` Matthias Weisser
  0 siblings, 1 reply; 6+ messages in thread
From: Ilya Yanok @ 2011-12-09 15:03 UTC (permalink / raw)
  To: u-boot

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.

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

* [U-Boot] Cache function change breaks zmx25
  2011-12-09 15:03 ` Ilya Yanok
@ 2011-12-10 16:36   ` Matthias Weisser
  2011-12-11 23:09     ` [U-Boot] [PATCH] arm926ejs: remove noop flush_dcache_all function Ilya Yanok
  0 siblings, 1 reply; 6+ messages in thread
From: Matthias Weisser @ 2011-12-10 16:36 UTC (permalink / raw)
  To: u-boot

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.

-- 
Matthias

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

* [U-Boot] [PATCH] arm926ejs: remove noop flush_dcache_all function
  2011-12-10 16:36   ` Matthias Weisser
@ 2011-12-11 23:09     ` Ilya Yanok
  2011-12-12  9:20       ` Matthias Weißer
  0 siblings, 1 reply; 6+ messages in thread
From: Ilya Yanok @ 2011-12-11 23:09 UTC (permalink / raw)
  To: u-boot

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();
-- 
1.7.6.4

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

* [U-Boot] [PATCH] arm926ejs: remove noop flush_dcache_all function
  2011-12-11 23:09     ` [U-Boot] [PATCH] arm926ejs: remove noop flush_dcache_all function Ilya Yanok
@ 2011-12-12  9:20       ` Matthias Weißer
  2011-12-13 18:43         ` Tom Rini
  0 siblings, 1 reply; 6+ messages in thread
From: Matthias Weißer @ 2011-12-12  9:20 UTC (permalink / raw)
  To: u-boot

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 Yanok<yanok@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

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

* [U-Boot] [PATCH] arm926ejs: remove noop flush_dcache_all function
  2011-12-12  9:20       ` Matthias Weißer
@ 2011-12-13 18:43         ` Tom Rini
  0 siblings, 0 replies; 6+ messages in thread
From: Tom Rini @ 2011-12-13 18:43 UTC (permalink / raw)
  To: u-boot

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 Yanok<yanok@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!

-- 
Tom

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

end of thread, other threads:[~2011-12-13 18:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-09 14:24 [U-Boot] Cache function change breaks zmx25 Matthias Weißer
2011-12-09 15:03 ` Ilya Yanok
2011-12-10 16:36   ` Matthias Weisser
2011-12-11 23:09     ` [U-Boot] [PATCH] arm926ejs: remove noop flush_dcache_all function Ilya Yanok
2011-12-12  9:20       ` Matthias Weißer
2011-12-13 18:43         ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox