[U-Boot] [PATCH v5 2/9] dfu: Support larger than memory transfers.

Tom Rini trini at ti.com
Mon Mar 11 13:55:27 CET 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/11/2013 06:03 AM, Lukasz Majewski wrote:
> Hi Tom,
> 
> 
>> 
>>> From: Pantelis Antoniou <panto at antoniou-consulting.com>
>>> 
>>> Previously we didn't support upload/download larger than
>>> available memory.  This is pretty bad when you have to update
>>> your root filesystem for example.
>>> 
>>> This patch removes that limitation (and the crashes when you 
>>> transfered any file larger than 4MB) by making raw image writes
>>> be done in chunks and making file maximum size be
>>> configurable.
>>> 
>>> The sequence number is a 16 bit counter; make sure we handle 
>>> rollover correctly. This fixes the wrong transfers for large
>>> (> 256MB) images.
>>> 
>>> Also utilize a variable to handle initialization, so that we
>>> don't rely on just the counter sent by the host.
>>> 
>>> Signed-off-by: Pantelis Antoniou
>>> <panto at antoniou-consulting.com> Signed-off-by: Tom Rini
>>> <trini at ti.com>
>> 
>> Acked-by: Lukasz Majewski <l.majewski at samsung.com>
>> 
>> Test-hw: Exynos 4210 (Trats)
>> 
>> Tested-by: Lukasz Majewski <l.majewski at samsung.com>
> 
> Sorry but, I've found a regression for reading image from a file 
> system. It happens with EXT4 mmc read (like uImage).

Can you please confirm read works as-is today?  It's possible that
when I tried I was using (what I've now called) a marginal SD card
I've finally written too much to the front sectors on, but it wasn't
working for me at all.  I'll try and reproduce as well.  That said,
there is a problem:

> mmc_file_op: ext4load mmc 0:2 /uImage 0x0 0 0x7f95dc98 ** File not
> found 0x0 ** dfu: Read error!
> 
> ext4load params: ext4load - load binary file from a Ext4
> filesystem
> 
> Usage: ext4load <interface> <dev[:part]> [addr] [filename] [bytes] 
> - load binary file 'filename' from 'dev' on 'interface' to address
> 'addr' from ext4 filesystem. All numeric parameters are assumed to
> be hex.
> 
> Some parameters are wrong (buffer - 0x0) and some are switched
> (address and filename).

I just noticed last week that ext4load has the syntax backwards from
fatload for address/filename :(  And in this case it's passing in too
many params, so I will fix that.

>>> +	       __func__, dfu->name, buf, size, blk_seq_num, 
>>> dfu->i_buf); + +	if (!dfu->inited) { +		ret =
>>> dfu->read_medium(dfu, 0, NULL, &dfu->r_left);
> ^^^^^^^^^^^^ this call causes read error. I suppose, that it is an
> initial "read". Does it read the whole file at once?

I'll double check what's going on over here.

- -- 
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRPdQ+AAoJENk4IS6UOR1WYzgP/RwNBOTJ7XPM9mrFFU+3UtyA
Z/tUwuyghitC/rBBPuUyoml6Oq+9oVtCd89uZyjYjFUh68HKGSZ6a+XaLl1KC9Yr
n/3m91CXgnJAdh3TcrGoX6Gg9dVPb0vomLZpyZg/UK71PNnXcFI9BAvkXlfwUi1r
KbPDF10WzNq4qACELdwHKP8gumhBvgB+qyCHjFRalD/jk9HS1Nv7rIpgng2eQpbv
kGyRzZRJNmJ5s0/XSlg6G+XP9seE23oAw1eLZRO3bF33PcynC1L2R96iBLU4dIcQ
BHQp3jC+3m7v543eXqNvBaBJDIuABkqm8Or0xdw18T8d0unci+VxRXNvVlI2VrdL
fhhj47cSEKzAEJ6KTzwwvZl4CUnqfExPds/yTWl5CF+PNukw91b7kZca2uOuEtkM
htbQthvt7jzaD5Ji0U8R3FF3cJ39g1XVOARpY1hzPeHMrX83b5dHFPg0LDEj31qK
FWkNElx4MHgu2Cir8cBWGaFwAHxXqyG9VfPX2LwHD6zCLHmKryq+UlH+KfZgi3UE
u0vDxH24jeGccDc6BIXgJdDvt8AN8SQgXtpV6xrCWEPYR90GBpM8/yOIeTbxzuky
hTi2Ke8VxIGYmVWBDQ/YtKoANL1peiZuFB/DmoMA9d6WbQDkZbmgI0lQ+3x6kZxs
WRBsQxgaW4Yf6nIUv5X3
=t1hs
-----END PGP SIGNATURE-----


More information about the U-Boot mailing list