All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] arm: Activating dcache breaks 'usb start' and 'tftpboot' on jadecpu
Date: Fri, 03 Dec 2010 16:33:10 +0100	[thread overview]
Message-ID: <20101203153310.8BA14CD138A@gemini.denx.de> (raw)
In-Reply-To: <4CF90819.7040904@arcor.de>

Dear =?ISO-8859-1?Q?Matthias_Wei=DFer?=,

In message <4CF90819.7040904@arcor.de> you wrote:
> 
> >> Has anyone an explanation for this behavior? Is anyone out there having
> >> dcache running on an ARM926 and working usb/tftpboot?
> >
> > Many drivers have not been written to work with enabled caches.
> 
> What is the reason that special handling is needed when dcache is 
> enabled? If a driver doesn't use any DMA there should be no need as the 
> dcache is only enabled for the RAM and not for any memory mapped IO if I 
> understand the code in arch/arm/lib/cache-cp15.c right.

On ARM, device write accesses are typically just store instructions
(in C: assignments to a volatile pointer). With caches on, these
accesses will be - guess what? cached, i. e. they are NOT written to
the device, at least not immediately.  And if you repeatedly read a
register (like when polling for some status bit to change) these
accesses will be cached, too.

You need to make sure that caches are properly flushed / invalidated
at the right points.

> > As far as USB is concerned, you might be lucky that your system usies
> > a EHCI controller, so setting CONFIG_EHCI_DCACHE should help.
> 
> No, only OHCI.

Bad luck.

> As the memory mapped network controller (SMSC9221) is not cached it 
> shouldn't be a problem or do I miss something here?

You said you had enabled the data cache, so why do you think these
accesses are not cached?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Blast medicine anyway!  We've learned to tie into every organ in the
human body but one.  The brain!  The brain is what life is all about.
	-- McCoy, "The Menagerie", stardate 3012.4

  reply	other threads:[~2010-12-03 15:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-03 14:27 [U-Boot] arm: Activating dcache breaks 'usb start' and 'tftpboot' on jadecpu Matthias Weißer
2010-12-03 14:47 ` Wolfgang Denk
2010-12-03 15:09   ` Matthias Weißer
2010-12-03 15:33     ` Wolfgang Denk [this message]
2010-12-03 16:34       ` Albert ARIBAUD
2010-12-03 16:48         ` Matthias Weißer
2010-12-03 16:43       ` Matthias Weißer
2010-12-03 16:55         ` Wolfgang Denk

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=20101203153310.8BA14CD138A@gemini.denx.de \
    --to=wd@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.