[U-Boot] [PATCH V2] usb: ci_udc: Allocate the qTD list directly

Stephen Warren swarren at wwwdotorg.org
Wed Jul 2 01:10:24 CEST 2014


On 07/01/2014 04:57 PM, Jörg Krause wrote:
> 
> On 07/02/2014 12:51 AM, Stephen Warren wrote:
>> [...]
>>>      Loading: ##
>>>           4.3 MiB/s
>>>      done
>>>      Bytes transferred = 18003 (4653 hex)
>>>      CACHE: Misaligned operation at range [40008000, 4000c653]
>> OK, that particular error happens well after the network transfer phase
>> of the tftp command, so is likely nothing to do with ci_udc. It'd be
>> great if you could track it down and fix it though.
> 
> Oh, any idea where to look at?

My guess is common/cmd_net.c netboot_common() which does:

	/* flush cache */
	flush_cache(load_addr, size);

That seems pointless and wrong:

* The Ethernet driver should do any cache management it requires as part
of its low-level IO code, before copying the data to the load address.

* A cache flush after copying data into RAM seems pointless. A cache
*invalidate* /might/ make sense in some circumstances (e.g. after DMA
before CPU reads), but that's not the case here.

* The top-level TFTP code can't do the cache management, since it can't
be sure that the file length is an exact multiple of the cache line
size, and hence can't guarantee that cache management won't corrupt
other adjacent data. That's why the cache management must be performed
by the low-level network driver on its own aligned buffers.

In summary, I think we should remove that flush_cache() call, but I'm
not going to send a patch for that right before I go on vacation right
before a release...


More information about the U-Boot mailing list