[PATCH v3 17/20] board: apalis-imx8: initialize snvs

Francesco Dolcini
2023-01-16T19:09:28Z

From: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>

Initialize Secure Non-Volatile Storage, aka SNVS.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
---
v3: added Reviewed-by: Fabio
v2: new patch
---
board/toradex/apalis-imx8/apalis-imx8.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c
index ad0986eebfc1..6b43b5870073 100644
--- a/board/toradex/apalis-imx8/apalis-imx8.c
+++ b/board/toradex/apalis-imx8/apalis-imx8.c
@@ -12,6 +12,7 @@
#include <asm/arch/imx8-pins.h>
#include <asm/arch/iomux.h>
#include <asm/arch/sci/sci.h>
+#include <asm/arch/snvs_security_sc.h>
#include <asm/arch/sys_proto.h>
#include <asm/gpio.h>
#include <asm/io.h>
@@ -290,6 +291,13 @@ int board_init(void)
{
board_gpio_init();

+ if (IS_ENABLED(CONFIG_IMX_SNVS_SEC_SC_AUTO)) {
+ int ret = snvs_security_sc_init();
+
+ if (ret)
+ return ret;
+ }
+
return 0;
}

--
2.25.1