Add CAAM driver model support
Subsystems (5)
v4 cover Add CAAM driver model support
This patchset adds the support for following:
1) CAAM Driver model for all i.MX, layerscape, PPC platforms.
2) Added crypto node in device tree files.
3) CAAM support for blob key encryption key(bkek), random number generation.
4) fix build issue for mx6sabre: Remove SPL DTB related configs and SPL_OF_CONTROL.
5) fixed hwrng performance issue in kernel.
i.MX platforms:
i.MX6, i.MX7, i.MX7ULP, i.MX8MM/MN/MP/MQ, i.MX8QM/QXP
Layerscape platforms:
LS1021, LS1012, LS1028, LS1043, LS1046, LS1088, LS2088, LX2160, LX2162
Powerpc platforms:
P3041, P4080, P5040, P2041, T1024, T1042, T2080, T4240
changes since v3:
- rebase to latest master
- fixed build error when new file arch/powerpc/include/asm/u-boot-ppc.h is included from assembly files.
- removed arch/arm/dts/fsl-ls1028a.dtsi as it is conflicting with the series
https://lore.kernel.org/u-boot/[email protected]/
Gaurav Jain (14):
crypto/fsl: Add support for CAAM Job ring driver model crypto/fsl: Add CAAM support for bkek, random number generation i.MX8M: crypto: updated device tree for supporting DM in SPL crypto/fsl: i.MX8M: Enable Job ring driver model in SPL and U-Boot. i.MX6: Enable Job ring driver model in U-Boot.
i.MX7: Enable Job ring driver model in U-Boot.
i.MX7ULP: Enable Job ring driver model in U-Boot.
i.MX8: Add crypto node in device tree
crypto/fsl: i.MX8: Enable Job ring driver model in SPL and U-Boot.
Layerscape: Add crypto node in device tree
Layerscape: Enable Job ring driver model in U-Boot.
PPC: Add crypto node in device tree
PPC: Enable Job ring driver model in U-Boot
update CAAM MAINTAINER
Ye Li (2):
mx6sabre: Remove unnecessary SPL configs
crypto/fsl: Fix kick_trng
MAINTAINERS | 7 + arch/arm/Kconfig | 9 +- arch/arm/cpu/armv7/ls102xa/Kconfig | 4 + arch/arm/cpu/armv7/ls102xa/cpu.c | 16 + arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 27 + arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 10 +- arch/arm/dts/fsl-imx8dx.dtsi | 61 ++- arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi | 34 +- arch/arm/dts/fsl-imx8qm.dtsi | 61 ++- arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi | 34 +- arch/arm/dts/fsl-ls1012a.dtsi | 46 +- arch/arm/dts/fsl-ls1043a.dtsi | 45 +- arch/arm/dts/fsl-ls1046a.dtsi | 44 ++ arch/arm/dts/fsl-ls1088a.dtsi | 39 ++ arch/arm/dts/fsl-ls2080a.dtsi | 39 ++ arch/arm/dts/fsl-lx2160a.dtsi | 41 +- arch/arm/dts/imx7ulp.dtsi | 24 + arch/arm/dts/imx8mm-evk-u-boot.dtsi | 18 +- arch/arm/dts/imx8mm.dtsi | 1 + arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 18 +- arch/arm/dts/imx8mn.dtsi | 1 + arch/arm/dts/imx8mp-evk-u-boot.dtsi | 18 +- arch/arm/dts/imx8mp.dtsi | 1 + arch/arm/dts/imx8mq.dtsi | 1 + arch/arm/dts/ls1021a.dtsi | 40 ++ arch/arm/include/asm/arch-imx8/imx-regs.h | 5 +- arch/arm/include/asm/arch-imx8m/imx-regs.h | 1 + arch/arm/mach-imx/cmd_dek.c | 1 + arch/arm/mach-imx/imx8/Kconfig | 9 + arch/arm/mach-imx/imx8/cpu.c | 16 +- arch/arm/mach-imx/imx8m/Kconfig | 23 + arch/arm/mach-imx/imx8m/soc.c | 10 +- arch/arm/mach-imx/mx6/Kconfig | 20 + arch/arm/mach-imx/mx6/soc.c | 12 +- arch/arm/mach-imx/mx7/Kconfig | 3 + arch/arm/mach-imx/mx7/soc.c | 11 +- arch/arm/mach-imx/mx7ulp/Kconfig | 4 + arch/arm/mach-imx/mx7ulp/soc.c | 16 + arch/powerpc/cpu/mpc85xx/Kconfig | 44 ++ arch/powerpc/cpu/mpc85xx/cpu_init.c | 17 +- arch/powerpc/dts/p2041si-post.dtsi | 1 + arch/powerpc/dts/p3041si-post.dtsi | 1 + arch/powerpc/dts/p4080si-post.dtsi | 1 + arch/powerpc/dts/p5040si-post.dtsi | 1 + arch/powerpc/dts/qoriq-sec4.0-0.dtsi | 74 +++ arch/powerpc/dts/qoriq-sec4.2-0.dtsi | 83 ++++ arch/powerpc/dts/qoriq-sec5.2-0.dtsi | 92 ++++ arch/powerpc/dts/t1023si-post.dtsi | 1 + arch/powerpc/dts/t1042si-post.dtsi | 1 + arch/powerpc/dts/t2080si-post.dtsi | 1 + arch/powerpc/dts/t4240si-post.dtsi | 1 + arch/powerpc/include/asm/u-boot-ppc.h | 17 + arch/powerpc/include/asm/u-boot.h | 1 + board/freescale/imx8mm_evk/spl.c | 9 +- board/freescale/imx8mn_evk/spl.c | 8 +- board/freescale/imx8mp_evk/spl.c | 13 +- board/freescale/imx8mq_evk/spl.c | 9 +- board/freescale/imx8qm_mek/spl.c | 6 +- board/freescale/imx8qxp_mek/spl.c | 6 +- board/freescale/ls1012afrdm/ls1012afrdm.c | 7 +- board/freescale/ls1012aqds/ls1012aqds.c | 6 +- board/freescale/ls1012ardb/ls1012ardb.c | 6 +- board/freescale/ls1021aiot/ls1021aiot.c | 6 +- board/freescale/ls1021aqds/ls1021aqds.c | 6 +- board/freescale/ls1021atsn/ls1021atsn.c | 7 +- board/freescale/ls1021atwr/ls1021atwr.c | 8 +- board/freescale/ls1028a/ls1028a.c | 6 +- board/freescale/ls1043ardb/ls1043ardb.c | 6 +- board/freescale/ls1046afrwy/ls1046afrwy.c | 7 +- board/freescale/ls1046aqds/ls1046aqds.c | 7 +- board/freescale/ls1046ardb/ls1046ardb.c | 6 +- board/freescale/ls1088a/ls1088a.c | 6 +- board/freescale/ls2080aqds/ls2080aqds.c | 6 +- board/freescale/ls2080ardb/ls2080ardb.c | 9 +- board/freescale/lx2160a/lx2160a.c | 5 - cmd/Kconfig | 1 + configs/P2041RDB_defconfig | 1 - configs/P3041DS_defconfig | 1 - configs/P4080DS_defconfig | 1 - configs/P5040DS_defconfig | 1 - configs/T1024RDB_defconfig | 1 - configs/T1042D4RDB_defconfig | 1 - configs/T2080QDS_defconfig | 1 - configs/T2080RDB_defconfig | 1 - configs/T4240RDB_defconfig | 1 - configs/ls1021aiot_qspi_defconfig | 1 - configs/ls1021aqds_nor_defconfig | 1 - configs/ls1021aqds_qspi_defconfig | 1 - configs/ls1021atsn_qspi_defconfig | 1 - configs/ls1021atwr_nor_defconfig | 1 - ...s1021atwr_sdcard_ifc_SECURE_BOOT_defconfig | 1 + configs/ls1028ardb_tfa_defconfig | 1 - configs/ls1043ardb_tfa_defconfig | 1 - configs/ls1046afrwy_tfa_defconfig | 1 - configs/ls1046aqds_tfa_defconfig | 1 - configs/ls1046ardb_tfa_defconfig | 1 - configs/ls2088aqds_tfa_defconfig | 1 - configs/ls2088ardb_tfa_defconfig | 1 - configs/lx2160aqds_tfa_defconfig | 1 - configs/lx2160ardb_tfa_defconfig | 1 - configs/lx2162aqds_tfa_defconfig | 1 - configs/mx6sabreauto_defconfig | 2 - configs/mx6sabresd_defconfig | 4 - drivers/crypto/fsl/Kconfig | 9 +- drivers/crypto/fsl/Makefile | 4 +- drivers/crypto/fsl/desc.h | 5 + drivers/crypto/fsl/fsl_blob.c | 82 ++++ drivers/crypto/fsl/jobdesc.c | 20 +- drivers/crypto/fsl/jobdesc.h | 4 + drivers/crypto/fsl/jr.c | 461 +++++++++++++----- drivers/crypto/fsl/jr.h | 14 + include/fsl_sec.h | 13 +- scripts/config_whitelist.txt | 1 + 113 files changed, 1614 insertions(+), 292 deletions(-) create mode 100644 arch/powerpc/dts/qoriq-sec4.0-0.dtsi create mode 100644 arch/powerpc/dts/qoriq-sec4.2-0.dtsi create mode 100644 arch/powerpc/dts/qoriq-sec5.2-0.dtsi create mode 100644 arch/powerpc/include/asm/u-boot-ppc.h
Signature · 1 line
2.17.1
PATCH v4 1/16 crypto/fsl: Add support for CAAM Job ring driver model
added device tree support for job ring driver. sec is initialized based on job ring information processed from device tree.
--- cmd/Kconfig | 1 + drivers/crypto/fsl/Kconfig | 7 + drivers/crypto/fsl/Makefile | 4 +- drivers/crypto/fsl/jr.c | 318 ++++++++++++++++++++++++------------ drivers/crypto/fsl/jr.h | 14 ++ 5 files changed, 234 insertions(+), 110 deletions(-)
cmd/Kconfig +1 -0
@@ -2009,6 +2009,7 @@ config CMD_AES config CMD_BLOB bool "Enable the 'blob' command" + select FSL_BLOB depends on !MX6ULL && !MX6SLL && !MX6SL select IMX_HAB if ARCH_MX6 || ARCH_MX7 || ARCH_MX7ULP || ARCH_IMX8M help
drivers/crypto/fsl/Kconfig +7 -0
@@ -66,4 +66,11 @@ config FSL_CAAM_RNG using the prediction resistance flag which means the DRGB is reseeded from the TRNG every time random data is generated. +config FSL_BLOB + bool "Enable Blob Encap/Decap, Blob KEK support" + help + Enable support for the hardware based crytographic blob encap/decap + module of the CAAM. blobs can be safely placed into non-volatile + storage. blobs can only be decapsulated by the SoC that created it. + Enable support for blob key encryption key generation. endif
drivers/crypto/fsl/Makefile +3 -1
@@ -1,10 +1,12 @@ # SPDX-License-Identifier: GPL-2.0+ # # Copyright 2014 Freescale Semiconductor, Inc. +# Copyright 2021 NXP obj-y += sec.o obj-$(CONFIG_FSL_CAAM) += jr.o fsl_hash.o jobdesc.o error.o -obj-$(CONFIG_CMD_BLOB)$(CONFIG_IMX_CAAM_DEK_ENCAP) += fsl_blob.o +obj-$(CONFIG_FSL_BLOB) += fsl_blob.o +obj-$(CONFIG_IMX_CAAM_DEK_ENCAP) += fsl_blob.o obj-$(CONFIG_RSA_FREESCALE_EXP) += fsl_rsa.o obj-$(CONFIG_FSL_CAAM_RNG) += rng.o obj-$(CONFIG_FSL_MFGPROT) += fsl_mfgprot.o
drivers/crypto/fsl/jr.c +209 -109
543 lines not on this page · raw message
drivers/crypto/fsl/jr.h +14 -0
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2008-2014 Freescale Semiconductor, Inc. +* Copyright 2021 NXP * */
@@ -8,7 +9,9 @@#define __JR_H#include <linux/compiler.h> +#include "fsl_sec.h" #include "type.h" +#include <misc.h> #define JR_SIZE 4/* Timeout currently defined as 10 sec */
@@ -35,6 +38,10 @@#define JRSLIODN_SHIFT 0#define JRSLIODN_MASK 0x00000fff +#define JRDID_MS_PRIM_DID 1 +#define JRDID_MS_PRIM_TZ (1 << 4) +#define JRDID_MS_TZ_OWN (1 << 15) +#define JQ_DEQ_ERR -1#define JQ_DEQ_TO_ERR -2#define JQ_ENQ_ERR -3
@@ -102,6 +109,13 @@ struct result {uint32_t status; }; +struct caam_regs { +ccsr_sec_t *sec; +struct jr_regs *regs; +u8 jrid; +struct jobring jr[CONFIG_SYS_FSL_MAX_NUM_OF_SEC ]; +}; +void caam_jr_strstatus (u32 status);int run_descriptor_jr (uint32_t *desc);
Signature · 1 line
2.17.1
Re: [PATCH v4 01/16] crypto/fsl: Add support for CAAM Job ring driver model
Hi Gaurav,
Quoted 7 lines · Gaurav Jain
added device tree support for job ring driver. sec is initialized based on job ring information processed from device tree.
Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>
Quoted 7 lines
--- cmd/Kconfig | 1 + drivers/crypto/fsl/Kconfig | 7 + drivers/crypto/fsl/Makefile | 4 +- drivers/crypto/fsl/jr.c | 318 ++++++++++++++++++++++++------------ drivers/crypto/fsl/jr.h | 14 ++ 5 files changed, 234 insertions(+), 110 deletions(-)
You should not have CONFIG_ARCH_IMX8 in a driver. Things like that should be handled by using a different compatible string. Also please use the livetree API.
I asked about the use of MISC as a uclass earlier. It seems that this device provides random numbers and perhaps hashing? It is hard to know since I am not sure where the documentation is in this series. It seems odd to be modelled as a MISC device. My understanding is that there are problems with the size in SPL if a different UCLASS is used. Is that correct? I asked about of-platdata but I didn't see any comment on that.
This does seem to be a significant clean-up even as it is, though, so these thoughts could be looked at after this series is applied.
Regards,
Simon
RE: [EXT] Re: [PATCH v4 01/16] crypto/fsl: Add support for CAAM Job ring driver model
Hello Simon
Quoted 50 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Tuesday, November 2, 2021 8:26 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 7 lines · Gaurav Jain
added device tree support for job ring driver.
sec is initialized based on job ring information processed from device tree.Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>Quoted 7 lines
--- cmd/Kconfig | 1 + drivers/crypto/fsl/Kconfig | 7 + drivers/crypto/fsl/Makefile | 4 +- drivers/crypto/fsl/jr.c | 318 ++++++++++++++++++++++++------------ drivers/crypto/fsl/jr.h | 14 ++ 5 files changed, 234 insertions(+), 110 deletions(-)You should not have
CONFIG_ARCH_IMX8in a driver. Things like that should be handled by using a different compatible string. Also please use the livetree API.I asked about the use of MISC as a uclass earlier. It seems that this device provides random numbers and perhaps hashing? It is hard to know since I am not sure where the documentation is in this series. It seems odd to be modelled as a MISC device. My understanding is that there are problems with the size in SPL if a different UCLASS is used.
Is that correct? I asked about of-platdata but I didn't see any comment on that.
Quoted 3 lines
This does seem to be a significant clean-up even as it is, though, so these thoughts could be looked at after this series is applied.
Kernel dtb uses single compatible string for all imx platforms.
Adding a different compatible string will introduce a difference with kernel dts nodes. Will update the driver with livetree API in next version of this series.
RNG instantiation is done as part of caam initialization. hwrng_generate() function is added by me to generate random number via caam rng. I am not sure where to document but cover letter was updated.
using OF_PLATDATA also have memory issues in SPL. It needs 15KB more memory compared to no driver model in SPL. We don't have enough OCRAM on few platforms. SPL size issue is not caused by MISC UCLASS but it is due to limited OCRAM.
I agree to your suggestion for any change/cleanup after the series is applied.
Regards
Gaurav Jain
Quoted 2 lines
Regards,
Simon
Re: [EXT] Re: [PATCH v4 01/16] crypto/fsl: Add support for CAAM Job ring driver model
Hi Gaurav,
Quoted 53 lines · Gaurav Jain
Hello Simon
Quoted 50 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Tuesday, November 2, 2021 8:26 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 7 lines · Gaurav Jain
added device tree support for job ring driver.
sec is initialized based on job ring information processed from device tree.Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>Quoted 7 lines
--- cmd/Kconfig | 1 + drivers/crypto/fsl/Kconfig | 7 + drivers/crypto/fsl/Makefile | 4 +- drivers/crypto/fsl/jr.c | 318 ++++++++++++++++++++++++------------ drivers/crypto/fsl/jr.h | 14 ++ 5 files changed, 234 insertions(+), 110 deletions(-)You should not have
CONFIG_ARCH_IMX8in a driver. Things like that should be handled by using a different compatible string. Also please use the livetree API.I asked about the use of MISC as a uclass earlier. It seems that this device provides random numbers and perhaps hashing? It is hard to know since I am not sure where the documentation is in this series. It seems odd to be modelled as a MISC device. My understanding is that there are problems with the size in SPL if a different UCLASS is used.
Is that correct? I asked about of-platdata but I didn't see any comment on that.
Quoted 5 lines
Quoted 3 lines
This does seem to be a significant clean-up even as it is, though, so these thoughts could be looked at after this series is applied.
Kernel dtb uses single compatible string for all imx platforms.
Adding a different compatible string will introduce a difference with kernel dts nodes.
That sounds like a bug?
Quoted 7 lines
Will update the driver with livetree API in next version of this series.
RNG instantiation is done as part of caam initialization.
hwrng_generate()function is added by me to generate random number via caam rng. I am not sure where to document but cover letter was updated.using
OF_PLATDATAalso have memory issues in SPL. It needs 15KB more memory compared to no driver model in SPL. We don't have enough OCRAM on few platforms. SPL size issue is not caused by MISC UCLASS but it is due to limited OCRAM.
That's a very large increase. Can you point me to the tree which enables that so I can take a look? With of-platadata the overhead should be much smaller than that, perhaps 4KB.
Quoted 2 lines
I agree to your suggestion for any change/cleanup after the series is applied.
Regards,
Simon
RE: [EXT] Re: [PATCH v4 01/16] crypto/fsl: Add support for CAAM Job ring driver model
Hello Simon
Quoted 83 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Thursday, November 25, 2021 5:42 AM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 47 lines · Gaurav Jain
Hello Simon
Quoted 44 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Tuesday, November 2, 2021 8:26 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 7 lines · Gaurav Jain
added device tree support for job ring driver.
sec is initialized based on job ring information processed from device tree.Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>Quoted 7 lines
--- cmd/Kconfig | 1 + drivers/crypto/fsl/Kconfig | 7 + drivers/crypto/fsl/Makefile | 4 +- drivers/crypto/fsl/jr.c | 318 ++++++++++++++++++++++++------------ drivers/crypto/fsl/jr.h | 14 ++ 5 files changed, 234 insertions(+), 110 deletions(-)You should not have
CONFIG_ARCH_IMX8in a driver. Things like that should be handled by using a different compatible string. Also please use thelivetree API.
Quoted 6 lines
Quoted 6 lines
I asked about the use of MISC as a uclass earlier. It seems that this device provides random numbers and perhaps hashing? It is hard to know since I am not sure where the documentation is in this series. It seems odd to be modelled as a MISC device. My understanding is that there are problems with the size in SPL if a different
UCLASS is used.
Quoted 1 line
Quoted 1 line
Is that correct? I asked about of-platdata but I didn't see any comment on
that.
Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
This does seem to be a significant clean-up even as it is, though, so these thoughts could be looked at after this series is applied.
Kernel dtb uses single compatible string for all imx platforms. Adding a different compatible string will introduce a difference with kernel dts
nodes.
That sounds like a bug?
In jr.c, for IMX8 we need to do only Jr initialization and skipping RNG instantiation as it is already done. This is achieved using CONFIG_ARCH_IMX8. Are you suggesting to use different macro?
Quoted 7 lines
Quoted 4 lines
Will update the driver with livetree API in next version of this series.
RNG instantiation is done as part of caam initialization.
hwrng_generate()function is added by me to generate random number via caam rng.
Quoted 2 lines
I am not sure where to document but cover letter was updated.
Quoted 8 lines
Quoted 1 line
using
OF_PLATDATAalso have memory issues in SPL. It needs 15KB morememory compared to no driver model in SPL. We don't have enough OCRAM on few platforms.
Quoted 1 line
SPL size issue is not caused by MISC UCLASS but it is due to limited OCRAM.
That's a very large increase. Can you point me to the tree which enables that so I can take a look? With of-platadata the overhead should be much smaller than that, perhaps 4KB.
1. Tried imx8mm_evk_defconfig with downstream uboot, which results in 15K increase in u-boot-spl.bin when enable OF_PLATDATA.
2. then tried imx8mq_evk_defconfig with upstream. Lot of build errors reported with OF_PLATDATA. Just commented and build, which resulted in 11K increase in u-boot-spl.bin(77K to 88K).
Regards
Gaurav Jain
Quoted 6 lines
Quoted 3 lines
I agree to your suggestion for any change/cleanup after the series is applied.
Regards,
Simon
Re: [EXT] Re: [PATCH v4 01/16] crypto/fsl: Add support for CAAM Job ring driver model
Hi Gaurav,
Quoted 89 lines · Gaurav Jain
Hello Simon
Quoted 86 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Thursday, November 25, 2021 5:42 AM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 47 lines · Gaurav Jain
Hello Simon
Quoted 44 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Tuesday, November 2, 2021 8:26 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 7 lines · Gaurav Jain
added device tree support for job ring driver.
sec is initialized based on job ring information processed from device tree.Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>Quoted 7 lines
--- cmd/Kconfig | 1 + drivers/crypto/fsl/Kconfig | 7 + drivers/crypto/fsl/Makefile | 4 +- drivers/crypto/fsl/jr.c | 318 ++++++++++++++++++++++++------------ drivers/crypto/fsl/jr.h | 14 ++ 5 files changed, 234 insertions(+), 110 deletions(-)You should not have
CONFIG_ARCH_IMX8in a driver. Things like that should be handled by using a different compatible string. Also please use thelivetree API.
Quoted 6 lines
Quoted 6 lines
I asked about the use of MISC as a uclass earlier. It seems that this device provides random numbers and perhaps hashing? It is hard to know since I am not sure where the documentation is in this series. It seems odd to be modelled as a MISC device. My understanding is that there are problems with the size in SPL if a different
UCLASS is used.
Quoted 1 line
Quoted 1 line
Is that correct? I asked about of-platdata but I didn't see any comment on
that.
Quoted 4 lines
Quoted 4 lines
This does seem to be a significant clean-up even as it is, though, so these thoughts could be looked at after this series is applied.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Kernel dtb uses single compatible string for all imx platforms. Adding a different compatible string will introduce a difference with kernel dts
nodes.
That sounds like a bug?
In
jr.c, for IMX8 we need to do only Jr initialization and skipping RNG instantiation as it is already done. This is achieved usingCONFIG_ARCH_IMX8. Are you suggesting to use different macro?
Don't add #ifdefs to drivers. Use a compatible string instead.
Quoted 11 lines
Quoted 11 lines
Quoted 5 lines
Will update the driver with livetree API in next version of this series.
RNG instantiation is done as part of caam initialization.
hwrng_generate()function is added by me to generate random number via caam rng.
Quoted 3 lines
I am not sure where to document but cover letter was updated.
using
OF_PLATDATAalso have memory issues in SPL. It needs 15KB morememory compared to no driver model in SPL. We don't have enough OCRAM on few platforms.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
SPL size issue is not caused by MISC UCLASS but it is due to limited OCRAM.
That's a very large increase. Can you point me to the tree which enables that so I can take a look? With of-platadata the overhead should be much smaller than that, perhaps 4KB.
1. Tried
imx8mm_evk_defconfigwith downstream uboot, which results in 15K increase in u-boot-spl.bin when enableOF_PLATDATA.
Can you please push a patch or push your tree somewhere? That board already uses SPL_OF_CONTROL so I cannot fathom why enabling SPL_OF_PLATDATA as well would increase the size.
Quoted 1 line
2. then tried
imx8mq_evk_defconfigwith upstream. Lot of build errors reported withOF_PLATDATA. Just commented and build, which resulted in 11K increase in u-boot-spl.bin(77K to 88K).
Well let's ignore that one for now, for this issue.
Regards,
Simon
RE: [EXT] Re: [PATCH v4 01/16] crypto/fsl: Add support for CAAM Job ring driver model
Hello Simon
Quoted 126 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Wednesday, December 1, 2021 11:57 AM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 51 lines · Gaurav Jain
Hello Simon
Quoted 48 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Thursday, November 25, 2021 5:42 AM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 21 lines · Gaurav Jain
Hello Simon
Quoted 18 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Tuesday, November 2, 2021 8:26 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>;Adrian
Quoted 49 lines
Quoted 49 lines
Quoted 25 lines
Quoted 25 lines
Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 14 lines · Gaurav Jain
added device tree support for job ring driver. sec is initialized based on job ring information processed from device tree.
Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>--- cmd/Kconfig | 1 + drivers/crypto/fsl/Kconfig | 7 + drivers/crypto/fsl/Makefile | 4 +- drivers/crypto/fsl/jr.c | 318 ++++++++++++++++++++++++------------ drivers/crypto/fsl/jr.h | 14 ++ 5 files changed, 234 insertions(+), 110 deletions(-)Quoted 3 lines
Quoted 3 lines
You should not have
CONFIG_ARCH_IMX8in a driver. Things like that should be handled by using a different compatible string. Also please use thelivetree API.
Quoted 7 lines
Quoted 7 lines
I asked about the use of MISC as a uclass earlier. It seems that this device provides random numbers and perhaps hashing? It is hard to know since I am not sure where the documentation is in this series. It seems odd to be modelled as a MISC device. My understanding is that there are problems with the size in SPL if a different
UCLASS is used.
Quoted 2 lines
Quoted 2 lines
Is that correct? I asked about of-platdata but I didn't see any comment on
that.
Quoted 7 lines
Quoted 4 lines
This does seem to be a significant clean-up even as it is, though, so these thoughts could be looked at after this series is applied.
Kernel dtb uses single compatible string for all imx platforms. Adding a different compatible string will introduce a difference with kernel dts
nodes.
Quoted 7 lines
Quoted 2 lines
Quoted 1 line
That sounds like a bug?
In
jr.c, for IMX8 we need to do only Jr initialization and skipping RNGinstantiation as it is already done.
Quoted 1 line
This is achieved using
CONFIG_ARCH_IMX8. Are you suggesting to usedifferent macro?
Don't add #ifdefs to drivers. Use a compatible string instead.
defining a different compatible string for imx8 in -u-boot-dtsi file which will overwrite the original is ok??
Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Quoted 7 lines
Will update the driver with livetree API in next version of this series.
RNG instantiation is done as part of caam initialization.
hwrng_generate()function is added by me to generate random number via caam rng.
Quoted 4 lines
I am not sure where to document but cover letter was updated.
using
OF_PLATDATAalso have memory issues in SPL. It needs 15KB morememory compared to no driver model in SPL. We don't have enough OCRAM on few platforms.
Quoted 1 line
SPL size issue is not caused by MISC UCLASS but it is due to limited OCRAM.
That's a very large increase. Can you point me to the tree which enables that so I can take a look? With of-platadata the overhead should be much smaller than that, perhaps 4KB.
Quoted 6 lines
Quoted 1 line
1. Tried
imx8mm_evk_defconfigwith downstream uboot, which results in 15Kincrease in u-boot-spl.bin when enable
OF_PLATDATA.Can you please push a patch or push your tree somewhere? That board already uses
SPL_OF_CONTROLso I cannot fathom why enablingSPL_OF_PLATDATAas well would increase the size.
You can take the source code from https://source.codeaurora.org/external/imx/uboot-imx/ (branch: lf_v2021.04). With downstream uboot, for imx8mm SPL_OF_CONTROL is not enabled in SPL because of size issues.
Quoted 6 lines
Quoted 2 lines
2. then tried
imx8mq_evk_defconfigwith upstream. Lot of build errorsreported with
OF_PLATDATA. Just commented and build, which resulted in 11K increase in u-boot-spl.bin(77K to 88K).Well let's ignore that one for now, for this issue.
Ok..
Regards
Gaurav Jain
Quoted 3 lines
Regards,
Simon
Re: [EXT] Re: [PATCH v4 01/16] crypto/fsl: Add support for CAAM Job ring driver model
Quoted 129 lines · Gaurav Jain
Hello Simon
Quoted 126 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Wednesday, December 1, 2021 11:57 AM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 51 lines · Gaurav Jain
Hello Simon
Quoted 48 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Thursday, November 25, 2021 5:42 AM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 21 lines · Gaurav Jain
Hello Simon
Quoted 18 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Tuesday, November 2, 2021 8:26 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>;Adrian
Quoted 49 lines
Quoted 49 lines
Quoted 25 lines
Quoted 25 lines
Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 14 lines · Gaurav Jain
added device tree support for job ring driver. sec is initialized based on job ring information processed from device tree.
Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>--- cmd/Kconfig | 1 + drivers/crypto/fsl/Kconfig | 7 + drivers/crypto/fsl/Makefile | 4 +- drivers/crypto/fsl/jr.c | 318 ++++++++++++++++++++++++------------ drivers/crypto/fsl/jr.h | 14 ++ 5 files changed, 234 insertions(+), 110 deletions(-)Quoted 3 lines
Quoted 3 lines
You should not have
CONFIG_ARCH_IMX8in a driver. Things like that should be handled by using a different compatible string. Also please use thelivetree API.
Quoted 7 lines
Quoted 7 lines
I asked about the use of MISC as a uclass earlier. It seems that this device provides random numbers and perhaps hashing? It is hard to know since I am not sure where the documentation is in this series. It seems odd to be modelled as a MISC device. My understanding is that there are problems with the size in SPL if a different
UCLASS is used.
Quoted 2 lines
Quoted 2 lines
Is that correct? I asked about of-platdata but I didn't see any comment on
that.
Quoted 7 lines
Quoted 4 lines
This does seem to be a significant clean-up even as it is, though, so these thoughts could be looked at after this series is applied.
Kernel dtb uses single compatible string for all imx platforms. Adding a different compatible string will introduce a difference with kernel dts
nodes.
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
Quoted 1 line
That sounds like a bug?
In
jr.c, for IMX8 we need to do only Jr initialization and skipping RNGinstantiation as it is already done.
Quoted 1 line
This is achieved using
CONFIG_ARCH_IMX8. Are you suggesting to usedifferent macro?
Don't add #ifdefs to drivers. Use a compatible string instead.
defining a different compatible string for imx8 in -u-boot-dtsi file which will overwrite the original is ok??
Can you not fix this in the kernel? How did you come to use the same compatible string for two different pieces of hardware?
Regards,
Simon
RE: [EXT] Re: [PATCH v4 01/16] crypto/fsl: Add support for CAAM Job ring driver model
Hello
Quoted 167 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Wednesday, December 1, 2021 11:32 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Quoted 51 lines · Gaurav Jain
Hello Simon
Quoted 48 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Wednesday, December 1, 2021 11:57 AM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
Quoted 21 lines · Gaurav Jain
Hello Simon
Quoted 18 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Thursday, November 25, 2021 5:42 AM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>;Adrian
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
On Mon, 8 Nov 2021 at 02:30, Gaurav Jain <[email protected]>
Quoted 34 lines · wrote:
Quoted 34 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Hello Simon
Quoted 12 lines
-----Original Message-----
From: Simon Glass <[email protected]>
Sent: Tuesday, November 2, 2021 8:26 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj GuptaQuoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
<[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>;
Adrian
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: [EXT] Re: [PATCH v4 01/16]crypto/fsl: Add support for CAAM Job ring driver modelCaution: EXT Email
Hi Gaurav,
On Tue, 26 Oct 2021 at 00:56, Gaurav Jain <[email protected]>
Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
added device tree support for job ring driver. sec is initialized based on job ring information processed from device tree.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>--- cmd/Kconfig | 1 + drivers/crypto/fsl/Kconfig | 7 + drivers/crypto/fsl/Makefile | 4 +- drivers/crypto/fsl/jr.c | 318 ++++++++++++++++++++++++------------
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
drivers/crypto/fsl/jr.h | 14 ++ 5 files changed, 234 insertions(+), 110 deletions(-)You should not have
CONFIG_ARCH_IMX8in a driver. Things like that should be handled by using a different compatible string. Also please use thelivetree API.
Quoted 7 lines
Quoted 7 lines
I asked about the use of MISC as a uclass earlier. It seems that this device provides random numbers and perhaps hashing? It is hard to know since I am not sure where the documentation is in this series. It seems odd to be modelled as a MISC device. My understanding is that there are problems with the size in SPL if a different
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
UCLASS is used.
Quoted 2 lines
Quoted 2 lines
Is that correct? I asked about of-platdata but I didn't see any comment on
that.
Quoted 3 lines
Quoted 3 lines
This does seem to be a significant clean-up even as it is, though, so these thoughts could be looked at after this series is
applied.
Quoted 11 lines
Quoted 11 lines
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Kernel dtb uses single compatible string for all imx platforms. Adding a different compatible string will introduce a difference with kernel dts
nodes.
That sounds like a bug?
In
jr.c, for IMX8 we need to do only Jr initialization and skipping RNGinstantiation as it is already done.
Quoted 1 line
This is achieved using
CONFIG_ARCH_IMX8. Are you suggesting to use
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
different macro?
Don't add #ifdefs to drivers. Use a compatible string instead.
defining a different compatible string for imx8 in -u-boot-dtsi file which will
overwrite the original is ok??
Can you not fix this in the kernel? How did you come to use the same compatible string for two different pieces of hardware?
This will be addressed in uboot in next version.
Regards
Gaurav Jain
Quoted 3 lines
Regards,
Simon
PATCH v4 2/16 crypto/fsl: Add CAAM support for bkek, random number generation
In reply to Gaurav Jainadded api and descriptor for blob key encryption key(bkek) generation. added api for random number generation.
--- drivers/crypto/fsl/desc.h | 5 +++ drivers/crypto/fsl/fsl_blob.c | 82 +++++++++++++++++++++++++++++++++++ drivers/crypto/fsl/jobdesc.c | 20 +++++++-- drivers/crypto/fsl/jobdesc.h | 4 ++ 4 files changed, 108 insertions(+), 3 deletions(-)
drivers/crypto/fsl/desc.h +5 -0
@@ -4,6 +4,7 @@* Definitions to support CAAM descriptor instruction generation * * Copyright 2008-2014 Freescale Semiconductor, Inc. +* Copyright 2021 NXP * * Based on desc.h file in linux drivers/crypto/caam */
@@ -15,6 +16,7 @@#define KEY_BLOB_SIZE 32#define MAC_SIZE 16 +#define BKEK_SIZE 32/* Max size of any CAAM descriptor in 32-bit words, inclusive of header */ #define MAX_CAAM_DESCSIZE 64
@@ -463,6 +465,9 @@#define OP_PROTINFO_HASH_SHA384 0x00000200#define OP_PROTINFO_HASH_SHA512 0x00000280 +/* PROTINFO fields for Blob Operations */ +#define OP_PROTINFO_MKVB 0x00000002 +/* For non-protocol/alg-only op commands */ #define OP_ALG_TYPE_SHIFT 24#define OP_ALG_TYPE_MASK (0x7 << OP_ALG_TYPE_SHIFT)
drivers/crypto/fsl/fsl_blob.c +82 -0
94 lines not on this page · raw message
drivers/crypto/fsl/jobdesc.c +17 -3
@@ -4,7 +4,7 @@* Basic job descriptor construction * * Copyright 2014 Freescale Semiconductor, Inc. -* Copyright 2018 NXP +* Copyright 2018, 2021 NXP * */
@@ -207,7 +207,7 @@ void inline_cnstr_jobdesc_hash(uint32_t *desc,append_store (desc, dma_addr_out, storelen,LDST_CLASS_2_CCB |LDST_SRCDST_BYTE_CONTEXT ); } -#ifndef CONFIG_SPL_BUILD +void inline_cnstr_jobdesc_blob_encap (uint32_t *desc,uint8_t *key_idnfr,uint8_t *plain_txt,uint8_t *enc_blob,uint32_t in_sz)
@@ -255,7 +255,7 @@ void inline_cnstr_jobdesc_blob_decap(uint32_t *desc, uint8_t *key_idnfr,append_operation (desc,OP_TYPE_DECAP_PROTOCOL |OP_PCLID_BLOB ); } -#endif +/* * Descriptor to instantiate RNG State Handle 0 in normal mode and * load the JDKEK, TDKEK and TDSK registers
@@ -334,3 +334,17 @@ void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc,append_fifo_store (desc, dma_addr_out, out_siz,LDST_CLASS_1_CCB |FIFOST_TYPE_PKHA_B ); } + +void inline_cnstr_jobdesc_derive_bkek (uint32_t *desc,void *bkek_out, +void *key_mod,uint32_t key_sz) +{ +dma_addr_t dma_key_mod =virt_to_phys (key_mod); +dma_addr_t dma_bkek_out =virt_to_phys (bkek_out); + +init_job_desc (desc,0 ); +append_load (desc, dma_key_mod, key_sz,LDST_CLASS_2_CCB | +LDST_SRCDST_BYTE_KEY ); +append_seq_out_ptr_intlen (desc, dma_bkek_out,BKEK_SIZE ,0 ); +append_operation (desc,OP_TYPE_ENCAP_PROTOCOL |OP_PCLID_BLOB | +OP_PROTINFO_MKVB ); +}
drivers/crypto/fsl/jobdesc.h +4 -0
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2014 Freescale Semiconductor, Inc. +* Copyright 2021 NXP * */
@@ -49,4 +50,7 @@ void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc, struct pk_in_params *pkin, uint8_t *out, uint32_t out_siz); +void inline_cnstr_jobdesc_derive_bkek (uint32_t *desc,void *bkek_out, +void *key_mod,uint32_t key_sz); +#endif
Signature · 1 line
2.17.1
PATCH v4 3/16 i.MX8M: crypto: updated device tree for supporting DM in SPL
In reply to Gaurav Jaindisabled use of JR0 in SPL and uboot, as JR0 is reserved for secure boot.
--- arch/arm/dts/imx8mm-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mm.dtsi | 1 + arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mn.dtsi | 1 + arch/arm/dts/imx8mp-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mp.dtsi | 1 + arch/arm/dts/imx8mq.dtsi | 1 + 7 files changed, 55 insertions(+), 3 deletions(-)
arch/arm/dts/imx8mm-evk-u-boot.dtsi +17 -1
@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mm-u-boot.dtsi"
@@ -72,6 +72,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };
arch/arm/dts/imx8mm.dtsi +1 -0
@@ -824,6 +824,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; }; sec_jr1: jr@2000 {
arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +17 -1
@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ / {
@@ -104,6 +104,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };
arch/arm/dts/imx8mn.dtsi +1 -0
@@ -822,6 +822,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; }; sec_jr1: jr@2000 {
arch/arm/dts/imx8mp-evk-u-boot.dtsi +17 -1
@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mp-u-boot.dtsi"
@@ -67,6 +67,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &i2c1 { u-boot,dm-spl; };
arch/arm/dts/imx8mp.dtsi +1 -0
@@ -624,6 +624,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; }; sec_jr1: jr@2000 {
arch/arm/dts/imx8mq.dtsi +1 -0
@@ -955,6 +955,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; }; sec_jr1: jr@2000 {
Signature · 1 line
2.17.1
Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPL
Quoted 56 lines · Gaurav Jain
disabled use of JR0 in SPL and uboot, as JR0 is reserved for secure boot.
Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>--- arch/arm/dts/imx8mm-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mm.dtsi | 1 + arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mn.dtsi | 1 + arch/arm/dts/imx8mp-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mp.dtsi | 1 + arch/arm/dts/imx8mq.dtsi | 1 + 7 files changed, 55 insertions(+), 3 deletions(-)arch/arm/dts/imx8mm-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mm-u-boot.dtsi"@@ -72,6 +72,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };arch/arm/dts/imx8mm.dtsi +0
-0
arch/arm/dts/imx8mm.dtsi line 827
Quoted 4 lines
arch/arm/dts/imx8mm.dtsi +1
-0@@ -824,6 +824,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";
Changing the SoC DTSI files makes future re-synchronizing difficult. If you mark these as disabled in the respective u-boot.dtsi files, it will create less work in the future. You're already enabling a bunch of new features in the respective -u-boot.dtsi files, I would suggest doing the disable in the same way.
Quoted 43 lines
arch/arm/dts/imx8mm.dtsi +0
-0}; sec_jr1: jr@2000 {arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ / {@@ -104,6 +104,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };arch/arm/dts/imx8mn.dtsi +0
-0
arch/arm/dts/imx8mn.dtsi line 825
Quoted 4 lines
arch/arm/dts/imx8mn.dtsi +1
-0@@ -822,6 +822,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";
ditto
Quoted 43 lines
arch/arm/dts/imx8mn.dtsi +0
-0}; sec_jr1: jr@2000 {arch/arm/dts/imx8mp-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mp-u-boot.dtsi"@@ -67,6 +67,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &i2c1 { u-boot,dm-spl; };arch/arm/dts/imx8mp.dtsi +0
-0
arch/arm/dts/imx8mp.dtsi line 627
Quoted 4 lines
arch/arm/dts/imx8mp.dtsi +1
-0@@ -624,6 +624,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";
ditto
arch/arm/dts/imx8mq.dtsi line 958
Quoted 12 lines
arch/arm/dts/imx8mp.dtsi +0
-0}; sec_jr1: jr@2000 {arch/arm/dts/imx8mq.dtsi +1
-0@@ -955,6 +955,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";
ditto
Quoted 6 lines
arch/arm/dts/imx8mq.dtsi +0
-1}; sec_jr1: jr@2000 { --2.17.1
RE: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPL
Hello Adam
Quoted 83 lines
-----Original Message-----
From: Adam Ford <[email protected]>
Sent: Monday, November 1, 2021 6:30 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Simon Glass <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl-uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPLCaution: EXT Email
Quoted 59 lines · Gaurav Jain
disabled use of JR0 in SPL and uboot, as JR0 is reserved for secure boot.
Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>--- arch/arm/dts/imx8mm-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mm.dtsi | 1 + arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mn.dtsi | 1 + arch/arm/dts/imx8mp-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mp.dtsi | 1 + arch/arm/dts/imx8mq.dtsi | 1 + 7 files changed, 55 insertions(+), 3 deletions(-)arch/arm/dts/imx8mm-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mm-u-boot.dtsi"@@ -72,6 +72,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };arch/arm/dts/imx8mm.dtsi index renamed from arch/arm/dts/imx8mm.dtsi +0
-0
b142b80734..009999bf3a100644arch/arm/dts/imx8mm.dtsi +0
-0@@ -824,6 +824,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>;
Quoted 8 lines
arch/arm/dts/imx8mm.dtsi line 828
Quoted 3 lines
arch/arm/dts/imx8mm.dtsi +1
-0interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";Changing the SoC DTSI files makes future re-synchronizing difficult.
If you mark these as disabled in the respectiveu-boot.dtsifiles, it will create less work in the future. You're already enabling a bunch of new features in the respective-u-boot.dtsifiles, I would suggest doing the disable in the same way.
JR0 status is marked as disabled, as it is reserved in ATF and cannot be accessed in SPL and Uboot. For JR driver model(new feature) to work, at least one Jobring has to be initialized, which is not possible with JR0. JR1 will be initialized.
Regards
Gaurav Jain
Quoted 124 lines
Quoted 45 lines
arch/arm/dts/imx8mm.dtsi +0
-0};sec_jr1: jr@2000 { diff --git
a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsib/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index1d3844437d..b462d24eb2100644arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ / {@@ -104,6 +104,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };arch/arm/dts/imx8mn.dtsi index renamed from arch/arm/dts/imx8mn.dtsi +0
-0
edcb415b53..1820a5af37100644arch/arm/dts/imx8mn.dtsi line 826
Quoted 5 lines
arch/arm/dts/imx8mn.dtsi +1
-0@@ -822,6 +822,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";ditto
Quoted 44 lines
arch/arm/dts/imx8mn.dtsi +0
-0};sec_jr1: jr@2000 { diff --git
a/arch/arm/dts/imx8mp-evk-u-boot.dtsib/arch/arm/dts/imx8mp-evk-u-boot.dtsi
indexab849ebaac..52f473dc52100644arch/arm/dts/imx8mp-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mp-u-boot.dtsi"@@ -67,6 +67,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &i2c1 { u-boot,dm-spl; };arch/arm/dts/imx8mp.dtsi index renamed from arch/arm/dts/imx8mp.dtsi +0
-0
c2d51a46cb..57b01c3a57100644arch/arm/dts/imx8mp.dtsi line 628
Quoted 5 lines
arch/arm/dts/imx8mp.dtsi +1
-0@@ -624,6 +624,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";ditto
arch/arm/dts/imx8mq.dtsi line 959
Quoted 13 lines
arch/arm/dts/imx8mp.dtsi +0
-0};sec_jr1: jr@2000 { diff --git
a/arch/arm/dts/imx8mq.dtsib/arch/arm/dts/imx8mq.dtsiindexa44f729d0e..ecab44ca13100644arch/arm/dts/imx8mq.dtsi +1
-0@@ -955,6 +955,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";ditto
Quoted 6 lines
arch/arm/dts/imx8mq.dtsi +0
-0};sec_jr1: jr@2000 {--
2.17.1
Re: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPL
Quoted 95 lines · Gaurav Jain
Hello Adam
Quoted 83 lines
-----Original Message-----
From: Adam Ford <[email protected]>
Sent: Monday, November 1, 2021 6:30 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Simon Glass <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl-uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPLCaution: EXT Email
Quoted 59 lines · Gaurav Jain
disabled use of JR0 in SPL and uboot, as JR0 is reserved for secure boot.
Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>--- arch/arm/dts/imx8mm-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mm.dtsi | 1 + arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mn.dtsi | 1 + arch/arm/dts/imx8mp-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mp.dtsi | 1 + arch/arm/dts/imx8mq.dtsi | 1 + 7 files changed, 55 insertions(+), 3 deletions(-)arch/arm/dts/imx8mm-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mm-u-boot.dtsi"@@ -72,6 +72,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };arch/arm/dts/imx8mm.dtsi index renamed from arch/arm/dts/imx8mm.dtsi +0
-0
b142b80734..009999bf3a100644arch/arm/dts/imx8mm.dtsi +0
-0@@ -824,6 +824,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>;Quoted 8 lines
arch/arm/dts/imx8mm.dtsi line 828
Quoted 3 lines
arch/arm/dts/imx8mm.dtsi +1
-0interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";Changing the SoC DTSI files makes future re-synchronizing difficult.
If you mark these as disabled in the respectiveu-boot.dtsifiles, it will create less work in the future. You're already enabling a bunch of new features in the respective-u-boot.dtsifiles, I would suggest doing the disable in the same way.
Quoted 3 lines
JR0 status is marked as disabled, as it is reserved in ATF and cannot be accessed in SPL and Uboot. For JR driver model(new feature) to work, at least one Jobring has to be initialized, which is not possible with JR0. JR1 will be initialized.
I wasn't suggesting that it should not be disabled. I was asking that it be disabled in the -u-boot.dtsi file instead of the imx8mm.dtsi file because when the imx8mm.dtsi file gets resync'd with Linux, it might be lost. Having it done in the -u-boot.dtsi file instead helps reduce the likelihood of being undone later, and that is the purpose of the -u-boot.dtsi files.
adam
Quoted 127 lines
Regards
Gaurav JainQuoted 124 lines
Quoted 45 lines
arch/arm/dts/imx8mm.dtsi +0
-0};sec_jr1: jr@2000 { diff --git
a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsib/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index1d3844437d..b462d24eb2100644arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ / {@@ -104,6 +104,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };arch/arm/dts/imx8mn.dtsi index renamed from arch/arm/dts/imx8mn.dtsi +0
-0
edcb415b53..1820a5af37100644arch/arm/dts/imx8mn.dtsi line 826
Quoted 5 lines
arch/arm/dts/imx8mn.dtsi +1
-0@@ -822,6 +822,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";ditto
Quoted 44 lines
arch/arm/dts/imx8mn.dtsi +0
-0};sec_jr1: jr@2000 { diff --git
a/arch/arm/dts/imx8mp-evk-u-boot.dtsib/arch/arm/dts/imx8mp-evk-u-boot.dtsi
indexab849ebaac..52f473dc52100644arch/arm/dts/imx8mp-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mp-u-boot.dtsi"@@ -67,6 +67,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &i2c1 { u-boot,dm-spl; };arch/arm/dts/imx8mp.dtsi index renamed from arch/arm/dts/imx8mp.dtsi +0
-0
c2d51a46cb..57b01c3a57100644arch/arm/dts/imx8mp.dtsi line 628
Quoted 5 lines
arch/arm/dts/imx8mp.dtsi +1
-0@@ -624,6 +624,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";ditto
arch/arm/dts/imx8mq.dtsi line 959
Quoted 13 lines
arch/arm/dts/imx8mp.dtsi +0
-0};sec_jr1: jr@2000 { diff --git
a/arch/arm/dts/imx8mq.dtsib/arch/arm/dts/imx8mq.dtsiindexa44f729d0e..ecab44ca13100644arch/arm/dts/imx8mq.dtsi +1
-0@@ -955,6 +955,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";ditto
Quoted 6 lines
arch/arm/dts/imx8mq.dtsi +0
-0};sec_jr1: jr@2000 {--
2.17.1
RE: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPL
Hello Gurav/Adam ,
Quoted 123 lines
-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Adam Ford
Sent: Tuesday, November 2, 2021 12:19 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Simon Glass <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl-uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPLQuoted 95 lines · Gaurav Jain
Hello Adam
Quoted 92 lines
-----Original Message-----
From: Adam Ford <[email protected]>
Sent: Monday, November 1, 2021 6:30 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Simon Glass <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl-uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPLCaution: EXT Email
Quoted 57 lines · Gaurav Jain
disabled use of JR0 in SPL and uboot, as JR0 is reserved for secure boot.
Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>--- arch/arm/dts/imx8mm-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mm.dtsi | 1 + arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mn.dtsi | 1 + arch/arm/dts/imx8mp-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mp.dtsi | 1 + arch/arm/dts/imx8mq.dtsi | 1 + 7 files changed, 55 insertions(+), 3 deletions(-)arch/arm/dts/imx8mm-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mm-u-boot.dtsi"@@ -72,6 +72,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };arch/arm/dts/imx8mm.dtsi +0
-0arch/arm/dts/imx8mm.dtsi line 828
Quoted 5 lines
arch/arm/dts/imx8mm.dtsi +1
-0@@ -824,6 +824,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";Changing the SoC DTSI files makes future re-synchronizing difficult. If you mark these as disabled in the respective
u-boot.dtsifiles, it will create less work in the future. You're already enabling a bunch of new features in the respective-u-boot.dtsifiles, I would suggestdoing the disable in the same way.
Quoted 2 lines
JR0 status is marked as disabled, as it is reserved in ATF and cannot be accessed
in SPL and Uboot.
Quoted 1 line
For JR driver model(new feature) to work, at least one Jobring has to be
Quoted 8 lines
initialized, which is not possible with JR0.
Quoted 1 line
JR1 will be initialized.
I wasn't suggesting that it should not be disabled. I was asking that it be disabled in the
-u-boot.dtsifile instead of theimx8mm.dtsifile because when theimx8mm.dtsifile gets resync'd with Linux, it might be lost. Having it done in the -u-boot.dtsifile instead helps reduce the likelihood of being undone later, and that is the purpose of the-u-boot.dtsifiles.
If I may add my 2c here:
It seems to me that this patch should be split into at least 2 separate patches: one that disables the JR0 node, and one - for the rest.
The reason being: if the JR0 node is reserved for ATF and should not be available - then it should be disabled in the Kernel DTB as well as here.
This part is missing in upstream Kernel, so the boot process throws following errors during JR probing:
----
[ 1.509894] caam 30900000.crypto: job rings = 3, qi = 0 [ 1.525201] caam_jr 30901000.jr: failed to flush job ring 0 [ 1.525214] caam_jr: probe of 30901000.jr failed with error -5
----
Disabling the JR0 node in the kernel makes this error go away, and decreases the JR count to 2 which can be observed in the NXP vendor kernel.
I suggest you to extract the node disabling from this patch and send it to Kernel. Once accepted in upstream - this change would be picked up by the U-Boot at next DTB re-sync.
-- andrey
Quoted 131 lines
adam
Quoted 129 lines
Regards
Gaurav JainQuoted 126 lines
Quoted 46 lines
arch/arm/dts/imx8mm.dtsi +0
-0};sec_jr1: jr@2000 { diff --git
a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsib/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index1d3844437d..b462d24eb2100644arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ / {@@ -104,6 +104,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };arch/arm/dts/imx8mn.dtsi +0
-0index
edcb415b53..1820a5af37100644arch/arm/dts/imx8mn.dtsi line 826
Quoted 5 lines
arch/arm/dts/imx8mn.dtsi +1
-0@@ -822,6 +822,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";ditto
Quoted 45 lines
arch/arm/dts/imx8mn.dtsi +0
-0};sec_jr1: jr@2000 { diff --git
a/arch/arm/dts/imx8mp-evk-u-boot.dtsib/arch/arm/dts/imx8mp-evk-u-boot.dtsi
indexab849ebaac..52f473dc52100644arch/arm/dts/imx8mp-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mp-u-boot.dtsi"@@ -67,6 +67,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &i2c1 { u-boot,dm-spl; };arch/arm/dts/imx8mp.dtsi +0
-0index
c2d51a46cb..57b01c3a57100644arch/arm/dts/imx8mp.dtsi line 628
Quoted 5 lines
arch/arm/dts/imx8mp.dtsi +1
-0@@ -624,6 +624,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";ditto
arch/arm/dts/imx8mq.dtsi line 959
Quoted 13 lines
arch/arm/dts/imx8mp.dtsi +0
-0};sec_jr1: jr@2000 { diff --git
a/arch/arm/dts/imx8mq.dtsib/arch/arm/dts/imx8mq.dtsiindexa44f729d0e..ecab44ca13100644arch/arm/dts/imx8mq.dtsi +1
-0@@ -955,6 +955,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";ditto
Quoted 6 lines
arch/arm/dts/imx8mq.dtsi +0
-0};sec_jr1: jr@2000 {--
2.17.1
RE: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPL
Hello Andrey
Quoted 181 lines
-----Original Message-----
From: ZHIZHIKIN Andrey <[email protected]>
Sent: Wednesday, November 3, 2021 5:05 PM
To: Adam Ford <[email protected]>; Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Simon Glass <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl-uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: RE: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPLCaution: EXT Email
Hello Gurav/Adam ,
Quoted 8 lines
-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Adam Ford
Sent: Tuesday, November 2, 2021 12:19 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Simon Glass <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia GeantaQuoted 8 lines
<[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl-uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>;
Alison
Quoted 1 line
Wang <[email protected]>; Pramod Kumar
Quoted 36 lines
Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPLQuoted 29 lines · Gaurav Jain
Hello Adam
Quoted 26 lines
-----Original Message-----
From: Adam Ford <[email protected]>
Sent: Monday, November 1, 2021 6:30 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Simon Glass <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl-uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPLCaution: EXT Email
On Tue, Oct 26, 2021 at 1:57 AM Gaurav Jain <[email protected]>
Quoted 75 lines · wrote:
Quoted 60 lines
Quoted 60 lines
Quoted 60 lines
disabled use of JR0 in SPL and uboot, as JR0 is reserved for secure boot.
Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>--- arch/arm/dts/imx8mm-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mm.dtsi | 1 + arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mn.dtsi | 1 + arch/arm/dts/imx8mp-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mp.dtsi | 1 + arch/arm/dts/imx8mq.dtsi | 1 + 7 files changed, 55 insertions(+), 3 deletions(-)arch/arm/dts/imx8mm-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mm-u-boot.dtsi"@@ -72,6 +72,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };arch/arm/dts/imx8mm.dtsi +0
-0@@ -824,6 +824,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPIQuoted 8 lines
Quoted 8 lines
arch/arm/dts/imx8mm.dtsi line 828
Quoted 2 lines
arch/arm/dts/imx8mm.dtsi +1
-0105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";Changing the SoC DTSI files makes future re-synchronizing difficult. If you mark these as disabled in the respective
u-boot.dtsifiles, it will create less work in the future. You're already enabling a bunch of new features in the respective-u-boot.dtsifiles, I would suggestdoing the disable in the same way.
Quoted 3 lines
JR0 status is marked as disabled, as it is reserved in ATF and cannot be accessed
in SPL and Uboot.
Quoted 2 lines
For JR driver model(new feature) to work, at least one Jobring has to be
Quoted 8 lines
initialized, which is not possible with JR0.
Quoted 1 line
JR1 will be initialized.
I wasn't suggesting that it should not be disabled. I was asking that it be disabled in the
-u-boot.dtsifile instead of theimx8mm.dtsifile because when theimx8mm.dtsifile gets resync'd with Linux, it might be lost. Having it done in the -u-boot.dtsifile instead helps reduce the likelihood of being undone later, and that is the purpose of the -u-
boot.dtsifiles.If I may add my 2c here:
It seems to me that this patch should be split into at least 2 separate patches:
one that disables the JR0 node, and one - for the rest.The reason being: if the JR0 node is reserved for ATF and should not be available
- then it should be disabled in the Kernel DTB as well as here.This part is missing in upstream Kernel, so the boot process throws following errors during JR probing:
----[ 1.509894] caam 30900000.crypto: job rings = 3, qi = 0 [ 1.525201] caam_jr 30901000.jr: failed to flush job ring 0 [ 1.525214] caam_jr: probe of 30901000.jr failed with error -5----
Quoted 9 lines
Disabling the JR0 node in the kernel makes this error go away, and decreases the JR count to 2 which can be observed in the NXP vendor kernel.
I suggest you to extract the node disabling from this patch and send it to Kernel. Once accepted in upstream - this change would be picked up by the U-Boot at next DTB re-sync.
-- andrey
Removing the JR0 disable change from this patch will cause CAAM failed to initialize on iMX8M series. As Adam suggested, I will disable the JR0 in the - u-boot.dtsi. I will also send a patch to kernel for disabling the JRO. When U-boot DTB will be synced with kernel, I will remove the JR0 disable change from - u-boot.dtsi
Regards
Gaurav Jain
Quoted 131 lines
Quoted 131 lines
adam
Quoted 129 lines
Regards
Gaurav JainQuoted 126 lines
Quoted 46 lines
arch/arm/dts/imx8mm.dtsi +0
-0};sec_jr1: jr@2000 { diff --git
a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsib/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index1d3844437d..b462d24eb2100644arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ / {@@ -104,6 +104,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };arch/arm/dts/imx8mn.dtsi +0
-0index
edcb415b53..1820a5af37100644arch/arm/dts/imx8mn.dtsi line 826
Quoted 5 lines
arch/arm/dts/imx8mn.dtsi +1
-0@@ -822,6 +822,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";ditto
Quoted 45 lines
arch/arm/dts/imx8mn.dtsi +0
-0};sec_jr1: jr@2000 { diff --git
a/arch/arm/dts/imx8mp-evk-u-boot.dtsib/arch/arm/dts/imx8mp-evk-u-boot.dtsi
indexab849ebaac..52f473dc52100644arch/arm/dts/imx8mp-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mp-u-boot.dtsi"@@ -67,6 +67,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &i2c1 { u-boot,dm-spl; };arch/arm/dts/imx8mp.dtsi +0
-0index
c2d51a46cb..57b01c3a57100644arch/arm/dts/imx8mp.dtsi line 628
Quoted 5 lines
arch/arm/dts/imx8mp.dtsi +1
-0@@ -624,6 +624,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";ditto
arch/arm/dts/imx8mq.dtsi line 959
Quoted 13 lines
arch/arm/dts/imx8mp.dtsi +0
-0};sec_jr1: jr@2000 { diff --git
a/arch/arm/dts/imx8mq.dtsib/arch/arm/dts/imx8mq.dtsiindexa44f729d0e..ecab44ca13100644arch/arm/dts/imx8mq.dtsi +1
-0@@ -955,6 +955,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";ditto
Quoted 6 lines
arch/arm/dts/imx8mq.dtsi +0
-0};sec_jr1: jr@2000 {--
2.17.1
RE: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPL
Hello Gurav,
I'll Cc: Michael Walle here for the reason described below.
Quoted 222 lines
-----Original Message-----
From: Gaurav Jain <[email protected]>
Sent: Monday, November 8, 2021 9:21 AM
To: ZHIZHIKIN Andrey <[email protected]>; Adam Ford <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Simon Glass <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl-uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: RE: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPLHello Andrey
Quoted 8 lines
-----Original Message-----
From: ZHIZHIKIN Andrey <[email protected]>
Sent: Wednesday, November 3, 2021 5:05 PM
To: Adam Ford <[email protected]>; Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Simon Glass <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia GeantaQuoted 8 lines
<[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl-uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>;
Alison
Quoted 62 lines
Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: RE: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPLCaution: EXT Email
Hello Gurav/Adam ,
Quoted 8 lines
-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Adam Ford
Sent: Tuesday, November 2, 2021 12:19 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Simon Glass <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia GeantaQuoted 8 lines
<[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl-uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>;
Alison
Quoted 1 line
Wang <[email protected]>; Pramod Kumar
Quoted 33 lines
Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPLQuoted 26 lines · Gaurav Jain
Hello Adam
Quoted 23 lines
-----Original Message-----
From: Adam Ford <[email protected]>
Sent: Monday, November 1, 2021 6:30 PM
To: Gaurav Jain <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Simon Glass <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl-uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPLQuoted 15 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Caution: EXT Email
On Tue, Oct 26, 2021 at 1:57 AM Gaurav Jain
<[email protected]>Quoted 10 lines · wrote:
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
disabled use of JR0 in SPL and uboot, as JR0 is reserved for secure boot.
Signed-off-by Gaurav Jain <[email protected]>Reviewed-by Ye Li <[email protected]>--- arch/arm/dts/imx8mm-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mm.dtsi | 1 + arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 18+++++++++++++++++-
Quoted 92 lines
Quoted 66 lines
Quoted 50 lines
Quoted 50 lines
Quoted 50 lines
arch/arm/dts/imx8mn.dtsi | 1 + arch/arm/dts/imx8mp-evk-u-boot.dtsi | 18 +++++++++++++++++- arch/arm/dts/imx8mp.dtsi | 1 + arch/arm/dts/imx8mq.dtsi | 1 + 7 files changed, 55 insertions(+), 3 deletions(-)arch/arm/dts/imx8mm-evk-u-boot.dtsi +17
-1@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 NXP + * Copyright 2019, 2021 NXP */ #include "imx8mm-u-boot.dtsi"@@ -72,6 +72,22 @@ u-boot,dm-spl; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + &usdhc1 { u-boot,dm-spl; };(quoted diff) +0
-0
b/arch/arm/dts/imx8mm.dtsiindexb142b80734..009999bf3a100644arch/arm/dts/imx8mm.dtsi +0
-0@@ -824,6 +824,7 @@ compatible = "fsl,sec-v4.0-job-ring"; reg = <0x1000 0x1000>; interrupts = <GIC_SPIQuoted 8 lines
Quoted 8 lines
arch/arm/dts/imx8mm.dtsi line 828
Quoted 2 lines
arch/arm/dts/imx8mm.dtsi +1
-0105 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled";Changing the SoC DTSI files makes future re-synchronizing difficult. If you mark these as disabled in the respective
u-boot.dtsifiles, it will create less work in the future. You're already enabling a bunch of new features in the respective-u-boot.dtsifiles, I would suggestdoing the disable in the same way.
Quoted 3 lines
JR0 status is marked as disabled, as it is reserved in ATF and cannot be accessed
in SPL and Uboot.
Quoted 2 lines
For JR driver model(new feature) to work, at least one Jobring has to be
initialized, which is not possible with JR0.
Quoted 8 lines
Quoted 1 line
JR1 will be initialized.
I wasn't suggesting that it should not be disabled. I was asking that it be disabled in the
-u-boot.dtsifile instead of theimx8mm.dtsifile because when theimx8mm.dtsifile gets resync'd with Linux, it might be lost. Having it done in the -u-boot.dtsifile instead helps reduce the likelihood of being undone later, and that is the purpose of the -u-
boot.dtsifiles.If I may add my 2c here:
It seems to me that this patch should be split into at least 2 separate patches:
one that disables the JR0 node, and one - for the rest.The reason being: if the JR0 node is reserved for ATF and should not be available
- then it should be disabled in the Kernel DTB as well as here.This part is missing in upstream Kernel, so the boot process throws following errors during JR probing:
----[ 1.509894] caam 30900000.crypto: job rings = 3, qi = 0 [ 1.525201] caam_jr 30901000.jr: failed to flush job ring 0 [ 1.525214] caam_jr: probe of 30901000.jr failed with error -5----
Quoted 9 lines
Disabling the JR0 node in the kernel makes this error go away, and decreases the JR count to 2 which can be observed in the NXP vendor kernel.
I suggest you to extract the node disabling from this patch and send it to Kernel. Once accepted in upstream - this change would be picked up by the U-Boot at next DTB re-sync.
-- andrey
Quoted 6 lines
Removing the JR0 disable change from this patch will cause CAAM failed to initialize on iMX8M series.
As Adam suggested, I will disable the JR0 in the -u-boot.dtsi. I will also send a patch to kernel for disabling the JRO.
When U-boot DTB will be synced with kernel, I will remove the JR0 disable change from -u-boot.dtsi
I'm currently working on dynamic recognition of Job Rings which are reserved for TZ at the early boot, there is a patch proposed to address this [1]. I was planning to re-work this to also include a small clean-up of the CAAM driver in a way how JRs are probed. The patch does not require nodes to be permanently disabled in DTB, rather they would need to be omitted from the probing instead.
I was wondering perhaps similar changes can be introduced in the U-Boot, since it would allow to account for cases where JRs reserved for specific purposes (e.g. HAB) can be dynamically changed and would not require modifications of DTB to align.
In generic case, any JR can be "taken away" into TZ. Those modifications should be sync'ed with DTB changes, while having this dynamically recognized would have a benefit of not touching the DTB at all.
Quoted 4 lines
Regards
Gaurav Jain
-- andrey
Re: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPL
Am 2021-11-08 09:48, schrieb ZHIZHIKIN Andrey:
..
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Disabling the JR0 node in the kernel makes this error go away, and decreases the JR count to 2 which can be observed in the NXP vendor kernel.
I suggest you to extract the node disabling from this patch and send it to Kernel. Once accepted in upstream - this change would be picked up by the U-Boot at next DTB re-sync.
No. Please don't disable the node in the kernel device tree. IMHO TF-A (or whoever is using the job ring) is optional. So either u-boot should disable it, either statically by -u-boot.dtsi (but please _per_ board) or at runtime by fixing up the device tree. Another way would be for linux to skip probing if its not available. Though I don't know whether this is "the ususal way".
But as Andrey mentioned, any job ring could be taken away. So the -u-boot.dtsi method doesn't seem to be that good.
-michael
RE: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPL
Hello Michael
Quoted 41 lines
-----Original Message-----
From: Michael Walle <[email protected]>
Sent: Monday, November 8, 2021 2:29 PM
To: ZHIZHIKIN Andrey <[email protected]>
Cc: Gaurav Jain <[email protected]>; Adam Ford <[email protected]>; U-Boot Mailing List <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; Peng Fan <[email protected]>; Simon Glass <[email protected]>; Priyanka Jain <[email protected]>; Ye Li <[email protected]>; Horia Geanta <[email protected]>; Ji Luo <[email protected]>; Franck Lenormand <[email protected]>; Silvano Di Ninno <[email protected]>; Sahil Malhotra <[email protected]>; Pankaj Gupta <[email protected]>; Varun Sethi <[email protected]>; dl- uboot-imx <[email protected]>; Shengzhou Liu <[email protected]>; Mingkai Hu <[email protected]>; Rajesh Bhagat <[email protected]>; Meenakshi Aggarwal <[email protected]>; Wasim Khan <[email protected]>; Alison Wang <[email protected]>; Pramod Kumar <[email protected]>; Andy Tang <[email protected]>; Adrian Alonso <[email protected]>; Vladimir Oltean <[email protected]>
Subject: Re: [EXT] Re: [PATCH v4 03/16] i.MX8M: crypto: updated device tree for supporting DM in SPLCaution: EXT Email
Am 2021-11-08 09:48, schrieb ZHIZHIKIN Andrey:
..Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Disabling the JR0 node in the kernel makes this error go away, and decreases the JR count to 2 which can be observed in the NXP vendor kernel.
I suggest you to extract the node disabling from this patch and send it to
Kernel.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Once accepted in upstream - this change would be picked up by the U-Boot at next DTB re-sync.
No. Please don't disable the node in the kernel device tree. IMHO TF-A (or whoever is using the job ring) is optional. So either u-boot should disable it, either statically by
-u-boot.dtsi(but please _per_
board) or at runtime by fixing up the device tree. Another way would be for linux to skip probing if its not available. Though I don't know whether this is "the ususal way".
Quoted 3 lines
But as Andrey mentioned, any job ring could be taken away. So the
-u-boot.dtsimethod doesn't seem to be that good.
Moved the JR0 disabled code to *-u-boot.dtsi files in version 5 of this patch series.
Regards
Gaurav Jain
Quoted 1 line
-michael
PATCH v4 4/16 crypto/fsl: i.MX8M: Enable Job ring driver model in SPL and U-Boot.
In reply to Gaurav Jaini.MX8MM/MN/MP/MQ - added support for JR driver model. sec is initialized based on job ring information processed from device tree.
--- arch/arm/Kconfig | 2 +- arch/arm/include/asm/arch-imx8m/imx-regs.h | 1 + arch/arm/mach-imx/imx8m/Kconfig | 23 ++++++++++++++++++++++ arch/arm/mach-imx/imx8m/soc.c | 10 +++++++++- board/freescale/imx8mm_evk/spl.c | 9 ++++++++- board/freescale/imx8mn_evk/spl.c | 8 ++++++-- board/freescale/imx8mp_evk/spl.c | 13 ++++++++++-- board/freescale/imx8mq_evk/spl.c | 9 +++++++-- drivers/crypto/fsl/jr.c | 14 ++++++++++--- scripts/config_whitelist.txt | 1 + 10 files changed, 78 insertions(+), 12 deletions(-)
arch/arm/Kconfig +1 -1
@@ -817,7 +817,7 @@ config ARCH_IMX8M select ARM64 select GPIO_EXTRA_HEADER select MACH_IMX - select SYS_FSL_HAS_SEC if IMX_HAB + select SYS_FSL_HAS_SEC select SYS_FSL_SEC_COMPAT_4 select SYS_FSL_SEC_LE select SYS_I2C_MXC
arch/arm/include/asm/arch-imx8m/imx-regs.h +1 -0
@@ -72,6 +72,7 @@#define CONFIG_SYS_FSL_SEC_ADDR (CAAM_IPS_BASE_ADDR + \ CONFIG_SYS_FSL_SEC_OFFSET)#define CONFIG_SYS_FSL_JR0_OFFSET (0x1000) +#define CONFIG_SYS_FSL_JR1_OFFSET (0x2000)#define CONFIG_SYS_FSL_JR0_ADDR (CONFIG_SYS_FSL_SEC_ADDR + \ CONFIG_SYS_FSL_JR0_OFFSET)#define CONFIG_SYS_FSL_MAX_NUM_OF_SEC 1
arch/arm/mach-imx/imx8m/Kconfig +23 -0
@@ -38,6 +38,11 @@ config TARGET_IMX8MQ_EVK bool "imx8mq_evk" select IMX8MQ select IMX8M_LPDDR4 + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT + select SPL_CRYPTO if SPL config TARGET_IMX8MQ_PHANBELL bool "imx8mq_phanbell"
@@ -50,6 +55,11 @@ config TARGET_IMX8MM_EVK select IMX8MM select SUPPORT_SPL select IMX8M_LPDDR4 + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT + select SPL_CRYPTO if SPL config TARGET_IMX8MM_ICORE_MX8MM bool "Engicam i.Core MX8M Mini SOM"
@@ -88,6 +98,10 @@ config TARGET_IMX8MN_EVK select IMX8MN select SUPPORT_SPL select IMX8M_LPDDR4 + select FSL_CAAM + select FSL_BLOB + select MISC + select SPL_CRYPTO if SPL config TARGET_IMX8MN_DDR4_EVK bool "imx8mn DDR4 EVK board"
@@ -95,6 +109,10 @@ config TARGET_IMX8MN_DDR4_EVK select IMX8MN select SUPPORT_SPL select IMX8M_DDR4 + select FSL_CAAM + select FSL_BLOB + select MISC + select SPL_CRYPTO if SPL config TARGET_IMX8MP_EVK bool "imx8mp LPDDR4 EVK board"
@@ -102,6 +120,11 @@ config TARGET_IMX8MP_EVK select IMX8MP select SUPPORT_SPL select IMX8M_LPDDR4 + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT + select SPL_CRYPTO if SPL config TARGET_PICO_IMX8MQ bool "Support Technexion Pico iMX8MQ"
arch/arm/mach-imx/imx8m/soc.c +9 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* -* Copyright 2017-2019 NXP +* Copyright 2017-2019, 2021 NXP * * Peng Fan <[email protected]> */
@@ -20,6 +20,7 @@#include <asm/ptrace.h> #include <asm/armv8/mmu.h> #include <dm/uclass.h> +#include <dm/device.h> #include <efi_loader.h> #include <env.h> #include <env_internal.h>
@@ -1197,6 +1198,13 @@ static void acquire_buildinfo(void)int arch_misc_init (void ) { +struct udevice *dev; +int ret; + + ret =uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (caam_jr), &dev); +if (ret) +printf ("Failed to initialize %s: %d\n" , dev->name, ret); +acquire_buildinfo ();return 0 ;
board/freescale/imx8mm_evk/spl.c +8 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* -* Copyright 2019 NXP +* Copyright 2019, 2021 NXP */ #include <common.h>
@@ -51,6 +51,13 @@ static void spl_dram_init(void)void spl_board_init (void ) { +struct udevice *dev; +int ret; + + ret =uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (caam_jr), &dev); +if (ret) +printf ("Failed to initialize %s: %d\n" , dev->name, ret); +puts ("Normal Boot\n" ); }
board/freescale/imx8mn_evk/spl.c +6 -2
@@ -1,7 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* -* Copyright 2018-2019 NXP +* Copyright 2018-2019, 2021 NXP * -* SPDX-License-Identifier: GPL-2.0+ */ #include <common.h>
@@ -49,6 +49,10 @@ void spl_board_init(void)struct udevice *dev;int ret; + ret =uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (caam_jr), &dev); +if (ret) +printf ("Failed to initialize %s: %d\n" , dev->name, ret); +puts ("Normal Boot\n" ); ret = uclass_get_device_by_name(UCLASS_CLK,
board/freescale/imx8mp_evk/spl.c +11 -2
@@ -1,7 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* -* Copyright 2018-2019 NXP +* Copyright 2018-2019, 2021 NXP * -* SPDX-License-Identifier: GPL-2.0+ */ #include <common.h>
@@ -20,6 +20,8 @@#include <asm/arch/ddr.h> #include <power/pmic.h> #include <power/pca9450.h> +#include <dm/uclass.h> +#include <dm/device.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -35,6 +37,13 @@ void spl_dram_init(void)void spl_board_init (void ) { +struct udevice *dev; +int ret; + + ret =uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (caam_jr), &dev); +if (ret) +printf ("Failed to initialize %s: %d\n" , dev->name, ret); +/* * Set GIC clock to 500Mhz for OD VDD_SOC. Kernel driver does * not allow to change it. Should set the clock after PMIC
board/freescale/imx8mq_evk/spl.c +7 -2
@@ -1,8 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* -* Copyright 2018 NXP +* Copyright 2018, 2021 NXP * -* SPDX-License-Identifier: GPL-2.0+ */ #include <common.h>
@@ -22,6 +21,7 @@#include <asm/mach-imx/gpio.h> #include <asm/mach-imx/mxc_i2c.h> #include <fsl_esdhc_imx.h> +#include <fsl_sec.h> #include <mmc.h> #include <linux/delay.h> #include <power/pmic.h>
@@ -199,6 +199,11 @@ int power_init_board(void)void spl_board_init (void ) { +#ifdef CONFIG_FSL_CAAM +if (sec_init ()) +printf ("\nsec_init failed!\n" ); + +#endif puts ("Normal Boot\n" ); }
drivers/crypto/fsl/jr.c +11 -3
@@ -43,9 +43,17 @@ struct udevice *caam_dev;#define SEC_ADDR (idx) \ (ulong)((CONFIG_SYS_FSL_SEC_ADDR + sec_offset[idx])) -#define SEC_JR0_ADDR (idx) \ +#ifndef CONFIG_IMX8M +#define SEC_JR_ADDR (idx) \ (ulong)(SEC_ADDR(idx) + \ (CONFIG_SYS_FSL_JR0_OFFSET - CONFIG_SYS_FSL_SEC_OFFSET)) +#define JR_ID 0 +#else +#define SEC_JR_ADDR (idx) \ + (ulong)(SEC_ADDR(idx) + \ + (CONFIG_SYS_FSL_JR1_OFFSET - CONFIG_SYS_FSL_SEC_OFFSET)) +#define JR_ID 1 +#endif struct caam_regs caam_st;#endif
@@ -675,8 +683,8 @@ int sec_init_idx(uint8_t sec_idx) caam =dev_get_priv (caam_dev);#else caam_st.sec = (void *)SEC_ADDR (sec_idx); - caam_st.regs = (struct jr_regs *)SEC_JR0_ADDR (sec_idx); - caam_st.jrid =0 ; + caam_st.regs = (struct jr_regs *)SEC_JR_ADDR (sec_idx); + caam_st.jrid =JR_ID ; caam = &caam_st;#endif #ifndef CONFIG_ARCH_IMX8
scripts/config_whitelist.txt +1 -0
@@ -1853,6 +1853,7 @@ CONFIG_SYS_FSL_IFC_SIZE2 CONFIG_SYS_FSL_ISBC_VER CONFIG_SYS_FSL_JR0_ADDR CONFIG_SYS_FSL_JR0_OFFSET +CONFIG_SYS_FSL_JR1_OFFSET CONFIG_SYS_FSL_LS1_CLK_ADDR CONFIG_SYS_FSL_LSCH3_SERDES_ADDR CONFIG_SYS_FSL_MAX_NUM_OF_SEC
Signature · 1 line
2.17.1
PATCH v4 5/16 mx6sabre: Remove unnecessary SPL configs
In reply to Gaurav JainFrom: Ye Li <[email protected]>
Because we don't use SPL_DM on mx6sabresd and mx6sabreauto, so it is unnecessary to have SPL DTB related configs and SPL_OF_CONTROL enabled.
--- configs/mx6sabreauto_defconfig | 2 -- configs/mx6sabresd_defconfig | 4 ---- 2 files changed, 6 deletions(-)
configs/mx6sabreauto_defconfig +0 -2
@@ -60,10 +60,8 @@ CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y CONFIG_OF_CONTROL=y -CONFIG_SPL_OF_CONTROL=y CONFIG_OF_LIST="imx6dl-sabreauto imx6q-sabreauto imx6qp-sabreauto" CONFIG_MULTI_DTB_FIT=y -CONFIG_SPL_MULTI_DTB_FIT=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y
configs/mx6sabresd_defconfig +0 -4
@@ -63,12 +63,8 @@ CONFIG_CMD_FS_GENERIC=y CONFIG_EFI_PARTITION=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_OF_CONTROL=y -CONFIG_SPL_OF_CONTROL=y CONFIG_OF_LIST="imx6q-sabresd imx6qp-sabresd imx6dl-sabresd" CONFIG_MULTI_DTB_FIT=y -CONFIG_SPL_MULTI_DTB_FIT=y -CONFIG_SPL_OF_LIST="imx6dl-sabresd imx6q-sabresd imx6qp-sabresd" -CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y
Signature · 1 line
2.17.1
PATCH v4 6/16 i.MX6: Enable Job ring driver model in U-Boot.
In reply to Gaurav Jaini.MX6,i.MX6SX,i.MX6UL - added support for JR driver model.
removed sec_init() call, sec is initialized based on job ring information processed from device tree.
--- arch/arm/mach-imx/mx6/Kconfig | 20 ++++++++++++++++++++ arch/arm/mach-imx/mx6/soc.c | 12 ++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-)
arch/arm/mach-imx/mx6/Kconfig +20 -0
@@ -354,6 +354,10 @@ config TARGET_MX6SABREAUTO select DM_THERMAL select SUPPORT_SPL imply CMD_DM + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT config TARGET_MX6SABRESD bool "mx6sabresd"
@@ -364,6 +368,10 @@ config TARGET_MX6SABRESD select DM_THERMAL select SUPPORT_SPL imply CMD_DM + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT config TARGET_MX6SLEVK bool "mx6slevk"
@@ -386,6 +394,10 @@ config TARGET_MX6SXSABRESD select DM select DM_THERMAL select SUPPORT_SPL + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT config TARGET_MX6SXSABREAUTO bool "mx6sxsabreauto"
@@ -404,6 +416,10 @@ config TARGET_MX6UL_9X9_EVK select DM_THERMAL select SUPPORT_SPL imply CMD_DM + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT config TARGET_MX6UL_14X14_EVK bool "mx6ul_14x14_evk"
@@ -413,6 +429,10 @@ config TARGET_MX6UL_14X14_EVK select DM_THERMAL select SUPPORT_SPL imply CMD_DM + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT config TARGET_MX6UL_ENGICAM bool "Support Engicam GEAM6UL/Is.IoT"
arch/arm/mach-imx/mx6/soc.c +8 -4
@@ -4,6 +4,7 @@* Sascha Hauer, Pengutronix * * (C) Copyright 2009 Freescale Semiconductor, Inc. +* Copyright 2021 NXP */ #include <common.h>
@@ -23,7 +24,6 @@#include <asm/arch/mxc_hdmi.h> #include <asm/arch/crm_regs.h> #include <dm.h> -#include <fsl_sec.h> #include <imx_thermal.h> #include <mmc.h>
@@ -734,9 +734,13 @@ static void setup_serial_number(void)int arch_misc_init (void ) { -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif +struct udevice *dev; +int ret; + + ret =uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (caam_jr), &dev); +if (ret) +printf ("Failed to initialize %s: %d\n" , dev->name, ret); +setup_serial_number ();return 0 ; }
Signature · 1 line
2.17.1
PATCH v4 7/16 i.MX7: Enable Job ring driver model in U-Boot.
In reply to Gaurav Jaini.MX7D - added support for JR driver model.
removed sec_init() call, sec is initialized based on job ring information processed from device tree.
--- arch/arm/Kconfig | 2 +- arch/arm/mach-imx/mx7/Kconfig | 3 +++ arch/arm/mach-imx/mx7/soc.c | 11 +++++++---- 3 files changed, 11 insertions(+), 5 deletions(-)
arch/arm/Kconfig +1 -1
@@ -885,7 +885,7 @@ config ARCH_MX7 select CPU_V7A select GPIO_EXTRA_HEADER select MACH_IMX - select SYS_FSL_HAS_SEC if IMX_HAB + select SYS_FSL_HAS_SEC select SYS_FSL_SEC_COMPAT_4 select SYS_FSL_SEC_LE imply BOARD_EARLY_INIT_F
arch/arm/mach-imx/mx7/Kconfig +3 -0
@@ -68,6 +68,9 @@ config TARGET_MX7DSABRESD select DM_THERMAL select MX7D imply CMD_DM + select FSL_CAAM + select FSL_BLOB + select MISC config TARGET_PICO_IMX7D bool "pico-imx7d"
arch/arm/mach-imx/mx7/soc.c +7 -4
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2015 Freescale Semiconductor, Inc. +* Copyright 2021 NXP */ #include <common.h>
@@ -19,7 +20,6 @@#include <dm.h> #include <env.h> #include <imx_thermal.h> -#include <fsl_sec.h> #include <asm/setup.h> #include <linux/delay.h>
@@ -337,6 +337,9 @@ int arch_cpu_init(void)#ifdef CONFIG_ARCH_MISC_INIT int arch_misc_init (void ) { +struct udevice *dev; +int ret; +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG struct tag_serialnr serialnr;char serial_string[0x20 ];
@@ -353,9 +356,9 @@ int arch_misc_init(void)env_set ("serial#" , serial_string);#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif + ret =uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (caam_jr), &dev); +if (ret) +printf ("Failed to initialize %s: %d\n" , dev->name, ret);return 0 ; }
Signature · 1 line
2.17.1
PATCH v4 8/16 i.MX7ULP: Enable Job ring driver model in U-Boot.
In reply to Gaurav Jainadded crypto node in device tree.
sec is initialized based on job ring information processed from device tree.
--- arch/arm/Kconfig | 2 +- arch/arm/dts/imx7ulp.dtsi | 24 ++++++++++++++++++++++++ arch/arm/mach-imx/mx7ulp/Kconfig | 4 ++++ arch/arm/mach-imx/mx7ulp/soc.c | 16 ++++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-)
arch/arm/Kconfig +1 -1
@@ -872,7 +872,7 @@ config ARCH_MX7ULP select CPU_V7A select GPIO_EXTRA_HEADER select MACH_IMX - select SYS_FSL_HAS_SEC if IMX_HAB + select SYS_FSL_HAS_SEC select SYS_FSL_SEC_COMPAT_4 select SYS_FSL_SEC_LE select ROM_UNIFIED_SECTIONS
arch/arm/dts/imx7ulp.dtsi +24 -0
@@ -1,5 +1,6 @@ /* * Copyright 2015-2016 Freescale Semiconductor, Inc. + * Copyright 2021 NXP * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as
@@ -198,6 +199,29 @@ }; }; + crypto: crypto@40240000 { + compatible = "fsl,sec-v4.0"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x40240000 0x10000>; + ranges = <0 0x40240000 0x10000>; + clocks = <&clks IMX7ULP_CLK_CAAM>, + <&clks IMX7ULP_CLK_NIC1_BUS_DIV>; + clock-names = "aclk", "ipg"; + + sec_jr0: jr@1000 { + compatible = "fsl,sec-v4.0-job-ring"; + reg = <0x1000 0x1000>; + interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; + }; + + sec_jr1: jr@2000 { + compatible = "fsl,sec-v4.0-job-ring"; + reg = <0x2000 0x1000>; + interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; + }; + }; + tpm5: tpm@40260000 { compatible = "fsl,imx7ulp-tpm"; reg = <0x40260000 0x1000>;
arch/arm/mach-imx/mx7ulp/Kconfig +4 -0
@@ -25,6 +25,10 @@ config TARGET_MX7ULP_EVK bool "Support mx7ulp EVK board" select MX7ULP select SYS_ARCH_TIMER + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT endchoice
arch/arm/mach-imx/mx7ulp/soc.c +16 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2016 Freescale Semiconductor, Inc. +* Copyright 2021 NXP */ #include <common.h>
@@ -15,6 +16,7 @@#include <asm/mach-imx/hab.h> #include <asm/setup.h> #include <linux/bitops.h> +#include <dm.h> #define PMC0_BASE_ADDR 0x410a1000#define PMC0_CTRL 0x28
@@ -80,6 +82,20 @@ int arch_cpu_init(void)return 0 ; } +#if defined(CONFIG_ARCH_MISC_INIT ) +int arch_misc_init (void ) +{ +struct udevice *dev; +int ret; + + ret =uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (caam_jr), &dev); +if (ret) +printf ("Failed to initialize %s: %d\n" , dev->name, ret); + +return 0 ; +} +#endif +#ifdef CONFIG_BOARD_POSTCLK_INIT int board_postclk_init (void ) {
Signature · 1 line
2.17.1
PATCH v4 9/16 i.MX8: Add crypto node in device tree
In reply to Gaurav Jaini.MX8(QM/QXP) - updated device tree for supporting DM in SPL.
disabled use of JR1 in SPL and uboot, as JR1 is reserved for SECO FW.
--- arch/arm/dts/fsl-imx8dx.dtsi | 61 +++++++++++++++++++++++- arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi | 34 ++++++++++++- arch/arm/dts/fsl-imx8qm.dtsi | 61 +++++++++++++++++++++++- arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi | 34 ++++++++++++- 4 files changed, 186 insertions(+), 4 deletions(-)
arch/arm/dts/fsl-imx8dx.dtsi +60 -1
@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2018 NXP + * Copyright 2018, 2021 NXP */ #include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -261,6 +261,30 @@ power-domains = <&pd_dma>; }; }; + + pd_caam: PD_CAAM { + compatible = "nxp,imx8-pd"; + reg = <SC_R_NONE>; + #power-domain-cells = <0>; + #address-cells = <1>; + #size-cells = <0>; + + pd_caam_jr1: PD_CAAM_JR1 { + reg = <SC_R_CAAM_JR1>; + #power-domain-cells = <0>; + power-domains = <&pd_caam>; + }; + pd_caam_jr2: PD_CAAM_JR2 { + reg = <SC_R_CAAM_JR2>; + #power-domain-cells = <0>; + power-domains = <&pd_caam>; + }; + pd_caam_jr3: PD_CAAM_JR3 { + reg = <SC_R_CAAM_JR3>; + #power-domain-cells = <0>; + power-domains = <&pd_caam>; + }; + }; }; i2c0: i2c@5a800000 {
@@ -609,6 +633,41 @@ }; }; }; + + crypto: caam@0x31400000 { + compatible = "fsl,sec-v4.0"; + reg = <0 0x31400000 0 0x400000>; + interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0x31400000 0x400000>; + fsl,first-jr-index = <2>; + fsl,sec-era = <9>; + + sec_jr1: jr1@0x20000 { + compatible = "fsl,sec-v4.0-job-ring"; + reg = <0x20000 0x1000>; + interrupts = <GIC_SPI 452 IRQ_TYPE_LEVEL_HIGH>; + power-domains = <&pd_caam_jr1>; + status = "disabled"; + }; + + sec_jr2: jr2@30000 { + compatible = "fsl,sec-v4.0-job-ring"; + reg = <0x30000 0x1000>; + interrupts = <GIC_SPI 453 IRQ_TYPE_LEVEL_HIGH>; + power-domains = <&pd_caam_jr2>; + status = "okay"; + }; + + sec_jr3: jr3@40000 { + compatible = "fsl,sec-v4.0-job-ring"; + reg = <0x40000 0x1000>; + interrupts = <GIC_SPI 454 IRQ_TYPE_LEVEL_HIGH>; + power-domains = <&pd_caam_jr3>; + status = "okay"; + }; + }; }; &A35_0 {
arch/arm/dts/fsl-imx8qm-mek-u-boot.dtsi +33 -1
@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2018 NXP + * Copyright 2018, 2021 NXP */ &{/imx8qm-pm} {
@@ -80,6 +80,22 @@ u-boot,dm-spl; }; +&pd_caam { + u-boot,dm-spl; +}; + +&pd_caam_jr1 { + u-boot,dm-spl; +}; + +&pd_caam_jr2 { + u-boot,dm-spl; +}; + +&pd_caam_jr3 { + u-boot,dm-spl; +}; + &gpio0 { u-boot,dm-spl; };
@@ -126,3 +142,19 @@ sd-uhs-sdr104; sd-uhs-ddr50; }; + +&crypto { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + +&sec_jr3 { + u-boot,dm-spl; +};
arch/arm/dts/fsl-imx8qm.dtsi +60 -1
78 lines not on this page · raw message
arch/arm/dts/fsl-imx8qxp-mek-u-boot.dtsi +33 -1
@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2018 NXP + * Copyright 2018, 2021 NXP */ &{/imx8qx-pm} {
@@ -80,6 +80,22 @@ u-boot,dm-spl; }; +&pd_caam { + u-boot,dm-spl; +}; + +&pd_caam_jr1 { + u-boot,dm-spl; +}; + +&pd_caam_jr2 { + u-boot,dm-spl; +}; + +&pd_caam_jr3 { + u-boot,dm-spl; +}; + &gpio0 { u-boot,dm-spl; };
@@ -126,3 +142,19 @@ sd-uhs-sdr104; sd-uhs-ddr50; }; + +&crypto { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + +&sec_jr3 { + u-boot,dm-spl; +};
Signature · 1 line
2.17.1
PATCH v4 10/16 crypto/fsl: i.MX8: Enable Job ring driver model in SPL and U-Boot.
In reply to Gaurav Jaini.MX8(QM/QXP) - added support for JR driver model. sec is initialized based on job ring information processed from device tree.
--- arch/arm/Kconfig | 3 +++ arch/arm/include/asm/arch-imx8/imx-regs.h | 5 ++++- arch/arm/mach-imx/cmd_dek.c | 1 + arch/arm/mach-imx/imx8/Kconfig | 9 +++++++++ arch/arm/mach-imx/imx8/cpu.c | 16 ++++++++++++++- board/freescale/imx8qm_mek/spl.c | 6 ++++-- board/freescale/imx8qxp_mek/spl.c | 6 ++++-- drivers/crypto/fsl/Kconfig | 2 +- drivers/crypto/fsl/jr.c | 24 +++++++++++++++++++++++ include/fsl_sec.h | 12 +++++------- 10 files changed, 70 insertions(+), 14 deletions(-)
arch/arm/Kconfig +3 -0
@@ -806,6 +806,9 @@ config ARCH_LPC32XX config ARCH_IMX8 bool "NXP i.MX8 platform" select ARM64 + select SYS_FSL_HAS_SEC + select SYS_FSL_SEC_COMPAT_4 + select SYS_FSL_SEC_LE select DM select GPIO_EXTRA_HEADER select MACH_IMX
arch/arm/include/asm/arch-imx8/imx-regs.h +4 -1
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0+ */ /* -* Copyright 2018 NXP +* Copyright 2018, 2021 NXP */ #ifndef __ASM_ARCH_IMX8_REGS_H__
@@ -47,4 +47,7 @@#define USB_BASE_ADDR 0x5b0d0000#define USB_PHY0_BASE_ADDR 0x5b100000 +#define CONFIG_SYS_FSL_SEC_ADDR (0x31400000) +#define CONFIG_SYS_FSL_MAX_NUM_OF_SEC 1 +#endif /* __ASM_ARCH_IMX8_REGS_H__ */
arch/arm/mach-imx/cmd_dek.c +1 -0
@@ -9,6 +9,7 @@#include <command.h> #include <log.h> #include <malloc.h> +#include <memalign.h> #include <asm/byteorder.h> #include <linux/compiler.h> #include <fsl_sec.h>
arch/arm/mach-imx/imx8/Kconfig +9 -0
@@ -8,6 +8,7 @@ config AHAB_BOOT config IMX8 bool + select HAS_CAAM config MU_BASE_SPL hex "MU base address used in SPL"
@@ -72,6 +73,10 @@ config TARGET_IMX8QM_MEK bool "Support i.MX8QM MEK board" select BOARD_LATE_INIT select IMX8QM + select FSL_CAAM + select FSL_BLOB + select ARCH_MISC_INIT + select SPL_CRYPTO if SPL config TARGET_CONGA_QMX8 bool "Support congatec conga-QMX8 board"
@@ -89,6 +94,10 @@ config TARGET_IMX8QXP_MEK bool "Support i.MX8QXP MEK board" select BOARD_LATE_INIT select IMX8QXP + select FSL_CAAM + select FSL_BLOB + select ARCH_MISC_INIT + select SPL_CRYPTO if SPL endchoice
arch/arm/mach-imx/imx8/cpu.c +15 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* -* Copyright 2018 NXP +* Copyright 2018, 2021 NXP */ #include <common.h>
@@ -89,6 +89,20 @@ int arch_cpu_init_dm(void)return 0 ; } +#if defined(CONFIG_ARCH_MISC_INIT ) +int arch_misc_init (void ) +{ +struct udevice *dev; +int ret; + + ret =uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (caam_jr), &dev); +if (ret) +printf ("Failed to initialize %s: %d\n" , dev->name, ret); + +return 0 ; +} +#endif +int print_bootinfo (void ) {enum boot_device bt_dev =get_boot_device ();
board/freescale/imx8qm_mek/spl.c +4 -2
@@ -1,7 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* -* Copyright 2018 NXP +* Copyright 2018, 2021 NXP * -* SPDX-License-Identifier: GPL-2.0+ */ #include <common.h>
@@ -24,6 +24,8 @@ void spl_board_init(void) {struct udevice *dev; +uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (imx8_scu), &dev); +uclass_find_first_device (UCLASS_MISC , &dev);for (; dev;uclass_find_next_device (&dev)) {
board/freescale/imx8qxp_mek/spl.c +4 -2
@@ -1,7 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* -* Copyright 2018 NXP +* Copyright 2018, 2021 NXP * -* SPDX-License-Identifier: GPL-2.0+ */ #include <common.h>
@@ -39,6 +39,8 @@ void spl_board_init(void) {struct udevice *dev; +uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (imx8_scu), &dev); +uclass_find_first_device (UCLASS_MISC , &dev);for (; dev;uclass_find_next_device (&dev)) {
drivers/crypto/fsl/Kconfig +1 -1
@@ -11,7 +11,7 @@ config FSL_CAAM config CAAM_64BIT bool - default y if PHYS_64BIT && !ARCH_IMX8M + default y if PHYS_64BIT && !ARCH_IMX8M && !ARCH_IMX8 help Select Crypto driver for 64 bits CAAM version
drivers/crypto/fsl/jr.c +24 -0
@@ -25,6 +25,7 @@#include <linux/delay.h> #include <dm/root.h> #include <dm/device-internal.h> +#include <power-domain.h> #define CIRC_CNT (head, tail, size) (((head) - (tail)) & (size - 1))#define CIRC_SPACE (head, tail, size) CIRC_CNT((tail), (head) + 1, (size))
@@ -790,6 +791,25 @@ int sec_init(void)return sec_init_idx (0 ); } +#ifdef CONFIG_ARCH_IMX8 +static int jr_power_on (int subnode) +{ +#if CONFIG_IS_ENABLED (POWER_DOMAIN ) +struct udevice __maybe_unused jr_dev; +struct power_domain pd; + +dev_set_ofnode (&jr_dev,offset_to_ofnode (subnode)); + +/* Need to power on Job Ring before access it */ +if (!power_domain_get (&jr_dev, &pd)) { +if (power_domain_on (&pd)) +return -EINVAL ; + } +#endif +return 0 ; +} +#endif +#if CONFIG_IS_ENABLED (DM )static int caam_jr_probe (struct udevice *dev) {
@@ -822,6 +842,10 @@ static int caam_jr_probe(struct udevice *dev) jr_node = jr_node >>4 ; } caam->jrid = jr_node -1 ; +#ifdef CONFIG_ARCH_IMX8 +if (jr_power_on (subnode)) +return -EINVAL ; +#endif break ; } }
include/fsl_sec.h +5 -7
@@ -3,7 +3,7 @@* Common internal memory map for some Freescale SoCs * * Copyright 2014 Freescale Semiconductor, Inc. -* Copyright 2018 NXP +* Copyright 2018, 2021 NXP */ #ifndef __FSL_SEC_H
@@ -194,12 +194,10 @@ typedef struct ccsr_sec {#define SEC_CHAVID_LS_RNG_SHIFT 16#define SEC_CHAVID_RNG_LS_MASK 0x000f0000 -#define CONFIG_JRSTARTR_JR0 0x00000001 -struct jr_regs {#if defined(CONFIG_SYS_FSL_SEC_LE ) && \ !(defined(CONFIG_MX6 ) || defined(CONFIG_MX7 ) || \ - defined(CONFIG_MX7ULP ) || defined(CONFIG_IMX8M )) + defined(CONFIG_MX7ULP ) || defined(CONFIG_IMX8M ) || defined(CONFIG_IMX8 ))u32 irba_l;u32 irba_h;#else
@@ -214,7 +212,7 @@ struct jr_regs {u32 irja;#if defined(CONFIG_SYS_FSL_SEC_LE ) && \ !(defined(CONFIG_MX6 ) || defined(CONFIG_MX7 ) || \ - defined(CONFIG_MX7ULP ) || defined(CONFIG_IMX8M )) + defined(CONFIG_MX7ULP ) || defined(CONFIG_IMX8M ) || defined(CONFIG_IMX8 ))u32 orba_l;u32 orba_h;#else
@@ -248,7 +246,7 @@ struct jr_regs {struct sg_entry {#if defined(CONFIG_SYS_FSL_SEC_LE ) && \ !(defined(CONFIG_MX6 ) || defined(CONFIG_MX7 ) || \ - defined(CONFIG_MX7ULP ) || defined(CONFIG_IMX8M )) + defined(CONFIG_MX7ULP ) || defined(CONFIG_IMX8M ) || defined(CONFIG_IMX8 ))uint32_t addr_lo;/* Memory Address - lo */ uint32_t addr_hi;/* Memory Address of start of buffer - hi */ #else
@@ -268,7 +266,7 @@ struct sg_entry { };#if defined(CONFIG_MX6 ) || defined(CONFIG_MX7 ) || \ - defined(CONFIG_MX7ULP ) || defined(CONFIG_IMX8M ) + defined(CONFIG_MX7ULP ) || defined(CONFIG_IMX8M ) || defined(CONFIG_IMX8 )/* Job Ring Base Address */ #define JR_BASE_ADDR (x) (CONFIG_SYS_FSL_SEC_ADDR + 0x1000 * (x + 1))/* Secure Memory Offset varies accross versions */
Signature · 1 line
2.17.1
PATCH v4 11/16 crypto/fsl: Fix kick_trng
In reply to Gaurav JainFrom: Ye Li <[email protected]>
fix hwrng performance issue in kernel.
--- drivers/crypto/fsl/jr.c | 109 ++++++++++++++++++++++++++++++++++------ include/fsl_sec.h | 1 + 2 files changed, 94 insertions(+), 16 deletions(-)
drivers/crypto/fsl/jr.c +93 -16
@@ -602,30 +602,107 @@ static u8 get_rng_vid(ccsr_sec_t *sec)*/ static void kick_trng (int ent_delay,ccsr_sec_t *sec) { +u32 samples =512 ;/* number of bits to generate and test */ +u32 mono_min =195 ; +u32 mono_max =317 ; +u32 mono_range = mono_max - mono_min; +u32 poker_min =1031 ; +u32 poker_max =1600 ; +u32 poker_range = poker_max - poker_min +1 ; +u32 retries =2 ; +u32 lrun_max =32 ; +s32 run_1_min =27 ; +s32 run_1_max =107 ; +s32 run_1_range = run_1_max - run_1_min; +s32 run_2_min =7 ; +s32 run_2_max =62 ; +s32 run_2_range = run_2_max - run_2_min; +s32 run_3_min =0 ; +s32 run_3_max =39 ; +s32 run_3_range = run_3_max - run_3_min; +s32 run_4_min =-1 ; +s32 run_4_max =26 ; +s32 run_4_range = run_4_max - run_4_min; +s32 run_5_min =-1 ; +s32 run_5_max =18 ; +s32 run_5_range = run_5_max - run_5_min; +s32 run_6_min =-1 ; +s32 run_6_max =17 ; +s32 run_6_range = run_6_max - run_6_min; +u32 val; +struct rng4tst __iomem *rng = (struct rng4tst __iomem *)&sec->rng; -u32 val; -/* put RNG4 into program mode */ -sec_setbits32 (&rng->rtmctl,RTMCTL_PRGM ); -/* rtsdctl bits 0-15 contain "Entropy Delay, which defines the -* length (in system clocks) of each Entropy sample taken -* */ +/* Put RNG in program mode */ +/* Setting both RTMCTL:PRGM and RTMCTL:TRNG_ACC causes TRNG to +* properly invalidate the entropy in the entropy register and +* force re-generation. +*/ +sec_setbits32 (&rng->rtmctl,RTMCTL_PRGM |RTMCTL_ACC ); + +/* Configure the RNG Entropy Delay +* Performance-wise, it does not make sense to +* set the delay to a value that is lower +* than the last one that worked (i.e. the state handles +* were instantiated properly. Thus, instead of wasting +* time trying to set the values controlling the sample +* frequency, the function simply returns. +*/ val =sec_in32 (&rng->rtsdctl); - val = (val & ~RTSDCTL_ENT_DLY_MASK ) | - (ent_delay <<RTSDCTL_ENT_DLY_SHIFT ); + val &=RTSDCTL_ENT_DLY_MASK ; + val >>=RTSDCTL_ENT_DLY_SHIFT ; +if (ent_delay < val) { +/* Put RNG4 into run mode */ +sec_clrbits32 (&rng->rtmctl,RTMCTL_PRGM |RTMCTL_ACC ); +return ; + } + + val = (ent_delay <<RTSDCTL_ENT_DLY_SHIFT ) | samples;sec_out32 (&rng->rtsdctl, val); -/* min. freq. count, equal to 1/4 of the entropy sample length */ -sec_out32 (&rng->rtfreqmin, ent_delay >>2 ); -/* disable maximum frequency count */ -sec_out32 (&rng->rtfreqmax,RTFRQMAX_DISABLE ); +/* -* select raw sampling in both entropy shifter +* Recommended margins (min,max) for freq. count: +* freq_mul = RO_freq / TRNG_clk_freq +* rtfrqmin = (ent_delay x freq_mul) >> 1; +* rtfrqmax = (ent_delay x freq_mul) << 3; +* Given current deployments of CAAM in i.MX SoCs, and to simplify +* the configuration, we consider [1,16] to be a safe interval +* for the freq_mul and the limits of the interval are used to compute +* rtfrqmin, rtfrqmax +*/ +sec_out32 (&rng->rtfreqmin, ent_delay >>1 ); +sec_out32 (&rng->rtfreqmax, ent_delay <<7 ); + +sec_out32 (&rng->rtscmisc, (retries <<16 ) | lrun_max); +sec_out32 (&rng->rtpkrmax, poker_max); +sec_out32 (&rng->rtpkrrng, poker_range); +sec_out32 (&rng->rsvd1[0 ], (mono_range <<16 ) | mono_max); +sec_out32 (&rng->rsvd1[1 ], (run_1_range <<16 ) | run_1_max); +sec_out32 (&rng->rsvd1[2 ], (run_2_range <<16 ) | run_2_max); +sec_out32 (&rng->rsvd1[3 ], (run_3_range <<16 ) | run_3_max); +sec_out32 (&rng->rsvd1[4 ], (run_4_range <<16 ) | run_4_max); +sec_out32 (&rng->rsvd1[5 ], (run_5_range <<16 ) | run_5_max); +sec_out32 (&rng->rsvd1[6 ], (run_6_range <<16 ) | run_6_max); + + val =sec_in32 (&rng->rtmctl); +/* +* Select raw sampling in both entropy shifter * and statistical checker */ -sec_setbits32 (&rng->rtmctl,RTMCTL_SAMP_MODE_RAW_ES_SC ); -/* put RNG4 into run mode */ -sec_clrbits32 (&rng->rtmctl,RTMCTL_PRGM ); + val &= ~RTMCTL_SAMP_MODE_INVALID ; + val |=RTMCTL_SAMP_MODE_RAW_ES_SC ; +/* Put RNG4 into run mode */ + val &= ~(RTMCTL_PRGM |RTMCTL_ACC ); +/*test with sample mode only */ +sec_out32 (&rng->rtmctl, val); + +/* Clear the ERR bit in RTMCTL if set. The TRNG error can occur when the +* RNG clock is not within 1/2x to 8x the system clock. +* This error is possible if ROM code does not initialize the system PLLs +* immediately after PoR. +*/ +/* setbits_le32(CAAM_RTMCTL, RTMCTL_ERR); */ }static int rng_init (uint8_t sec_idx,ccsr_sec_t *sec)
include/fsl_sec.h +1 -0
@@ -34,6 +34,7 @@ #if CONFIG_SYS_FSL_SEC_COMPAT >= 4 /* RNG4 TRNG test registers */ struct rng4tst { +#define RTMCTL_ACC 0x20 #define RTMCTL_PRGM 0x00010000 /* 1 -> program mode, 0 -> run mode */ #define RTMCTL_SAMP_MODE_VON_NEUMANN_ES_SC 0 /* use von Neumann data in both entropy shifter and
Signature · 1 line
2.17.1
PATCH v4 12/16 Layerscape: Add crypto node in device tree
In reply to Gaurav JainLS(1021/1012/1028/1043/1046/1088/2088), LX2160 - updated device tree
--- arch/arm/dts/fsl-ls1012a.dtsi | 46 ++++++++++++++++++++++++++++++++++- arch/arm/dts/fsl-ls1043a.dtsi | 45 +++++++++++++++++++++++++++++++++- arch/arm/dts/fsl-ls1046a.dtsi | 44 +++++++++++++++++++++++++++++++++ arch/arm/dts/fsl-ls1088a.dtsi | 39 +++++++++++++++++++++++++++++ arch/arm/dts/fsl-ls2080a.dtsi | 39 +++++++++++++++++++++++++++++ arch/arm/dts/fsl-lx2160a.dtsi | 41 ++++++++++++++++++++++++++++++- arch/arm/dts/ls1021a.dtsi | 40 ++++++++++++++++++++++++++++++ 7 files changed, 291 insertions(+), 3 deletions(-)
arch/arm/dts/fsl-ls1012a.dtsi +45 -1
@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ OR X11 /* - * Copyright 2020 NXP + * Copyright 2020-2021 NXP * Copyright 2016 Freescale Semiconductor */
@@ -71,6 +71,50 @@ bus-width = <4>; }; + crypto: crypto@1700000 { + compatible = "fsl,sec-v5.4", "fsl,sec-v5.0", + "fsl,sec-v4.0"; + fsl,sec-era = <8>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x00 0x1700000 0x100000>; + reg = <0x00 0x1700000 0x0 0x100000>; + interrupts = <0 75 0x4>; + dma-coherent; + + sec_jr0: jr@10000 { + compatible = "fsl,sec-v5.4-job-ring", + "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x10000 0x10000>; + interrupts = <0 71 0x4>; + }; + + sec_jr1: jr@20000 { + compatible = "fsl,sec-v5.4-job-ring", + "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x20000 0x10000>; + interrupts = <0 72 0x4>; + }; + + sec_jr2: jr@30000 { + compatible = "fsl,sec-v5.4-job-ring", + "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x30000 0x10000>; + interrupts = <0 73 0x4>; + }; + + sec_jr3: jr@40000 { + compatible = "fsl,sec-v5.4-job-ring", + "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x40000 0x10000>; + interrupts = <0 74 0x4>; + }; + }; + gpio0: gpio@2300000 { compatible = "fsl,qoriq-gpio"; reg = <0x0 0x2300000 0x0 0x10000>;
arch/arm/dts/fsl-ls1043a.dtsi +44 -1
57 lines not on this page · raw message
arch/arm/dts/fsl-ls1046a.dtsi +44 -0
56 lines not on this page · raw message
arch/arm/dts/fsl-ls1088a.dtsi +39 -0
@@ -180,6 +180,45 @@ dr_mode = "host"; }; + crypto: crypto@8000000 { + compatible = "fsl,sec-v5.0", "fsl,sec-v4.0"; + fsl,sec-era = <8>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x00 0x8000000 0x100000>; + reg = <0x00 0x8000000 0x0 0x100000>; + interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>; + dma-coherent; + + sec_jr0: jr@10000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x10000 0x10000>; + interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>; + }; + + sec_jr1: jr@20000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x20000 0x10000>; + interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; + }; + + sec_jr2: jr@30000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x30000 0x10000>; + interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>; + }; + + sec_jr3: jr@40000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x40000 0x10000>; + interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; + }; + }; + pcie1: pcie@3400000 { compatible = "fsl,ls-pcie", "snps,dw-pcie"; reg = <0x00 0x03400000 0x0 0x80000 /* dbi registers */
arch/arm/dts/fsl-ls2080a.dtsi +39 -0
@@ -245,6 +245,45 @@ status = "disabled"; }; + crypto: crypto@8000000 { + compatible = "fsl,sec-v5.0", "fsl,sec-v4.0"; + fsl,sec-era = <8>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x00 0x8000000 0x100000>; + reg = <0x00 0x8000000 0x0 0x100000>; + interrupts = <0 139 0x4>; /* Level high type */ + dma-coherent; + + sec_jr0: jr@10000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x10000 0x10000>; + interrupts = <0 140 0x4>; /* Level high type */ + }; + + sec_jr1: jr@20000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x20000 0x10000>; + interrupts = <0 141 0x4>; /* Level high type */ + }; + + sec_jr2: jr@30000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x30000 0x10000>; + interrupts = <0 142 0x4>; /* Level high type */ + }; + + sec_jr3: jr@40000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x40000 0x10000>; + interrupts = <0 143 0x4>; /* Level high type */ + }; + }; + fsl_mc: fsl-mc@80c000000 { compatible = "fsl,qoriq-mc", "simple-mfd"; reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal base */
arch/arm/dts/fsl-lx2160a.dtsi +40 -1
53 lines not on this page · raw message
arch/arm/dts/ls1021a.dtsi +40 -0
@@ -3,6 +3,7 @@ * Freescale ls1021a SOC common device tree source * * Copyright 2013-2015 Freescale Semiconductor, Inc. + * Copyright 2021 NXP */ #include "skeleton.dtsi"
@@ -144,6 +145,45 @@ big-endian; }; + crypto: crypto@1700000 { + compatible = "fsl,sec-v5.0", "fsl,sec-v4.0"; + fsl,sec-era = <7>; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x1700000 0x100000>; + ranges = <0x0 0x1700000 0x100000>; + interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>; + + sec_jr0: jr@10000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x10000 0x10000>; + interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>; + }; + + sec_jr1: jr@20000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x20000 0x10000>; + interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>; + }; + + sec_jr2: jr@30000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x30000 0x10000>; + interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; + }; + + sec_jr3: jr@40000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x40000 0x10000>; + interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>; + }; + + }; + clockgen: clocking@1ee1000 { #address-cells = <1>; #size-cells = <1>;
Signature · 1 line
2.17.1
PATCH v4 13/16 Layerscape: Enable Job ring driver model in U-Boot.
In reply to Gaurav JainLS(1021/1012/1028/1043/1046/1088/2088), LX2160, LX2162 platforms are enabled with JR driver model.
removed sec_init() call from board files.
removed CONFIG_FSL_CAAM from defconfig files.
sec is initialized based on job ring information processed from device tree.
--- arch/arm/cpu/armv7/ls102xa/Kconfig | 4 +++ arch/arm/cpu/armv7/ls102xa/cpu.c | 16 +++++++++++ arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 27 +++++++++++++++++++ arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 10 ++++++- board/freescale/ls1012afrdm/ls1012afrdm.c | 7 +---- board/freescale/ls1012aqds/ls1012aqds.c | 6 +---- board/freescale/ls1012ardb/ls1012ardb.c | 6 +---- board/freescale/ls1021aiot/ls1021aiot.c | 6 ++--- board/freescale/ls1021aqds/ls1021aqds.c | 6 +---- board/freescale/ls1021atsn/ls1021atsn.c | 7 ++--- board/freescale/ls1021atwr/ls1021atwr.c | 8 ++---- board/freescale/ls1028a/ls1028a.c | 6 +---- board/freescale/ls1043ardb/ls1043ardb.c | 6 +---- board/freescale/ls1046afrwy/ls1046afrwy.c | 7 +---- board/freescale/ls1046aqds/ls1046aqds.c | 7 +---- board/freescale/ls1046ardb/ls1046ardb.c | 6 +---- board/freescale/ls1088a/ls1088a.c | 6 +---- board/freescale/ls2080aqds/ls2080aqds.c | 6 +---- board/freescale/ls2080ardb/ls2080ardb.c | 9 +------ board/freescale/lx2160a/lx2160a.c | 5 ---- configs/ls1021aiot_qspi_defconfig | 1 - configs/ls1021aqds_nor_defconfig | 1 - configs/ls1021aqds_qspi_defconfig | 1 - configs/ls1021atsn_qspi_defconfig | 1 - configs/ls1021atwr_nor_defconfig | 1 - ...s1021atwr_sdcard_ifc_SECURE_BOOT_defconfig | 1 + configs/ls1028ardb_tfa_defconfig | 1 - configs/ls1043ardb_tfa_defconfig | 1 - configs/ls1046afrwy_tfa_defconfig | 1 - configs/ls1046aqds_tfa_defconfig | 1 - configs/ls1046ardb_tfa_defconfig | 1 - configs/ls2088aqds_tfa_defconfig | 1 - configs/ls2088ardb_tfa_defconfig | 1 - configs/lx2160aqds_tfa_defconfig | 1 - configs/lx2160ardb_tfa_defconfig | 1 - configs/lx2162aqds_tfa_defconfig | 1 - 36 files changed, 75 insertions(+), 102 deletions(-)
arch/arm/cpu/armv7/ls102xa/Kconfig +4 -0
@@ -21,6 +21,10 @@ config ARCH_LS1021A select SYS_FSL_SRDS_1 select SYS_HAS_SERDES select SYS_I2C_MXC + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply CMD_PCI imply SCSI imply SCSI_AHCI
arch/arm/cpu/armv7/ls102xa/cpu.c +16 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2014 Freescale Semiconductor, Inc. +* Copyright 2021 NXP */ #include <common.h>
@@ -20,6 +21,7 @@#include <config.h> #include <fsl_wdog.h> #include <linux/delay.h> +#include <dm.h> #include "fsl_epu.h"
@@ -397,3 +399,17 @@ void arch_preboot_os(void) ctrl &= ~ARCH_TIMER_CTRL_ENABLE ; asm("mcr p15, 0, %0, c14, c2, 1" : :"r" (ctrl)); } + +#ifdef CONFIG_ARCH_MISC_INIT +int arch_misc_init (void ) +{ +struct udevice *dev; +int ret; + + ret =uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (caam_jr), &dev); +if (ret) +printf ("Failed to initialize %s: %d\n" , dev->name, ret); + +return 0 ; +} +#endif
arch/arm/cpu/armv8/fsl-layerscape/Kconfig +27 -0
@@ -20,6 +20,10 @@ config ARCH_LS1012A select SYS_I2C_MXC select SYS_I2C_MXC_I2C1 if !DM_I2C select SYS_I2C_MXC_I2C2 if !DM_I2C + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply PANIC_HANG config ARCH_LS1028A
@@ -53,6 +57,9 @@ config ARCH_LS1028A select SYS_FSL_ERRATUM_A011334 select SYS_FSL_ESDHC_UNRELIABLE_PULSE_DETECTION_WORKAROUND select RESV_RAM if GIC_V3_ITS + select FSL_CAAM + select FSL_BLOB + select MISC imply PANIC_HANG config ARCH_LS1043A
@@ -88,6 +95,10 @@ config ARCH_LS1043A select SYS_I2C_MXC_I2C2 if !DM_I2C select SYS_I2C_MXC_I2C3 if !DM_I2C select SYS_I2C_MXC_I2C4 if !DM_I2C + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply CMD_PCI imply ID_EEPROM
@@ -125,6 +136,10 @@ config ARCH_LS1046A select SYS_I2C_MXC_I2C2 if !DM_I2C select SYS_I2C_MXC_I2C3 if !DM_I2C select SYS_I2C_MXC_I2C4 if !DM_I2C + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply ID_EEPROM imply SCSI imply SCSI_AHCI
@@ -170,6 +185,9 @@ config ARCH_LS1088A select SYS_I2C_MXC_I2C3 if !TFABOOT select SYS_I2C_MXC_I2C4 if !TFABOOT select RESV_RAM if GIC_V3_ITS + select FSL_CAAM + select FSL_BLOB + select MISC imply ID_EEPROM imply SCSI imply SPL_SYS_I2C_LEGACY
@@ -225,6 +243,9 @@ config ARCH_LS2080A select SYS_I2C_MXC_I2C3 if !TFABOOT select SYS_I2C_MXC_I2C4 if !TFABOOT select RESV_RAM if GIC_V3_ITS + select FSL_CAAM + select FSL_BLOB + select MISC imply DISTRO_DEFAULTS imply ID_EEPROM imply PANIC_HANG
@@ -257,6 +278,9 @@ config ARCH_LX2162A select BOARD_EARLY_INIT_F select SYS_I2C_MXC select RESV_RAM if GIC_V3_ITS + select FSL_CAAM + select FSL_BLOB + select MISC imply DISTRO_DEFAULTS imply PANIC_HANG imply SCSI
@@ -292,6 +316,9 @@ config ARCH_LX2160A select BOARD_EARLY_INIT_F select SYS_I2C_MXC select RESV_RAM if GIC_V3_ITS + select FSL_CAAM + select FSL_BLOB + select MISC imply DISTRO_DEFAULTS imply ID_EEPROM imply PANIC_HANG
arch/arm/cpu/armv8/fsl-layerscape/cpu.c +9 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* -* Copyright 2017-2020 NXP +* Copyright 2017-2021 NXP * Copyright 2014-2015 Freescale Semiconductor, Inc. */
@@ -48,6 +48,7 @@#endif #endif #include <linux/mii.h> +#include <dm.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -1649,6 +1650,13 @@ __weak int serdes_misc_init(void)int arch_misc_init (void ) { +struct udevice *dev; +int ret; + + ret =uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (caam_jr), &dev); +if (ret) +printf ("Failed to initialize %s: %d\n" , dev->name, ret); +serdes_misc_init ();return 0 ;
board/freescale/ls1012afrdm/ls1012afrdm.c +1 -6
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* -* Copyright 2017-2018 NXP +* Copyright 2017-2018, 2021 NXP */ #include <common.h>
@@ -22,7 +22,6 @@#include <env_internal.h> #include <fsl_mmdc.h> #include <netdev.h> -#include <fsl_sec.h> #include <net/pfe_eth/pfe/pfe_hw.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -176,10 +175,6 @@ int board_init(void) gd->env_addr = (ulong)&default_environment[0 ];#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif -#ifdef CONFIG_FSL_LS_PPA ppa_init ();#endif
board/freescale/ls1012aqds/ls1012aqds.c +1 -5
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2016 Freescale Semiconductor, Inc. +* Copyright 2021 NXP */ #include <common.h>
@@ -28,7 +29,6 @@#include <fsl_mmdc.h> #include <spl.h> #include <netdev.h> -#include <fsl_sec.h> #include "../common/qixis.h" #include "ls1012aqds_qixis.h" #include "ls1012aqds_pfe.h"
@@ -154,10 +154,6 @@ int board_init(void) gd->env_addr = (ulong)&default_environment[0 ];#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif -#ifdef CONFIG_FSL_LS_PPA ppa_init ();#endif
board/freescale/ls1012ardb/ls1012ardb.c +1 -5
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2016 Freescale Semiconductor, Inc. +* Copyright 2021 NXP */ #include <common.h>
@@ -27,7 +28,6 @@#include <env_internal.h> #include <fsl_mmdc.h> #include <netdev.h> -#include <fsl_sec.h> #include <net/pfe_eth/pfe/pfe_hw.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -177,10 +177,6 @@ int board_init(void) gd->env_addr = (ulong)&default_environment[0 ];#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif -#ifdef CONFIG_FSL_LS_PPA ppa_init ();#endif
board/freescale/ls1021aiot/ls1021aiot.c +2 -4
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2016 Freescale Semiconductor, Inc. +* Copyright 2021 NXP */ #include <common.h>
@@ -209,10 +210,7 @@ int misc_init_r(void)device_disable (devdis_tbl,ARRAY_SIZE (devdis_tbl));#endif - -#ifdef CONFIG_FSL_CAAM -return sec_init (); -#endif + return 0; }#endif
board/freescale/ls1021aqds/ls1021aqds.c +1 -5
@@ -1,7 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2014 Freescale Semiconductor, Inc. -* Copyright 2019 NXP +* Copyright 2019, 2021 NXP */ #include <common.h>
@@ -20,7 +20,6 @@#include <mmc.h> #include <fsl_csu.h> #include <fsl_ifc.h> -#include <fsl_sec.h> #include <spl.h> #include <fsl_devdis.h> #include <fsl_validate.h>
@@ -386,9 +385,6 @@ int misc_init_r(void)#ifdef CONFIG_FSL_DEVICE_DISABLE device_disable (devdis_tbl,ARRAY_SIZE (devdis_tbl)); -#endif -#ifdef CONFIG_FSL_CAAM -return sec_init ();#endif return 0 ; }
board/freescale/ls1021atsn/ls1021atsn.c +2 -5
@@ -1,5 +1,5 @@// SPDX-License-Identifier: GPL-2.0 -/* Copyright 2016-2019 NXP +/* Copyright 2016-2019, 2021 NXP */ #include <common.h> #include <clock_legacy.h>
@@ -238,10 +238,7 @@ int misc_init_r(void)#ifdef CONFIG_FSL_DEVICE_DISABLE device_disable (devdis_tbl,ARRAY_SIZE (devdis_tbl));#endif - -#ifdef CONFIG_FSL_CAAM -return sec_init (); -#endif + return 0; }#endif
board/freescale/ls1021atwr/ls1021atwr.c +2 -6
@@ -1,7 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2014 Freescale Semiconductor, Inc. -* Copyright 2019 NXP +* Copyright 2019, 2021 NXP */ #include <common.h>
@@ -26,7 +26,6 @@#include <netdev.h> #include <fsl_mdio.h> #include <tsec.h> -#include <fsl_sec.h> #include <fsl_devdis.h> #include <spl.h> #include <linux/delay.h>
@@ -555,10 +554,7 @@ int misc_init_r(void)#if !defined(CONFIG_QSPI_BOOT ) && !defined(CONFIG_SD_BOOT_QSPI )config_board_mux ();#endif - -#ifdef CONFIG_FSL_CAAM -return sec_init (); -#endif + return 0; }#endif
board/freescale/ls1028a/ls1028a.c +1 -5
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* -* Copyright 2019 NXP +* Copyright 2019, 2021 NXP */ #include <common.h>
@@ -77,10 +77,6 @@ int board_init(void) gd->env_addr = (ulong)&default_environment[0 ];#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif -#ifdef CONFIG_FSL_LS_PPA ppa_init ();#endif
board/freescale/ls1043ardb/ls1043ardb.c +1 -5
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2015 Freescale Semiconductor, Inc. +* Copyright 2021 NXP */ #include <common.h>
@@ -20,7 +21,6 @@#include <fm_eth.h> #include <fsl_esdhc.h> #include <fsl_ifc.h> -#include <fsl_sec.h> #include "cpld.h" #ifdef CONFIG_U_QE #include <fsl_qe.h>
@@ -211,10 +211,6 @@ int board_init(void)out_le32 (SMMU_NSCR0 , val);#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif -#ifdef CONFIG_FSL_LS_PPA ppa_init ();#endif
board/freescale/ls1046afrwy/ls1046afrwy.c +1 -6
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* -* Copyright 2019 NXP +* Copyright 2019, 2021 NXP */ #include <common.h>
@@ -20,7 +20,6 @@#include <fm_eth.h> #include <fsl_csu.h> #include <fsl_esdhc.h> -#include <fsl_sec.h> #include <fsl_dspi.h> #include "../common/i2c_mux.h"
@@ -135,10 +134,6 @@ val = (in_le32(SMMU_SCR0) | SCR0_CLIENTPD_MASK) & ~(SCR0_USFCFG_MASK);out_le32 (SMMU_NSCR0 , val);#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif -select_i2c_ch_pca9547 (I2C_MUX_CH_DEFAULT ,0 );return 0 ; }
board/freescale/ls1046aqds/ls1046aqds.c +1 -6
@@ -1,7 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2016 Freescale Semiconductor, Inc. -* Copyright 2019-2020 NXP +* Copyright 2019-2021 NXP */ #include <common.h>
@@ -27,7 +27,6 @@#include <fsl_csu.h> #include <fsl_esdhc.h> #include <fsl_ifc.h> -#include <fsl_sec.h> #include <spl.h> #include "../common/i2c_mux.h"
@@ -420,10 +419,6 @@ int board_init(void)out_le32 (SMMU_NSCR0 , val);#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif -return 0 ; }
board/freescale/ls1046ardb/ls1046ardb.c +1 -5
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2016 Freescale Semiconductor, Inc. +* Copyright 2021 NXP */ #include <common.h>
@@ -23,7 +24,6 @@#include <fsl_esdhc.h> #include <power/mc34vr500_pmic.h> #include "cpld.h" -#include <fsl_sec.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -85,10 +85,6 @@ int board_init(void)out_le32 (SMMU_NSCR0 , val);#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif -#ifdef CONFIG_FSL_LS_PPA ppa_init ();#endif
board/freescale/ls1088a/ls1088a.c +1 -5
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0+ /* -* Copyright 2017-2018 NXP +* Copyright 2017-2018, 2021 NXP */ #include <common.h> #include <env.h>
@@ -12,7 +12,6 @@#include <netdev.h> #include <fsl_ifc.h> #include <fsl_ddr.h> -#include <fsl_sec.h> #include <asm/global_data.h> #include <asm/io.h> #include <fdt_support.h>
@@ -819,9 +818,6 @@ int board_init(void)out_le32 (irq_ccsr +IRQCR_OFFSET /4 ,AQR105_IRQ_MASK );#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif #ifdef CONFIG_FSL_LS_PPA ppa_init ();#endif
board/freescale/ls2080aqds/ls2080aqds.c +1 -5
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2015 Freescale Semiconductor +* Copyright 2021 NXP */ #include <common.h> #include <env.h>
@@ -20,7 +21,6 @@#include <rtc.h> #include <asm/arch/soc.h> #include <hwconfig.h> -#include <fsl_sec.h> #include <asm/arch/ppa.h> #include <asm/arch-fsl-layerscape/fsl_icid.h> #include "../common/i2c_mux.h"
@@ -224,10 +224,6 @@ int board_init(void)#endif #endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif -#ifdef CONFIG_FSL_LS_PPA ppa_init ();#endif
board/freescale/ls2080ardb/ls2080ardb.c +1 -8
@@ -1,7 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2015 Freescale Semiconductor -* Copyright 2017 NXP +* Copyright 2017, 2021 NXP */ #include <common.h> #include <env.h>
@@ -23,7 +23,6 @@#include <asm/arch/mmu.h> #include <asm/arch/soc.h> #include <asm/arch/ppa.h> -#include <fsl_sec.h> #include <asm/arch-fsl-layerscape/fsl_icid.h> #include "../common/i2c_mux.h"
@@ -290,9 +289,6 @@ int board_init(void)QIXIS_WRITE (rst_ctl,QIXIS_RST_CTL_RESET_EN );#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif #ifdef CONFIG_FSL_LS_PPA ppa_init ();#endif
@@ -301,9 +297,6 @@ int board_init(void)/* invert AQR405 IRQ pins polarity */ out_le32 (irq_ccsr +IRQCR_OFFSET /4 ,AQR405_IRQ_MASK );#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif #if !defined(CONFIG_SYS_EARLY_PCI_INIT ) && defined(CONFIG_DM_ETH )pci_init ();
board/freescale/lx2160a/lx2160a.c +0 -5
@@ -14,7 +14,6 @@#include <errno.h> #include <netdev.h> #include <fsl_ddr.h> -#include <fsl_sec.h> #include <asm/io.h> #include <fdt_support.h> #include <linux/bitops.h>
@@ -599,10 +598,6 @@ int board_init(void)out_le32 (irq_ccsr +IRQCR_OFFSET /4 ,AQR107_IRQ_MASK );#endif -#ifdef CONFIG_FSL_CAAM -sec_init (); -#endif -#if !defined(CONFIG_SYS_EARLY_PCI_INIT ) && defined(CONFIG_DM_ETH )pci_init ();#endif
configs/ls1021aiot_qspi_defconfig +0 -1
@@ -36,7 +36,6 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
configs/ls1021aqds_nor_defconfig +0 -1
@@ -50,7 +50,6 @@ CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0x60300000 CONFIG_DM=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y CONFIG_DYNAMIC_DDR_CLK_FREQ=y CONFIG_SYS_FSL_DDR3=y CONFIG_DDR_ECC=y
configs/ls1021aqds_qspi_defconfig +0 -1
@@ -50,7 +50,6 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y CONFIG_SYS_FSL_DDR3=y CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
configs/ls1021atsn_qspi_defconfig +0 -1
@@ -36,7 +36,6 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM=y -CONFIG_FSL_CAAM=y CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
configs/ls1021atwr_nor_defconfig +0 -1
@@ -44,7 +44,6 @@ CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0x60300000 CONFIG_DM=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y CONFIG_DM_I2C=y CONFIG_SPL_SYS_I2C_LEGACY=y CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig +1 -0
@@ -61,6 +61,7 @@ CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM=y CONFIG_SPL_DM=y +CONFIG_SPL_OF_CONTROL=y # CONFIG_SPL_BLK is not set CONFIG_DM_I2C=y # CONFIG_SPL_DM_I2C is not set
configs/ls1028ardb_tfa_defconfig +0 -1
@@ -48,7 +48,6 @@ CONFIG_NETCONSOLE=y CONFIG_DM=y CONFIG_SCSI_AHCI=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y # CONFIG_DDR_SPD is not set CONFIG_DM_I2C=y CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
configs/ls1043ardb_tfa_defconfig +0 -1
@@ -41,7 +41,6 @@ CONFIG_ENV_IS_IN_MMC=y CONFIG_ENV_IS_IN_NAND=y CONFIG_ENV_ADDR=0x60500000 CONFIG_DM=y -CONFIG_FSL_CAAM=y # CONFIG_DDR_SPD is not set CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y CONFIG_DM_I2C=y
configs/ls1046afrwy_tfa_defconfig +0 -1
@@ -39,7 +39,6 @@ CONFIG_ENV_ADDR=0x40500000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y # CONFIG_DDR_SPD is not set CONFIG_DM_I2C=y CONFIG_I2C_SET_DEFAULT_BUS_NUM=y
configs/ls1046aqds_tfa_defconfig +0 -1
@@ -54,7 +54,6 @@ CONFIG_ENV_SPI_BUS=0 CONFIG_ENV_ADDR=0x40500000 CONFIG_DM=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y CONFIG_DYNAMIC_DDR_CLK_FREQ=y CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
configs/ls1046ardb_tfa_defconfig +0 -1
@@ -44,7 +44,6 @@ CONFIG_ENV_ADDR=0x40500000 CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y CONFIG_DM_I2C=y
configs/ls2088aqds_tfa_defconfig +0 -1
@@ -51,7 +51,6 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y CONFIG_DYNAMIC_DDR_CLK_FREQ=y CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
configs/ls2088ardb_tfa_defconfig +0 -1
@@ -49,7 +49,6 @@ CONFIG_ENV_ADDR=0x580500000 CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y CONFIG_DDR_CLK_FREQ=133333333 CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
configs/lx2160aqds_tfa_defconfig +0 -1
@@ -51,7 +51,6 @@ CONFIG_ENV_ADDR=0x20500000 CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y CONFIG_DYNAMIC_DDR_CLK_FREQ=y CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
configs/lx2160ardb_tfa_defconfig +0 -1
@@ -50,7 +50,6 @@ CONFIG_ENV_ADDR=0x20500000 CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y CONFIG_DYNAMIC_DDR_CLK_FREQ=y CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
configs/lx2162aqds_tfa_defconfig +0 -1
@@ -53,7 +53,6 @@ CONFIG_ENV_ADDR=0x20500000 CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM=y CONFIG_SATA_CEVA=y -CONFIG_FSL_CAAM=y CONFIG_DYNAMIC_DDR_CLK_FREQ=y CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
Signature · 1 line
2.17.1
PATCH v4 14/16 PPC: Add crypto node in device tree
In reply to Gaurav Jaindevice tree imported from linux kernel.c500bee1c5b2 (tag: v5.14-rc4) Linux 5.14-rc4
--- arch/powerpc/dts/p2041si-post.dtsi | 1 + arch/powerpc/dts/p3041si-post.dtsi | 1 + arch/powerpc/dts/p4080si-post.dtsi | 1 + arch/powerpc/dts/p5040si-post.dtsi | 1 + arch/powerpc/dts/qoriq-sec4.0-0.dtsi | 74 ++++++++++++++++++++++ arch/powerpc/dts/qoriq-sec4.2-0.dtsi | 83 +++++++++++++++++++++++++ arch/powerpc/dts/qoriq-sec5.2-0.dtsi | 92 ++++++++++++++++++++++++++++ arch/powerpc/dts/t1023si-post.dtsi | 1 + arch/powerpc/dts/t1042si-post.dtsi | 1 + arch/powerpc/dts/t2080si-post.dtsi | 1 + arch/powerpc/dts/t4240si-post.dtsi | 1 + 11 files changed, 257 insertions(+) create mode 100644 arch/powerpc/dts/qoriq-sec4.0-0.dtsi create mode 100644 arch/powerpc/dts/qoriq-sec4.2-0.dtsi create mode 100644 arch/powerpc/dts/qoriq-sec5.2-0.dtsi
arch/powerpc/dts/p2041si-post.dtsi +1 -0
@@ -11,6 +11,7 @@ /include/ "qoriq-clockgen1.dtsi" /include/ "qoriq-gpio-0.dtsi" +/include/ "qoriq-sec4.2-0.dtsi" /* include used FMan blocks */ /include/ "qoriq-fman-0.dtsi"
arch/powerpc/dts/p3041si-post.dtsi +1 -0
@@ -11,6 +11,7 @@ /include/ "qoriq-clockgen1.dtsi" /include/ "qoriq-gpio-0.dtsi" +/include/ "qoriq-sec4.2-0.dtsi" /* include used FMan blocks */ /include/ "qoriq-fman-0.dtsi"
arch/powerpc/dts/p4080si-post.dtsi +1 -0
@@ -11,6 +11,7 @@ /include/ "qoriq-clockgen1.dtsi" /include/ "qoriq-gpio-0.dtsi" +/include/ "qoriq-sec4.0-0.dtsi" /* include used FMan blocks */ /include/ "qoriq-fman-0.dtsi"
arch/powerpc/dts/p5040si-post.dtsi +1 -0
@@ -11,6 +11,7 @@ /include/ "qoriq-clockgen1.dtsi" /include/ "qoriq-gpio-0.dtsi" +/include/ "qoriq-sec5.2-0.dtsi" /* include used FMan blocks */ /include/ "qoriq-fman-0.dtsi"
arch/powerpc/dts/qoriq-sec4.0-0.dtsi new file +74 -0
74 lines not on this page · raw message
arch/powerpc/dts/qoriq-sec4.2-0.dtsi new file +83 -0
83 lines not on this page · raw message
arch/powerpc/dts/qoriq-sec5.2-0.dtsi new file +92 -0
92 lines not on this page · raw message
arch/powerpc/dts/t1023si-post.dtsi +1 -0
@@ -14,6 +14,7 @@ /include/ "qoriq-gpio-1.dtsi" /include/ "qoriq-gpio-2.dtsi" /include/ "qoriq-gpio-3.dtsi" +/include/ "qoriq-sec5.0-0.dtsi" /* include used FMan blocks */ /include/ "qoriq-fman3l-0.dtsi"
arch/powerpc/dts/t1042si-post.dtsi +1 -0
@@ -12,6 +12,7 @@ /include/ "qoriq-gpio-1.dtsi" /include/ "qoriq-gpio-2.dtsi" /include/ "qoriq-gpio-3.dtsi" +/include/ "qoriq-sec5.0-0.dtsi" /include/ "qoriq-fman3l-0.dtsi" /include/ "qoriq-fman3-0-1g-0.dtsi"
arch/powerpc/dts/t2080si-post.dtsi +1 -0
@@ -13,6 +13,7 @@ /include/ "qoriq-gpio-1.dtsi" /include/ "qoriq-gpio-2.dtsi" /include/ "qoriq-gpio-3.dtsi" +/include/ "qoriq-sec5.2-0.dtsi" /include/ "qoriq-fman3-0.dtsi" /include/ "qoriq-fman3-0-10g-0-best-effort.dtsi"
arch/powerpc/dts/t4240si-post.dtsi +1 -0
@@ -12,6 +12,7 @@ /include/ "qoriq-gpio-1.dtsi" /include/ "qoriq-gpio-2.dtsi" /include/ "qoriq-gpio-3.dtsi" +/include/ "qoriq-sec5.0-0.dtsi" /include/ "qoriq-fman3-0.dtsi" /include/ "qoriq-fman3-0-1g-0.dtsi"
Signature · 1 line
2.17.1
PATCH v4 15/16 PPC: Enable Job ring driver model in U-Boot
In reply to Gaurav Jainremoved sec_init() call and CONFIG_FSL_CAAM from defconfig. sec is initialized based on job ring information processed from device tree.
--- arch/powerpc/cpu/mpc85xx/Kconfig | 44 +++++++++++++++++++++++++++ arch/powerpc/cpu/mpc85xx/cpu_init.c | 17 +++++++++-- arch/powerpc/include/asm/u-boot-ppc.h | 17 +++++++++++ arch/powerpc/include/asm/u-boot.h | 1 + configs/P2041RDB_defconfig | 1 - configs/P3041DS_defconfig | 1 - configs/P4080DS_defconfig | 1 - configs/P5040DS_defconfig | 1 - configs/T1024RDB_defconfig | 1 - configs/T1042D4RDB_defconfig | 1 - configs/T2080QDS_defconfig | 1 - configs/T2080RDB_defconfig | 1 - configs/T4240RDB_defconfig | 1 - 13 files changed, 77 insertions(+), 11 deletions(-) create mode 100644 arch/powerpc/include/asm/u-boot-ppc.h
arch/powerpc/cpu/mpc85xx/Kconfig +44 -0
@@ -25,6 +25,10 @@ config TARGET_P3041DS select PHYS_64BIT select ARCH_P3041 select BOARD_LATE_INIT if CHAIN_OF_TRUST + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply CMD_SATA imply PANIC_HANG
@@ -33,6 +37,10 @@ config TARGET_P4080DS select PHYS_64BIT select ARCH_P4080 select BOARD_LATE_INIT if CHAIN_OF_TRUST + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply CMD_SATA imply PANIC_HANG
@@ -41,6 +49,10 @@ config TARGET_P5040DS select PHYS_64BIT select ARCH_P5040 select BOARD_LATE_INIT if CHAIN_OF_TRUST + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply CMD_SATA imply PANIC_HANG
@@ -102,6 +114,10 @@ config TARGET_P2041RDB select ARCH_P2041 select BOARD_LATE_INIT if CHAIN_OF_TRUST select PHYS_64BIT + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply CMD_SATA imply FSL_SATA
@@ -117,6 +133,10 @@ config TARGET_T1024RDB select SUPPORT_SPL select PHYS_64BIT select FSL_DDR_INTERACTIVE + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply CMD_EEPROM imply PANIC_HANG
@@ -126,6 +146,10 @@ config TARGET_T1042RDB select BOARD_LATE_INIT if CHAIN_OF_TRUST select SUPPORT_SPL select PHYS_64BIT + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT config TARGET_T1042D4RDB bool "Support T1042D4RDB"
@@ -133,6 +157,10 @@ config TARGET_T1042D4RDB select BOARD_LATE_INIT if CHAIN_OF_TRUST select SUPPORT_SPL select PHYS_64BIT + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply PANIC_HANG config TARGET_T1042RDB_PI
@@ -141,6 +169,10 @@ config TARGET_T1042RDB_PI select BOARD_LATE_INIT if CHAIN_OF_TRUST select SUPPORT_SPL select PHYS_64BIT + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply PANIC_HANG config TARGET_T2080QDS
@@ -151,6 +183,10 @@ config TARGET_T2080QDS select PHYS_64BIT select FSL_DDR_FIRST_SLOT_QUAD_CAPABLE select FSL_DDR_INTERACTIVE + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply CMD_SATA config TARGET_T2080RDB
@@ -159,6 +195,10 @@ config TARGET_T2080RDB select BOARD_LATE_INIT if CHAIN_OF_TRUST select SUPPORT_SPL select PHYS_64BIT + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply CMD_SATA imply PANIC_HANG
@@ -168,6 +208,10 @@ config TARGET_T4240RDB select SUPPORT_SPL select PHYS_64BIT select FSL_DDR_FIRST_SLOT_QUAD_CAPABLE + select FSL_CAAM + select FSL_BLOB + select MISC + select ARCH_MISC_INIT imply CMD_SATA imply PANIC_HANG
arch/powerpc/cpu/mpc85xx/cpu_init.c +15 -2
@@ -56,6 +56,7 @@#ifdef CONFIG_U_QE #include <fsl_qe.h> #endif +#include <dm.h> #ifdef CONFIG_SYS_FSL_SINGLE_SOURCE_CLK /*
@@ -974,8 +975,6 @@ int cpu_init_r(void)#endif #ifdef CONFIG_FSL_CAAM -sec_init (); -#if defined(CONFIG_ARCH_C29X )if ((SVR_SOC_VER (svr) ==SVR_C292 ) || (SVR_SOC_VER (svr) ==SVR_C293 ))
@@ -1014,6 +1013,20 @@ int cpu_init_r(void)return 0 ; } +#ifdef CONFIG_ARCH_MISC_INIT +int arch_misc_init (void ) +{ +struct udevice *dev; +int ret; + + ret =uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (caam_jr), &dev); +if (ret) +printf ("Failed to initialize %s: %d\n" , dev->name, ret); + +return 0 ; +} +#endif +void arch_preboot_os (void ) {u32 msr;
arch/powerpc/include/asm/u-boot-ppc.h new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* +* Copyright 2021 NXP +* +* Gaurav Jain <[email protected]> +*/ + +#ifndef _U_BOOT_PPC_H_ +#define _U_BOOT_PPC_H_ + +#ifndef __ASSEMBLY__ + +int arch_misc_init (void ); + +#endif /* __ASSEMBLY__ */ + +#endif /* _U_BOOT_PPC_H_ */
arch/powerpc/include/asm/u-boot.h +1 -0
@@ -21,5 +21,6 @@/* Use the generic board which requires a unified bd_info */ #include <asm-generic/u-boot.h> #include <asm/ppc.h> +#include <asm/u-boot-ppc.h> #endif /* __U_BOOT_H__ */
configs/P2041RDB_defconfig +0 -1
@@ -34,7 +34,6 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0xEFF20000 CONFIG_DM=y -CONFIG_FSL_CAAM=y CONFIG_DM_I2C=y CONFIG_I2C_SET_DEFAULT_BUS_NUM=y CONFIG_SYS_I2C_FSL=y
configs/P3041DS_defconfig +0 -1
@@ -32,7 +32,6 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0xEFF20000 CONFIG_DM=y -CONFIG_FSL_CAAM=y CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y CONFIG_DM_I2C=y
configs/P4080DS_defconfig +0 -1
@@ -32,7 +32,6 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0xEFF20000 CONFIG_DM=y -CONFIG_FSL_CAAM=y CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y CONFIG_DM_I2C=y
configs/P5040DS_defconfig +0 -1
@@ -32,7 +32,6 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0xEFF20000 CONFIG_DM=y -CONFIG_FSL_CAAM=y CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y CONFIG_DM_I2C=y
configs/T1024RDB_defconfig +0 -1
@@ -44,7 +44,6 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0xEFF20000 CONFIG_DM=y -CONFIG_FSL_CAAM=y CONFIG_SYS_FSL_DDR3=y CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
configs/T1042D4RDB_defconfig +0 -1
@@ -35,7 +35,6 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0xEFF20000 CONFIG_DM=y -CONFIG_FSL_CAAM=y CONFIG_DDR_CLK_FREQ=66666666 CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
configs/T2080QDS_defconfig +0 -1
@@ -33,7 +33,6 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0xEFF20000 CONFIG_DM=y -CONFIG_FSL_CAAM=y CONFIG_DYNAMIC_DDR_CLK_FREQ=y CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
configs/T2080RDB_defconfig +0 -1
@@ -38,7 +38,6 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0xEFF20000 CONFIG_DM=y -CONFIG_FSL_CAAM=y CONFIG_DDR_CLK_FREQ=133330000 CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
configs/T4240RDB_defconfig +0 -1
@@ -30,7 +30,6 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0xEFF20000 CONFIG_DM=y -CONFIG_FSL_CAAM=y CONFIG_DDR_CLK_FREQ=133333333 CONFIG_DDR_ECC=y CONFIG_ECC_INIT_VIA_DDRCONTROLLER=y
Signature · 1 line
2.17.1
PATCH v4 16/16 update CAAM MAINTAINER
In reply to Gaurav Jain--- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
@@ -1276,3 +1276,10 @@ T: git https://source.denx.de/u-boot/u-boot.git F: configs/tools-only_defconfig F: * F: */ + +CAAM +M: Gaurav Jain <[email protected]> +S: Maintained +F: drivers/crypto/fsl/ +F: include/fsl_sec.h +F: cmd/blob.c
Signature · 1 line
2.17.1