[U-Boot] [PATCH v2 1/3] ARM: cache: add an empty stub function for invalidate/flush dcache

Tom Rini trini at konsulko.com
Mon Jun 8 15:20:35 CEST 2015


On Mon, Jun 08, 2015 at 10:26:29AM +0200, Marek Vasut wrote:
> On Monday, June 08, 2015 at 04:05:04 AM, Josh Wu wrote:
> > Hi, Marek
> > 
> > On 6/5/2015 9:18 PM, Marek Vasut wrote:
> > > On Friday, June 05, 2015 at 09:47:30 AM, Josh Wu wrote:
> > >> Since some driver like ohci, lcd used dcache functions. But some ARM
> > >> cpu don't implement the invalidate_dcache_range()/flush_dcache_range()
> > >> functions.
> > >> 
> > >> To avoid compiling errors this patch adds an weak empty stub function
> > >> for all ARM cpu.
> > >> 
> > >> And each cpu can implement its own implementation. If not implemented
> > >> by default it will use an empty function.
> > >> 
> > >> Signed-off-by: Josh Wu <josh.wu at atmel.com>
> > >> ---
> > >> 
> > >> Changes in v2: new added
> > >> 
> > >>   arch/arm/lib/cache.c | 9 +++++++++
> > >>   1 file changed, 9 insertions(+)
> > > 
> > > So, why exactly can't this be entirely common code , but a CPU-specific
> > > code ? :)
> > 
> > Do you mean to make those empty functions as common code for all arch
> > cpu to use?
> 
> Yes.
> 
> > It seems there is no place to put common code for all arch cpu.
> 
> Isn't that what the common/ directory is for ? ;-)

No, this is making something common for the sake of making it common
rather than good architecutre of the code I think.  We aren't going to
share real cache functions just these dummy ones.  We may re-evaluate
our dummy ones at some point in the future when people try and use some
particular combination harder, see for example the PowerPC dummy cache
functions we just recently dropped.  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150608/f4179dbf/attachment.sig>


More information about the U-Boot mailing list