blob: ccb513fba24b7542b8cb35151443d5eb27991dbd [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).
41 */
Saksham Jain6121f082016-03-23 16:24:34 +053042#ifndef CONFIG_ESBC_HDR_LS
43/* Current Key EXT feature not available in LS ESBC Header */
Aneesh Bansald31bb3e2015-07-31 14:10:03 +053044#define CONFIG_FSL_ISBC_KEY_EXT
45#endif
46
Saksham Jain6121f082016-03-23 16:24:34 +053047#endif
48
York Suncbe8e1c2016-04-04 11:41:26 -070049#if defined(CONFIG_LS1043A) || defined(CONFIG_LS2080A)
Saksham Jainc0c38d22016-03-23 16:24:35 +053050/* For LS1043 (ARMv8), ESBC image Address in Header is 64 bit
York Suncbe8e1c2016-04-04 11:41:26 -070051 * Similiarly for LS2080
Saksham Jainc0c38d22016-03-23 16:24:35 +053052 */
Aneesh Bansal962021a2016-01-22 16:37:22 +053053#define CONFIG_ESBC_ADDR_64BIT
54#endif
55
York Suncbe8e1c2016-04-04 11:41:26 -070056#ifdef CONFIG_LS2080A
Saksham Jainf0eb2ca2016-03-23 16:24:38 +053057#define CONFIG_EXTRA_ENV \
58 "setenv fdt_high 0xa0000000;" \
59 "setenv initrd_high 0xcfffffff;" \
60 "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
61#else
gaurav ranaf79323c2015-03-10 14:08:50 +053062#define CONFIG_EXTRA_ENV \
Sumit Garg45642832016-06-14 13:52:39 -040063 "setenv fdt_high 0xffffffff;" \
64 "setenv initrd_high 0xffffffff;" \
gaurav ranaf79323c2015-03-10 14:08:50 +053065 "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
Saksham Jainf0eb2ca2016-03-23 16:24:38 +053066#endif
gaurav ranaf79323c2015-03-10 14:08:50 +053067
Saksham Jain503eab92016-03-23 16:24:37 +053068/* Copying Bootscript and Header to DDR from NOR for LS2 and for rest, from
69 * Non-XIP Memory (Nand/SD)*/
Udit Agarwal6b29d232017-01-06 15:58:56 +053070#if defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_FSL_LSCH3) || \
Sumit Garg45642832016-06-14 13:52:39 -040071 defined(CONFIG_SD_BOOT)
Saksham Jain503eab92016-03-23 16:24:37 +053072#define CONFIG_BOOTSCRIPT_COPY_RAM
73#endif
Sumit Garg45642832016-06-14 13:52:39 -040074/* The address needs to be modified according to NOR, NAND, SD and
75 * DDR memory map
76 */
Udit Agarwal6b29d232017-01-06 15:58:56 +053077#ifdef CONFIG_FSL_LSCH3
78#define CONFIG_BS_HDR_ADDR_DEVICE 0x580d00000
79#define CONFIG_BS_ADDR_DEVICE 0x580e00000
80#define CONFIG_BS_HDR_ADDR_RAM 0xa0d00000
81#define CONFIG_BS_ADDR_RAM 0xa0e00000
Sumit Garg45642832016-06-14 13:52:39 -040082#define CONFIG_BS_HDR_SIZE 0x00002000
83#define CONFIG_BS_SIZE 0x00001000
Saksham Jain503eab92016-03-23 16:24:37 +053084#else
Sumit Garg45642832016-06-14 13:52:39 -040085#ifdef CONFIG_SD_BOOT
86/* For SD boot address and size are assigned in terms of sector
87 * offset and no. of sectors respectively.
88 */
89#define CONFIG_BS_HDR_ADDR_DEVICE 0x00000800
90#define CONFIG_BS_ADDR_DEVICE 0x00000840
91#define CONFIG_BS_HDR_SIZE 0x00000010
92#define CONFIG_BS_SIZE 0x00000008
93#else
94#define CONFIG_BS_HDR_ADDR_DEVICE 0x600a0000
95#define CONFIG_BS_ADDR_DEVICE 0x60060000
96#define CONFIG_BS_HDR_SIZE 0x00002000
97#define CONFIG_BS_SIZE 0x00001000
98#endif /* #ifdef CONFIG_SD_BOOT */
99#define CONFIG_BS_HDR_ADDR_RAM 0x81000000
100#define CONFIG_BS_ADDR_RAM 0x81020000
Saksham Jain503eab92016-03-23 16:24:37 +0530101#endif
102
103#ifdef CONFIG_BOOTSCRIPT_COPY_RAM
104#define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_RAM
Saksham Jain503eab92016-03-23 16:24:37 +0530105#define CONFIG_BOOTSCRIPT_ADDR CONFIG_BS_ADDR_RAM
Saksham Jain506c2eb2016-03-23 16:24:36 +0530106#else
Sumit Garg45642832016-06-14 13:52:39 -0400107#define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_DEVICE
108/* BOOTSCRIPT_ADDR is not required */
Saksham Jain506c2eb2016-03-23 16:24:36 +0530109#endif
gaurav ranaf79323c2015-03-10 14:08:50 +0530110
Sumit Garge0f9e9b2016-09-01 12:56:44 -0400111#ifdef CONFIG_FSL_LS_PPA
112#ifdef CONFIG_SYS_LS_PPA_FW_IN_XIP
113#ifdef CONFIG_LS1043A
114#define CONFIG_SYS_LS_PPA_ESBC_ADDR 0x600c0000
115#endif
116#else
117#error "No CONFIG_SYS_LS_PPA_FW_IN_xxx defined"
118#endif /* ifdef CONFIG_SYS_LS_PPA_FW_IN_XIP */
119
120/* Define the key hash here if SRK used for signing PPA image is
121 * different from SRK hash put in SFP used for U-Boot.
122 * Example
123 * #define CONFIG_PPA_KEY_HASH \
124 * "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b"
125 */
126#define CONFIG_PPA_KEY_HASH NULL
127#endif /* ifdef CONFIG_FSL_LS_PPA */
128
Aneesh Bansal43104702016-01-22 16:37:24 +0530129#include <config_fsl_chain_trust.h>
Sumit Gargbdddd6e2016-06-14 13:52:38 -0400130#endif /* #ifndef CONFIG_SPL_BUILD */
Aneesh Bansal43104702016-01-22 16:37:24 +0530131#endif /* #ifdef CONFIG_CHAIN_OF_TRUST */
gaurav ranaf79323c2015-03-10 14:08:50 +0530132#endif