aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/ubi-media.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/ubi-media.h')
-rw-r--r--drivers/mtd/ubi/ubi-media.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/ubi-media.h b/drivers/mtd/ubi/ubi-media.h
index 8419fdccc79..503ea9b2730 100644
--- a/drivers/mtd/ubi/ubi-media.h
+++ b/drivers/mtd/ubi/ubi-media.h
@@ -129,6 +129,7 @@ enum {
129 * @ec: the erase counter 129 * @ec: the erase counter
130 * @vid_hdr_offset: where the VID header starts 130 * @vid_hdr_offset: where the VID header starts
131 * @data_offset: where the user data start 131 * @data_offset: where the user data start
132 * @image_seq: image sequence number
132 * @padding2: reserved for future, zeroes 133 * @padding2: reserved for future, zeroes
133 * @hdr_crc: erase counter header CRC checksum 134 * @hdr_crc: erase counter header CRC checksum
134 * 135 *
@@ -144,6 +145,14 @@ enum {
144 * volume identifier header and user data, relative to the beginning of the 145 * volume identifier header and user data, relative to the beginning of the
145 * physical eraseblock. These values have to be the same for all physical 146 * physical eraseblock. These values have to be the same for all physical
146 * eraseblocks. 147 * eraseblocks.
148 *
149 * The @image_seq field is used to validate a UBI image that has been prepared
150 * for a UBI device. The @image_seq value can be any value, but it must be the
151 * same on all eraseblocks. UBI will ensure that all new erase counter headers
152 * also contain this value, and will check the value when scanning at start-up.
153 * One way to make use of @image_seq is to increase its value by one every time
154 * an image is flashed over an existing image, then, if the flashing does not
155 * complete, UBI will detect the error when scanning.
147 */ 156 */
148struct ubi_ec_hdr { 157struct ubi_ec_hdr {
149 __be32 magic; 158 __be32 magic;
@@ -152,7 +161,8 @@ struct ubi_ec_hdr {
152 __be64 ec; /* Warning: the current limit is 31-bit anyway! */ 161 __be64 ec; /* Warning: the current limit is 31-bit anyway! */
153 __be32 vid_hdr_offset; 162 __be32 vid_hdr_offset;
154 __be32 data_offset; 163 __be32 data_offset;
155 __u8 padding2[36]; 164 __be32 image_seq;
165 __u8 padding2[32];
156 __be32 hdr_crc; 166 __be32 hdr_crc;
157} __attribute__ ((packed)); 167} __attribute__ ((packed));
158 168