From: Mike Frysinger Date: Sun, 9 Oct 2011 11:56:46 -0400 Subject: [U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled In-Reply-To: <4E917A6B.1010200@emcraft.com> References: <1317857806-16549-1-git-send-email-yanok@emcraft.com> <201110071334.20378.vapier@gentoo.org> <4E917A6B.1010200@emcraft.com> Message-ID: <201110091156.47437.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sunday 09 October 2011 06:41:47 Ilya Yanok wrote: > On 07.10.2011 21:34, Mike Frysinger wrote: > >> +#ifdef DAVINCI_EMAC_DCACHE > >> +static inline void davinci_flush(void *addr, int size) > >> +{ > >> + flush_dcache_range((unsigned long)addr, > >> + (unsigned long)addr + size); > >> +} > >> + > >> +static inline void davinci_invalidate(void *addr, int size) > >> +{ > >> + invalidate_dcache_range((unsigned long)addr, > >> + (unsigned long)addr + size); > >> +} > >> +#else > >> +#define davinci_flush(addr, size) do {} while (0) > >> +#define davinci_invalidate(addr, size) do {} while (0) > >> +#endif > > > > does it really make sense to have this be conditional ? > > arm926ejs doesn't have {invalidate,flush}_dcache_range(), so we have to > add this not to break the driver on DaVinci boards (maybe we need to add > empty cache functions on arm926ejs instead?) if the prototype is in include/common.h, then code may assume it exists. if it doesn't exist for a particular cpu, then that cpu is broken and common code (which is what drivers/ is) should not be adding hacks to workaround broken cpus. please add stubs to the cpu you're referring to and drop the DAVINCI_EMAC_DCACHE define. or let whoever cares about that cpu add the defines, but still drop DAVINCI_EMAC_DCACHE. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20111009/a7bd825d/attachment.pgp