blob: d576f2ef45a7f6cc252ffe4bb67939bf0dbe22af [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
Aneesh Bansal3322e212016-01-22 16:37:23 +053020#define CONFIG_CMD_BLOB
Saksham Jainc0c38d22016-03-23 16:24:35 +053021#define CONFIG_CMD_HASH
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053022#define CONFIG_FSL_SEC_MON
Saksham Jainc0c38d22016-03-23 16:24:35 +053023#define CONFIG_SHA_HW_ACCEL
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053024#define CONFIG_SHA_PROG_HW_ACCEL
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053025#define CONFIG_RSA_FREESCALE_EXP
Aneesh Bansalb3e98202015-12-08 13:54:29 +053026
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053027#ifndef CONFIG_FSL_CAAM
28#define CONFIG_FSL_CAAM
29#endif
30
31#define CONFIG_KEY_REVOCATION
32#ifndef CONFIG_SYS_RAMBOOT
33/* The key used for verification of next level images
34 * is picked up from an Extension Table which has
35 * been verified by the ISBC (Internal Secure boot Code)
36 * in boot ROM of the SoC.
37 * The feature is only applicable in case of NOR boot and is
38 * not applicable in case of RAMBOOT (NAND, SD, SPI).
39 */
Saksham Jain6121f082016-03-23 16:24:34 +053040#ifndef CONFIG_ESBC_HDR_LS
41/* Current Key EXT feature not available in LS ESBC Header */
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053042#define CONFIG_FSL_ISBC_KEY_EXT
43#endif
44
Saksham Jain6121f082016-03-23 16:24:34 +053045#endif
46
Saksham Jainc0c38d22016-03-23 16:24:35 +053047#if defined(CONFIG_LS1043A) || defined(CONFIG_LS2080A) ||\
48 defined(CONFIG_LS2085A)
49/* For LS1043 (ARMv8), ESBC image Address in Header is 64 bit
50 * Similiarly for LS2080 and LS2085
51 */
Aneesh Bansal962021a2016-01-22 16:37:22 +053052#define CONFIG_ESBC_ADDR_64BIT
53#endif
54
Saksham Jainf0eb2ca2016-03-23 16:24:38 +053055#if defined(CONFIG_LS2080A) || defined(CONFIG_LS2085A)
56#define CONFIG_EXTRA_ENV \
57 "setenv fdt_high 0xa0000000;" \
58 "setenv initrd_high 0xcfffffff;" \
59 "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
60#else
gaurav ranaf79323c2015-03-10 14:08:50 +053061#define CONFIG_EXTRA_ENV \
62 "setenv fdt_high 0xcfffffff;" \
63 "setenv initrd_high 0xcfffffff;" \
64 "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
Saksham Jainf0eb2ca2016-03-23 16:24:38 +053065#endif
gaurav ranaf79323c2015-03-10 14:08:50 +053066
Saksham Jain503eab92016-03-23 16:24:37 +053067/* Copying Bootscript and Header to DDR from NOR for LS2 and for rest, from
68 * Non-XIP Memory (Nand/SD)*/
69#if defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_LS2080A) ||\
70 defined(CONFIG_LS2085A)
71#define CONFIG_BOOTSCRIPT_COPY_RAM
72#endif
73/* The address needs to be modified according to NOR and DDR memory map */
Saksham Jain506c2eb2016-03-23 16:24:36 +053074#if defined(CONFIG_LS2080A) || defined(CONFIG_LS2085A)
Saksham Jain503eab92016-03-23 16:24:37 +053075#define CONFIG_BS_HDR_ADDR_FLASH 0x583920000
76#define CONFIG_BS_ADDR_FLASH 0x583900000
77#define CONFIG_BS_HDR_ADDR_RAM 0xa3920000
78#define CONFIG_BS_ADDR_RAM 0xa3900000
79#else
80#define CONFIG_BS_HDR_ADDR_FLASH 0x600a0000
81#define CONFIG_BS_ADDR_FLASH 0x60060000
82#define CONFIG_BS_HDR_ADDR_RAM 0xa0060000
83#define CONFIG_BS_ADDR_RAM 0xa0060000
84#endif
85
86#ifdef CONFIG_BOOTSCRIPT_COPY_RAM
87#define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_RAM
88#define CONFIG_BS_HDR_SIZE 0x00002000
89#define CONFIG_BOOTSCRIPT_ADDR CONFIG_BS_ADDR_RAM
90#define CONFIG_BS_SIZE 0x00001000
Saksham Jain506c2eb2016-03-23 16:24:36 +053091#else
Saksham Jain503eab92016-03-23 16:24:37 +053092#define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_FLASH
93/* BS_HDR_SIZE, BOOTSCRIPT_ADDR and BS_SIZE are not required */
Saksham Jain506c2eb2016-03-23 16:24:36 +053094#endif
gaurav ranaf79323c2015-03-10 14:08:50 +053095
Aneesh Bansal43104702016-01-22 16:37:24 +053096#include <config_fsl_chain_trust.h>
97#endif /* #ifdef CONFIG_CHAIN_OF_TRUST */
gaurav ranaf79323c2015-03-10 14:08:50 +053098#endif