platform_def.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Copyright (c) 2020, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef PLATFORM_DEF_H
  7. #define PLATFORM_DEF_H
  8. #include <arch.h>
  9. #include <plat/common/common_def.h>
  10. #include <platform_def.h>
  11. #include "../fpga_def.h"
  12. #define PLATFORM_LINKER_FORMAT "elf64-littleaarch64"
  13. #define PLATFORM_LINKER_ARCH aarch64
  14. #define PLATFORM_STACK_SIZE UL(0x800)
  15. #define CACHE_WRITEBACK_SHIFT U(6)
  16. #define CACHE_WRITEBACK_GRANULE (U(1) << CACHE_WRITEBACK_SHIFT)
  17. #define PLATFORM_CORE_COUNT \
  18. (FPGA_MAX_CLUSTER_COUNT * \
  19. FPGA_MAX_CPUS_PER_CLUSTER * \
  20. FPGA_MAX_PE_PER_CPU)
  21. #define PLAT_NUM_PWR_DOMAINS (FPGA_MAX_CLUSTER_COUNT + PLATFORM_CORE_COUNT + 1)
  22. #if !ENABLE_PIE
  23. #define BL31_BASE UL(0x80000000)
  24. #define BL31_LIMIT UL(0x80070000)
  25. #else
  26. #define BL31_BASE UL(0x0)
  27. #define BL31_LIMIT UL(0x01000000)
  28. #endif
  29. #define PLAT_SDEI_NORMAL_PRI 0x70
  30. #define ARM_IRQ_SEC_PHY_TIMER 29
  31. #define ARM_IRQ_SEC_SGI_0 8
  32. #define ARM_IRQ_SEC_SGI_1 9
  33. #define ARM_IRQ_SEC_SGI_2 10
  34. #define ARM_IRQ_SEC_SGI_3 11
  35. #define ARM_IRQ_SEC_SGI_4 12
  36. #define ARM_IRQ_SEC_SGI_5 13
  37. #define ARM_IRQ_SEC_SGI_6 14
  38. #define ARM_IRQ_SEC_SGI_7 15
  39. /*
  40. * Define a list of Group 1 Secure and Group 0 interrupt properties as per GICv3
  41. * terminology. On a GICv2 system or mode, the lists will be merged and treated
  42. * as Group 0 interrupts.
  43. */
  44. #define PLATFORM_G1S_PROPS(grp) \
  45. INTR_PROP_DESC(ARM_IRQ_SEC_PHY_TIMER, GIC_HIGHEST_SEC_PRIORITY, (grp), \
  46. GIC_INTR_CFG_LEVEL), \
  47. INTR_PROP_DESC(ARM_IRQ_SEC_SGI_1, GIC_HIGHEST_SEC_PRIORITY, (grp), \
  48. GIC_INTR_CFG_EDGE), \
  49. INTR_PROP_DESC(ARM_IRQ_SEC_SGI_2, GIC_HIGHEST_SEC_PRIORITY, (grp), \
  50. GIC_INTR_CFG_EDGE), \
  51. INTR_PROP_DESC(ARM_IRQ_SEC_SGI_3, GIC_HIGHEST_SEC_PRIORITY, (grp), \
  52. GIC_INTR_CFG_EDGE), \
  53. INTR_PROP_DESC(ARM_IRQ_SEC_SGI_4, GIC_HIGHEST_SEC_PRIORITY, (grp), \
  54. GIC_INTR_CFG_EDGE), \
  55. INTR_PROP_DESC(ARM_IRQ_SEC_SGI_5, GIC_HIGHEST_SEC_PRIORITY, (grp), \
  56. GIC_INTR_CFG_EDGE), \
  57. INTR_PROP_DESC(ARM_IRQ_SEC_SGI_7, GIC_HIGHEST_SEC_PRIORITY, (grp), \
  58. GIC_INTR_CFG_EDGE)
  59. #define PLATFORM_G0_PROPS(grp) \
  60. INTR_PROP_DESC(ARM_IRQ_SEC_SGI_0, PLAT_SDEI_NORMAL_PRI, (grp), \
  61. GIC_INTR_CFG_EDGE), \
  62. INTR_PROP_DESC(ARM_IRQ_SEC_SGI_6, GIC_HIGHEST_SEC_PRIORITY, (grp), \
  63. GIC_INTR_CFG_EDGE)
  64. #define PLAT_MAX_RET_STATE 1
  65. #define PLAT_MAX_OFF_STATE 2
  66. #define PLAT_MAX_PWR_LVL MPIDR_AFFLVL2
  67. #define PLAT_FPGA_HOLD_ENTRY_SHIFT 3
  68. #define PLAT_FPGA_HOLD_STATE_WAIT 0
  69. #define PLAT_FPGA_HOLD_STATE_GO 1
  70. #endif