Skip to contentSkip to conversation

LS2080ARDB: Secure Boot defconfig for QSPI boot.

PATCH New Udit Agarwal 2 participants 7 messages May 2, 2017 – May 25, 2017 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 LS2080ARDB: Secure Boot defconfig for QSPI boot.

Add the secure boot defconfig for QSPI boot on LS2088ARDB platform.

---
https://patchwork.ozlabs.org/patch/756222/
https://patchwork.ozlabs.org/patch/756221/
https://patchwork.ozlabs.org/patch/756250/

 configs/ls2088ardb_qspi_SECURE_BOOT_defconfig | 50 +++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 configs/ls2088ardb_qspi_SECURE_BOOT_defconfig
configs/ls2088ardb_qspi_SECURE_BOOT_defconfig new file +50 -0
new file mode 100644
index 0000000..749ad1d
@@ -0,0 +1,50 @@
+CONFIG_ARM=y
+CONFIG_TARGET_LS2080ARDB=y
+CONFIG_SECURE_BOOT=y
+CONFIG_FSL_LS_PPA=y
+CONFIG_QSPI_AHB_INIT=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls2088a-rdb-qspi"
+# CONFIG_SYS_MALLOC_F is not set
+CONFIG_FIT_VERBOSE=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_SYS_EXTRA_OPTIONS="LS2080A"
+CONFIG_QSPI_BOOT=y
+CONFIG_BOOTDELAY=10
+CONFIG_CMD_GREPENV=y
+# CONFIG_CMD_IMLS is not set
+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_NET_RANDOM_ETHADDR=y
+CONFIG_DM=y
+CONFIG_FSL_CAAM=y
+CONFIG_DM_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_QSPI=y
+CONFIG_FSL_DSPI=y
+CONFIG_CMD_USB=y
+CONFIG_RSA=y
+CONFIG_RSA_SOFTWARE_EXP=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_USB_STORAGE=y
+CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/3 LS2080ARDB: QSPI boot: Secure Boot image validation

Validates the images in the ESBC phase for LS2088ARDB platform and QSPI boot using esbc_validate command. Add images validation in default environment under mcinitcmd prior to MC initialization.

Adds header address for PPA to be validated during ESBC phase for ARCH_LS2088 and QSPI_BOOT.

Moves sec_init prior to ppa_init as for validation of PPA sec must be initialised before the PPA is initialised.

---
https://patchwork.ozlabs.org/patch/756222/
https://patchwork.ozlabs.org/patch/756221/
https://patchwork.ozlabs.org/patch/756250/

 arch/arm/cpu/armv8/fsl-layerscape/Kconfig |  1 +
 board/freescale/ls2080aqds/ls2080aqds.c   |  2 +-
 board/freescale/ls2080ardb/ls2080ardb.c   |  7 ++++---
 include/configs/ls2080ardb.h              | 22 ++++++++++++++++++++++
 4 files changed, 28 insertions(+), 4 deletions(-)
arch/arm/cpu/armv8/fsl-layerscape/Kconfig +1 -0
index 57660e8..8b39e00 100644
@@ -216,6 +216,7 @@ config SYS_LS_PPA_ESBC_ADDR
 	default 0x40680000 if SYS_LS_PPA_FW_IN_XIP && ARCH_LS1046A
 	default 0x40680000 if SYS_LS_PPA_FW_IN_XIP && ARCH_LS1012A
 	default 0x20680000 if SYS_LS_PPA_FW_IN_XIP && ARCH_LS1088A
+	default 0x20680000 if SYS_LS_PPA_FW_IN_XIP && QSPI_BOOT && ARCH_LS2080A
 	default 0x580680000 if SYS_LS_PPA_FW_IN_XIP && ARCH_LS2080A
 	default 0x680000 if SYS_LS_PPA_FW_IN_MMC
 	default 0x680000 if SYS_LS_PPA_FW_IN_NAND
board/freescale/ls2080aqds/ls2080aqds.c +1 -1
index ba3347b..00f4bb1 100644
@@ -229,7 +229,7 @@ int board_init(void)
 	select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
 	rtc_enable_32khz_output();
 #ifdef CONFIG_FSL_CAAM
-        sec_init();
+	sec_init();
 #endif
 
 #ifdef CONFIG_FSL_LS_PPA
board/freescale/ls2080ardb/ls2080ardb.c +4 -3
index edb6b33..c25f8ab 100644
@@ -233,6 +233,10 @@ int board_init(void)
 #ifdef CONFIG_FSL_QIXIS
 	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
@@ -241,9 +245,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
 
 	return 0;
 }
include/configs/ls2080ardb.h +22 -0
index 711241a..5a1d516 100644
@@ -366,6 +366,27 @@ unsigned long get_board_sys_clk(void);
 /* Initial environment variables */
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #ifdef CONFIG_SECURE_BOOT
+#ifdef CONFIG_QSPI_BOOT
+#define CONFIG_EXTRA_ENV_SETTINGS		\
+	"hwconfig=fsl_ddr:bank_intlv=auto\0"	\
+	"scriptaddr=0x80800000\0"		\
+	"kernel_addr_r=0x81000000\0"		\
+	"pxefile_addr_r=0x81000000\0"		\
+	"fdt_addr_r=0x88000000\0"		\
+	"ramdisk_addr_r=0x89000000\0"		\
+	"loadaddr=0x80100000\0"			\
+	"kernel_addr=0x100000\0"		\
+	"ramdisk_size=0x2000000\0"		\
+	"fdt_high=0xa0000000\0"			\
+	"initrd_high=0xffffffffffffffff\0"	\
+	"kernel_start=0x21000000\0"		\
+	"mcmemsize=0x40000000\0"		\
+	"mcinitcmd=esbc_validate 0x20700000;"	\
+	"esbc_validate 0x20740000;"		\
+	"fsl_mc start mc 0x20a00000"		\
+	" 0x20e00000 \0"			\
+	BOOTENV
+#else /* !(CONFIG_QSPI_BOOT) */
 #define CONFIG_EXTRA_ENV_SETTINGS		\
 	"hwconfig=fsl_ddr:bank_intlv=auto\0"	\
 	"scriptaddr=0x80800000\0"		\
@@ -389,6 +410,7 @@ unsigned long get_board_sys_clk(void);
 	"fsl_mc start mc 0x580300000"           \
 	" 0x580800000 \0"                       \
 	BOOTENV
+#endif
 #else
 #ifdef CONFIG_QSPI_BOOT
 #define CONFIG_EXTRA_ENV_SETTINGS		\
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 LS2080ARDB: QSPI boot: Secure Boot image validation

Quoted 16 lines · Udit Agarwal

Validates the images in the ESBC phase for LS2088ARDB platform and QSPI boot using esbc_validate command. Add images validation in default environment under mcinitcmd prior to MC initialization.

Adds header address for PPA to be validated during ESBC phase for ARCH_LS2088 and QSPI_BOOT.

Moves sec_init prior to ppa_init as for validation of PPA sec must be initialised before the PPA is initialised.

---
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F756222%2F&data=01%7C01%7Cyork.sun%40nxp.com%7Cefbc55c412914cf4faf808d49154fc09%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0&sdata=%2FeexbUyXknE0uXMdkcdC3tUEcvGo0YS2EENAaUo9%2BhA%3D&reserved=0
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F756221%2F&data=01%7C01%7Cyork.sun%40nxp.com%7Cefbc55c412914cf4faf808d49154fc09%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0&sdata=nYyB0OSlm2IYaFUjG9TPf%2BVgth5ElzRl4ZIi8TKNqV0%3D&reserved=0
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F756250%2F&data=01%7C01%7Cyork.sun%40nxp.com%7Cefbc55c412914cf4faf808d49154fc09%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0&sdata=9boHaBRQFKflABEDX6KRGO478gAC3AfjdZvtVOYGJco%3D&reserved=0

Quoted 5 lines
 arch/arm/cpu/armv8/fsl-layerscape/Kconfig |  1 +
 board/freescale/ls2080aqds/ls2080aqds.c   |  2 +-
 board/freescale/ls2080ardb/ls2080ardb.c   |  7 ++++---
 include/configs/ls2080ardb.h              | 22 ++++++++++++++++++++++
 4 files changed, 28 insertions(+), 4 deletions(-)

Shouldn't you put this patch before patch 1/3 in this set? You would need this patch to have secure boot working, wouldn't you?

York

#3 lore raw

PATCH 3/3 LS2080A: Adjust memory map for secure boot headers for NOR-boot

In reply to Udit Agarwal

This patch adjusts memory map for secure boot headers on LS2080AQDS and LS2080ARDB platforms.

Secure boot headers are placed on NOR flash at offset 0x00600000.

---
https://patchwork.ozlabs.org/patch/756222/
https://patchwork.ozlabs.org/patch/756221/
https://patchwork.ozlabs.org/patch/756250/

 board/freescale/ls2080aqds/README |  1 +
 board/freescale/ls2080ardb/README |  1 +
 include/configs/ls2080aqds.h      | 10 +++++-----
 include/configs/ls2080ardb.h      | 10 +++++-----
 4 files changed, 12 insertions(+), 10 deletions(-)
board/freescale/ls2080aqds/README +1 -0
index fd0e25a..cad860e 100644
@@ -96,6 +96,7 @@ RCW+PBI				0x00000000
 Boot firmware (U-Boot)		0x00100000
 Boot firmware Environment	0x00300000
 PPA firmware			0x00400000
+Secure Headers			0x00600000
 DPAA2 MC			0x00A00000
 DPAA2 DPL			0x00D00000
 DPAA2 DPC			0x00E00000
board/freescale/ls2080ardb/README +1 -0
index f228d80..205c45c 100644
@@ -92,6 +92,7 @@ RCW+PBI				0x00000000
 Boot firmware (U-Boot)		0x00100000
 Boot firmware Environment	0x00300000
 PPA firmware			0x00400000
+Secure Headers			0x00600000
 Cortina PHY firmware		0x00980000
 DPAA2 MC			0x00A00000
 DPAA2 DPL			0x00D00000
include/configs/ls2080aqds.h +5 -5
index d646197..efc3d5b 100644
@@ -369,14 +369,14 @@ unsigned long get_board_ddr_clk(void);
 	"ramdisk_size=0x2000000\0"		\
 	"fdt_high=0xa0000000\0"			\
 	"initrd_high=0xffffffffffffffff\0"	\
-	"kernel_start=0x581100000\0"		\
+	"kernel_start=0x581000000\0"		\
 	"kernel_load=0xa0000000\0"		\
 	"kernel_size=0x2800000\0"		\
 	"mcmemsize=0x40000000\0"		\
-	"mcinitcmd=esbc_validate 0x580c80000;"  \
-	"esbc_validate 0x580cc0000;"            \
-	"fsl_mc start mc 0x580300000"           \
-	" 0x580800000 \0"
+	"mcinitcmd=esbc_validate 0x580700000;"  \
+	"esbc_validate 0x580740000;"            \
+	"fsl_mc start mc 0x580a00000"           \
+	" 0x580e00000 \0"
 #else
 #define CONFIG_EXTRA_ENV_SETTINGS		\
 	"hwconfig=fsl_ddr:bank_intlv=auto\0"	\
include/configs/ls2080ardb.h +5 -5
index 5a1d516..6abf54b 100644
@@ -400,15 +400,15 @@ unsigned long get_board_sys_clk(void);
 	"ramdisk_size=0x2000000\0"		\
 	"fdt_high=0xa0000000\0"			\
 	"initrd_high=0xffffffffffffffff\0"	\
-	"kernel_start=0x581100000\0"		\
+	"kernel_start=0x581000000\0"		\
 	"kernel_load=0xa0000000\0"		\
 	"kernel_size=0x2800000\0"		\
 	"mcmemsize=0x40000000\0"		\
 	"fdtfile=fsl-ls2080a-rdb.dtb\0"		\
-	"mcinitcmd=esbc_validate 0x580c80000;"  \
-	"esbc_validate 0x580cc0000;"            \
-	"fsl_mc start mc 0x580300000"           \
-	" 0x580800000 \0"                       \
+	"mcinitcmd=esbc_validate 0x580700000;"  \
+	"esbc_validate 0x580740000;"            \
+	"fsl_mc start mc 0x580a00000"           \
+	" 0x580e00000 \0"                       \
 	BOOTENV
 #endif
 #else
Signature · 1 line
1.9.1
Applied
#4 lore raw

PATCH 3/3 LS2080A: Adjust memory map for secure boot headers for NOR-boot

#5 lore raw

PATCH 1/3 LS2080ARDB: Secure Boot defconfig for QSPI boot.

In reply to Udit Agarwal
Quoted 20 lines · Udit Agarwal

Add the secure boot defconfig for QSPI boot on LS2088ARDB platform.

---
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F756222%2F&data=01%7C01%7Cyork.sun%40nxp.com%7Cbb4048d4e8f54f7a92f108d49154f10c%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0&sdata=Y%2BHozPqSb6MSs9t3rUXi%2FLbDJ3Yups0eSk876rv2VPE%3D&reserved=0
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F756221%2F&data=01%7C01%7Cyork.sun%40nxp.com%7Cbb4048d4e8f54f7a92f108d49154f10c%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0&sdata=vGcpFar3OLsspPz7%2FWlHz45NE2u%2BDuqDriVs%2FTnFrf8%3D&reserved=0
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F756250%2F&data=01%7C01%7Cyork.sun%40nxp.com%7Cbb4048d4e8f54f7a92f108d49154f10c%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0&sdata=mmux45TOPLFMRxdP3MdD8a%2FGpQABsulOM%2BJiFMNd3%2FY%3D&reserved=0

 configs/ls2088ardb_qspi_SECURE_BOOT_defconfig | 50 +++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 configs/ls2088ardb_qspi_SECURE_BOOT_defconfig
configs/ls2088ardb_qspi_SECURE_BOOT_defconfig new file +1 -0
new file mode 100644
index 0000000..749ad1d
@@ -0,0 +1,50 @@
+CONFIG_ARM=y

configs/ls2088ardb_qspi_SECURE_BOOT_defconfig line 11

Quoted 10 lines
configs/ls2088ardb_qspi_SECURE_BOOT_defconfig new file +10 -0
+CONFIG_TARGET_LS2080ARDB=y
+CONFIG_SECURE_BOOT=y
+CONFIG_FSL_LS_PPA=y
+CONFIG_QSPI_AHB_INIT=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls2088a-rdb-qspi"
+# CONFIG_SYS_MALLOC_F is not set
+CONFIG_FIT_VERBOSE=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_SYS_EXTRA_OPTIONS="LS2080A"

This is not needed, and not allowed. Please fix. Make sure you test your patches on the top of latest upstream master branch.

York

#6 lore raw

PATCH 1/3 LS2080ARDB: Secure Boot defconfig for QSPI boot.

Quoted 26 lines · york sun
Quoted 25 lines · Udit Agarwal

Add the secure boot defconfig for QSPI boot on LS2088ARDB platform.

---
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F756222%2F&data=01%7C01%7Cyork.sun%40nxp.com%7Cbb4048d4e8f54f7a92f108d49154f10c%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0&sdata=Y%2BHozPqSb6MSs9t3rUXi%2FLbDJ3Yups0eSk876rv2VPE%3D&reserved=0
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F756221%2F&data=01%7C01%7Cyork.sun%40nxp.com%7Cbb4048d4e8f54f7a92f108d49154f10c%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0&sdata=vGcpFar3OLsspPz7%2FWlHz45NE2u%2BDuqDriVs%2FTnFrf8%3D&reserved=0
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.ozlabs.org%2Fpatch%2F756250%2F&data=01%7C01%7Cyork.sun%40nxp.com%7Cbb4048d4e8f54f7a92f108d49154f10c%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0&sdata=mmux45TOPLFMRxdP3MdD8a%2FGpQABsulOM%2BJiFMNd3%2FY%3D&reserved=0

 configs/ls2088ardb_qspi_SECURE_BOOT_defconfig | 50 +++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 configs/ls2088ardb_qspi_SECURE_BOOT_defconfig
configs/ls2088ardb_qspi_SECURE_BOOT_defconfig new file +6 -0
new file mode 100644
index 0000000..749ad1d
@@ -0,0 +1,50 @@
+CONFIG_ARM=y
+CONFIG_TARGET_LS2080ARDB=y
+CONFIG_SECURE_BOOT=y
+CONFIG_FSL_LS_PPA=y
+CONFIG_QSPI_AHB_INIT=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls2088a-rdb-qspi"
Quoted 9 lines

configs/ls2088ardb_qspi_SECURE_BOOT_defconfig line 11

Quoted 5 lines
configs/ls2088ardb_qspi_SECURE_BOOT_defconfig new file +5 -0
+# CONFIG_SYS_MALLOC_F is not set
+CONFIG_FIT_VERBOSE=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_SYS_EXTRA_OPTIONS="LS2080A"

This is not needed, and not allowed. Please fix. Make sure you test your patches on the top of latest upstream master branch.

Please also update the MAINTAINER file when you respin this patch.

York