Ruchika Gupta | 8ca8d82 | 2010-12-15 17:02:08 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2010-2011 Freescale Semiconductor, Inc. |
| 3 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Ruchika Gupta | 8ca8d82 | 2010-12-15 17:02:08 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __FSL_SECURE_BOOT_H |
| 8 | #define __FSL_SECURE_BOOT_H |
gaurav rana | 8b5ea65 | 2015-02-27 09:46:17 +0530 | [diff] [blame] | 9 | #include <asm/config_mpc85xx.h> |
Ruchika Gupta | 8ca8d82 | 2010-12-15 17:02:08 +0000 | [diff] [blame] | 10 | |
Po Liu | d103009 | 2013-08-21 14:20:21 +0800 | [diff] [blame] | 11 | #ifdef CONFIG_SECURE_BOOT |
Aneesh Bansal | 4310470 | 2016-01-22 16:37:24 +0530 | [diff] [blame] | 12 | |
| 13 | #ifndef CONFIG_FIT_SIGNATURE |
| 14 | #define CONFIG_CHAIN_OF_TRUST |
gaurav rana | 8b5ea65 | 2015-02-27 09:46:17 +0530 | [diff] [blame] | 15 | #endif |
| 16 | |
Ruchika Gupta | 8ca8d82 | 2010-12-15 17:02:08 +0000 | [diff] [blame] | 17 | #if defined(CONFIG_FSL_CORENET) |
| 18 | #define CONFIG_SYS_PBI_FLASH_BASE 0xc0000000 |
York Sun | 4620e1f | 2016-11-15 18:32:50 -0800 | [diff] [blame] | 19 | #elif defined(CONFIG_TARGET_BSC9132QDS) |
Aneesh Bansal | bf955b2 | 2014-03-12 00:07:27 +0530 | [diff] [blame] | 20 | #define CONFIG_SYS_PBI_FLASH_BASE 0xc8000000 |
York Sun | c6c51ae | 2016-11-16 11:51:24 -0800 | [diff] [blame] | 21 | #elif defined(CONFIG_TARGET_C29XPCIE) |
Aneesh Bansal | 11421b4 | 2014-12-12 15:35:04 +0530 | [diff] [blame] | 22 | #define CONFIG_SYS_PBI_FLASH_BASE 0xcc000000 |
Ruchika Gupta | 8ca8d82 | 2010-12-15 17:02:08 +0000 | [diff] [blame] | 23 | #else |
| 24 | #define CONFIG_SYS_PBI_FLASH_BASE 0xce000000 |
| 25 | #endif |
| 26 | #define CONFIG_SYS_PBI_FLASH_WINDOW 0xcff80000 |
| 27 | |
Aneesh Bansal | c25baec | 2014-03-18 23:40:59 +0530 | [diff] [blame] | 28 | #if defined(CONFIG_B4860QDS) || \ |
| 29 | defined(CONFIG_T4240QDS) || \ |
Aneesh Bansal | a02a44b | 2014-03-18 23:41:14 +0530 | [diff] [blame] | 30 | defined(CONFIG_T2080QDS) || \ |
Aneesh Bansal | b642549 | 2014-04-22 15:17:06 +0530 | [diff] [blame] | 31 | defined(CONFIG_T2080RDB) || \ |
Aneesh Bansal | a02a44b | 2014-03-18 23:41:14 +0530 | [diff] [blame] | 32 | defined(CONFIG_T1040QDS) || \ |
gaurav rana | abfd448 | 2015-03-26 15:52:47 +0530 | [diff] [blame] | 33 | defined(CONFIG_T104xD4QDS) || \ |
Shengzhou Liu | e6fb770 | 2014-11-24 17:11:54 +0800 | [diff] [blame] | 34 | defined(CONFIG_T104xRDB) || \ |
gaurav rana | abfd448 | 2015-03-26 15:52:47 +0530 | [diff] [blame] | 35 | defined(CONFIG_T104xD4RDB) || \ |
Shengzhou Liu | e6fb770 | 2014-11-24 17:11:54 +0800 | [diff] [blame] | 36 | defined(CONFIG_PPC_T1023) || \ |
| 37 | defined(CONFIG_PPC_T1024) |
Sumit Garg | afaca2a | 2016-07-14 12:27:52 -0400 | [diff] [blame] | 38 | #ifndef CONFIG_SYS_RAMBOOT |
Aneesh Bansal | 8bcbc27 | 2014-03-18 23:40:26 +0530 | [diff] [blame] | 39 | #define CONFIG_SYS_CPC_REINIT_F |
Sumit Garg | afaca2a | 2016-07-14 12:27:52 -0400 | [diff] [blame] | 40 | #endif |
gaurav rana | 8b5ea65 | 2015-02-27 09:46:17 +0530 | [diff] [blame] | 41 | #define CONFIG_KEY_REVOCATION |
Aneesh Bansal | 8bcbc27 | 2014-03-18 23:40:26 +0530 | [diff] [blame] | 42 | #undef CONFIG_SYS_INIT_L3_ADDR |
| 43 | #define CONFIG_SYS_INIT_L3_ADDR 0xbff00000 |
| 44 | #endif |
| 45 | |
Aneesh Bansal | e0f5015 | 2015-06-16 10:36:00 +0530 | [diff] [blame] | 46 | #if defined(CONFIG_RAMBOOT_PBL) |
| 47 | #undef CONFIG_SYS_INIT_L3_ADDR |
Sumit Garg | afaca2a | 2016-07-14 12:27:52 -0400 | [diff] [blame] | 48 | #ifdef CONFIG_SYS_INIT_L3_VADDR |
| 49 | #define CONFIG_SYS_INIT_L3_ADDR \ |
| 50 | (CONFIG_SYS_INIT_L3_VADDR & ~0xFFF00000) | \ |
| 51 | 0xbff00000 |
| 52 | #else |
| 53 | #define CONFIG_SYS_INIT_L3_ADDR 0xbff00000 |
| 54 | #endif |
Aneesh Bansal | e0f5015 | 2015-06-16 10:36:00 +0530 | [diff] [blame] | 55 | #endif |
| 56 | |
York Sun | c6c51ae | 2016-11-16 11:51:24 -0800 | [diff] [blame] | 57 | #if defined(CONFIG_TARGET_C29XPCIE) |
gaurav rana | 8b5ea65 | 2015-02-27 09:46:17 +0530 | [diff] [blame] | 58 | #define CONFIG_KEY_REVOCATION |
| 59 | #endif |
| 60 | |
York Sun | df70d06 | 2016-11-18 11:20:40 -0800 | [diff] [blame] | 61 | #if defined(CONFIG_ARCH_P3041) || \ |
York Sun | 84be8a9 | 2016-11-18 11:24:40 -0800 | [diff] [blame] | 62 | defined(CONFIG_ARCH_P4080) || \ |
York Sun | 2ed73f4 | 2016-11-18 11:30:56 -0800 | [diff] [blame] | 63 | defined(CONFIG_ARCH_P5020) || \ |
York Sun | a3c5b66 | 2016-11-18 11:39:36 -0800 | [diff] [blame^] | 64 | defined(CONFIG_ARCH_P5040) || \ |
York Sun | 5786fca | 2016-11-18 11:15:21 -0800 | [diff] [blame] | 65 | defined(CONFIG_ARCH_P2041) |
gaurav rana | 8b5ea65 | 2015-02-27 09:46:17 +0530 | [diff] [blame] | 66 | #define CONFIG_FSL_TRUST_ARCH_v1 |
| 67 | #endif |
| 68 | |
Aneesh Bansal | d31bb3e | 2015-07-31 14:10:03 +0530 | [diff] [blame] | 69 | #if defined(CONFIG_FSL_CORENET) && !defined(CONFIG_SYS_RAMBOOT) |
gaurav rana | 8b5ea65 | 2015-02-27 09:46:17 +0530 | [diff] [blame] | 70 | /* The key used for verification of next level images |
| 71 | * is picked up from an Extension Table which has |
| 72 | * been verified by the ISBC (Internal Secure boot Code) |
Aneesh Bansal | d31bb3e | 2015-07-31 14:10:03 +0530 | [diff] [blame] | 73 | * in boot ROM of the SoC. |
| 74 | * The feature is only applicable in case of NOR boot and is |
| 75 | * not applicable in case of RAMBOOT (NAND, SD, SPI). |
gaurav rana | 8b5ea65 | 2015-02-27 09:46:17 +0530 | [diff] [blame] | 76 | */ |
| 77 | #define CONFIG_FSL_ISBC_KEY_EXT |
| 78 | #endif |
Aneesh Bansal | 4310470 | 2016-01-22 16:37:24 +0530 | [diff] [blame] | 79 | #endif /* #ifdef CONFIG_SECURE_BOOT */ |
gaurav rana | 8b5ea65 | 2015-02-27 09:46:17 +0530 | [diff] [blame] | 80 | |
Aneesh Bansal | 4310470 | 2016-01-22 16:37:24 +0530 | [diff] [blame] | 81 | #ifdef CONFIG_CHAIN_OF_TRUST |
Simon Glass | 3aa6612 | 2016-09-12 23:18:23 -0600 | [diff] [blame] | 82 | #ifdef CONFIG_SPL_BUILD |
Sumit Garg | f6d96cb | 2016-07-14 12:27:51 -0400 | [diff] [blame] | 83 | /* |
| 84 | * PPAACT and SPAACT table for PAMU must be placed on DDR after DDR init |
| 85 | * due to space crunch on CPC and thus malloc will not work. |
| 86 | */ |
| 87 | #define CONFIG_SPL_PPAACT_ADDR 0x2e000000 |
| 88 | #define CONFIG_SPL_SPAACT_ADDR 0x2f000000 |
| 89 | #define CONFIG_SPL_JR0_LIODN_S 454 |
| 90 | #define CONFIG_SPL_JR0_LIODN_NS 458 |
| 91 | /* |
| 92 | * Define the key hash for U-Boot here if public/private key pair used to |
| 93 | * sign U-boot are different from the SRK hash put in the fuse |
| 94 | * Example of defining KEY_HASH is |
| 95 | * #define CONFIG_SPL_UBOOT_KEY_HASH \ |
| 96 | * "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b" |
| 97 | * else leave it defined as NULL |
| 98 | */ |
| 99 | |
| 100 | #define CONFIG_SPL_UBOOT_KEY_HASH NULL |
| 101 | #endif /* ifdef CONFIG_SPL_BUILD */ |
| 102 | |
Aneesh Bansal | 4310470 | 2016-01-22 16:37:24 +0530 | [diff] [blame] | 103 | #define CONFIG_CMD_ESBC_VALIDATE |
| 104 | #define CONFIG_CMD_BLOB |
| 105 | #define CONFIG_FSL_SEC_MON |
| 106 | #define CONFIG_SHA_PROG_HW_ACCEL |
Aneesh Bansal | 4310470 | 2016-01-22 16:37:24 +0530 | [diff] [blame] | 107 | #define CONFIG_RSA_FREESCALE_EXP |
| 108 | |
Aneesh Bansal | 4310470 | 2016-01-22 16:37:24 +0530 | [diff] [blame] | 109 | #ifndef CONFIG_FSL_CAAM |
| 110 | #define CONFIG_FSL_CAAM |
| 111 | #endif |
| 112 | |
Sumit Garg | f6d96cb | 2016-07-14 12:27:51 -0400 | [diff] [blame] | 113 | #ifndef CONFIG_SPL_BUILD |
| 114 | /* |
| 115 | * fsl_setenv_chain_of_trust() must be called from |
Aneesh Bansal | c624909 | 2016-01-22 16:37:27 +0530 | [diff] [blame] | 116 | * board_late_init() |
| 117 | */ |
| 118 | #ifndef CONFIG_BOARD_LATE_INIT |
| 119 | #define CONFIG_BOARD_LATE_INIT |
| 120 | #endif |
| 121 | |
Aneesh Bansal | b69061d | 2015-06-16 10:36:43 +0530 | [diff] [blame] | 122 | /* If Boot Script is not on NOR and is required to be copied on RAM */ |
| 123 | #ifdef CONFIG_BOOTSCRIPT_COPY_RAM |
| 124 | #define CONFIG_BS_HDR_ADDR_RAM 0x00010000 |
Sumit Garg | 4564283 | 2016-06-14 13:52:39 -0400 | [diff] [blame] | 125 | #define CONFIG_BS_HDR_ADDR_DEVICE 0x00800000 |
Aneesh Bansal | b69061d | 2015-06-16 10:36:43 +0530 | [diff] [blame] | 126 | #define CONFIG_BS_HDR_SIZE 0x00002000 |
| 127 | #define CONFIG_BS_ADDR_RAM 0x00012000 |
Sumit Garg | 4564283 | 2016-06-14 13:52:39 -0400 | [diff] [blame] | 128 | #define CONFIG_BS_ADDR_DEVICE 0x00802000 |
Aneesh Bansal | b69061d | 2015-06-16 10:36:43 +0530 | [diff] [blame] | 129 | #define CONFIG_BS_SIZE 0x00001000 |
| 130 | |
| 131 | #define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_RAM |
| 132 | #else |
| 133 | |
gaurav rana | f79323c | 2015-03-10 14:08:50 +0530 | [diff] [blame] | 134 | /* The bootscript header address is different for B4860 because the NOR |
| 135 | * mapping is different on B4 due to reduced NOR size. |
| 136 | */ |
| 137 | #if defined(CONFIG_B4860QDS) |
| 138 | #define CONFIG_BOOTSCRIPT_HDR_ADDR 0xecc00000 |
| 139 | #elif defined(CONFIG_FSL_CORENET) |
| 140 | #define CONFIG_BOOTSCRIPT_HDR_ADDR 0xe8e00000 |
York Sun | 4620e1f | 2016-11-15 18:32:50 -0800 | [diff] [blame] | 141 | #elif defined(CONFIG_TARGET_BSC9132QDS) |
gaurav rana | f79323c | 2015-03-10 14:08:50 +0530 | [diff] [blame] | 142 | #define CONFIG_BOOTSCRIPT_HDR_ADDR 0x88020000 |
York Sun | c6c51ae | 2016-11-16 11:51:24 -0800 | [diff] [blame] | 143 | #elif defined(CONFIG_TARGET_C29XPCIE) |
gaurav rana | f79323c | 2015-03-10 14:08:50 +0530 | [diff] [blame] | 144 | #define CONFIG_BOOTSCRIPT_HDR_ADDR 0xec020000 |
| 145 | #else |
| 146 | #define CONFIG_BOOTSCRIPT_HDR_ADDR 0xee020000 |
| 147 | #endif |
| 148 | |
Aneesh Bansal | 4310470 | 2016-01-22 16:37:24 +0530 | [diff] [blame] | 149 | #endif /* #ifdef CONFIG_BOOTSCRIPT_COPY_RAM */ |
gaurav rana | f79323c | 2015-03-10 14:08:50 +0530 | [diff] [blame] | 150 | |
Aneesh Bansal | 4310470 | 2016-01-22 16:37:24 +0530 | [diff] [blame] | 151 | #include <config_fsl_chain_trust.h> |
Sumit Garg | f6d96cb | 2016-07-14 12:27:51 -0400 | [diff] [blame] | 152 | #endif /* #ifndef CONFIG_SPL_BUILD */ |
Aneesh Bansal | 4310470 | 2016-01-22 16:37:24 +0530 | [diff] [blame] | 153 | #endif /* #ifdef CONFIG_CHAIN_OF_TRUST */ |
Po Liu | d103009 | 2013-08-21 14:20:21 +0800 | [diff] [blame] | 154 | #endif |