blob: 17ca5409080a47373bd36b5320cc9ea6df16b8f5 [file] [log] [blame]
gaurav ranaf79323c2015-03-10 14:08:50 +05301/*
2 * Copyright 2015 Freescale Semiconductor, Inc.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#ifndef __FSL_SECURE_BOOT_H
8#define __FSL_SECURE_BOOT_H
9
Aneesh Bansal43104702016-01-22 16:37:24 +053010#ifdef CONFIG_CHAIN_OF_TRUST
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053011#define CONFIG_CMD_ESBC_VALIDATE
12#define CONFIG_FSL_SEC_MON
Saksham Jainc0c38d22016-03-23 16:24:35 +053013#define CONFIG_SHA_HW_ACCEL
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053014#define CONFIG_SHA_PROG_HW_ACCEL
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053015#define CONFIG_RSA_FREESCALE_EXP
Aneesh Bansalb3e98202015-12-08 13:54:29 +053016
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053017#ifndef CONFIG_FSL_CAAM
18#define CONFIG_FSL_CAAM
19#endif
20
Sumit Gargbdddd6e2016-06-14 13:52:38 -040021#define CONFIG_SPL_BOARD_INIT
Simon Glass3aa66122016-09-12 23:18:23 -060022#ifdef CONFIG_SPL_BUILD
Sumit Gargbdddd6e2016-06-14 13:52:38 -040023/*
24 * Define the key hash for U-Boot here if public/private key pair used to
25 * sign U-boot are different from the SRK hash put in the fuse
26 * Example of defining KEY_HASH is
27 * #define CONFIG_SPL_UBOOT_KEY_HASH \
28 * "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b"
29 * else leave it defined as NULL
30 */
31
32#define CONFIG_SPL_UBOOT_KEY_HASH NULL
33#endif /* ifdef CONFIG_SPL_BUILD */
34
35#ifndef CONFIG_SPL_BUILD
36#define CONFIG_CMD_BLOB
37#define CONFIG_CMD_HASH
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053038#define CONFIG_KEY_REVOCATION
39#ifndef CONFIG_SYS_RAMBOOT
40/* The key used for verification of next level images
41 * is picked up from an Extension Table which has
42 * been verified by the ISBC (Internal Secure boot Code)
43 * in boot ROM of the SoC.
44 * The feature is only applicable in case of NOR boot and is
45 * not applicable in case of RAMBOOT (NAND, SD, SPI).
46 */
Saksham Jain6121f082016-03-23 16:24:34 +053047#ifndef CONFIG_ESBC_HDR_LS
48/* Current Key EXT feature not available in LS ESBC Header */
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053049#define CONFIG_FSL_ISBC_KEY_EXT
50#endif
51
Saksham Jain6121f082016-03-23 16:24:34 +053052#endif
53
York Suncbe8e1c2016-04-04 11:41:26 -070054#if defined(CONFIG_LS1043A) || defined(CONFIG_LS2080A)
Saksham Jainc0c38d22016-03-23 16:24:35 +053055/* For LS1043 (ARMv8), ESBC image Address in Header is 64 bit
York Suncbe8e1c2016-04-04 11:41:26 -070056 * Similiarly for LS2080
Saksham Jainc0c38d22016-03-23 16:24:35 +053057 */
Aneesh Bansal962021a2016-01-22 16:37:22 +053058#define CONFIG_ESBC_ADDR_64BIT
59#endif
60
York Suncbe8e1c2016-04-04 11:41:26 -070061#ifdef CONFIG_LS2080A
Saksham Jainf0eb2ca2016-03-23 16:24:38 +053062#define CONFIG_EXTRA_ENV \
63 "setenv fdt_high 0xa0000000;" \
64 "setenv initrd_high 0xcfffffff;" \
65 "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
66#else
gaurav ranaf79323c2015-03-10 14:08:50 +053067#define CONFIG_EXTRA_ENV \
Sumit Garg45642832016-06-14 13:52:39 -040068 "setenv fdt_high 0xffffffff;" \
69 "setenv initrd_high 0xffffffff;" \
gaurav ranaf79323c2015-03-10 14:08:50 +053070 "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
Saksham Jainf0eb2ca2016-03-23 16:24:38 +053071#endif
gaurav ranaf79323c2015-03-10 14:08:50 +053072
Saksham Jain503eab92016-03-23 16:24:37 +053073/* Copying Bootscript and Header to DDR from NOR for LS2 and for rest, from
74 * Non-XIP Memory (Nand/SD)*/
Udit Agarwal6b29d232017-01-06 15:58:56 +053075#if defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_FSL_LSCH3) || \
Sumit Garg45642832016-06-14 13:52:39 -040076 defined(CONFIG_SD_BOOT)
Saksham Jain503eab92016-03-23 16:24:37 +053077#define CONFIG_BOOTSCRIPT_COPY_RAM
78#endif
Sumit Garg45642832016-06-14 13:52:39 -040079/* The address needs to be modified according to NOR, NAND, SD and
80 * DDR memory map
81 */
Udit Agarwal6b29d232017-01-06 15:58:56 +053082#ifdef CONFIG_FSL_LSCH3
83#define CONFIG_BS_HDR_ADDR_DEVICE 0x580d00000
84#define CONFIG_BS_ADDR_DEVICE 0x580e00000
85#define CONFIG_BS_HDR_ADDR_RAM 0xa0d00000
86#define CONFIG_BS_ADDR_RAM 0xa0e00000
Sumit Garg45642832016-06-14 13:52:39 -040087#define CONFIG_BS_HDR_SIZE 0x00002000
88#define CONFIG_BS_SIZE 0x00001000
Saksham Jain503eab92016-03-23 16:24:37 +053089#else
Sumit Garg45642832016-06-14 13:52:39 -040090#ifdef CONFIG_SD_BOOT
91/* For SD boot address and size are assigned in terms of sector
92 * offset and no. of sectors respectively.
93 */
94#define CONFIG_BS_HDR_ADDR_DEVICE 0x00000800
95#define CONFIG_BS_ADDR_DEVICE 0x00000840
96#define CONFIG_BS_HDR_SIZE 0x00000010
97#define CONFIG_BS_SIZE 0x00000008
98#else
99#define CONFIG_BS_HDR_ADDR_DEVICE 0x600a0000
100#define CONFIG_BS_ADDR_DEVICE 0x60060000
101#define CONFIG_BS_HDR_SIZE 0x00002000
102#define CONFIG_BS_SIZE 0x00001000
103#endif /* #ifdef CONFIG_SD_BOOT */
104#define CONFIG_BS_HDR_ADDR_RAM 0x81000000
105#define CONFIG_BS_ADDR_RAM 0x81020000
Saksham Jain503eab92016-03-23 16:24:37 +0530106#endif
107
108#ifdef CONFIG_BOOTSCRIPT_COPY_RAM
109#define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_RAM
Saksham Jain503eab92016-03-23 16:24:37 +0530110#define CONFIG_BOOTSCRIPT_ADDR CONFIG_BS_ADDR_RAM
Saksham Jain506c2eb2016-03-23 16:24:36 +0530111#else
Sumit Garg45642832016-06-14 13:52:39 -0400112#define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_DEVICE
113/* BOOTSCRIPT_ADDR is not required */
Saksham Jain506c2eb2016-03-23 16:24:36 +0530114#endif
gaurav ranaf79323c2015-03-10 14:08:50 +0530115
Sumit Garge0f9e9b2016-09-01 12:56:44 -0400116#ifdef CONFIG_FSL_LS_PPA
117#ifdef CONFIG_SYS_LS_PPA_FW_IN_XIP
118#ifdef CONFIG_LS1043A
119#define CONFIG_SYS_LS_PPA_ESBC_ADDR 0x600c0000
120#endif
121#else
122#error "No CONFIG_SYS_LS_PPA_FW_IN_xxx defined"
123#endif /* ifdef CONFIG_SYS_LS_PPA_FW_IN_XIP */
124
125/* Define the key hash here if SRK used for signing PPA image is
126 * different from SRK hash put in SFP used for U-Boot.
127 * Example
128 * #define CONFIG_PPA_KEY_HASH \
129 * "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b"
130 */
131#define CONFIG_PPA_KEY_HASH NULL
132#endif /* ifdef CONFIG_FSL_LS_PPA */
133
Aneesh Bansal43104702016-01-22 16:37:24 +0530134#include <config_fsl_chain_trust.h>
Sumit Gargbdddd6e2016-06-14 13:52:38 -0400135#endif /* #ifndef CONFIG_SPL_BUILD */
Aneesh Bansal43104702016-01-22 16:37:24 +0530136#endif /* #ifdef CONFIG_CHAIN_OF_TRUST */
gaurav ranaf79323c2015-03-10 14:08:50 +0530137#endif