From: Wolfgang Denk Date: Tue, 21 May 2013 14:26:01 +0200 Subject: [U-Boot] ARM v7: Flush icache when executing a program with go In-Reply-To: <1368792981.765.21.camel@localhost> References: <1368540962.4464.9.camel@localhost> <20130515171111.481eb3de@lilith> <1368635647.3991.18.camel@localhost> <20130515184410.26e34874@lilith> <20130515165121.GG29196@bill-the-cat> <20130515193959.69aa9d64@lilith> <1368669278.27007.43.camel@localhost> <20130516071406.6AD19380635@gemini.denx.de> <20130516133754.GF32163@bill-the-cat> <1368718669.25965.14.camel@localhost> <20130516221350.49FAA3811D7@gemini.denx.de> <1368792981.765.21.camel@localhost> Message-ID: <20130521122601.6D9BA384809@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 problem; that's why I pointed you to the sumnmary (and the rest of the thread). > > The cache commands currently do not support subcommands for flushing > > / invalidating the caches. See again [1]. > > From what I see the cache commands do have a sub commands for flushing. > > "icache flush" calls icache_invalidate_all(). > > "dcache flush" calls flush_dcache_all(). Indeed. I was not aware of this :-( > 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. > I don't see much of a performance problem with a automatic full cache > flush when using the go command on platforms with incoherent caches. In > most use cases it's not very different from the bootm command which also > needs to do the same (and using a similar hooking mechanism as what I > used for go, but not saying that is a good thing) No. bootm knows exactly the location and size of the image, so it is sufficient to flush / invalidate a part of the memory, usually a pretty small one compared to the total RAM size. > And I do not think there needs to be commands for flushing specific > regions other than for testing. Region based flushing is better done by > code which knows what is needed. It's hard for users to get this right > as most times it works anyway. The code should know which ranges need flushing, not the user. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Now here's something you're really going to like!" - Rocket J. Squirrel