public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] integratorap: disable dcache
Date: Fri, 15 Jul 2011 11:31:32 +0200	[thread overview]
Message-ID: <201107151131.32896.sr@denx.de> (raw)
In-Reply-To: <20110715085441.GA5891@guralp.com>

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

  reply	other threads:[~2011-07-15  9:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13 23:04 [U-Boot] [PATCH 1/2] integratorap: disable dcache Linus Walleij
2011-07-14 11:39 ` Wolfgang Denk
2011-07-14 17:57   ` Linus Walleij
2011-07-15  7:42     ` Heiko Schocher
2011-07-15  8:54       ` Laurence Withers
2011-07-15  9:31         ` Stefan Roese [this message]
2011-07-15  9:36       ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201107151131.32896.sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox