From: Stefano Babic Date: Tue, 2 Aug 2016 10:17:52 +0200 Subject: [U-Boot] [PATCH] mtd: nand: mxs: fix cache alignment for cache lines >32 In-Reply-To: <20160802065518.24140-1-stefan@agner.ch> References: <20160802065518.24140-1-stefan@agner.ch> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Stefan, On 02/08/2016 08:55, Stefan Agner wrote: > From: Stefan Agner > > Currently the command buffer gets allocated with a size of 32 bytes. > This causes warning messages on systems with cache lines bigger than > 32 bytes: > CACHE: Misaligned operation at range [9df17a00, 9df17a20] > I've never seen this on NAND.... > Define command buffer to be at least 32 bytes, but more if cache > line is bigger. > > Signed-off-by: Stefan Agner > --- > This appeared after Simon enable the message in check_cache_range > by default... ok, this explains why ! > > drivers/mtd/nand/mxs_nand.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c > index 94fc5c1..4bf564e 100644 > --- a/drivers/mtd/nand/mxs_nand.c > +++ b/drivers/mtd/nand/mxs_nand.c > @@ -37,7 +37,12 @@ > #endif > #define MXS_NAND_METADATA_SIZE 10 > #define MXS_NAND_BITS_PER_ECC_LEVEL 13 > + > +#if !defined(CONFIG_SYS_CACHELINE_SIZE) || CONFIG_SYS_CACHELINE_SIZE < 32 > #define MXS_NAND_COMMAND_BUFFER_SIZE 32 > +#else > +#define MXS_NAND_COMMAND_BUFFER_SIZE CONFIG_SYS_CACHELINE_SIZE > +#endif > > #define MXS_NAND_BCH_TIMEOUT 10000 > > Reviewed-by: Stefano Babic Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================