summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJérémy Dufour2012-11-08 18:56:26 +0100
committerJérémy Dufour2012-11-21 17:09:56 +0100
commitd842842a1042853c21aac25c6c992d4fe309cf6c (patch)
tree1cedf86271a31a4029bc75703a18f899f713742b /common
parentc5bda9a4ba9876340751449d9448623499413634 (diff)
common/include: add a common header in all spidcom image desc, refs #3452
Diffstat (limited to 'common')
-rw-r--r--common/include/spid_img_desc.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/common/include/spid_img_desc.h b/common/include/spid_img_desc.h
index a1540b469e..ae272f24da 100644
--- a/common/include/spid_img_desc.h
+++ b/common/include/spid_img_desc.h
@@ -62,6 +62,29 @@ typedef enum {
} spidcom_image_desc_image_type_t;
/**
+ * Version of the common header for image descriptor.
+ */
+#define SPIDCOM_IMG_DESC_COMMON_HEADER_VERSION 1
+
+/**
+ * Common header for image descriptor.
+ * If you change it, please increase SPIDCOM_IMG_DESC_COMMON_HEADER_VERSION.
+ */
+typedef struct {
+ /** Must be SPIDCOM_IMG_DESC_MAGIC, otherwise the header is invalid. */
+ char magic[8];
+ /** Version of this header. */
+ uint32_t header_version;
+ /** Type of the image, see spid_img_desc_image_type_t. */
+ uint32_t image_type;
+} spidcom_image_desc_header_t;
+
+/**
+ * Reserved size at the end of all descriptors (in bytes).
+ */
+#define SPIDCOM_IMG_DESC_COMMON_RESERVER_SIZE 836
+
+/**
* Image descriptor for SPC300 (and MSE500-300).
* All values are in little-endian.
*/
@@ -82,7 +105,11 @@ typedef struct {
uint32_t arch; /* spc300 or unknown */
uint32_t plc_ram; /* RAM size needed for the PLC processor */
char board_type[32]; /* Board type string */
- char reserved[864];
+ char empty[12]; /* Empty field to make the common header
+ start at the same offset on both
+ spidcom image descriptor. */
+ spidcom_image_desc_header_t header; /* Common header. */
+ char reserved[SPIDCOM_IMG_DESC_COMMON_RESERVER_SIZE];
char image[0]; /* Used in bootloader to mark beging of the payload */
} spidcom_image_desc_300_t;
@@ -104,7 +131,8 @@ typedef struct {
char version[64]; /* Image version string */
char description[64]; /* Image description string */
uint32_t arch; /* spc200e, spc200c or unknown */
- char reserved[852];
+ spidcom_image_desc_header_t header; /* Common header. */
+ char reserved[SPIDCOM_IMG_DESC_COMMON_RESERVER_SIZE];
char image[0]; /* Used in bootloader */
} spidcom_image_desc_200_t;