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 19a202b9f8SYork Sun #elif defined(CONFIG_TARGET_BSC9132QDS) 20f978f7c2SAneesh Bansal #define CONFIG_SYS_PBI_FLASH_BASE 0xc8000000 21ebccf255SYork Sun #elif defined(CONFIG_TARGET_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 28d46a4a13SYork Sun #if defined(CONFIG_TARGET_B4860QDS) || \ 29d46a4a13SYork Sun defined(CONFIG_TARGET_B4420QDS) || \ 309c21d06cSYork Sun defined(CONFIG_TARGET_T4160QDS) || \ 31*673c01c7SYork Sun defined(CONFIG_TARGET_T4240QDS) || \ 322d8db6d3SAneesh Bansal defined(CONFIG_T2080QDS) || \ 33e47c2a68SAneesh Bansal defined(CONFIG_T2080RDB) || \ 342d8db6d3SAneesh Bansal defined(CONFIG_T1040QDS) || \ 35e622d9edSgaurav rana defined(CONFIG_T104xD4QDS) || \ 3678e56995SYork Sun defined(CONFIG_TARGET_T1040RDB) || \ 3778e56995SYork Sun defined(CONFIG_TARGET_T1040D4RDB) || \ 3878e56995SYork Sun defined(CONFIG_TARGET_T1042RDB) || \ 3978e56995SYork Sun defined(CONFIG_TARGET_T1042D4RDB) || \ 4078e56995SYork Sun defined(CONFIG_TARGET_T1042RDB_PI) || \ 415ff3f41dSYork Sun defined(CONFIG_ARCH_T1023) || \ 42e5d5f5a8SYork Sun defined(CONFIG_ARCH_T1024) 43aa36c84eSSumit Garg #ifndef CONFIG_SYS_RAMBOOT 44fb4a2409SAneesh Bansal #define CONFIG_SYS_CPC_REINIT_F 45aa36c84eSSumit Garg #endif 46e04916a7Sgaurav rana #define CONFIG_KEY_REVOCATION 47fb4a2409SAneesh Bansal #undef CONFIG_SYS_INIT_L3_ADDR 48fb4a2409SAneesh Bansal #define CONFIG_SYS_INIT_L3_ADDR 0xbff00000 49fb4a2409SAneesh Bansal #endif 50fb4a2409SAneesh Bansal 51467a40dfSAneesh Bansal #if defined(CONFIG_RAMBOOT_PBL) 52467a40dfSAneesh Bansal #undef CONFIG_SYS_INIT_L3_ADDR 53aa36c84eSSumit Garg #ifdef CONFIG_SYS_INIT_L3_VADDR 54aa36c84eSSumit Garg #define CONFIG_SYS_INIT_L3_ADDR \ 55aa36c84eSSumit Garg (CONFIG_SYS_INIT_L3_VADDR & ~0xFFF00000) | \ 56aa36c84eSSumit Garg 0xbff00000 57aa36c84eSSumit Garg #else 58467a40dfSAneesh Bansal #define CONFIG_SYS_INIT_L3_ADDR 0xbff00000 59467a40dfSAneesh Bansal #endif 60aa36c84eSSumit Garg #endif 61467a40dfSAneesh Bansal 62ebccf255SYork Sun #if defined(CONFIG_TARGET_C29XPCIE) 63e04916a7Sgaurav rana #define CONFIG_KEY_REVOCATION 64e04916a7Sgaurav rana #endif 65e04916a7Sgaurav rana 665e5fdd2dSYork Sun #if defined(CONFIG_ARCH_P3041) || \ 67e71372cbSYork Sun defined(CONFIG_ARCH_P4080) || \ 68cefe11cdSYork Sun defined(CONFIG_ARCH_P5020) || \ 6995390360SYork Sun defined(CONFIG_ARCH_P5040) || \ 70ce040c83SYork Sun defined(CONFIG_ARCH_P2041) 71e04916a7Sgaurav rana #define CONFIG_FSL_TRUST_ARCH_v1 72e04916a7Sgaurav rana #endif 73e04916a7Sgaurav rana 742ed948f4SAneesh Bansal #if defined(CONFIG_FSL_CORENET) && !defined(CONFIG_SYS_RAMBOOT) 75e04916a7Sgaurav rana /* The key used for verification of next level images 76e04916a7Sgaurav rana * is picked up from an Extension Table which has 77e04916a7Sgaurav rana * been verified by the ISBC (Internal Secure boot Code) 782ed948f4SAneesh Bansal * in boot ROM of the SoC. 792ed948f4SAneesh Bansal * The feature is only applicable in case of NOR boot and is 802ed948f4SAneesh Bansal * not applicable in case of RAMBOOT (NAND, SD, SPI). 81e04916a7Sgaurav rana */ 82e04916a7Sgaurav rana #define CONFIG_FSL_ISBC_KEY_EXT 83e04916a7Sgaurav rana #endif 84bdc22074SAneesh Bansal #endif /* #ifdef CONFIG_SECURE_BOOT */ 85e04916a7Sgaurav rana 86bdc22074SAneesh Bansal #ifdef CONFIG_CHAIN_OF_TRUST 87b63f8a43SSimon Glass #ifdef CONFIG_SPL_BUILD 888f01397bSSumit Garg /* 898f01397bSSumit Garg * PPAACT and SPAACT table for PAMU must be placed on DDR after DDR init 908f01397bSSumit Garg * due to space crunch on CPC and thus malloc will not work. 918f01397bSSumit Garg */ 928f01397bSSumit Garg #define CONFIG_SPL_PPAACT_ADDR 0x2e000000 938f01397bSSumit Garg #define CONFIG_SPL_SPAACT_ADDR 0x2f000000 948f01397bSSumit Garg #define CONFIG_SPL_JR0_LIODN_S 454 958f01397bSSumit Garg #define CONFIG_SPL_JR0_LIODN_NS 458 968f01397bSSumit Garg /* 978f01397bSSumit Garg * Define the key hash for U-Boot here if public/private key pair used to 988f01397bSSumit Garg * sign U-boot are different from the SRK hash put in the fuse 998f01397bSSumit Garg * Example of defining KEY_HASH is 1008f01397bSSumit Garg * #define CONFIG_SPL_UBOOT_KEY_HASH \ 1018f01397bSSumit Garg * "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b" 1028f01397bSSumit Garg * else leave it defined as NULL 1038f01397bSSumit Garg */ 1048f01397bSSumit Garg 1058f01397bSSumit Garg #define CONFIG_SPL_UBOOT_KEY_HASH NULL 1068f01397bSSumit Garg #endif /* ifdef CONFIG_SPL_BUILD */ 1078f01397bSSumit Garg 108bdc22074SAneesh Bansal #define CONFIG_CMD_ESBC_VALIDATE 109bdc22074SAneesh Bansal #define CONFIG_CMD_BLOB 110bdc22074SAneesh Bansal #define CONFIG_FSL_SEC_MON 111bdc22074SAneesh Bansal #define CONFIG_SHA_PROG_HW_ACCEL 112bdc22074SAneesh Bansal #define CONFIG_RSA_FREESCALE_EXP 113bdc22074SAneesh Bansal 114bdc22074SAneesh Bansal #ifndef CONFIG_FSL_CAAM 115bdc22074SAneesh Bansal #define CONFIG_FSL_CAAM 116bdc22074SAneesh Bansal #endif 117bdc22074SAneesh Bansal 1188f01397bSSumit Garg #ifndef CONFIG_SPL_BUILD 1198f01397bSSumit Garg /* 1208f01397bSSumit Garg * fsl_setenv_chain_of_trust() must be called from 121d0a6d7ceSAneesh Bansal * board_late_init() 122d0a6d7ceSAneesh Bansal */ 123d0a6d7ceSAneesh Bansal #ifndef CONFIG_BOARD_LATE_INIT 124d0a6d7ceSAneesh Bansal #define CONFIG_BOARD_LATE_INIT 125d0a6d7ceSAneesh Bansal #endif 126d0a6d7ceSAneesh Bansal 1275050f6f0SAneesh Bansal /* If Boot Script is not on NOR and is required to be copied on RAM */ 1285050f6f0SAneesh Bansal #ifdef CONFIG_BOOTSCRIPT_COPY_RAM 1295050f6f0SAneesh Bansal #define CONFIG_BS_HDR_ADDR_RAM 0x00010000 13069d4b48cSSumit Garg #define CONFIG_BS_HDR_ADDR_DEVICE 0x00800000 1315050f6f0SAneesh Bansal #define CONFIG_BS_HDR_SIZE 0x00002000 1325050f6f0SAneesh Bansal #define CONFIG_BS_ADDR_RAM 0x00012000 13369d4b48cSSumit Garg #define CONFIG_BS_ADDR_DEVICE 0x00802000 1345050f6f0SAneesh Bansal #define CONFIG_BS_SIZE 0x00001000 1355050f6f0SAneesh Bansal 1365050f6f0SAneesh Bansal #define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_RAM 1375050f6f0SAneesh Bansal #else 1385050f6f0SAneesh Bansal 13998cb0efdSgaurav rana /* The bootscript header address is different for B4860 because the NOR 14098cb0efdSgaurav rana * mapping is different on B4 due to reduced NOR size. 14198cb0efdSgaurav rana */ 142d46a4a13SYork Sun #if defined(CONFIG_TARGET_B4860QDS) || defined(CONFIG_TARGET_B4420QDS) 14398cb0efdSgaurav rana #define CONFIG_BOOTSCRIPT_HDR_ADDR 0xecc00000 14498cb0efdSgaurav rana #elif defined(CONFIG_FSL_CORENET) 14598cb0efdSgaurav rana #define CONFIG_BOOTSCRIPT_HDR_ADDR 0xe8e00000 146a202b9f8SYork Sun #elif defined(CONFIG_TARGET_BSC9132QDS) 14798cb0efdSgaurav rana #define CONFIG_BOOTSCRIPT_HDR_ADDR 0x88020000 148ebccf255SYork Sun #elif defined(CONFIG_TARGET_C29XPCIE) 14998cb0efdSgaurav rana #define CONFIG_BOOTSCRIPT_HDR_ADDR 0xec020000 15098cb0efdSgaurav rana #else 15198cb0efdSgaurav rana #define CONFIG_BOOTSCRIPT_HDR_ADDR 0xee020000 15298cb0efdSgaurav rana #endif 15398cb0efdSgaurav rana 154bdc22074SAneesh Bansal #endif /* #ifdef CONFIG_BOOTSCRIPT_COPY_RAM */ 1555050f6f0SAneesh Bansal 156bdc22074SAneesh Bansal #include <config_fsl_chain_trust.h> 1578f01397bSSumit Garg #endif /* #ifndef CONFIG_SPL_BUILD */ 158bdc22074SAneesh Bansal #endif /* #ifdef CONFIG_CHAIN_OF_TRUST */ 1590d2cff2dSPo Liu #endif 160