LS1046ARDB: Add QSPI Secure Boot target
PATCH v2 3/3 LS1046ARDB: Add QSPI Secure Boot target
In reply to Vinitha Pillai-B57223Hi all
Please Ignore this mail
Regards,
Vinitha
-----Original Message-----
From: Vinitha Pillai-B57223 [mailto:B57223 at freescale.com]
Sent: Tuesday, January 03, 2017 11:01 PM
To: Udit Agarwal <[email protected]>; u-boot at lists.denx.de
Cc: Sumit Garg <[email protected]>; Ruchika Gupta <[email protected]>; Vini Pillai <[email protected]>
Subject: [U-Boot,v2,3/3] LS1046ARDB: Add QSPI Secure Boot target
From: Sumit Garg <[email protected]>
Add QSPI Secure Boot target. Also enable sec init.
---
Changes in v2:
Split patches logically from 2 to 3.
board/freescale/ls1046ardb/MAINTAINERS | 4 ++++ board/freescale/ls1046ardb/ls1046ardb.c | 19 +++++++++++++++++++ configs/ls1046ardb_qspi_SECURE_BOOT_defconfig | 27 +++++++++++++++++++++++++++ include/configs/ls1046ardb.h | 2 ++ 4 files changed, 52 insertions(+) create mode 100644 configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
board/freescale/ls1046ardb/MAINTAINERS +4 -0
@@ -7,3 +7,7 @@ F: include/configs/ls1046ardb.h F: configs/ls1046ardb_qspi_defconfig F: configs/ls1046ardb_sdcard_defconfig F: configs/ls1046ardb_emmc_defconfig + +M: Sumit Garg <[email protected]> +S: Maintained +F: configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
board/freescale/ls1046ardb/ls1046ardb.c +19 -0
@@ -20,6 +20,7 @@#include <fsl_csu.h> #include <fsl_esdhc.h> #include "cpld.h" +#include <fsl_sec.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -77,6 +78,24 @@ int board_init(void)enable_layerscape_ns_access ();#endif +#ifdef CONFIG_SECURE_BOOT +/* +* In case of Secure Boot, the IBR configures the SMMU +* to allow only Secure transactions. +* SMMU must be reset in bypass mode. +* Set the ClientPD bit and Clear the USFCFG Bit +*/ +u32 val; + val = (in_le32 (SMMU_SCR0 ) |SCR0_CLIENTPD_MASK ) & ~(SCR0_USFCFG_MASK ); +out_le32 (SMMU_SCR0 , val); + val = (in_le32 (SMMU_NSCR0 ) |SCR0_CLIENTPD_MASK ) & ~(SCR0_USFCFG_MASK ); +out_le32 (SMMU_NSCR0 , val); +#endif + +#ifdef CONFIG_FSL_CAAM +sec_init (); +#endif +#ifdef CONFIG_FSL_LS_PPA ppa_init ();#endif
configs/ls1046ardb_qspi_SECURE_BOOT_defconfig new file +27 -0
@@ -0,0 +1,27 @@ +CONFIG_ARM=y +CONFIG_TARGET_LS1046ARDB=y +CONFIG_DM_SPI=y +CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1046a-rdb" +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,SECURE_BOOT" +CONFIG_QSPI_BOOT=y +CONFIG_BOOTDELAY=10 +CONFIG_HUSH_PARSER=y +# CONFIG_CMD_IMLS is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_SF=y +CONFIG_CMD_I2C=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_CACHE=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_FAT=y +CONFIG_OF_CONTROL=y +CONFIG_DM=y +CONFIG_SPI_FLASH=y +CONFIG_SYS_NS16550=y +CONFIG_FSL_QSPI=y +CONFIG_RSA=y
include/configs/ls1046ardb.h +2 -0
@@ -234,4 +234,6 @@"7e800000.flash:16m(nand_uboot)," \ "48m(nand_kernel),448m(nand_free)" +#include <asm/fsl_secure_boot.h> +#endif /* __LS1046ARDB_H__ */
PATCH v2 3/3 LS1046ARDB: Add QSPI Secure Boot target
From: Sumit Garg <[email protected]>
Add QSPI Secure Boot target. Also enable sec init.
---
Changes in v2:
Split patches logically from 2 to 3.
board/freescale/ls1046ardb/MAINTAINERS | 4 ++++ board/freescale/ls1046ardb/ls1046ardb.c | 19 +++++++++++++++++++ configs/ls1046ardb_qspi_SECURE_BOOT_defconfig | 27 +++++++++++++++++++++++++++ include/configs/ls1046ardb.h | 2 ++ 4 files changed, 52 insertions(+) create mode 100644 configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
board/freescale/ls1046ardb/MAINTAINERS +4 -0
@@ -7,3 +7,7 @@ F: include/configs/ls1046ardb.h F: configs/ls1046ardb_qspi_defconfig F: configs/ls1046ardb_sdcard_defconfig F: configs/ls1046ardb_emmc_defconfig + +M: Sumit Garg <[email protected]> +S: Maintained +F: configs/ls1046ardb_qspi_SECURE_BOOT_defconfig
board/freescale/ls1046ardb/ls1046ardb.c +19 -0
@@ -20,6 +20,7 @@#include <fsl_csu.h> #include <fsl_esdhc.h> #include "cpld.h" +#include <fsl_sec.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -77,6 +78,24 @@ int board_init(void)enable_layerscape_ns_access ();#endif +#ifdef CONFIG_SECURE_BOOT +/* +* In case of Secure Boot, the IBR configures the SMMU +* to allow only Secure transactions. +* SMMU must be reset in bypass mode. +* Set the ClientPD bit and Clear the USFCFG Bit +*/ +u32 val; + val = (in_le32 (SMMU_SCR0 ) |SCR0_CLIENTPD_MASK ) & ~(SCR0_USFCFG_MASK ); +out_le32 (SMMU_SCR0 , val); + val = (in_le32 (SMMU_NSCR0 ) |SCR0_CLIENTPD_MASK ) & ~(SCR0_USFCFG_MASK ); +out_le32 (SMMU_NSCR0 , val); +#endif + +#ifdef CONFIG_FSL_CAAM +sec_init (); +#endif +#ifdef CONFIG_FSL_LS_PPA ppa_init ();#endif
configs/ls1046ardb_qspi_SECURE_BOOT_defconfig new file +27 -0
@@ -0,0 +1,27 @@ +CONFIG_ARM=y +CONFIG_TARGET_LS1046ARDB=y +CONFIG_DM_SPI=y +CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1046a-rdb" +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,SECURE_BOOT" +CONFIG_QSPI_BOOT=y +CONFIG_BOOTDELAY=10 +CONFIG_HUSH_PARSER=y +# CONFIG_CMD_IMLS is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_SF=y +CONFIG_CMD_I2C=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_CACHE=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_FAT=y +CONFIG_OF_CONTROL=y +CONFIG_DM=y +CONFIG_SPI_FLASH=y +CONFIG_SYS_NS16550=y +CONFIG_FSL_QSPI=y +CONFIG_RSA=y
include/configs/ls1046ardb.h +2 -0
@@ -234,4 +234,6 @@"7e800000.flash:16m(nand_uboot)," \ "48m(nand_kernel),448m(nand_free)" +#include <asm/fsl_secure_boot.h> +#endif /* __LS1046ARDB_H__ */