[U-Boot] [PATCH 1/2] integratorap: disable dcache

Stefan Roese sr at denx.de
Fri Jul 15 11:31:32 CEST 2011


Hi Laurence,

On Friday 15 July 2011 10:54:41 Laurence Withers wrote:
> On Fri, Jul 15, 2011 at 09:42:53AM +0200, Heiko Schocher wrote:
> > Hmm.. trying bootm with actual u-boot on a davinci (arm926ejs) based
> > board, there I couldn;t use the Davinci-EMAC (if I disable the dcache
> > it works ...)
> 
> I can confirm there are some cache coherency problems with the DaVinci EMAC
> driver. I've done a port to a new board based on the DA850 and had problems
> with corrupt Ethernet packets until I disabled the dcache altogether. The
> clue was the packets started working when I added a hex dump just before
> eth_send()!
> 
> While I haven't come across any explicit documentation I presume the EMAC
> controller's independent DMA engine is simply not aware of the ARM's cache.

Yes.

> I haven't yet identified whether there's some mechanism already in U-Boot
> for marking particular bits of memory as uncacheable, which would seem to
> be the correct approach, but turning of dcache doesn't really have any
> side effects that cause problems for me.

The "side effect" is a slow down on boot time. And it should be avoided if 
possible.

We have stumbled over this d-cache "problem" on powerpc a while ago. I suggest 
you take a look at the EHCI driver for example (drivers/usb/host/ehci-hcd.c). 
Please search for CONFIG_EHCI_DCACHE). We implemented the following functions 
on powerpc for d-cache handling:

- flush_dcache_range()
- invalidate_dcache_range()

The API was taken from Linux at that time. Now I notice that unfortunately 
this API seems to be powerpc specific in Linux. IMHO it would make sense to 
either implement this API for all other platforms using dcache with DMA 
engines (e.g. USB), or introduce another cache/flush/invalidate API and move 
powerpc to it as well.

Best regards,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de


More information about the U-Boot mailing list