fsl_secure_boot.h 3.6 KB

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