From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Agner Date: Wed, 03 Aug 2016 12:18:48 -0700 Subject: [U-Boot] [PATCH] mtd: nand: mxs: fix cache alignment for cache lines >32 In-Reply-To: References: <20160802065518.24140-1-stefan@agner.ch> <25dc4a8aeadcdc3698ce4f59b619dc01@agner.ch> <20160803180908.GA9942@bill-the-cat> Message-ID: <453e7f677bc53a50f4683df55e7d9ca8@agner.ch> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2016-08-03 11:44, Fabio Estevam wrote: > Hi Simon, > > On Wed, Aug 3, 2016 at 3:35 PM, Simon Glass wrote: > >> Actually I think these are bugs and should be fixed. In this case, I am completely with you Simon! check_cache_range return 0, which actually leads to the cache operation not being executed at all! Depending on the situation this can be quite catastrophic... >> from what I can tell netboot_common() should cache-align the size in >> the call to: >> >> /* flush cache */ >> flush_cache(load_addr, size); > > Do you mean like this? > > --- a/cmd/net.c > +++ b/cmd/net.c > @@ -244,6 +244,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmd > } > > /* flush cache */ > + load_addr &= ~(CONFIG_SYS_CACHELINE_SIZE - 1); > + size = ALIGN(size, CONFIG_SYS_CACHELINE_SIZE); > flush_cache(load_addr, size); > > bootstage_mark(BOOTSTAGE_ID_NET_LOADED); > > This makes the net warnings go away. Yes, see my patch too. https://patchwork.ozlabs.org/patch/654585/ So up until now, that stuff did not get flushed whenever the file size was not cache line aligned, and nobody noticed... Is that cache flush necessary at all? > > There is still this one that I am seeing: > > Kernel image @ 0x80800000 [ 0x000000 - 0x6fea70 ] > ## Flattened Device Tree blob at 83000000 > Booting using the fdt blob at 0x83000000 > Using Device Tree in place at 83000000, end 83009c5d > > Starting kernel ... > > CACHE: Misaligned operation at range [00900000, 00900529] > [ 0.000000] Booting Linux on physical CPU 0x0 > > Any ideas where it may come from? I did not had that one on i.MX 7 -- Stefan