xref: /rk3399_rockchip-uboot/arch/powerpc/include/asm/fsl_secure_boot.h (revision 8f01397ba76d1ee210bedbf031d807e8df34c482)
17065b7d4SRuchika Gupta /*
27065b7d4SRuchika Gupta  * Copyright 2010-2011 Freescale Semiconductor, Inc.
37065b7d4SRuchika Gupta  *
41a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
57065b7d4SRuchika Gupta  */
67065b7d4SRuchika Gupta 
77065b7d4SRuchika Gupta #ifndef __FSL_SECURE_BOOT_H
87065b7d4SRuchika Gupta #define __FSL_SECURE_BOOT_H
9e04916a7Sgaurav rana #include <asm/config_mpc85xx.h>
10e04916a7Sgaurav rana 
11e04916a7Sgaurav rana #ifdef CONFIG_SECURE_BOOT
12bdc22074SAneesh Bansal 
13bdc22074SAneesh Bansal #ifndef CONFIG_FIT_SIGNATURE
14bdc22074SAneesh Bansal #define CONFIG_CHAIN_OF_TRUST
15e04916a7Sgaurav rana #endif
167065b7d4SRuchika Gupta 
177065b7d4SRuchika Gupta #if defined(CONFIG_FSL_CORENET)
187065b7d4SRuchika Gupta #define CONFIG_SYS_PBI_FLASH_BASE		0xc0000000
19f978f7c2SAneesh Bansal #elif defined(CONFIG_BSC9132QDS)
20f978f7c2SAneesh Bansal #define CONFIG_SYS_PBI_FLASH_BASE		0xc8000000
21b3f0f632SAneesh Bansal #elif defined(CONFIG_C29XPCIE)
22b3f0f632SAneesh Bansal #define CONFIG_SYS_PBI_FLASH_BASE		0xcc000000
237065b7d4SRuchika Gupta #else
247065b7d4SRuchika Gupta #define CONFIG_SYS_PBI_FLASH_BASE		0xce000000
257065b7d4SRuchika Gupta #endif
267065b7d4SRuchika Gupta #define CONFIG_SYS_PBI_FLASH_WINDOW		0xcff80000
277065b7d4SRuchika Gupta 
28ca4819dfSAneesh Bansal #if defined(CONFIG_B4860QDS) || \
29ca4819dfSAneesh Bansal 	defined(CONFIG_T4240QDS) || \
302d8db6d3SAneesh Bansal 	defined(CONFIG_T2080QDS) || \
31e47c2a68SAneesh Bansal 	defined(CONFIG_T2080RDB) || \
322d8db6d3SAneesh Bansal 	defined(CONFIG_T1040QDS) || \
33e622d9edSgaurav rana 	defined(CONFIG_T104xD4QDS) || \
34f6050790SShengzhou Liu 	defined(CONFIG_T104xRDB) || \
35e622d9edSgaurav rana 	defined(CONFIG_T104xD4RDB) || \
36f6050790SShengzhou Liu 	defined(CONFIG_PPC_T1023) || \
37f6050790SShengzhou Liu 	defined(CONFIG_PPC_T1024)
38fb4a2409SAneesh Bansal #define CONFIG_SYS_CPC_REINIT_F
39e04916a7Sgaurav rana #define CONFIG_KEY_REVOCATION
40fb4a2409SAneesh Bansal #undef CONFIG_SYS_INIT_L3_ADDR
41fb4a2409SAneesh Bansal #define CONFIG_SYS_INIT_L3_ADDR			0xbff00000
42fb4a2409SAneesh Bansal #endif
43fb4a2409SAneesh Bansal 
44467a40dfSAneesh Bansal #if defined(CONFIG_RAMBOOT_PBL)
45467a40dfSAneesh Bansal #undef CONFIG_SYS_INIT_L3_ADDR
46467a40dfSAneesh Bansal #define CONFIG_SYS_INIT_L3_ADDR			0xbff00000
47467a40dfSAneesh Bansal #endif
48467a40dfSAneesh Bansal 
49e04916a7Sgaurav rana #if defined(CONFIG_C29XPCIE)
50e04916a7Sgaurav rana #define CONFIG_KEY_REVOCATION
51e04916a7Sgaurav rana #endif
52e04916a7Sgaurav rana 
53e04916a7Sgaurav rana #if defined(CONFIG_PPC_P3041)	||	\
54e04916a7Sgaurav rana 	defined(CONFIG_PPC_P4080) ||	\
55e04916a7Sgaurav rana 	defined(CONFIG_PPC_P5020) ||	\
56e04916a7Sgaurav rana 	defined(CONFIG_PPC_P5040) ||	\
57e04916a7Sgaurav rana 	defined(CONFIG_PPC_P2041)
58e04916a7Sgaurav rana 	#define	CONFIG_FSL_TRUST_ARCH_v1
59e04916a7Sgaurav rana #endif
60e04916a7Sgaurav rana 
612ed948f4SAneesh Bansal #if defined(CONFIG_FSL_CORENET) && !defined(CONFIG_SYS_RAMBOOT)
62e04916a7Sgaurav rana /* The key used for verification of next level images
63e04916a7Sgaurav rana  * is picked up from an Extension Table which has
64e04916a7Sgaurav rana  * been verified by the ISBC (Internal Secure boot Code)
652ed948f4SAneesh Bansal  * in boot ROM of the SoC.
662ed948f4SAneesh Bansal  * The feature is only applicable in case of NOR boot and is
672ed948f4SAneesh Bansal  * not applicable in case of RAMBOOT (NAND, SD, SPI).
68e04916a7Sgaurav rana  */
69e04916a7Sgaurav rana #define CONFIG_FSL_ISBC_KEY_EXT
70e04916a7Sgaurav rana #endif
71bdc22074SAneesh Bansal #endif /* #ifdef CONFIG_SECURE_BOOT */
72e04916a7Sgaurav rana 
73bdc22074SAneesh Bansal #ifdef CONFIG_CHAIN_OF_TRUST
74bdc22074SAneesh Bansal 
75*8f01397bSSumit Garg #ifdef CONFIG_SPL_BUILD
76*8f01397bSSumit Garg #define CONFIG_SPL_DM			1
77*8f01397bSSumit Garg #define CONFIG_SPL_CRYPTO_SUPPORT
78*8f01397bSSumit Garg #define CONFIG_SPL_HASH_SUPPORT
79*8f01397bSSumit Garg #define CONFIG_SPL_RSA
80*8f01397bSSumit Garg #define CONFIG_SPL_DRIVERS_MISC_SUPPORT
81*8f01397bSSumit Garg /*
82*8f01397bSSumit Garg  * PPAACT and SPAACT table for PAMU must be placed on DDR after DDR init
83*8f01397bSSumit Garg  * due to space crunch on CPC and thus malloc will not work.
84*8f01397bSSumit Garg  */
85*8f01397bSSumit Garg #define CONFIG_SPL_PPAACT_ADDR		0x2e000000
86*8f01397bSSumit Garg #define CONFIG_SPL_SPAACT_ADDR		0x2f000000
87*8f01397bSSumit Garg #define CONFIG_SPL_JR0_LIODN_S		454
88*8f01397bSSumit Garg #define CONFIG_SPL_JR0_LIODN_NS		458
89*8f01397bSSumit Garg /*
90*8f01397bSSumit Garg  * Define the key hash for U-Boot here if public/private key pair used to
91*8f01397bSSumit Garg  * sign U-boot are different from the SRK hash put in the fuse
92*8f01397bSSumit Garg  * Example of defining KEY_HASH is
93*8f01397bSSumit Garg  * #define CONFIG_SPL_UBOOT_KEY_HASH \
94*8f01397bSSumit Garg  *      "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b"
95*8f01397bSSumit Garg  * else leave it defined as NULL
96*8f01397bSSumit Garg  */
97*8f01397bSSumit Garg 
98*8f01397bSSumit Garg #define CONFIG_SPL_UBOOT_KEY_HASH	NULL
99*8f01397bSSumit Garg #endif /* ifdef CONFIG_SPL_BUILD */
100*8f01397bSSumit Garg 
101bdc22074SAneesh Bansal #define CONFIG_CMD_ESBC_VALIDATE
102bdc22074SAneesh Bansal #define CONFIG_CMD_BLOB
103bdc22074SAneesh Bansal #define CONFIG_FSL_SEC_MON
104bdc22074SAneesh Bansal #define CONFIG_SHA_PROG_HW_ACCEL
105bdc22074SAneesh Bansal #define CONFIG_RSA_FREESCALE_EXP
106bdc22074SAneesh Bansal 
107bdc22074SAneesh Bansal #ifndef CONFIG_FSL_CAAM
108bdc22074SAneesh Bansal #define CONFIG_FSL_CAAM
109bdc22074SAneesh Bansal #endif
110bdc22074SAneesh Bansal 
111*8f01397bSSumit Garg #ifndef CONFIG_SPL_BUILD
112*8f01397bSSumit Garg /*
113*8f01397bSSumit Garg  * fsl_setenv_chain_of_trust() must be called from
114d0a6d7ceSAneesh Bansal  * board_late_init()
115d0a6d7ceSAneesh Bansal  */
116d0a6d7ceSAneesh Bansal #ifndef CONFIG_BOARD_LATE_INIT
117d0a6d7ceSAneesh Bansal #define CONFIG_BOARD_LATE_INIT
118d0a6d7ceSAneesh Bansal #endif
119d0a6d7ceSAneesh Bansal 
1205050f6f0SAneesh Bansal /* If Boot Script is not on NOR and is required to be copied on RAM */
1215050f6f0SAneesh Bansal #ifdef CONFIG_BOOTSCRIPT_COPY_RAM
1225050f6f0SAneesh Bansal #define CONFIG_BS_HDR_ADDR_RAM		0x00010000
1235050f6f0SAneesh Bansal #define CONFIG_BS_HDR_ADDR_FLASH	0x00800000
1245050f6f0SAneesh Bansal #define CONFIG_BS_HDR_SIZE		0x00002000
1255050f6f0SAneesh Bansal #define CONFIG_BS_ADDR_RAM		0x00012000
1265050f6f0SAneesh Bansal #define CONFIG_BS_ADDR_FLASH		0x00802000
1275050f6f0SAneesh Bansal #define CONFIG_BS_SIZE			0x00001000
1285050f6f0SAneesh Bansal 
1295050f6f0SAneesh Bansal #define CONFIG_BOOTSCRIPT_HDR_ADDR	CONFIG_BS_HDR_ADDR_RAM
1305050f6f0SAneesh Bansal #else
1315050f6f0SAneesh Bansal 
13298cb0efdSgaurav rana /* The bootscript header address is different for B4860 because the NOR
13398cb0efdSgaurav rana  * mapping is different on B4 due to reduced NOR size.
13498cb0efdSgaurav rana  */
13598cb0efdSgaurav rana #if defined(CONFIG_B4860QDS)
13698cb0efdSgaurav rana #define CONFIG_BOOTSCRIPT_HDR_ADDR	0xecc00000
13798cb0efdSgaurav rana #elif defined(CONFIG_FSL_CORENET)
13898cb0efdSgaurav rana #define CONFIG_BOOTSCRIPT_HDR_ADDR	0xe8e00000
13998cb0efdSgaurav rana #elif defined(CONFIG_BSC9132QDS)
14098cb0efdSgaurav rana #define CONFIG_BOOTSCRIPT_HDR_ADDR	0x88020000
14198cb0efdSgaurav rana #elif defined(CONFIG_C29XPCIE)
14298cb0efdSgaurav rana #define CONFIG_BOOTSCRIPT_HDR_ADDR	0xec020000
14398cb0efdSgaurav rana #else
14498cb0efdSgaurav rana #define CONFIG_BOOTSCRIPT_HDR_ADDR	0xee020000
14598cb0efdSgaurav rana #endif
14698cb0efdSgaurav rana 
147bdc22074SAneesh Bansal #endif /* #ifdef CONFIG_BOOTSCRIPT_COPY_RAM */
1485050f6f0SAneesh Bansal 
149bdc22074SAneesh Bansal #include <config_fsl_chain_trust.h>
150*8f01397bSSumit Garg #endif /* #ifndef CONFIG_SPL_BUILD */
151bdc22074SAneesh Bansal #endif /* #ifdef CONFIG_CHAIN_OF_TRUST */
1520d2cff2dSPo Liu #endif
153