[U-Boot] [PATCH 4/4] dfu: add SF backend

Lukasz Majewski l.majewski at samsung.com
Tue Sep 22 09:23:54 CEST 2015


Hi Fabio,

> On Tue, Sep 22, 2015 at 12:23 AM, Stephen Warren
> <swarren at wwwdotorg.org> wrote:
> 
> > Oh good:-)

Nice to hear, that the bug is fixed.

> >
> > I was going to give you my dfu_alt_info, but it's at work right
> > now, so I was waiting until tomorrow. I did try to repro this, but
> > I was having a lot of trouble with both the two boards I have that
> > have SPI, so wasn't able to test yet.
> >
> > One thing I did notice: dfu_sf.c's parsing code doesn't work with
> > multiple entries in dfu_alt_info (e.g. for different partitions)
> > since the parsing of the device parameter (to the dfu command; not
> > part of dfu_info) modifies that parameter so it can't be parsed the
> > second time around. Since you're set up to test this, perhaps you
> > could fix it too? I assume all it'd need is to add a
> > strdup()/free() to the start/end of the alt info parsing function?
> 
> Yes, I noticed a problem here on parsing dfu_alt_info. In my case I
> need to flash the u-boot binary at offset 0x400 of the SPI NOR, but I
> was not able to find the correct syntax for this. I have tried:
> 
> dfu_alt_info=u-boot raw 0x400

For some dfu_alt_info example, please refer
to ./include/configs/trats[2].h files.

> 
> ,but I am not familiar with the dfu_alt_info syntax, so maybe this
> needs some adjustment.
> 
> For the eMMC I am able to flash it at offset 0x400 using the
> dfu_alt_info from warp.h:
> "dfu_alt_info=boot raw 0x2 0x400 mmcpart 1\0" \  ---> I am not sure
> what the 0x2 means.

As fair as I remember - 0x2 is the starting LBA number for eMMC. 0x400
is the number of consecutive LBAs to write to the medium.

> 
> At least the SPI NOR is getting flashed now (at offset 0x0 instead of
> 0x400) with the fix I have made. Will submit the fix soon.
> 
> About the incorrect offset, it is a different issue and I will
> investigate more tomorrow.

Since I don't have any target with SPI Flash, I can only guess or
provide analogy to eMMC.

In the eMMC case it is also possible to flash "raw" eMMC with passing
starting LBA and number of LBAs for write.

In ./include/configs/trats.h : dfu_alt_info="params.bin raw 0x38 0x8"

> 
> Thanks



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group


More information about the U-Boot mailing list