diff mbox

[U-Boot,v1] imx6sx: Fix i.MX6SX HAB api function table offset

Message ID 1412088231-19479-1-git-send-email-nitin.garg@freescale.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Nitin Garg Sept. 30, 2014, 2:43 p.m. UTC
i.MX6SX ROM implements unified table sections.
The HAB function table is at offset 0x100. Update
the HAB function pointers accordingly.

Signed-off-by: Nitin Garg <nitin.garg@freescale.com>

---

 arch/arm/include/asm/arch-mx6/hab.h |   33 +++++++++++++++++++++++----------
 include/configs/mx6sxsabresd.h      |    1 +
 2 files changed, 24 insertions(+), 10 deletions(-)

Comments

Fabio Estevam Sept. 30, 2014, 3:17 p.m. UTC | #1
On Tue, Sep 30, 2014 at 11:43 AM, Nitin Garg <nitin.garg@freescale.com> wrote:
> i.MX6SX ROM implements unified table sections.
> The HAB function table is at offset 0x100. Update
> the HAB function pointers accordingly.
>
> Signed-off-by: Nitin Garg <nitin.garg@freescale.com>

It fixes the issue for me, thanks. I have one comment though.

> --- a/include/configs/mx6sxsabresd.h
> +++ b/include/configs/mx6sxsabresd.h
> @@ -15,6 +15,7 @@
>  #include "mx6_common.h"
>
>  #define CONFIG_MX6
> +#define CONFIG_ROM_UNIFIED_SECTIONS
>  #define CONFIG_DISPLAY_CPUINFO
>  #define CONFIG_DISPLAY_BOARDINFO

It would be better to add this CONFIG_ROM_UNIFIED_SECTIONS inside mx6_common.h:

#ifdef CONFIG_MX6SX
#define CONFIG_ROM_UNIFIED_SECTIONS
#endif

with that in place you can add my:

Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
diff mbox

Patch

diff --git a/arch/arm/include/asm/arch-mx6/hab.h b/arch/arm/include/asm/arch-mx6/hab.h
index 1f12695..4c9734e 100644
--- a/arch/arm/include/asm/arch-mx6/hab.h
+++ b/arch/arm/include/asm/arch-mx6/hab.h
@@ -53,17 +53,30 @@  typedef void *hab_rvt_authenticate_image_t(uint8_t, ptrdiff_t,
 		void **, size_t *, hab_loader_callback_f_t);
 typedef void hapi_clock_init_t(void);
 
-#define HAB_RVT_REPORT_EVENT                   (*(uint32_t *)0x000000B4)
-#define HAB_RVT_REPORT_STATUS                  (*(uint32_t *)0x000000B8)
-#define HAB_RVT_AUTHENTICATE_IMAGE             (*(uint32_t *)0x000000A4)
-#define HAB_RVT_ENTRY                          (*(uint32_t *)0x00000098)
-#define HAB_RVT_EXIT                           (*(uint32_t *)0x0000009C)
+#ifdef CONFIG_ROM_UNIFIED_SECTIONS
 
-#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_RVT_BASE			0x00000100
+#define HAB_RVT_ENTRY			(*(uint32_t *)(HAB_RVT_BASE + 0x04))
+#define HAB_RVT_EXIT			(*(uint32_t *)(HAB_RVT_BASE + 0x08))
+#define HAB_RVT_AUTHENTICATE_IMAGE	(*(uint32_t *)(HAB_RVT_BASE + 0x10))
+#define HAB_RVT_REPORT_EVENT		(*(uint32_t *)(HAB_RVT_BASE + 0x20))
+#define HAB_RVT_REPORT_STATUS		(*(uint32_t *)(HAB_RVT_BASE + 0x24))
+
+#else
+
+#define HAB_RVT_REPORT_EVENT		(*(uint32_t *)0x000000B4)
+#define HAB_RVT_REPORT_STATUS		(*(uint32_t *)0x000000B8)
+#define HAB_RVT_AUTHENTICATE_IMAGE	(*(uint32_t *)0x000000A4)
+#define HAB_RVT_ENTRY			(*(uint32_t *)0x00000098)
+#define HAB_RVT_EXIT			(*(uint32_t *)0x0000009C)
+
+#endif
+
+#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*/
diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h
index 1eda65e..6394667 100644
--- a/include/configs/mx6sxsabresd.h
+++ b/include/configs/mx6sxsabresd.h
@@ -15,6 +15,7 @@ 
 #include "mx6_common.h"
 
 #define CONFIG_MX6
+#define CONFIG_ROM_UNIFIED_SECTIONS
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO