Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-21 Thread Henrik Nordström
tis 2013-05-21 klockan 14:26 +0200 skrev Wolfgang Denk: > > but imho the user shouldn't really need to care for these and is why I > > hooked into the go command. > > In this case you should use the common C API. Unfortunately the go command do now know what range(s) it needs to flush. > No. b

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-21 Thread Albert ARIBAUD
Hi Kees, On Tue, 21 May 2013 14:38:01 +0200, Kees Jongenburger wrote: > To my > understanding also enabling d-cache on ARM has no effect as long as > the MMU is not turned on so I totally miss the point. Enabling dcache gives DDR access performance benefits regardless of enabling MMU. > Greeti

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-21 Thread Kees Jongenburger
Hello, On Thu, May 16, 2013 at 5:37 PM, Henrik Nordström wrote: > Or maybe just punt it. If you are on an arch with incoherent caches then > make sure to make use of the cache command to flush caches and maybe > even disable caches before using go. This is indeed the behaviour one would expect fr

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-21 Thread Wolfgang Denk
Dear Kuo-Jung Su, In message you wrote: > > How about making the weak aliased arch_preboot_os() global, and then > get it invoked > in both bootm & go? > It looks much pretty to me, and we don't even worry about the i-cache issues. That would not really help as it would be architecure specific,

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-21 Thread Wolfgang Denk
Dear Henrik Nordström, In message <1368792981.765.21.camel@localhost> you wrote: > > > There is a common, architecture-independent C API that implements > > cache flushing/invalidation; please re-read the summary at [1] > > Sorry I missed that discussion. Had a bit too much mail for a while. No

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-19 Thread Kuo-Jung Su
2013/5/17 Henrik Nordström : > fre 2013-05-17 klockan 00:13 +0200 skrev Wolfgang Denk: > >> There is a common, architecture-independent C API that implements >> cache flushing/invalidation; please re-read the summary at [1] > > Sorry I missed that discussion. Had a bit too much mail for a while. >

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-17 Thread Henrik Nordström
fre 2013-05-17 klockan 00:13 +0200 skrev Wolfgang Denk: > There is a common, architecture-independent C API that implements > cache flushing/invalidation; please re-read the summary at [1] Sorry I missed that discussion. Had a bit too much mail for a while. > > Or maybe just punt it. If you are

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-16 Thread Wolfgang Denk
Dear Henrik, In message <1368718669.25965.14.camel@localhost> you wrote: > > I do not like having these things arch specific. I implemented it as an > ARMv7 hook only because there is no general cross-platform u-boot > function for clearing the icache. I'd much rather have a generic > function ca

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-16 Thread Henrik Nordström
tor 2013-05-16 klockan 09:37 -0400 skrev Tom Rini: > That this topic keeps coming up is one of the reasons I asked Henrik to > post this patch when I was looking over the Allwinner support queue. I > thought this was a rather clever fixup. For what it's worth a similar issue is also relevant to

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-16 Thread Tom Rini
On Thu, May 16, 2013 at 09:14:06AM +0200, Wolfgang Denk wrote: > Dear Henrik Nordstr??m, > > In message <1368669278.27007.43.camel@localhost> you wrote: > > > > > So my suggestion is to implement the icache_flush in common/bmmt_cmd.c > > > as follows: > ... > > From what I can tell there is no ne

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-16 Thread Wolfgang Denk
Dear Henrik Nordström, In message <1368669278.27007.43.camel@localhost> you wrote: > > > So my suggestion is to implement the icache_flush in common/bmmt_cmd.c > > as follows: ... > From what I can tell there is no need to theck icache_status(). It's > always safe to call invalidate_icache_all().

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-15 Thread Henrik Nordström
ons 2013-05-15 klockan 19:39 +0200 skrev Albert ARIBAUD: > I understand all this, but what I am interested in is the root issue. > > IIUC, the problem is that some code is loaded in DDR, and the CPU is > about to jump to it, but its instruction cache is enabled so maybe some > instructions afte

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-15 Thread Albert ARIBAUD
Hi Tom, On Wed, 15 May 2013 12:51:21 -0400, Tom Rini wrote: > On Wed, May 15, 2013 at 06:44:10PM +0200, Albert ARIBAUD wrote: > > Hi Henrik, > > > > On Wed, 15 May 2013 18:34:07 +0200, Henrik Nordstr??m > > wrote: > > > > > ons 2013-05-15 klockan 17:11 +0200 skrev Albert ARIBAUD: > > > > > >

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-15 Thread Tom Rini
On Wed, May 15, 2013 at 06:44:10PM +0200, Albert ARIBAUD wrote: > Hi Henrik, > > On Wed, 15 May 2013 18:34:07 +0200, Henrik Nordstr??m > wrote: > > > ons 2013-05-15 klockan 17:11 +0200 skrev Albert ARIBAUD: > > > > > What is the rationale behind putting it in arch/ rather than in common/ > > >

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-15 Thread Albert ARIBAUD
Hi Henrik, On Wed, 15 May 2013 18:34:07 +0200, Henrik Nordström wrote: > ons 2013-05-15 klockan 17:11 +0200 skrev Albert ARIBAUD: > > > What is the rationale behind putting it in arch/ rather than in common/ > > by adding this to the existing common/cmd_boot.c file under ARMv7 > > conditionals?

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-15 Thread Henrik Nordström
ons 2013-05-15 klockan 17:11 +0200 skrev Albert ARIBAUD: > What is the rationale behind putting it in arch/ rather than in common/ > by adding this to the existing common/cmd_boot.c file under ARMv7 > conditionals? Only because of what I said earlier: blindly calling invalidate_icache_all() from

Re: [U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-15 Thread Albert ARIBAUD
Hi Henrik, On Tue, 14 May 2013 16:16:02 +0200, Henrik Nordström wrote: > Tom Rini wanted me to post this again. There is no change from previous > version. > > I do agree with Wolfgang Denk that this really SHOULD NOT be arch > specific. The only reason why I made this ARMv7 specific is because

[U-Boot] ARM v7: Flush icache when executing a program with go

2013-05-14 Thread Henrik Nordström
Tom Rini wanted me to post this again. There is no change from previous version. I do agree with Wolfgang Denk that this really SHOULD NOT be arch specific. The only reason why I made this ARMv7 specific is because blindly calling invalidate_icache_all() from the go command will cause loud complai