public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Markus Niebel <list-09_u-boot@tqsc.de>
To: u-boot@lists.denx.de
Subject: [U-Boot]  armv7 DMA and cache mangement functions
Date: Mon, 24 Aug 2015 09:54:17 +0200	[thread overview]
Message-ID: <55DACDA9.1090502@tqsc.de> (raw)

Hello,

I'm not an expert in the low level details of this area. So please sorry if there are
wrong assumptions in this post post.

Hardware: i.MX6 Solo (TQMa6 on custom Mainboard)
U-Boot: 2014.10
gcc: 4.8.3 

We see an error using TFTP on i.MX6 that seems to triggered, if the code / data size goes
over a limit. Code changes have nothing to do with network stack, network drivers, 
memory mangement. TFTP will completely unusable: device sees frequently erroneous packages 
with different of wierd errors. If code stays below this size all works fine.

Up to now we checked a lot of things. The following brought us to the assumption, that this
could be cache related:

dynamically disable data cache before doing TFTP: 	TFTP works well again
running with disabled L2 cache (data cache enabled):	TFTP works well again

Looking at the code in drivers/net/fec_mxc.c, function fec_recv we see a call to
invalidate_dcache_range before accessing the received ethernet data. When looking at
the code for invalidate_dcache_range in arch/arm/cpu/armv7/cache_v7.c an comparing
how the things done in linux and barebox we noticed that the order of L2 chache / data cache
invalidation is just swapped there. Applying this to the receive code for fec_mxc,
TFTP will work again.

Question: is the order of cache invalidation important?

Thanks

Markus

             reply	other threads:[~2015-08-24  7:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24  7:54 Markus Niebel [this message]
2015-08-27 17:19 ` [U-Boot] armv7 DMA and cache mangement functions Markus Niebel
2015-08-27 17:41 ` Mark Rutland
2015-08-28  8:43   ` Markus Niebel

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=55DACDA9.1090502@tqsc.de \
    --to=list-09_u-boot@tqsc.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