fsl_secure_boot.h 4.0 KB

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