[U-Boot] dfu: dfu and UBI Volumes

Heiko Schocher hs at denx.de
Tue May 28 05:42:32 CEST 2013


Hello Wolfgang,

Am 27.05.2013 23:25, schrieb Wolfgang Denk:
> Dear Tom,
> 
> In message <20130527204127.GY17119 at bill-the-cat> you wrote:
>>
>> This _may_ be the hard part for UBI.  When doing raw block writes for
>> NAND/MMC, we're able to write them out quickly and thus support images
>> larger than RAM.  But for filesystems we don't support that notion in
>> general for write and so limit ourselves to 8MiB or so files.  Fine for
> 
> Where exactly is this 8 MB limit coming into play?

You find this in drivers/dfu/dfu.c:

static unsigned char __aligned(CONFIG_SYS_CACHELINE_SIZE)
                                   dfu_buf[DFU_DATA_BUF_SIZE];

I had just a patch in my workqueue, where I made this value
at least configurable ... but this limits not the transfer file
size, see below...

>> the most part, but not fine for UBI.  It's possible that we can support
>> this on UBI easier than we can on filesystems, but I just don't know.
> 
> I thought the only size limitation for images we can load is available
> system RAM?  Is this not the case?

As I read in code: Raw nand partitions fill the above buffer, if
it is full -> flush to nand, and go on ... so no limit for them.

drivers/dfu/dfu_mmc.c use (another?, why?) buffer:

static unsigned char __aligned(CONFIG_SYS_CACHELINE_SIZE)
                                dfu_file_buf[CONFIG_SYS_DFU_MAX_FILE_SIZE];

and use this buffer for not raw partitions ... and this buffer
gets flushed, only if the complete file is transfered, as the
README states:

                CONFIG_SYS_DFU_MAX_FILE_SIZE
                When updating files rather than the raw storage device,
                we use a static buffer to copy the file into and then write
                the buffer once we've been given the whole file.  Define
                this to the maximum filesize (in bytes) for the buffer.
                Default is 4 MiB if undefined.

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list