diff mbox series

[V2,29/30] imx: priblob: Update to use structure

Message ID 20230615100928.25767-30-peng.fan@oss.nxp.com
State Accepted
Commit 2159f7d9b6f191e74c3d2004867e138bb5a0533c
Delegated to: Stefano Babic
Headers show
Series imx: misc update and fix | expand

Commit Message

Peng Fan (OSS) June 15, 2023, 10:09 a.m. UTC
From: Maximus Sun <maximus.sun@nxp.com>

Use structure to avoid define CAAM_SCFGR for each platform

Signed-off-by: Maximus Sun <maximus.sun@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/mach-imx/priblob.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Stefano Babic July 11, 2023, 7:44 p.m. UTC | #1
> From: Maximus Sun <maximus.sun@nxp.com>
> Use structure to avoid define CAAM_SCFGR for each platform
> Signed-off-by: Maximus Sun <maximus.sun@nxp.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/priblob.c b/arch/arm/mach-imx/priblob.c
index 9b92eae7818..5b022d5c820 100644
--- a/arch/arm/mach-imx/priblob.c
+++ b/arch/arm/mach-imx/priblob.c
@@ -13,12 +13,16 @@ 
 #include <asm/io.h>
 #include <common.h>
 #include <command.h>
-#include "../drivers/crypto/fsl_caam_internal.h"
+#include <fsl_sec.h>
 
 int do_priblob_write(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
 {
-	writel((readl(CAAM_SCFGR) & 0xFFFFFFFC) | 3, CAAM_SCFGR);
-	printf("New priblob setting = 0x%x\n", readl(CAAM_SCFGR) & 0x3);
+	ccsr_sec_t *sec_regs = (ccsr_sec_t *)CAAM_BASE_ADDR;
+	u32 scfgr = sec_in32(&sec_regs->scfgr);
+
+	scfgr |= 0x3;
+	sec_out32(&sec_regs->scfgr, scfgr);
+	printf("New priblob setting = 0x%x\n", sec_in32(&sec_regs->scfgr) & 0x3);
 
 	return 0;
 }