platform_def.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (c) 2021-2023, Stephan Gerhold <stephan@gerhold.net>
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef PLATFORM_DEF_H
  7. #define PLATFORM_DEF_H
  8. #include <plat/common/common_def.h>
  9. #ifdef __aarch64__
  10. /*
  11. * There is at least 1 MiB available for BL31. However, at the moment the
  12. * "msm8916_entry_point" variable in the data section is read through the
  13. * 64 KiB region of the "boot remapper" after reset. For simplicity, limit
  14. * the end of the data section (BL31_PROGBITS_LIMIT) to 64 KiB for now and
  15. * the overall limit to 128 KiB. This could be increased if needed by placing
  16. * the "msm8916_entry_point" variable explicitly in the first 64 KiB of BL31.
  17. */
  18. #define BL31_LIMIT (BL31_BASE + SZ_128K)
  19. #define BL31_PROGBITS_LIMIT (BL31_BASE + SZ_64K)
  20. #endif
  21. #define BL32_LIMIT (BL32_BASE + SZ_128K)
  22. #define CACHE_WRITEBACK_GRANULE U(64)
  23. #define PLATFORM_STACK_SIZE SZ_4K
  24. /* CPU topology: one or two clusters with 4 cores each */
  25. #ifdef PLAT_msm8939
  26. #define PLATFORM_CLUSTER_COUNT U(2)
  27. #else
  28. #define PLATFORM_CLUSTER_COUNT U(1)
  29. #endif
  30. #if defined(PLAT_mdm9607)
  31. #define PLATFORM_CPU_PER_CLUSTER_SHIFT U(0) /* 1 */
  32. #else
  33. #define PLATFORM_CPU_PER_CLUSTER_SHIFT U(2) /* 4 */
  34. #endif
  35. #define PLATFORM_CPUS_PER_CLUSTER (1 << PLATFORM_CPU_PER_CLUSTER_SHIFT)
  36. #define PLATFORM_CORE_COUNT (PLATFORM_CLUSTER_COUNT * \
  37. PLATFORM_CPUS_PER_CLUSTER)
  38. /* Power management */
  39. #define PLATFORM_SYSTEM_COUNT U(1)
  40. #define PLAT_NUM_PWR_DOMAINS (PLATFORM_SYSTEM_COUNT + \
  41. PLATFORM_CLUSTER_COUNT + \
  42. PLATFORM_CORE_COUNT)
  43. #define PLAT_MAX_PWR_LVL MPIDR_AFFLVL2
  44. #define PLAT_MAX_RET_STATE U(2)
  45. #define PLAT_MAX_OFF_STATE U(3)
  46. /* Translation tables */
  47. #define MAX_MMAP_REGIONS 8
  48. #define MAX_XLAT_TABLES 4
  49. #define PLAT_PHY_ADDR_SPACE_SIZE (ULL(1) << 32)
  50. #define PLAT_VIRT_ADDR_SPACE_SIZE (ULL(1) << 32)
  51. /* Timer */
  52. #define PLAT_SYSCNT_FREQ 19200000
  53. #define IRQ_SEC_PHY_TIMER (16 + 2) /* PPI #2 */
  54. /*
  55. * The Qualcomm QGIC2 implementation seems to have PIDR0-4 and PIDR4-7
  56. * erroneously swapped for some reason. PIDR2 is actually at 0xFD8.
  57. * Override the address in <drivers/arm/gicv2.h> to avoid a failing assert().
  58. */
  59. #define GICD_PIDR2_GICV2 U(0xFD8)
  60. /* TSP */
  61. #define TSP_IRQ_SEC_PHY_TIMER IRQ_SEC_PHY_TIMER
  62. #define TSP_SEC_MEM_BASE BL32_BASE
  63. #define TSP_SEC_MEM_SIZE (BL32_LIMIT - BL32_BASE)
  64. #endif /* PLATFORM_DEF_H */