From a52ff334c5b16e71a58fb75f35394761e645f7e9 Mon Sep 17 00:00:00 2001 From: Sumit Garg Date: Thu, 30 Mar 2017 09:53:13 +0530 Subject: armv8: ls1046ardb: SPL size reduction Using changes in this patch we were able to reduce approx 4k size of u-boot-spl.bin image. Following is breif description of changes to reduce SPL size: 1. Changes in board/freescale/ls1046ardb/Makefile to remove compilation of eth.c and cpld.c in case of SPL build. 2. Changes in board/freescale/ls1046ardb/ls1046ardb.c to keep only ddr_init and board_early_init_f funcations in case of SPL build. 3. Changes in ls1046a_common.h & ls1046ardb.h to remove driver specific macros due to which static data was being compiled in case of SPL build. 4. Disable MMC driver from bieng compiled in case of SPL NAND build and NAND driver from bieng compiled in case of SPL MMC build. Signed-off-by: Vinitha Pillai Signed-off-by: Sumit Garg Reviewed-by: York Sun --- board/freescale/ls1046ardb/Makefile | 4 +++- board/freescale/ls1046ardb/ls1046ardb.c | 16 +++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'board/freescale/ls1046ardb') diff --git a/board/freescale/ls1046ardb/Makefile b/board/freescale/ls1046ardb/Makefile index 348eb76ea7..b92ed0b3ec 100644 --- a/board/freescale/ls1046ardb/Makefile +++ b/board/freescale/ls1046ardb/Makefile @@ -4,7 +4,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -obj-y += cpld.o obj-y += ddr.o obj-y += ls1046ardb.o +ifndef CONFIG_SPL_BUILD obj-$(CONFIG_SYS_DPAA_FMAN) += eth.o +obj-y += cpld.o +endif diff --git a/board/freescale/ls1046ardb/ls1046ardb.c b/board/freescale/ls1046ardb/ls1046ardb.c index 02b6c4c375..0cc508b01e 100644 --- a/board/freescale/ls1046ardb/ls1046ardb.c +++ b/board/freescale/ls1046ardb/ls1046ardb.c @@ -24,6 +24,14 @@ DECLARE_GLOBAL_DATA_PTR; +int board_early_init_f(void) +{ + fsl_lsch2_early_init_f(); + + return 0; +} + +#ifndef CONFIG_SPL_BUILD int checkboard(void) { static const char *freq[2] = {"100.00MHZ", "156.25MHZ"}; @@ -56,13 +64,6 @@ int checkboard(void) return 0; } -int board_early_init_f(void) -{ - fsl_lsch2_early_init_f(); - - return 0; -} - int board_init(void) { struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR; @@ -161,3 +162,4 @@ int ft_board_setup(void *blob, bd_t *bd) return 0; } +#endif -- cgit From f7244f2c4815aa80a7cd7e9ceaee1969a16acd47 Mon Sep 17 00:00:00 2001 From: Vinitha Pillai-B57223 Date: Thu, 23 Mar 2017 13:48:18 +0530 Subject: armv8: LS1046ARDB: Add QSPI Secure Boot target Add QSPI Secure Boot target. Also enable sec init. Signed-off-by: Vinitha Pillai Signed-off-by: Sumit Garg Reviewed-by: York Sun --- board/freescale/ls1046ardb/Kconfig | 2 +- board/freescale/ls1046ardb/MAINTAINERS | 4 ++++ board/freescale/ls1046ardb/ls1046ardb.c | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) (limited to 'board/freescale/ls1046ardb') diff --git a/board/freescale/ls1046ardb/Kconfig b/board/freescale/ls1046ardb/Kconfig index a62255c78d..b9f2ed7e4b 100644 --- a/board/freescale/ls1046ardb/Kconfig +++ b/board/freescale/ls1046ardb/Kconfig @@ -12,5 +12,5 @@ config SYS_SOC config SYS_CONFIG_NAME default "ls1046ardb" - +source "board/freescale/common/Kconfig" endif diff --git a/board/freescale/ls1046ardb/MAINTAINERS b/board/freescale/ls1046ardb/MAINTAINERS index ff42bef090..758ff9d572 100644 --- a/board/freescale/ls1046ardb/MAINTAINERS +++ b/board/freescale/ls1046ardb/MAINTAINERS @@ -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 +S: Maintained +F: configs/ls1046ardb_qspi_SECURE_BOOT_defconfig diff --git a/board/freescale/ls1046ardb/ls1046ardb.c b/board/freescale/ls1046ardb/ls1046ardb.c index 0cc508b01e..1dd5e69882 100644 --- a/board/freescale/ls1046ardb/ls1046ardb.c +++ b/board/freescale/ls1046ardb/ls1046ardb.c @@ -21,6 +21,7 @@ #include #include #include "cpld.h" +#include DECLARE_GLOBAL_DATA_PTR; @@ -72,6 +73,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 -- cgit From 511fc86d0b1b603532056c663c22b91056908755 Mon Sep 17 00:00:00 2001 From: Ruchika Gupta Date: Mon, 17 Apr 2017 18:07:19 +0530 Subject: arm: ls1046ardb: Add SD secure boot target - Add SD secure boot target for ls1046ardb. - Change the u-boot size defined by a macro for copying the main U-Boot by SPL to also include the u-boot Secure Boot header size as header is appended to u-boot image. So header will also be copied from SD to DDR. - CONFIG_MAX_SPL_SIZE is limited to 90KB. SPL is copied to OCRAM (128K) where 32K are reserved for use by boot ROM and 6K for the header. - Reduce the size of CAAM driver for SPL Blobification functions and descriptors, that are not required at the time of SPL are disabled. Further error code conversion to strings is disabled for SPL build. Signed-off-by: Vinitha Pillai Signed-off-by: Sumit Garg Signed-off-by: Ruchika Gupta Reviewed-by: York Sun --- board/freescale/ls1046ardb/MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'board/freescale/ls1046ardb') diff --git a/board/freescale/ls1046ardb/MAINTAINERS b/board/freescale/ls1046ardb/MAINTAINERS index 758ff9d572..79a2290974 100644 --- a/board/freescale/ls1046ardb/MAINTAINERS +++ b/board/freescale/ls1046ardb/MAINTAINERS @@ -8,6 +8,12 @@ F: configs/ls1046ardb_qspi_defconfig F: configs/ls1046ardb_sdcard_defconfig F: configs/ls1046ardb_emmc_defconfig +LS1046A_SECURE_BOOT BOARD +M: Ruchika Gupta +S: Maintained +F: configs/ls1046ardb_SECURE_BOOT_defconfig +F: configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig + M: Sumit Garg S: Maintained F: configs/ls1046ardb_qspi_SECURE_BOOT_defconfig -- cgit