fsl_secure_boot.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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_CMD_BLOB
  16. #define CONFIG_CMD_HASH
  17. #define CONFIG_FSL_SEC_MON
  18. #define CONFIG_SHA_HW_ACCEL
  19. #define CONFIG_SHA_PROG_HW_ACCEL
  20. #define CONFIG_RSA_FREESCALE_EXP
  21. #ifndef CONFIG_FSL_CAAM
  22. #define CONFIG_FSL_CAAM
  23. #endif
  24. #define CONFIG_KEY_REVOCATION
  25. #ifndef CONFIG_SYS_RAMBOOT
  26. /* The key used for verification of next level images
  27. * is picked up from an Extension Table which has
  28. * been verified by the ISBC (Internal Secure boot Code)
  29. * in boot ROM of the SoC.
  30. * The feature is only applicable in case of NOR boot and is
  31. * not applicable in case of RAMBOOT (NAND, SD, SPI).
  32. */
  33. #ifndef CONFIG_ESBC_HDR_LS
  34. /* Current Key EXT feature not available in LS ESBC Header */
  35. #define CONFIG_FSL_ISBC_KEY_EXT
  36. #endif
  37. #endif
  38. #if defined(CONFIG_LS1043A) || defined(CONFIG_LS2080A)
  39. /* For LS1043 (ARMv8), ESBC image Address in Header is 64 bit
  40. * Similiarly for LS2080
  41. */
  42. #define CONFIG_ESBC_ADDR_64BIT
  43. #endif
  44. #ifdef CONFIG_LS2080A
  45. #define CONFIG_EXTRA_ENV \
  46. "setenv fdt_high 0xa0000000;" \
  47. "setenv initrd_high 0xcfffffff;" \
  48. "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
  49. #else
  50. #define CONFIG_EXTRA_ENV \
  51. "setenv fdt_high 0xcfffffff;" \
  52. "setenv initrd_high 0xcfffffff;" \
  53. "setenv hwconfig \'fsl_ddr:ctlr_intlv=null,bank_intlv=null\';"
  54. #endif
  55. /* Copying Bootscript and Header to DDR from NOR for LS2 and for rest, from
  56. * Non-XIP Memory (Nand/SD)*/
  57. #if defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_LS2080A)
  58. #define CONFIG_BOOTSCRIPT_COPY_RAM
  59. #endif
  60. /* The address needs to be modified according to NOR and DDR memory map */
  61. #ifdef CONFIG_LS2080A
  62. #define CONFIG_BS_HDR_ADDR_FLASH 0x583920000
  63. #define CONFIG_BS_ADDR_FLASH 0x583900000
  64. #define CONFIG_BS_HDR_ADDR_RAM 0xa3920000
  65. #define CONFIG_BS_ADDR_RAM 0xa3900000
  66. #else
  67. #define CONFIG_BS_HDR_ADDR_FLASH 0x600a0000
  68. #define CONFIG_BS_ADDR_FLASH 0x60060000
  69. #define CONFIG_BS_HDR_ADDR_RAM 0xa0060000
  70. #define CONFIG_BS_ADDR_RAM 0xa0060000
  71. #endif
  72. #ifdef CONFIG_BOOTSCRIPT_COPY_RAM
  73. #define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_RAM
  74. #define CONFIG_BS_HDR_SIZE 0x00002000
  75. #define CONFIG_BOOTSCRIPT_ADDR CONFIG_BS_ADDR_RAM
  76. #define CONFIG_BS_SIZE 0x00001000
  77. #else
  78. #define CONFIG_BOOTSCRIPT_HDR_ADDR CONFIG_BS_HDR_ADDR_FLASH
  79. /* BS_HDR_SIZE, BOOTSCRIPT_ADDR and BS_SIZE are not required */
  80. #endif
  81. #include <config_fsl_chain_trust.h>
  82. #endif /* #ifdef CONFIG_CHAIN_OF_TRUST */
  83. #endif