[U-Boot] [RFC][DFU] Unification of dfu_alt_info alt settings description + command execution

Heiko Schocher hs at denx.de
Fri Nov 1 07:15:32 CET 2013


Hello Lukasz,

Am 31.10.2013 18:25, schrieb Lukasz Majewski:
> Dear All,
>
> As a follow up from u-boot's mini-summit at ELCE 2013, I would like to
> once again share the new format of dfu_alt_info env variable (for those
> who couldn't attend).
>
> dfu_alt_info_cleanup:
>
>      |---+-------------+-------------+---------+----------------------|
>      |   |<dev_name>: |<alt_name>, |<type>   | extra params         |
>      |---+-------------+-------------+---------+----------------------|
>      | 1 | mmc0:       | rootfs,     | part;   | -                    |
>      | 2 | mmc0:       | uImage,     | file,   | part, dir;           |
>      | 3 | nand0:      | u-boot.bin, | raw,    | start, size;         |

One more usecase for nand (just for documentation):

        | 4 | nand0:      | u-boot      | part,   | -                    |

Here is "alt_name" == "mtd partition name" -> start, size from mtd info

>      | 4 | mmc0:       | u-boot.bin, | raw,    | start_lba, size_lba; |
>      | 5 | ram0:       | uImage,     | ram,    | start, size;         |
>      | 6 | ubi0:       | kernel0,    | raw;    | -                    |

There are 2 usecases with ubi (Please correct me, if I am wrong):

a) update a complete ubi device:

        | 6 | ubi0:      | kernel,     | part    | -                    |
        | 7 | ubi0:      | kernel,     | raw     | start, size          |

with them, we can update a complete "ubi device" with n ubi volumes
in it (This is currently used on the am335x based siemens boards).

I am not sure if ubi is more a "device" or more a "type". But as ubi can
be used also on nor flash, I think in the meantime, it is more a device
than a type in the sight of dfu ... but I vary here in my opinion...

This usecase is currently implemented for nand, and same code is
used as for "raw" or "part" nand usecases, just in the ubi case a
flag is set, which does:

- erase nand sectors with WITH_DROP_FFS
- erase spare sectors at the end of the area

b) update single ubi volume.

We need this infos for updating a ubi volume

- ubi device name = mtd partition name
- vid header offset
- ubi volume name
- ubi volume size
- ubi volume type

- steps for updating a ubi volume
   - attach to an ubi device
     "ubi part device_name vid_header_offset"
   - if volume_name !exist, create it
     "ubi create volume_name size type"
   - write ubi volume
     "ubi write img_addr volume_name size"


        | 8 | ubi0:      | data,        | volume  | vid_off, vol_nam, vol_sz, vol_type |
                           ^
                           device name
   You see, the list gets long ... or maybe we can cover this usecase
   with dfu command?

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