ubi: bump ubi-media.h to newest version
Needed for ubiformat, we are interested in image_seq especially. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
52e60618d6
commit
68e00c165c
|
@ -11,7 +11,6 @@
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
||||||
* the GNU General Public License for more details.
|
* the GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* Authors: Artem Bityutskiy (Битюцкий Артём)
|
* Authors: Artem Bityutskiy (Битюцкий Артём)
|
||||||
* Thomas Gleixner
|
* Thomas Gleixner
|
||||||
* Frank Haverkamp
|
* Frank Haverkamp
|
||||||
|
@ -98,7 +97,8 @@ enum {
|
||||||
* to the flash
|
* to the flash
|
||||||
* @UBI_COMPAT_RO: attach this device in read-only mode
|
* @UBI_COMPAT_RO: attach this device in read-only mode
|
||||||
* @UBI_COMPAT_PRESERVE: preserve this internal volume - do not touch its
|
* @UBI_COMPAT_PRESERVE: preserve this internal volume - do not touch its
|
||||||
* physical eraseblocks, don't allow the wear-leveling unit to move them
|
* physical eraseblocks, don't allow the wear-leveling
|
||||||
|
* sub-system to move them
|
||||||
* @UBI_COMPAT_REJECT: reject this UBI image
|
* @UBI_COMPAT_REJECT: reject this UBI image
|
||||||
*/
|
*/
|
||||||
enum {
|
enum {
|
||||||
|
@ -125,13 +125,14 @@ enum {
|
||||||
* @ec: the erase counter
|
* @ec: the erase counter
|
||||||
* @vid_hdr_offset: where the VID header starts
|
* @vid_hdr_offset: where the VID header starts
|
||||||
* @data_offset: where the user data start
|
* @data_offset: where the user data start
|
||||||
|
* @image_seq: image sequence number
|
||||||
* @padding2: reserved for future, zeroes
|
* @padding2: reserved for future, zeroes
|
||||||
* @hdr_crc: erase counter header CRC checksum
|
* @hdr_crc: erase counter header CRC checksum
|
||||||
*
|
*
|
||||||
* The erase counter header takes 64 bytes and has a plenty of unused space for
|
* The erase counter header takes 64 bytes and has a plenty of unused space for
|
||||||
* future usage. The unused fields are zeroed. The @version field is used to
|
* future usage. The unused fields are zeroed. The @version field is used to
|
||||||
* indicate the version of UBI implementation which is supposed to be able to
|
* indicate the version of UBI implementation which is supposed to be able to
|
||||||
* work with this UBI image. If @version is greater then the current UBI
|
* work with this UBI image. If @version is greater than the current UBI
|
||||||
* version, the image is rejected. This may be useful in future if something
|
* version, the image is rejected. This may be useful in future if something
|
||||||
* is changed radically. This field is duplicated in the volume identifier
|
* is changed radically. This field is duplicated in the volume identifier
|
||||||
* header.
|
* header.
|
||||||
|
@ -140,6 +141,14 @@ enum {
|
||||||
* volume identifier header and user data, relative to the beginning of the
|
* volume identifier header and user data, relative to the beginning of the
|
||||||
* physical eraseblock. These values have to be the same for all physical
|
* physical eraseblock. These values have to be the same for all physical
|
||||||
* eraseblocks.
|
* eraseblocks.
|
||||||
|
*
|
||||||
|
* The @image_seq field is used to validate a UBI image that has been prepared
|
||||||
|
* for a UBI device. The @image_seq value can be any value, but it must be the
|
||||||
|
* same on all eraseblocks. UBI will ensure that all new erase counter headers
|
||||||
|
* also contain this value, and will check the value when scanning at start-up.
|
||||||
|
* One way to make use of @image_seq is to increase its value by one every time
|
||||||
|
* an image is flashed over an existing image, then, if the flashing does not
|
||||||
|
* complete, UBI will detect the error when scanning.
|
||||||
*/
|
*/
|
||||||
struct ubi_ec_hdr {
|
struct ubi_ec_hdr {
|
||||||
__be32 magic;
|
__be32 magic;
|
||||||
|
@ -148,7 +157,8 @@ struct ubi_ec_hdr {
|
||||||
__be64 ec; /* Warning: the current limit is 31-bit anyway! */
|
__be64 ec; /* Warning: the current limit is 31-bit anyway! */
|
||||||
__be32 vid_hdr_offset;
|
__be32 vid_hdr_offset;
|
||||||
__be32 data_offset;
|
__be32 data_offset;
|
||||||
__u8 padding2[36];
|
__be32 image_seq;
|
||||||
|
__u8 padding2[32];
|
||||||
__be32 hdr_crc;
|
__be32 hdr_crc;
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
@ -164,16 +174,15 @@ struct ubi_ec_hdr {
|
||||||
* %UBI_COMPAT_IGNORE, %UBI_COMPAT_PRESERVE, or %UBI_COMPAT_REJECT)
|
* %UBI_COMPAT_IGNORE, %UBI_COMPAT_PRESERVE, or %UBI_COMPAT_REJECT)
|
||||||
* @vol_id: ID of this volume
|
* @vol_id: ID of this volume
|
||||||
* @lnum: logical eraseblock number
|
* @lnum: logical eraseblock number
|
||||||
* @leb_ver: version of this logical eraseblock (IMPORTANT: obsolete, to be
|
* @padding1: reserved for future, zeroes
|
||||||
* removed, kept only for not breaking older UBI users)
|
|
||||||
* @data_size: how many bytes of data this logical eraseblock contains
|
* @data_size: how many bytes of data this logical eraseblock contains
|
||||||
* @used_ebs: total number of used logical eraseblocks in this volume
|
* @used_ebs: total number of used logical eraseblocks in this volume
|
||||||
* @data_pad: how many bytes at the end of this physical eraseblock are not
|
* @data_pad: how many bytes at the end of this physical eraseblock are not
|
||||||
* used
|
* used
|
||||||
* @data_crc: CRC checksum of the data stored in this logical eraseblock
|
* @data_crc: CRC checksum of the data stored in this logical eraseblock
|
||||||
* @padding1: reserved for future, zeroes
|
|
||||||
* @sqnum: sequence number
|
|
||||||
* @padding2: reserved for future, zeroes
|
* @padding2: reserved for future, zeroes
|
||||||
|
* @sqnum: sequence number
|
||||||
|
* @padding3: reserved for future, zeroes
|
||||||
* @hdr_crc: volume identifier header CRC checksum
|
* @hdr_crc: volume identifier header CRC checksum
|
||||||
*
|
*
|
||||||
* The @sqnum is the value of the global sequence counter at the time when this
|
* The @sqnum is the value of the global sequence counter at the time when this
|
||||||
|
@ -184,7 +193,7 @@ struct ubi_ec_hdr {
|
||||||
* (sequence number) is used to distinguish between older and newer versions of
|
* (sequence number) is used to distinguish between older and newer versions of
|
||||||
* logical eraseblocks.
|
* logical eraseblocks.
|
||||||
*
|
*
|
||||||
* There are 2 situations when there may be more then one physical eraseblock
|
* There are 2 situations when there may be more than one physical eraseblock
|
||||||
* corresponding to the same logical eraseblock, i.e., having the same @vol_id
|
* corresponding to the same logical eraseblock, i.e., having the same @vol_id
|
||||||
* and @lnum values in the volume identifier header. Suppose we have a logical
|
* and @lnum values in the volume identifier header. Suppose we have a logical
|
||||||
* eraseblock L and it is mapped to the physical eraseblock P.
|
* eraseblock L and it is mapped to the physical eraseblock P.
|
||||||
|
@ -221,10 +230,6 @@ struct ubi_ec_hdr {
|
||||||
* checksum is correct, this physical eraseblock is selected (P1). Otherwise
|
* checksum is correct, this physical eraseblock is selected (P1). Otherwise
|
||||||
* the older one (P) is selected.
|
* the older one (P) is selected.
|
||||||
*
|
*
|
||||||
* Note, there is an obsolete @leb_ver field which was used instead of @sqnum
|
|
||||||
* in the past. But it is not used anymore and we keep it in order to be able
|
|
||||||
* to deal with old UBI images. It will be removed at some point.
|
|
||||||
*
|
|
||||||
* There are 2 sorts of volumes in UBI: user volumes and internal volumes.
|
* There are 2 sorts of volumes in UBI: user volumes and internal volumes.
|
||||||
* Internal volumes are not seen from outside and are used for various internal
|
* Internal volumes are not seen from outside and are used for various internal
|
||||||
* UBI purposes. In this implementation there is only one internal volume - the
|
* UBI purposes. In this implementation there is only one internal volume - the
|
||||||
|
@ -245,9 +250,9 @@ struct ubi_ec_hdr {
|
||||||
* The @data_crc field contains the CRC checksum of the contents of the logical
|
* The @data_crc field contains the CRC checksum of the contents of the logical
|
||||||
* eraseblock if this is a static volume. In case of dynamic volumes, it does
|
* eraseblock if this is a static volume. In case of dynamic volumes, it does
|
||||||
* not contain the CRC checksum as a rule. The only exception is when the
|
* not contain the CRC checksum as a rule. The only exception is when the
|
||||||
* data of the physical eraseblock was moved by the wear-leveling unit, then
|
* data of the physical eraseblock was moved by the wear-leveling sub-system,
|
||||||
* the wear-leveling unit calculates the data CRC and stores it in the
|
* then the wear-leveling sub-system calculates the data CRC and stores it in
|
||||||
* @data_crc field. And of course, the @copy_flag is %in this case.
|
* the @data_crc field. And of course, the @copy_flag is %in this case.
|
||||||
*
|
*
|
||||||
* The @data_size field is used only for static volumes because UBI has to know
|
* The @data_size field is used only for static volumes because UBI has to know
|
||||||
* how many bytes of data are stored in this eraseblock. For dynamic volumes,
|
* how many bytes of data are stored in this eraseblock. For dynamic volumes,
|
||||||
|
@ -274,14 +279,14 @@ struct ubi_vid_hdr {
|
||||||
__u8 compat;
|
__u8 compat;
|
||||||
__be32 vol_id;
|
__be32 vol_id;
|
||||||
__be32 lnum;
|
__be32 lnum;
|
||||||
__be32 leb_ver; /* obsolete, to be removed, don't use */
|
__be32 leb_ver;
|
||||||
__be32 data_size;
|
__be32 data_size;
|
||||||
__be32 used_ebs;
|
__be32 used_ebs;
|
||||||
__be32 data_pad;
|
__be32 data_pad;
|
||||||
__be32 data_crc;
|
__be32 data_crc;
|
||||||
__u8 padding1[4];
|
__u8 padding2[4];
|
||||||
__be64 sqnum;
|
__be64 sqnum;
|
||||||
__u8 padding2[12];
|
__u8 padding3[12];
|
||||||
__be32 hdr_crc;
|
__be32 hdr_crc;
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue