fsl_secure_boot.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. * Copyright 2015 Freescale Semiconductor, Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __FSL_SECURE_BOOT_H
  7. #define __FSL_SECURE_BOOT_H
  8. #ifdef CONFIG_SECURE_BOOT
  9. #ifndef CONFIG_FIT_SIGNATURE
  10. #define CONFIG_CHAIN_OF_TRUST
  11. #endif
  12. #endif
  13. #ifdef CONFIG_CHAIN_OF_TRUST
  14. #define CONFIG_CMD_ESBC_VALIDATE
  15. #define CONFIG_FSL_SEC_MON
  16. #define CONFIG_SHA_HW_ACCEL
  17. #define CONFIG_SHA_PROG_HW_ACCEL
  18. #define CONFIG_RSA_FREESCALE_EXP
  19. #ifndef CONFIG_FSL_CAAM
  20. #define CONFIG_FSL_CAAM
  21. #endif
  22. #define CONFIG_SPL_BOARD_INIT
  23. #ifdef CONFIG_SPL_BUILD
  24. /*
  25. * Define the key hash for U-Boot here if public/private key pair used to
  26. * sign U-boot are different from the SRK hash put in the fuse
  27. * Example of defining KEY_HASH is
  28. * #define CONFIG_SPL_UBOOT_KEY_HASH \
  29. * "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b"
  30. * else leave it defined as NULL
  31. */
  32. #define CONFIG_SPL_UBOOT_KEY_HASH NULL
  33. #endif /* ifdef CONFIG_SPL_BUILD */
  34. #ifndef CONFIG_SPL_BUILD
  35. #define CONFIG_CMD_BLOB
  36. #define CONFIG_CMD_HASH
  37. #define CONFIG_KEY_REVOCATION
  38. #ifndef CONFIG_SYS_RAMBOOT
  39. /* The key used for verification of next level images
  40. * is picked up from an Extension Table which has
  41. * been verified by the ISBC (Internal Secure boot Code)
  42. * in boot ROM of the SoC.
  43. * The feature is only applicable in case of NOR boot and is
  44. * not applicable in case of RAMBOOT (NAND, SD, SPI).
  45. */
  46. #ifndef CONFIG_ESBC_HDR_LS
  47. /* Current Key EXT feature not available in LS ESBC Header */
  48. #define CONFIG_FSL_ISBC_KEY_EXT
  49. #endif
  50. #endif
  51. #if defined(CONFIG_LS1043A) || defined(CONFIG_LS2080A)
  52. /* For LS1043 (ARMv8), ESBC image Address in Header is 64 bit
  53. * Similiarly for LS2080
  54. */
  55. #define CONFIG_ESBC_ADDR_64BIT
  56. #endif
  57. #ifdef CONFIG_LS2080A
  58. #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
  63. #define CONFIG_EXTRA_ENV \
  64. "setenv fdt_high 0xffffffff;" \
  65. "setenv initrd_high 0xffffffff;" \
  66. "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
  67. #endif
  68. /* Copying Bootscript and Header to DDR from NOR for LS2 and for rest, from
  69. * Non-XIP Memory (Nand/SD)*/
  70. #if defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_LS2080A) || \
  71. defined(CONFIG_SD_BOOT)
  72. #define CONFIG_BOOTSCRIPT_COPY_RAM
  73. #endif
  74. /* The address needs to be modified according to NOR, NAND, SD and
  75. * DDR memory map
  76. */
  77. #ifdef CONFIG_LS2080A
  78. #define CONFIG_BS_HDR_ADDR_DEVICE 0x583920000
  79. #define CONFIG_BS_ADDR_DEVICE 0x583900000
  80. #define CONFIG_BS_HDR_ADDR_RAM 0xa3920000
  81. #define CONFIG_BS_ADDR_RAM 0xa3900000
  82. #define CONFIG_BS_HDR_SIZE 0x00002000
  83. #define CONFIG_BS_SIZE 0x00001000
  84. #else
  85. #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
  101. #endif
  102. #ifdef CONFIG_BOOTSCRIPT_COPY_RAM
  103. #define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_RAM
  104. #define CONFIG_BOOTSCRIPT_ADDR CONFIG_BS_ADDR_RAM
  105. #else
  106. #define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_DEVICE
  107. /* BOOTSCRIPT_ADDR is not required */
  108. #endif
  109. #ifdef CONFIG_FSL_LS_PPA
  110. #ifdef CONFIG_SYS_LS_PPA_FW_IN_XIP
  111. #ifdef CONFIG_LS1043A
  112. #define CONFIG_SYS_LS_PPA_ESBC_ADDR 0x600c0000
  113. #endif
  114. #else
  115. #error "No CONFIG_SYS_LS_PPA_FW_IN_xxx defined"
  116. #endif /* ifdef CONFIG_SYS_LS_PPA_FW_IN_XIP */
  117. /* Define the key hash here if SRK used for signing PPA image is
  118. * different from SRK hash put in SFP used for U-Boot.
  119. * Example
  120. * #define CONFIG_PPA_KEY_HASH \
  121. * "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b"
  122. */
  123. #define CONFIG_PPA_KEY_HASH NULL
  124. #endif /* ifdef CONFIG_FSL_LS_PPA */
  125. #include <config_fsl_chain_trust.h>
  126. #endif /* #ifndef CONFIG_SPL_BUILD */
  127. #endif /* #ifdef CONFIG_CHAIN_OF_TRUST */
  128. #endif