fsl_secure_boot.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. #define CONFIG_SPL_HASH_SUPPORT
  24. #define CONFIG_SPL_DRIVERS_MISC_SUPPORT
  25. #ifdef CONFIG_SPL_BUILD
  26. /*
  27. * Define the key hash for U-Boot here if public/private key pair used to
  28. * sign U-boot are different from the SRK hash put in the fuse
  29. * Example of defining KEY_HASH is
  30. * #define CONFIG_SPL_UBOOT_KEY_HASH \
  31. * "41066b564c6ffcef40ccbc1e0a5d0d519604000c785d97bbefd25e4d288d1c8b"
  32. * else leave it defined as NULL
  33. */
  34. #define CONFIG_SPL_UBOOT_KEY_HASH NULL
  35. #endif /* ifdef CONFIG_SPL_BUILD */
  36. #ifndef CONFIG_SPL_BUILD
  37. #define CONFIG_CMD_BLOB
  38. #define CONFIG_CMD_HASH
  39. #define CONFIG_KEY_REVOCATION
  40. #ifndef CONFIG_SYS_RAMBOOT
  41. /* The key used for verification of next level images
  42. * is picked up from an Extension Table which has
  43. * been verified by the ISBC (Internal Secure boot Code)
  44. * in boot ROM of the SoC.
  45. * The feature is only applicable in case of NOR boot and is
  46. * not applicable in case of RAMBOOT (NAND, SD, SPI).
  47. */
  48. #ifndef CONFIG_ESBC_HDR_LS
  49. /* Current Key EXT feature not available in LS ESBC Header */
  50. #define CONFIG_FSL_ISBC_KEY_EXT
  51. #endif
  52. #endif
  53. #if defined(CONFIG_LS1043A) || defined(CONFIG_LS2080A)
  54. /* For LS1043 (ARMv8), ESBC image Address in Header is 64 bit
  55. * Similiarly for LS2080
  56. */
  57. #define CONFIG_ESBC_ADDR_64BIT
  58. #endif
  59. #ifdef CONFIG_LS2080A
  60. #define CONFIG_EXTRA_ENV \
  61. "setenv fdt_high 0xa0000000;" \
  62. "setenv initrd_high 0xcfffffff;" \
  63. "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
  64. #else
  65. #define CONFIG_EXTRA_ENV \
  66. "setenv fdt_high 0xffffffff;" \
  67. "setenv initrd_high 0xffffffff;" \
  68. "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
  69. #endif
  70. /* Copying Bootscript and Header to DDR from NOR for LS2 and for rest, from
  71. * Non-XIP Memory (Nand/SD)*/
  72. #if defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_LS2080A) || \
  73. defined(CONFIG_SD_BOOT)
  74. #define CONFIG_BOOTSCRIPT_COPY_RAM
  75. #endif
  76. /* The address needs to be modified according to NOR, NAND, SD and
  77. * DDR memory map
  78. */
  79. #ifdef CONFIG_LS2080A
  80. #define CONFIG_BS_HDR_ADDR_DEVICE 0x583920000
  81. #define CONFIG_BS_ADDR_DEVICE 0x583900000
  82. #define CONFIG_BS_HDR_ADDR_RAM 0xa3920000
  83. #define CONFIG_BS_ADDR_RAM 0xa3900000
  84. #define CONFIG_BS_HDR_SIZE 0x00002000
  85. #define CONFIG_BS_SIZE 0x00001000
  86. #else
  87. #ifdef CONFIG_SD_BOOT
  88. /* For SD boot address and size are assigned in terms of sector
  89. * offset and no. of sectors respectively.
  90. */
  91. #define CONFIG_BS_HDR_ADDR_DEVICE 0x00000800
  92. #define CONFIG_BS_ADDR_DEVICE 0x00000840
  93. #define CONFIG_BS_HDR_SIZE 0x00000010
  94. #define CONFIG_BS_SIZE 0x00000008
  95. #else
  96. #define CONFIG_BS_HDR_ADDR_DEVICE 0x600a0000
  97. #define CONFIG_BS_ADDR_DEVICE 0x60060000
  98. #define CONFIG_BS_HDR_SIZE 0x00002000
  99. #define CONFIG_BS_SIZE 0x00001000
  100. #endif /* #ifdef CONFIG_SD_BOOT */
  101. #define CONFIG_BS_HDR_ADDR_RAM 0x81000000
  102. #define CONFIG_BS_ADDR_RAM 0x81020000
  103. #endif
  104. #ifdef CONFIG_BOOTSCRIPT_COPY_RAM
  105. #define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_RAM
  106. #define CONFIG_BOOTSCRIPT_ADDR CONFIG_BS_ADDR_RAM
  107. #else
  108. #define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_DEVICE
  109. /* BOOTSCRIPT_ADDR is not required */
  110. #endif
  111. #include <config_fsl_chain_trust.h>
  112. #endif /* #ifndef CONFIG_SPL_BUILD */
  113. #endif /* #ifdef CONFIG_CHAIN_OF_TRUST */
  114. #endif