]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
imx: priblob: Update to use structure
authorMaximus Sun <maximus.sun@nxp.com>
Thu, 15 Jun 2023 10:09:26 +0000 (18:09 +0800)
committerStefano Babic <sbabic@denx.de>
Thu, 13 Jul 2023 09:29:40 +0000 (11:29 +0200)
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

index 9b92eae78180fba69de3e5a2dc55f62625628902..5b022d5c8201f74063dce23e1871fbf8e18205b4 100644 (file)
 #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;
 }