From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shinya Kuribayashi Date: Wed, 14 May 2008 01:18:01 +0900 Subject: [U-Boot-Users] bugs in flush_cache In-Reply-To: <44f4144c0805130858x4bc68ae8s77d223216fc7b08a@mail.gmail.com> References: <44f4144c0805130526i18255f76l38633a38230816c4@mail.gmail.com> <48299557.4020706@ruby.dti.ne.jp> <44f4144c0805130858x4bc68ae8s77d223216fc7b08a@mail.gmail.com> Message-ID: <4829BF39.50503@ruby.dti.ne.jp> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Eyal Bari wrote: > in your version of the function the iterated cache ops second argument > was start_addr which stay constant. Probably already fixed in the latest git. See below commit: http://git.denx.de/?p=u-boot.git;a=commitdiff;h=188e94c370621708d13547d58dbc6ed3c5602aa8 > the second bug is that it doesn't iterate over the entire range: > for example: > if size is 42 and the cache line size is 32 - it takes two cache lines > to cache this buffer > your version will iterate only over one cache line > my version will iterate over two cache line covering the entire range Note that (addr == aend) is evaluated *after* cache_op()s. If start_addr = 0x80000000, size = 42, CFG_CACHE_LINE_SIZE = 32, cache_op( , 0x80000000) and cache_op( , 0x80000020) will be done. I hope I don't miss anything.