diff mbox series

[2/4] imx: hab: Encase majority of header in __ASSEMBLY__ declaration

Message ID 1520616949-11879-3-git-send-email-bryan.odonoghue@linaro.org
State New
Headers show
Series imx: hab: Add helper functions for scripted HAB auth | expand

Commit Message

Bryan O'Donoghue March 9, 2018, 5:35 p.m. UTC
Subsequent patches will want to include hab.h but in doing so include it on
an assembly compile path causing a range of compile errors. Fix the errors
pre-emptively by encasing the majority of the declarations in hab.h inside
an ifdef __ASSEMBLY__ block.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Cc: Breno Lima <breno.lima@nxp.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
---
 arch/arm/include/asm/mach-imx/hab.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Breno Matheus Lima March 15, 2018, 4:38 p.m. UTC | #1
Hi Bryan,

2018-03-09 14:35 GMT-03:00 Bryan O'Donoghue <bryan.odonoghue@linaro.org>:
> Subsequent patches will want to include hab.h but in doing so include it on
> an assembly compile path causing a range of compile errors. Fix the errors
> pre-emptively by encasing the majority of the declarations in hab.h inside
> an ifdef __ASSEMBLY__ block.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Cc: Utkarsh Gupta <utkarsh.gupta@nxp.com>
> Cc: Breno Lima <breno.lima@nxp.com>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>

Tested-by: <breno.lima@nxp.com>

Thanks,
Breno Lima
diff mbox series

Patch

diff --git a/arch/arm/include/asm/mach-imx/hab.h b/arch/arm/include/asm/mach-imx/hab.h
index ce9a44d..1bebdbe 100644
--- a/arch/arm/include/asm/mach-imx/hab.h
+++ b/arch/arm/include/asm/mach-imx/hab.h
@@ -8,6 +8,7 @@ 
 #ifndef __SECURE_MX6Q_H__
 #define __SECURE_MX6Q_H__
 
+#ifndef __ASSEMBLY__
 #include <linux/types.h>
 #include <linux/compiler.h>
 
@@ -196,13 +197,14 @@  typedef void hapi_clock_init_t(void);
 #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
-
 /* ----------- end of HAB API updates ------------*/
 
 int imx_hab_authenticate_image(uint32_t ddr_start, uint32_t image_size,
 			       uint32_t ivt_offset);
 bool imx_hab_is_enabled(void);
+#endif /* __ASSEMBLY__ */
+
+#define IVT_SIZE			0x20
+#define CSF_PAD_SIZE			0x2000
 
 #endif