blob: cbf92fbb7bdaef1875a15fff44ffa35bacf56624 [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
Sumit Gargbdddd6e2016-06-14 13:52:38 -040016#define CONFIG_SPL_BOARD_INIT
Simon Glass3aa66122016-09-12 23:18:23 -060017#ifdef CONFIG_SPL_BUILD
Sumit Gargbdddd6e2016-06-14 13:52:38 -040018/*
19 * Define the key hash for U-Boot here if public/private key pair used to
20 * sign U-boot are different from the SRK hash put in the fuse
21 * Example of defining KEY_HASH is
22 * #define CONFIG_SPL_UBOOT_KEY_HASH \
23 * "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b"
24 * else leave it defined as NULL
25 */
26
27#define CONFIG_SPL_UBOOT_KEY_HASH NULL
28#endif /* ifdef CONFIG_SPL_BUILD */
29
30#ifndef CONFIG_SPL_BUILD
31#define CONFIG_CMD_BLOB
32#define CONFIG_CMD_HASH
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053033#define CONFIG_KEY_REVOCATION
34#ifndef CONFIG_SYS_RAMBOOT
35/* The key used for verification of next level images
36 * is picked up from an Extension Table which has
37 * been verified by the ISBC (Internal Secure boot Code)
38 * in boot ROM of the SoC.
39 * The feature is only applicable in case of NOR boot and is
40 * not applicable in case of RAMBOOT (NAND, SD, SPI).
Udit Agarwal990a9972017-02-09 21:36:11 +053041 * For LS, this feature is available for all device if IE Table
42 * is copied to XIP memory
43 * Also, for LS, ISBC doesn't verify this table.
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053044 */
45#define CONFIG_FSL_ISBC_KEY_EXT
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053046
Saksham Jain6121f082016-03-23 16:24:34 +053047#endif
48
Vinitha Pillai-B572238a3c6452017-03-23 13:48:16 +053049#if defined(CONFIG_FSL_LAYERSCAPE)
50/*
51 * For fsl layerscape based platforms, ESBC image Address in Header
52 * is 64 bit.
Saksham Jainc0c38d22016-03-23 16:24:35 +053053 */
Aneesh Bansal962021a2016-01-22 16:37:22 +053054#define CONFIG_ESBC_ADDR_64BIT
55#endif
56
York Suncbe8e1c2016-04-04 11:41:26 -070057#ifdef CONFIG_LS2080A
Saksham Jainf0eb2ca2016-03-23 16:24:38 +053058#define CONFIG_EXTRA_ENV \
59 "setenv fdt_high 0xa0000000;" \
60 "setenv initrd_high 0xcfffffff;" \
61 "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
62#else
gaurav ranaf79323c2015-03-10 14:08:50 +053063#define CONFIG_EXTRA_ENV \
Sumit Garg45642832016-06-14 13:52:39 -040064 "setenv fdt_high 0xffffffff;" \
65 "setenv initrd_high 0xffffffff;" \
gaurav ranaf79323c2015-03-10 14:08:50 +053066 "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
Saksham Jainf0eb2ca2016-03-23 16:24:38 +053067#endif
gaurav ranaf79323c2015-03-10 14:08:50 +053068
Saksham Jain503eab92016-03-23 16:24:37 +053069/* Copying Bootscript and Header to DDR from NOR for LS2 and for rest, from
70 * Non-XIP Memory (Nand/SD)*/
Udit Agarwal6b29d232017-01-06 15:58:56 +053071#if defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_FSL_LSCH3) || \
Sumit Garg45642832016-06-14 13:52:39 -040072 defined(CONFIG_SD_BOOT)
Saksham Jain503eab92016-03-23 16:24:37 +053073#define CONFIG_BOOTSCRIPT_COPY_RAM
74#endif
Sumit Garg45642832016-06-14 13:52:39 -040075/* The address needs to be modified according to NOR, NAND, SD and
76 * DDR memory map
77 */
Udit Agarwal6b29d232017-01-06 15:58:56 +053078#ifdef CONFIG_FSL_LSCH3
79#define CONFIG_BS_HDR_ADDR_DEVICE 0x580d00000
80#define CONFIG_BS_ADDR_DEVICE 0x580e00000
81#define CONFIG_BS_HDR_ADDR_RAM 0xa0d00000
82#define CONFIG_BS_ADDR_RAM 0xa0e00000
Sumit Garg45642832016-06-14 13:52:39 -040083#define CONFIG_BS_HDR_SIZE 0x00002000
84#define CONFIG_BS_SIZE 0x00001000
Saksham Jain503eab92016-03-23 16:24:37 +053085#else
Sumit Garg45642832016-06-14 13:52:39 -040086#ifdef CONFIG_SD_BOOT
87/* For SD boot address and size are assigned in terms of sector
88 * offset and no. of sectors respectively.
89 */
Vinitha Pillai31b11c62017-02-01 18:28:53 +053090#define CONFIG_BS_HDR_ADDR_DEVICE 0x00000900
91#define CONFIG_BS_ADDR_DEVICE 0x00000940
Sumit Garg45642832016-06-14 13:52:39 -040092#define CONFIG_BS_HDR_SIZE 0x00000010
93#define CONFIG_BS_SIZE 0x00000008
Vinitha Pillai-B572238a3c6452017-03-23 13:48:16 +053094#elif defined(CONFIG_QSPI_BOOT)
95#ifdef CONFIG_ARCH_LS1046A
96#define CONFIG_BS_HDR_ADDR_DEVICE 0x40780000
97#define CONFIG_BS_ADDR_DEVICE 0x40800000
Sumit Garg45642832016-06-14 13:52:39 -040098#else
Vinitha Pillai-B572238a3c6452017-03-23 13:48:16 +053099#error "Platform not supported"
100#endif
101#define CONFIG_BS_HDR_SIZE 0x00002000
102#define CONFIG_BS_SIZE 0x00001000
103#else /* Default NOR Boot */
Sumit Garg45642832016-06-14 13:52:39 -0400104#define CONFIG_BS_HDR_ADDR_DEVICE 0x600a0000
105#define CONFIG_BS_ADDR_DEVICE 0x60060000
106#define CONFIG_BS_HDR_SIZE 0x00002000
107#define CONFIG_BS_SIZE 0x00001000
Vinitha Pillai-B572238a3c6452017-03-23 13:48:16 +0530108#endif
Sumit Garg45642832016-06-14 13:52:39 -0400109#define CONFIG_BS_HDR_ADDR_RAM 0x81000000
110#define CONFIG_BS_ADDR_RAM 0x81020000
Saksham Jain503eab92016-03-23 16:24:37 +0530111#endif
112
113#ifdef CONFIG_BOOTSCRIPT_COPY_RAM
114#define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_RAM
Saksham Jain503eab92016-03-23 16:24:37 +0530115#define CONFIG_BOOTSCRIPT_ADDR CONFIG_BS_ADDR_RAM
Saksham Jain506c2eb2016-03-23 16:24:36 +0530116#else
Sumit Garg45642832016-06-14 13:52:39 -0400117#define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_DEVICE
118/* BOOTSCRIPT_ADDR is not required */
Saksham Jain506c2eb2016-03-23 16:24:36 +0530119#endif
gaurav ranaf79323c2015-03-10 14:08:50 +0530120
Sumit Garge0f9e9b2016-09-01 12:56:44 -0400121#ifdef CONFIG_FSL_LS_PPA
Sumit Garge0f9e9b2016-09-01 12:56:44 -0400122/* Define the key hash here if SRK used for signing PPA image is
123 * different from SRK hash put in SFP used for U-Boot.
124 * Example
Vinitha Pillai-B57223a4b3ded2017-03-23 13:48:14 +0530125 * #define PPA_KEY_HASH \
Sumit Garge0f9e9b2016-09-01 12:56:44 -0400126 * "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b"
127 */
Vinitha Pillai-B57223a4b3ded2017-03-23 13:48:14 +0530128#define PPA_KEY_HASH NULL
Sumit Garge0f9e9b2016-09-01 12:56:44 -0400129#endif /* ifdef CONFIG_FSL_LS_PPA */
130
Aneesh Bansal43104702016-01-22 16:37:24 +0530131#include <config_fsl_chain_trust.h>
Sumit Gargbdddd6e2016-06-14 13:52:38 -0400132#endif /* #ifndef CONFIG_SPL_BUILD */
Aneesh Bansal43104702016-01-22 16:37:24 +0530133#endif /* #ifdef CONFIG_CHAIN_OF_TRUST */
gaurav ranaf79323c2015-03-10 14:08:50 +0530134#endif