All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/7] LS1046AQDS: Add NOR Secure Boot Target
Date: Thu, 23 Mar 2017 13:48:17 +0530	[thread overview]
Message-ID: <1490257100-16483-5-git-send-email-sumit.garg@nxp.com> (raw)
In-Reply-To: <1490257100-16483-1-git-send-email-sumit.garg@nxp.com>

Add NOR secure boot target. Also enable sec init.

Signed-off-by: Vinitha Pillai <vinitha.pillai@nxp.com>
Signed-off-by: Sumit Garg <sumit.garg@nxp.com>
---
 board/freescale/ls1046aqds/MAINTAINERS   |  4 ++++
 board/freescale/ls1046aqds/ls1046aqds.c  | 19 ++++++++++++++++
 configs/ls1046aqds_SECURE_BOOT_defconfig | 39 ++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+)
 create mode 100644 configs/ls1046aqds_SECURE_BOOT_defconfig

diff --git a/board/freescale/ls1046aqds/MAINTAINERS b/board/freescale/ls1046aqds/MAINTAINERS
index b4549ae..6737d55 100644
--- a/board/freescale/ls1046aqds/MAINTAINERS
+++ b/board/freescale/ls1046aqds/MAINTAINERS
@@ -8,3 +8,7 @@ F:	configs/ls1046aqds_nand_defconfig
 F:	configs/ls1046aqds_sdcard_ifc_defconfig
 F:	configs/ls1046aqds_sdcard_qspi_defconfig
 F:	configs/ls1046aqds_qspi_defconfig
+
+M:	Sumit Garg <sumit.garg@nxp.com>
+S:	Maintained
+F:	configs/ls1046aqds_SECURE_BOOT_defconfig
diff --git a/board/freescale/ls1046aqds/ls1046aqds.c b/board/freescale/ls1046aqds/ls1046aqds.c
index af3f70a..8def6e6 100644
--- a/board/freescale/ls1046aqds/ls1046aqds.c
+++ b/board/freescale/ls1046aqds/ls1046aqds.c
@@ -21,6 +21,7 @@
 #include <fsl_csu.h>
 #include <fsl_esdhc.h>
 #include <fsl_ifc.h>
+#include <fsl_sec.h>
 #include <spl.h>
 
 #include "../common/vid.h"
@@ -265,6 +266,24 @@ int board_init(void)
 	if (adjust_vdd(0))
 		printf("Warning: Adjusting core voltage failed.\n");
 
+#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
+
 	return 0;
 }
 
diff --git a/configs/ls1046aqds_SECURE_BOOT_defconfig b/configs/ls1046aqds_SECURE_BOOT_defconfig
new file mode 100644
index 0000000..dc16fa0
--- /dev/null
+++ b/configs/ls1046aqds_SECURE_BOOT_defconfig
@@ -0,0 +1,39 @@
+CONFIG_ARM=y
+CONFIG_TARGET_LS1046AQDS=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1046a-qds-duart"
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_SECURE_BOOT=y
+CONFIG_BOOTDELAY=10
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_GREPENV=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_MEMINFO=y
+CONFIG_CMD_GPT=y
+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_MTD_NOR_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_NETDEVICES=y
+CONFIG_E1000=y
+CONFIG_PCI=y
+CONFIG_DM_PCI=y
+CONFIG_DM_PCI_COMPAT=y
+CONFIG_PCIE_LAYERSCAPE=y
+CONFIG_SYS_NS16550=y
+CONFIG_DM_SPI=y
+CONFIG_FSL_DSPI=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_RSA=y
-- 
1.9.1

  parent reply	other threads:[~2017-03-23  8:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23  8:18 [U-Boot] [PATCH 0/7] Add LS1046 and LS1012 secure boot targets Sumit Garg
2017-03-23  8:18 ` [U-Boot] [PATCH 1/7] SECURE BOOT: Add header address of PPA in kconfig Sumit Garg
2017-03-23  8:18 ` [U-Boot] [PATCH 2/7] LS1043ARDB: Enable PPA in Secure boot defconfig Sumit Garg
2017-03-23  8:18 ` [U-Boot] [PATCH 3/7] SECURE_BOOT: Enable chain of trust on LS1046A platform Sumit Garg
2017-03-29 16:45   ` [U-Boot] [u-boot-release] " york sun
2017-03-29 17:00     ` Sumit Garg
2017-03-23  8:18 ` Sumit Garg [this message]
2017-03-23  8:18 ` [U-Boot] [PATCH 5/7] LS1046ARDB: Add QSPI Secure Boot target Sumit Garg
2017-03-23  8:18 ` [U-Boot] [PATCH 6/7] SECURE_BOOT: Enable chain of trust on LS1012A platform Sumit Garg
2017-03-29 16:50   ` york sun
2017-03-29 17:01     ` Sumit Garg
2017-03-29 17:03       ` york sun
2017-03-29 17:06         ` Sumit Garg
2017-03-23  8:18 ` [U-Boot] [PATCH 7/7] LS1012ARDB: Add QSPI Secure Boot target Sumit Garg
2017-04-18 15:36 ` [U-Boot] [PATCH 0/7] Add LS1046 and LS1012 secure boot targets York Sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490257100-16483-5-git-send-email-sumit.garg@nxp.com \
    --to=sumit.garg@nxp.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.