blob: c6930dd1c3808e0caef5e82219ec0d4050e43578 [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
York Sun4620e1f2016-11-15 18:32:50 -080019#elif defined(CONFIG_TARGET_BSC9132QDS)
Aneesh Bansalbf955b22014-03-12 00:07:27 +053020#define CONFIG_SYS_PBI_FLASH_BASE 0xc8000000
York Sunc6c51ae2016-11-16 11:51:24 -080021#elif defined(CONFIG_TARGET_C29XPCIE)
Aneesh Bansal11421b42014-12-12 15:35:04 +053022#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
York Sun2dfafc62016-11-18 11:47:35 -080028#if defined(CONFIG_TARGET_B4860QDS) || \
29 defined(CONFIG_TARGET_B4420QDS) || \
Aneesh Bansalc25baec2014-03-18 23:40:59 +053030 defined(CONFIG_T4240QDS) || \
Aneesh Bansala02a44b2014-03-18 23:41:14 +053031 defined(CONFIG_T2080QDS) || \
Aneesh Bansalb6425492014-04-22 15:17:06 +053032 defined(CONFIG_T2080RDB) || \
Aneesh Bansala02a44b2014-03-18 23:41:14 +053033 defined(CONFIG_T1040QDS) || \
gaurav ranaabfd4482015-03-26 15:52:47 +053034 defined(CONFIG_T104xD4QDS) || \
York Sun097aa602016-11-21 11:25:26 -080035 defined(CONFIG_TARGET_T1040RDB) || \
36 defined(CONFIG_TARGET_T1040D4RDB) || \
37 defined(CONFIG_TARGET_T1042RDB) || \
38 defined(CONFIG_TARGET_T1042D4RDB) || \
39 defined(CONFIG_TARGET_T1042RDB_PI) || \
York Sunbcee92e2016-11-18 12:35:47 -080040 defined(CONFIG_ARCH_T1023) || \
York Sun7d29dd62016-11-18 13:01:34 -080041 defined(CONFIG_ARCH_T1024)
Sumit Gargafaca2a2016-07-14 12:27:52 -040042#ifndef CONFIG_SYS_RAMBOOT
Aneesh Bansal8bcbc272014-03-18 23:40:26 +053043#define CONFIG_SYS_CPC_REINIT_F
Sumit Gargafaca2a2016-07-14 12:27:52 -040044#endif
gaurav rana8b5ea652015-02-27 09:46:17 +053045#define CONFIG_KEY_REVOCATION
Aneesh Bansal8bcbc272014-03-18 23:40:26 +053046#undef CONFIG_SYS_INIT_L3_ADDR
47#define CONFIG_SYS_INIT_L3_ADDR 0xbff00000
48#endif
49
Aneesh Bansale0f50152015-06-16 10:36:00 +053050#if defined(CONFIG_RAMBOOT_PBL)
51#undef CONFIG_SYS_INIT_L3_ADDR
Sumit Gargafaca2a2016-07-14 12:27:52 -040052#ifdef CONFIG_SYS_INIT_L3_VADDR
53#define CONFIG_SYS_INIT_L3_ADDR \
54 (CONFIG_SYS_INIT_L3_VADDR & ~0xFFF00000) | \
55 0xbff00000
56#else
57#define CONFIG_SYS_INIT_L3_ADDR 0xbff00000
58#endif
Aneesh Bansale0f50152015-06-16 10:36:00 +053059#endif
60
York Sunc6c51ae2016-11-16 11:51:24 -080061#if defined(CONFIG_TARGET_C29XPCIE)
gaurav rana8b5ea652015-02-27 09:46:17 +053062#define CONFIG_KEY_REVOCATION
63#endif
64
York Sundf70d062016-11-18 11:20:40 -080065#if defined(CONFIG_ARCH_P3041) || \
York Sun84be8a92016-11-18 11:24:40 -080066 defined(CONFIG_ARCH_P4080) || \
York Sun2ed73f42016-11-18 11:30:56 -080067 defined(CONFIG_ARCH_P5020) || \
York Suna3c5b662016-11-18 11:39:36 -080068 defined(CONFIG_ARCH_P5040) || \
York Sun5786fca2016-11-18 11:15:21 -080069 defined(CONFIG_ARCH_P2041)
gaurav rana8b5ea652015-02-27 09:46:17 +053070 #define CONFIG_FSL_TRUST_ARCH_v1
71#endif
72
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053073#if defined(CONFIG_FSL_CORENET) && !defined(CONFIG_SYS_RAMBOOT)
gaurav rana8b5ea652015-02-27 09:46:17 +053074/* The key used for verification of next level images
75 * is picked up from an Extension Table which has
76 * been verified by the ISBC (Internal Secure boot Code)
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053077 * in boot ROM of the SoC.
78 * The feature is only applicable in case of NOR boot and is
79 * not applicable in case of RAMBOOT (NAND, SD, SPI).
gaurav rana8b5ea652015-02-27 09:46:17 +053080 */
81#define CONFIG_FSL_ISBC_KEY_EXT
82#endif
Aneesh Bansal43104702016-01-22 16:37:24 +053083#endif /* #ifdef CONFIG_SECURE_BOOT */
gaurav rana8b5ea652015-02-27 09:46:17 +053084
Aneesh Bansal43104702016-01-22 16:37:24 +053085#ifdef CONFIG_CHAIN_OF_TRUST
Simon Glass3aa66122016-09-12 23:18:23 -060086#ifdef CONFIG_SPL_BUILD
Sumit Gargf6d96cb2016-07-14 12:27:51 -040087/*
88 * PPAACT and SPAACT table for PAMU must be placed on DDR after DDR init
89 * due to space crunch on CPC and thus malloc will not work.
90 */
91#define CONFIG_SPL_PPAACT_ADDR 0x2e000000
92#define CONFIG_SPL_SPAACT_ADDR 0x2f000000
93#define CONFIG_SPL_JR0_LIODN_S 454
94#define CONFIG_SPL_JR0_LIODN_NS 458
95/*
96 * Define the key hash for U-Boot here if public/private key pair used to
97 * sign U-boot are different from the SRK hash put in the fuse
98 * Example of defining KEY_HASH is
99 * #define CONFIG_SPL_UBOOT_KEY_HASH \
100 * "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b"
101 * else leave it defined as NULL
102 */
103
104#define CONFIG_SPL_UBOOT_KEY_HASH NULL
105#endif /* ifdef CONFIG_SPL_BUILD */
106
Aneesh Bansal43104702016-01-22 16:37:24 +0530107#define CONFIG_CMD_ESBC_VALIDATE
108#define CONFIG_CMD_BLOB
109#define CONFIG_FSL_SEC_MON
110#define CONFIG_SHA_PROG_HW_ACCEL
Aneesh Bansal43104702016-01-22 16:37:24 +0530111#define CONFIG_RSA_FREESCALE_EXP
112
Aneesh Bansal43104702016-01-22 16:37:24 +0530113#ifndef CONFIG_FSL_CAAM
114#define CONFIG_FSL_CAAM
115#endif
116
Sumit Gargf6d96cb2016-07-14 12:27:51 -0400117#ifndef CONFIG_SPL_BUILD
118/*
119 * fsl_setenv_chain_of_trust() must be called from
Aneesh Bansalc6249092016-01-22 16:37:27 +0530120 * board_late_init()
121 */
122#ifndef CONFIG_BOARD_LATE_INIT
123#define CONFIG_BOARD_LATE_INIT
124#endif
125
Aneesh Bansalb69061d2015-06-16 10:36:43 +0530126/* If Boot Script is not on NOR and is required to be copied on RAM */
127#ifdef CONFIG_BOOTSCRIPT_COPY_RAM
128#define CONFIG_BS_HDR_ADDR_RAM 0x00010000
Sumit Garg45642832016-06-14 13:52:39 -0400129#define CONFIG_BS_HDR_ADDR_DEVICE 0x00800000
Aneesh Bansalb69061d2015-06-16 10:36:43 +0530130#define CONFIG_BS_HDR_SIZE 0x00002000
131#define CONFIG_BS_ADDR_RAM 0x00012000
Sumit Garg45642832016-06-14 13:52:39 -0400132#define CONFIG_BS_ADDR_DEVICE 0x00802000
Aneesh Bansalb69061d2015-06-16 10:36:43 +0530133#define CONFIG_BS_SIZE 0x00001000
134
135#define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_RAM
136#else
137
gaurav ranaf79323c2015-03-10 14:08:50 +0530138/* The bootscript header address is different for B4860 because the NOR
139 * mapping is different on B4 due to reduced NOR size.
140 */
York Sun2dfafc62016-11-18 11:47:35 -0800141#if defined(CONFIG_TARGET_B4860QDS) || defined(CONFIG_TARGET_B4420QDS)
gaurav ranaf79323c2015-03-10 14:08:50 +0530142#define CONFIG_BOOTSCRIPT_HDR_ADDR 0xecc00000
143#elif defined(CONFIG_FSL_CORENET)
144#define CONFIG_BOOTSCRIPT_HDR_ADDR 0xe8e00000
York Sun4620e1f2016-11-15 18:32:50 -0800145#elif defined(CONFIG_TARGET_BSC9132QDS)
gaurav ranaf79323c2015-03-10 14:08:50 +0530146#define CONFIG_BOOTSCRIPT_HDR_ADDR 0x88020000
York Sunc6c51ae2016-11-16 11:51:24 -0800147#elif defined(CONFIG_TARGET_C29XPCIE)
gaurav ranaf79323c2015-03-10 14:08:50 +0530148#define CONFIG_BOOTSCRIPT_HDR_ADDR 0xec020000
149#else
150#define CONFIG_BOOTSCRIPT_HDR_ADDR 0xee020000
151#endif
152
Aneesh Bansal43104702016-01-22 16:37:24 +0530153#endif /* #ifdef CONFIG_BOOTSCRIPT_COPY_RAM */
gaurav ranaf79323c2015-03-10 14:08:50 +0530154
Aneesh Bansal43104702016-01-22 16:37:24 +0530155#include <config_fsl_chain_trust.h>
Sumit Gargf6d96cb2016-07-14 12:27:51 -0400156#endif /* #ifndef CONFIG_SPL_BUILD */
Aneesh Bansal43104702016-01-22 16:37:24 +0530157#endif /* #ifdef CONFIG_CHAIN_OF_TRUST */
Po Liud1030092013-08-21 14:20:21 +0800158#endif