]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/include/asm/mach-imx/hab.h
imx: hab: Fix usage of packed attribute
[u-boot] / arch / arm / include / asm / mach-imx / hab.h
index a0cb19db2fb9de96231966f4bdcde60cf1df479e..a522cbab896134764bffcd110b79cd2cdd49c3cf 100644 (file)
@@ -9,6 +9,7 @@
 #define __SECURE_MX6Q_H__
 
 #include <linux/types.h>
+#include <linux/compiler.h>
 
 /*
  * IVT header definitions
@@ -38,6 +39,12 @@ struct ivt {
        uint32_t reserved2;     /* Reserved should be zero */
 };
 
+struct __packed hab_hdr {
+       u8 tag;              /* Tag field */
+       u8 len[2];           /* Length field in bytes (big-endian) */
+       u8 par;              /* Parameters field */
+};
+
 /* -------- start of HAB API updates ------------*/
 /* The following are taken from HAB4 SIS */
 
@@ -162,7 +169,14 @@ typedef void hapi_clock_init_t(void);
 #ifdef CONFIG_ROM_UNIFIED_SECTIONS
 #define HAB_RVT_BASE                   0x00000100
 #else
-#define HAB_RVT_BASE                   0x00000094
+#define HAB_RVT_BASE_NEW               0x00000098
+#define HAB_RVT_BASE_OLD               0x00000094
+#define HAB_RVT_BASE ((is_mx6dqp()) ?                                  \
+                       HAB_RVT_BASE_NEW :                              \
+                       (is_mx6dq() && (soc_rev() >= CHIP_REV_1_5)) ?   \
+                       HAB_RVT_BASE_NEW :                              \
+                       (is_mx6sdl() && (soc_rev() >= CHIP_REV_1_2)) ?  \
+                       HAB_RVT_BASE_NEW : HAB_RVT_BASE_OLD)
 #endif
 
 #define HAB_RVT_ENTRY                  (*(uint32_t *)(HAB_RVT_BASE + 0x04))
@@ -173,15 +187,15 @@ typedef void hapi_clock_init_t(void);
 #define HAB_RVT_REPORT_STATUS          (*(uint32_t *)(HAB_RVT_BASE + 0x24))
 #define HAB_RVT_FAILSAFE               (*(uint32_t *)(HAB_RVT_BASE + 0x28))
 
-#define HAB_RVT_REPORT_EVENT_NEW               (*(uint32_t *)0x000000B8)
-#define HAB_RVT_REPORT_STATUS_NEW              (*(uint32_t *)0x000000BC)
-#define HAB_RVT_AUTHENTICATE_IMAGE_NEW         (*(uint32_t *)0x000000A8)
-#define HAB_RVT_ENTRY_NEW                      (*(uint32_t *)0x0000009C)
-#define HAB_RVT_EXIT_NEW                       (*(uint32_t *)0x000000A0)
-
 #define HAB_CID_ROM 0 /**< ROM Caller ID */
 #define HAB_CID_UBOOT 1 /**< UBOOT Caller ID*/
 
+#define HAB_CMD_HDR          0xD4  /* CSF Header */
+#define HAB_CMD_WRT_DAT      0xCC  /* Write Data command tag */
+#define HAB_CMD_CHK_DAT      0xCF  /* Check Data command tag */
+#define HAB_CMD_SET          0xB1  /* Set command tag */
+#define HAB_PAR_MID          0x01  /* MID parameter value */
+
 #define IVT_SIZE                       0x20
 #define CSF_PAD_SIZE                   0x2000