plat_def.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Copyright 2018-2021 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef PLAT_DEF_H
  8. #define PLAT_DEF_H
  9. #include <arch.h>
  10. #include <cortex_a72.h>
  11. /* Required without TBBR.
  12. * To include the defines for DDR PHY
  13. * Images.
  14. */
  15. #include <tbbr_img_def.h>
  16. #include <policy.h>
  17. #include <soc.h>
  18. #if defined(IMAGE_BL31)
  19. #define LS_SYS_TIMCTL_BASE 0x2890000
  20. #define PLAT_LS_NSTIMER_FRAME_ID 0
  21. #define LS_CONFIG_CNTACR 1
  22. #endif
  23. #define NXP_SYSCLK_FREQ 100000000
  24. #define NXP_DDRCLK_FREQ 100000000
  25. /* UART related definition */
  26. #define NXP_CONSOLE_ADDR NXP_UART_ADDR
  27. #define NXP_CONSOLE_BAUDRATE 115200
  28. /* Size of cacheable stacks */
  29. #if defined(IMAGE_BL2)
  30. #if defined(TRUSTED_BOARD_BOOT)
  31. #define PLATFORM_STACK_SIZE 0x2000
  32. #else
  33. #define PLATFORM_STACK_SIZE 0x1000
  34. #endif
  35. #elif defined(IMAGE_BL31)
  36. #define PLATFORM_STACK_SIZE 0x1000
  37. #endif
  38. /* SD block buffer */
  39. #define NXP_SD_BLOCK_BUF_SIZE (0x8000)
  40. #define NXP_SD_BLOCK_BUF_ADDR (NXP_OCRAM_ADDR + NXP_OCRAM_SIZE \
  41. - NXP_SD_BLOCK_BUF_SIZE)
  42. #ifdef SD_BOOT
  43. #define BL2_LIMIT (NXP_OCRAM_ADDR + NXP_OCRAM_SIZE \
  44. - NXP_SD_BLOCK_BUF_SIZE)
  45. #else
  46. #define BL2_LIMIT (NXP_OCRAM_ADDR + NXP_OCRAM_SIZE)
  47. #endif
  48. /* IO defines as needed by IO driver framework */
  49. #define MAX_IO_DEVICES 4
  50. #define MAX_IO_BLOCK_DEVICES 1
  51. #define MAX_IO_HANDLES 4
  52. #define PHY_GEN2_FW_IMAGE_BUFFER (NXP_OCRAM_ADDR + CSF_HDR_SZ)
  53. /*
  54. * FIP image defines - Offset at which FIP Image would be present
  55. * Image would include Bl31 , Bl33 and Bl32 (optional)
  56. */
  57. #ifdef POLICY_FUSE_PROVISION
  58. #define MAX_FIP_DEVICES 3
  59. #endif
  60. #ifndef MAX_FIP_DEVICES
  61. #define MAX_FIP_DEVICES 2
  62. #endif
  63. /*
  64. * ID of the secure physical generic timer interrupt used by the BL32.
  65. */
  66. #define BL32_IRQ_SEC_PHY_TIMER 29
  67. #define BL31_WDOG_SEC 89
  68. #define BL31_NS_WDOG_WS1 108
  69. /*
  70. * Define properties of Group 1 Secure and Group 0 interrupts as per GICv3
  71. * terminology. On a GICv2 system or mode, the lists will be merged and treated
  72. * as Group 0 interrupts.
  73. */
  74. #define PLAT_LS_G1S_IRQ_PROPS(grp) \
  75. INTR_PROP_DESC(BL32_IRQ_SEC_PHY_TIMER, GIC_HIGHEST_SEC_PRIORITY, grp, \
  76. GIC_INTR_CFG_EDGE)
  77. /* SGI 15 and Secure watchdog interrupts assigned to Group 0 */
  78. #define NXP_IRQ_SEC_SGI_7 15
  79. #define PLAT_LS_G0_IRQ_PROPS(grp) \
  80. INTR_PROP_DESC(BL31_WDOG_SEC, GIC_HIGHEST_SEC_PRIORITY, grp, \
  81. GIC_INTR_CFG_EDGE), \
  82. INTR_PROP_DESC(BL31_NS_WDOG_WS1, GIC_HIGHEST_SEC_PRIORITY, grp, \
  83. GIC_INTR_CFG_EDGE), \
  84. INTR_PROP_DESC(NXP_IRQ_SEC_SGI_7, GIC_HIGHEST_SEC_PRIORITY, grp, \
  85. GIC_INTR_CFG_LEVEL)
  86. #endif