From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aneesh V Date: Tue, 17 May 2011 15:50:06 +0530 Subject: [U-Boot] [PATCH v3 05/10] armv7: integrate cache maintenance support In-Reply-To: <20110515185534.9B1F01491B06@gemini.denx.de> References: <1299589658-30896-1-git-send-email-aneesh@ti.com> <1305202276-27784-6-git-send-email-aneesh@ti.com> <20110515185534.9B1F01491B06@gemini.denx.de> Message-ID: <4DD24BD6.5060608@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Wolfgang, On Monday 16 May 2011 12:25 AM, Wolfgang Denk wrote: > Dear Aneesh V, > > In message<1305202276-27784-6-git-send-email-aneesh@ti.com> you wrote: >> - Enable I-cache on bootup >> - Enable MMU and D-cache immediately after relocation >> - Do necessary initialization before enabling d-cache and MMU > > Would it be possible to do this even _before_ relocation, so to speed > up memory accesses during relocation? Of course, proper invalidates/ > flushes will be needed before jumping to the RAM address, but I guess > this would save a bit of boot times? I intentionally kept it after relocation to avoid un-necessary complexities. Relocation is a case of self-modifying code. In Harvard architectures like armv7 there will be coherency issues unless we flush the entire D-cache(range based operation may be equally or more expensive) and invalidate the entire I-cache. So, in effect everything has to be flushed to memory before you jump to the new location. There may be a small advantage because flushing from cache allows for bursting to the DDR where as bursting is not possible when d-cache is disabled. But I think this is not worth the trouble. best regards, Aneesh