blob: ddc77a54da632becd9cb325a53255d457982a4dd [file] [log] [blame]
gaurav ranaf79323c2015-03-10 14:08:50 +05301/*
2 * Copyright 2015 Freescale Semiconductor, Inc.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#ifndef __FSL_SECURE_BOOT_H
8#define __FSL_SECURE_BOOT_H
9
10#ifdef CONFIG_SECURE_BOOT
Aneesh Bansal43104702016-01-22 16:37:24 +053011
12#ifndef CONFIG_FIT_SIGNATURE
13#define CONFIG_CHAIN_OF_TRUST
14#endif
15
16#endif
17
18#ifdef CONFIG_CHAIN_OF_TRUST
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053019#define CONFIG_CMD_ESBC_VALIDATE
20#define CONFIG_FSL_SEC_MON
Saksham Jainc0c38d22016-03-23 16:24:35 +053021#define CONFIG_SHA_HW_ACCEL
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053022#define CONFIG_SHA_PROG_HW_ACCEL
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053023#define CONFIG_RSA_FREESCALE_EXP
Aneesh Bansalb3e98202015-12-08 13:54:29 +053024
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053025#ifndef CONFIG_FSL_CAAM
26#define CONFIG_FSL_CAAM
27#endif
28
Sumit Gargbdddd6e2016-06-14 13:52:38 -040029#define CONFIG_SPL_BOARD_INIT
Sumit Gargbdddd6e2016-06-14 13:52:38 -040030#define CONFIG_SPL_DRIVERS_MISC_SUPPORT
Simon Glass3aa66122016-09-12 23:18:23 -060031#ifdef CONFIG_SPL_BUILD
Sumit Gargbdddd6e2016-06-14 13:52:38 -040032/*
33 * Define the key hash for U-Boot here if public/private key pair used to
34 * sign U-boot are different from the SRK hash put in the fuse
35 * Example of defining KEY_HASH is
36 * #define CONFIG_SPL_UBOOT_KEY_HASH \
37 * "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b"
38 * else leave it defined as NULL
39 */
40
41#define CONFIG_SPL_UBOOT_KEY_HASH NULL
42#endif /* ifdef CONFIG_SPL_BUILD */
43
44#ifndef CONFIG_SPL_BUILD
45#define CONFIG_CMD_BLOB
46#define CONFIG_CMD_HASH
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053047#define CONFIG_KEY_REVOCATION
48#ifndef CONFIG_SYS_RAMBOOT
49/* The key used for verification of next level images
50 * is picked up from an Extension Table which has
51 * been verified by the ISBC (Internal Secure boot Code)
52 * in boot ROM of the SoC.
53 * The feature is only applicable in case of NOR boot and is
54 * not applicable in case of RAMBOOT (NAND, SD, SPI).
55 */
Saksham Jain6121f082016-03-23 16:24:34 +053056#ifndef CONFIG_ESBC_HDR_LS
57/* Current Key EXT feature not available in LS ESBC Header */
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053058#define CONFIG_FSL_ISBC_KEY_EXT
59#endif
60
Saksham Jain6121f082016-03-23 16:24:34 +053061#endif
62
York Suncbe8e1c2016-04-04 11:41:26 -070063#if defined(CONFIG_LS1043A) || defined(CONFIG_LS2080A)
Saksham Jainc0c38d22016-03-23 16:24:35 +053064/* For LS1043 (ARMv8), ESBC image Address in Header is 64 bit
York Suncbe8e1c2016-04-04 11:41:26 -070065 * Similiarly for LS2080
Saksham Jainc0c38d22016-03-23 16:24:35 +053066 */
Aneesh Bansal962021a2016-01-22 16:37:22 +053067#define CONFIG_ESBC_ADDR_64BIT
68#endif
69
York Suncbe8e1c2016-04-04 11:41:26 -070070#ifdef CONFIG_LS2080A
Saksham Jainf0eb2ca2016-03-23 16:24:38 +053071#define CONFIG_EXTRA_ENV \
72 "setenv fdt_high 0xa0000000;" \
73 "setenv initrd_high 0xcfffffff;" \
74 "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
75#else
gaurav ranaf79323c2015-03-10 14:08:50 +053076#define CONFIG_EXTRA_ENV \
Sumit Garg45642832016-06-14 13:52:39 -040077 "setenv fdt_high 0xffffffff;" \
78 "setenv initrd_high 0xffffffff;" \
gaurav ranaf79323c2015-03-10 14:08:50 +053079 "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
Saksham Jainf0eb2ca2016-03-23 16:24:38 +053080#endif
gaurav ranaf79323c2015-03-10 14:08:50 +053081
Saksham Jain503eab92016-03-23 16:24:37 +053082/* Copying Bootscript and Header to DDR from NOR for LS2 and for rest, from
83 * Non-XIP Memory (Nand/SD)*/
Sumit Garg45642832016-06-14 13:52:39 -040084#if defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_LS2080A) || \
85 defined(CONFIG_SD_BOOT)
Saksham Jain503eab92016-03-23 16:24:37 +053086#define CONFIG_BOOTSCRIPT_COPY_RAM
87#endif
Sumit Garg45642832016-06-14 13:52:39 -040088/* The address needs to be modified according to NOR, NAND, SD and
89 * DDR memory map
90 */
York Suncbe8e1c2016-04-04 11:41:26 -070091#ifdef CONFIG_LS2080A
Sumit Garg45642832016-06-14 13:52:39 -040092#define CONFIG_BS_HDR_ADDR_DEVICE 0x583920000
93#define CONFIG_BS_ADDR_DEVICE 0x583900000
Saksham Jain503eab92016-03-23 16:24:37 +053094#define CONFIG_BS_HDR_ADDR_RAM 0xa3920000
95#define CONFIG_BS_ADDR_RAM 0xa3900000
Sumit Garg45642832016-06-14 13:52:39 -040096#define CONFIG_BS_HDR_SIZE 0x00002000
97#define CONFIG_BS_SIZE 0x00001000
Saksham Jain503eab92016-03-23 16:24:37 +053098#else
Sumit Garg45642832016-06-14 13:52:39 -040099#ifdef CONFIG_SD_BOOT
100/* For SD boot address and size are assigned in terms of sector
101 * offset and no. of sectors respectively.
102 */
103#define CONFIG_BS_HDR_ADDR_DEVICE 0x00000800
104#define CONFIG_BS_ADDR_DEVICE 0x00000840
105#define CONFIG_BS_HDR_SIZE 0x00000010
106#define CONFIG_BS_SIZE 0x00000008
107#else
108#define CONFIG_BS_HDR_ADDR_DEVICE 0x600a0000
109#define CONFIG_BS_ADDR_DEVICE 0x60060000
110#define CONFIG_BS_HDR_SIZE 0x00002000
111#define CONFIG_BS_SIZE 0x00001000
112#endif /* #ifdef CONFIG_SD_BOOT */
113#define CONFIG_BS_HDR_ADDR_RAM 0x81000000
114#define CONFIG_BS_ADDR_RAM 0x81020000
Saksham Jain503eab92016-03-23 16:24:37 +0530115#endif
116
117#ifdef CONFIG_BOOTSCRIPT_COPY_RAM
118#define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_RAM
Saksham Jain503eab92016-03-23 16:24:37 +0530119#define CONFIG_BOOTSCRIPT_ADDR CONFIG_BS_ADDR_RAM
Saksham Jain506c2eb2016-03-23 16:24:36 +0530120#else
Sumit Garg45642832016-06-14 13:52:39 -0400121#define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_DEVICE
122/* BOOTSCRIPT_ADDR is not required */
Saksham Jain506c2eb2016-03-23 16:24:36 +0530123#endif
gaurav ranaf79323c2015-03-10 14:08:50 +0530124
Aneesh Bansal43104702016-01-22 16:37:24 +0530125#include <config_fsl_chain_trust.h>
Sumit Gargbdddd6e2016-06-14 13:52:38 -0400126#endif /* #ifndef CONFIG_SPL_BUILD */
Aneesh Bansal43104702016-01-22 16:37:24 +0530127#endif /* #ifdef CONFIG_CHAIN_OF_TRUST */
gaurav ranaf79323c2015-03-10 14:08:50 +0530128#endif