blob: c45cace552811032b311e8729059f065ed21f94f [file] [log] [blame]
Ruchika Gupta8ca8d822010-12-15 17:02:08 +00001/*
2 * Copyright 2010-2011 Freescale Semiconductor, Inc.
3 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Ruchika Gupta8ca8d822010-12-15 17:02:08 +00005 */
6
7#ifndef __FSL_SECURE_BOOT_H
8#define __FSL_SECURE_BOOT_H
gaurav rana8b5ea652015-02-27 09:46:17 +05309#include <asm/config_mpc85xx.h>
Ruchika Gupta8ca8d822010-12-15 17:02:08 +000010
Po Liud1030092013-08-21 14:20:21 +080011#ifdef CONFIG_SECURE_BOOT
Aneesh Bansal43104702016-01-22 16:37:24 +053012
13#ifndef CONFIG_FIT_SIGNATURE
14#define CONFIG_CHAIN_OF_TRUST
gaurav rana8b5ea652015-02-27 09:46:17 +053015#endif
16
Ruchika Gupta8ca8d822010-12-15 17:02:08 +000017#if defined(CONFIG_FSL_CORENET)
18#define CONFIG_SYS_PBI_FLASH_BASE 0xc0000000
Aneesh Bansalbf955b22014-03-12 00:07:27 +053019#elif defined(CONFIG_BSC9132QDS)
20#define CONFIG_SYS_PBI_FLASH_BASE 0xc8000000
Aneesh Bansal11421b42014-12-12 15:35:04 +053021#elif defined(CONFIG_C29XPCIE)
22#define CONFIG_SYS_PBI_FLASH_BASE 0xcc000000
Ruchika Gupta8ca8d822010-12-15 17:02:08 +000023#else
24#define CONFIG_SYS_PBI_FLASH_BASE 0xce000000
25#endif
26#define CONFIG_SYS_PBI_FLASH_WINDOW 0xcff80000
27
Aneesh Bansalc25baec2014-03-18 23:40:59 +053028#if defined(CONFIG_B4860QDS) || \
29 defined(CONFIG_T4240QDS) || \
Aneesh Bansala02a44b2014-03-18 23:41:14 +053030 defined(CONFIG_T2080QDS) || \
Aneesh Bansalb6425492014-04-22 15:17:06 +053031 defined(CONFIG_T2080RDB) || \
Aneesh Bansala02a44b2014-03-18 23:41:14 +053032 defined(CONFIG_T1040QDS) || \
gaurav ranaabfd4482015-03-26 15:52:47 +053033 defined(CONFIG_T104xD4QDS) || \
Shengzhou Liue6fb7702014-11-24 17:11:54 +080034 defined(CONFIG_T104xRDB) || \
gaurav ranaabfd4482015-03-26 15:52:47 +053035 defined(CONFIG_T104xD4RDB) || \
Shengzhou Liue6fb7702014-11-24 17:11:54 +080036 defined(CONFIG_PPC_T1023) || \
37 defined(CONFIG_PPC_T1024)
Aneesh Bansal8bcbc272014-03-18 23:40:26 +053038#define CONFIG_SYS_CPC_REINIT_F
gaurav rana8b5ea652015-02-27 09:46:17 +053039#define CONFIG_KEY_REVOCATION
Aneesh Bansal8bcbc272014-03-18 23:40:26 +053040#undef CONFIG_SYS_INIT_L3_ADDR
41#define CONFIG_SYS_INIT_L3_ADDR 0xbff00000
42#endif
43
Aneesh Bansale0f50152015-06-16 10:36:00 +053044#if defined(CONFIG_RAMBOOT_PBL)
45#undef CONFIG_SYS_INIT_L3_ADDR
46#define CONFIG_SYS_INIT_L3_ADDR 0xbff00000
47#endif
48
gaurav rana8b5ea652015-02-27 09:46:17 +053049#if defined(CONFIG_C29XPCIE)
50#define CONFIG_KEY_REVOCATION
51#endif
52
53#if defined(CONFIG_PPC_P3041) || \
54 defined(CONFIG_PPC_P4080) || \
55 defined(CONFIG_PPC_P5020) || \
56 defined(CONFIG_PPC_P5040) || \
57 defined(CONFIG_PPC_P2041)
58 #define CONFIG_FSL_TRUST_ARCH_v1
59#endif
60
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053061#if defined(CONFIG_FSL_CORENET) && !defined(CONFIG_SYS_RAMBOOT)
gaurav rana8b5ea652015-02-27 09:46:17 +053062/* The key used for verification of next level images
63 * is picked up from an Extension Table which has
64 * been verified by the ISBC (Internal Secure boot Code)
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053065 * in boot ROM of the SoC.
66 * The feature is only applicable in case of NOR boot and is
67 * not applicable in case of RAMBOOT (NAND, SD, SPI).
gaurav rana8b5ea652015-02-27 09:46:17 +053068 */
69#define CONFIG_FSL_ISBC_KEY_EXT
70#endif
Aneesh Bansal43104702016-01-22 16:37:24 +053071#endif /* #ifdef CONFIG_SECURE_BOOT */
gaurav rana8b5ea652015-02-27 09:46:17 +053072
Aneesh Bansal43104702016-01-22 16:37:24 +053073#ifdef CONFIG_CHAIN_OF_TRUST
74
75#define CONFIG_CMD_ESBC_VALIDATE
76#define CONFIG_CMD_BLOB
77#define CONFIG_FSL_SEC_MON
78#define CONFIG_SHA_PROG_HW_ACCEL
79#define CONFIG_RSA
80#define CONFIG_RSA_FREESCALE_EXP
81
82#ifndef CONFIG_DM
83#define CONFIG_DM
84#endif
85
86#ifndef CONFIG_FSL_CAAM
87#define CONFIG_FSL_CAAM
88#endif
89
Aneesh Bansalc6249092016-01-22 16:37:27 +053090/* fsl_setenv_chain_of_trust() must be called from
91 * board_late_init()
92 */
93#ifndef CONFIG_BOARD_LATE_INIT
94#define CONFIG_BOARD_LATE_INIT
95#endif
96
Aneesh Bansalb69061d2015-06-16 10:36:43 +053097/* If Boot Script is not on NOR and is required to be copied on RAM */
98#ifdef CONFIG_BOOTSCRIPT_COPY_RAM
99#define CONFIG_BS_HDR_ADDR_RAM 0x00010000
100#define CONFIG_BS_HDR_ADDR_FLASH 0x00800000
101#define CONFIG_BS_HDR_SIZE 0x00002000
102#define CONFIG_BS_ADDR_RAM 0x00012000
103#define CONFIG_BS_ADDR_FLASH 0x00802000
104#define CONFIG_BS_SIZE 0x00001000
105
106#define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_RAM
107#else
108
gaurav ranaf79323c2015-03-10 14:08:50 +0530109/* The bootscript header address is different for B4860 because the NOR
110 * mapping is different on B4 due to reduced NOR size.
111 */
112#if defined(CONFIG_B4860QDS)
113#define CONFIG_BOOTSCRIPT_HDR_ADDR 0xecc00000
114#elif defined(CONFIG_FSL_CORENET)
115#define CONFIG_BOOTSCRIPT_HDR_ADDR 0xe8e00000
116#elif defined(CONFIG_BSC9132QDS)
117#define CONFIG_BOOTSCRIPT_HDR_ADDR 0x88020000
118#elif defined(CONFIG_C29XPCIE)
119#define CONFIG_BOOTSCRIPT_HDR_ADDR 0xec020000
120#else
121#define CONFIG_BOOTSCRIPT_HDR_ADDR 0xee020000
122#endif
123
Aneesh Bansal43104702016-01-22 16:37:24 +0530124#endif /* #ifdef CONFIG_BOOTSCRIPT_COPY_RAM */
gaurav ranaf79323c2015-03-10 14:08:50 +0530125
Aneesh Bansal43104702016-01-22 16:37:24 +0530126#include <config_fsl_chain_trust.h>
127#endif /* #ifdef CONFIG_CHAIN_OF_TRUST */
Po Liud1030092013-08-21 14:20:21 +0800128#endif