platform_def.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (c) 2017-2019, 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 <common/tbbr/tbbr_img_def.h>
  10. #include <lib/utils_def.h>
  11. #include <plat/common/common_def.h>
  12. #include <hikey_def.h>
  13. #include <hikey_layout.h> /* BL memory region sizes, etc */
  14. /* Special value used to verify platform parameters from BL2 to BL3-1 */
  15. #define HIKEY_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL
  16. /*
  17. * Generic platform constants
  18. */
  19. /* Size of cacheable stacks */
  20. #define PLATFORM_STACK_SIZE 0x1000
  21. #define FIRMWARE_WELCOME_STR "Booting Trusted Firmware\n"
  22. #define PLATFORM_CACHE_LINE_SIZE 64
  23. #define PLATFORM_CLUSTER_COUNT U(2)
  24. #define PLATFORM_CORE_COUNT_PER_CLUSTER U(4)
  25. #define PLATFORM_CORE_COUNT (PLATFORM_CLUSTER_COUNT * \
  26. PLATFORM_CORE_COUNT_PER_CLUSTER)
  27. #define PLAT_MAX_PWR_LVL (MPIDR_AFFLVL2)
  28. #define PLAT_NUM_PWR_DOMAINS (PLATFORM_CORE_COUNT + \
  29. PLATFORM_CLUSTER_COUNT + U(1))
  30. #define PLAT_MAX_RET_STATE U(1)
  31. #define PLAT_MAX_OFF_STATE U(2)
  32. #define MAX_IO_DEVICES 3
  33. #define MAX_IO_HANDLES 4
  34. /* eMMC RPMB and eMMC User Data */
  35. #define MAX_IO_BLOCK_DEVICES U(2)
  36. /* GIC related constants (no GICR in GIC-400) */
  37. #define PLAT_ARM_GICD_BASE 0xF6801000
  38. #define PLAT_ARM_GICC_BASE 0xF6802000
  39. #define PLAT_ARM_GICH_BASE 0xF6804000
  40. #define PLAT_ARM_GICV_BASE 0xF6806000
  41. /*
  42. * Platform specific page table and MMU setup constants
  43. */
  44. #define PLAT_VIRT_ADDR_SPACE_SIZE (1ULL << 32)
  45. #define PLAT_PHY_ADDR_SPACE_SIZE (1ULL << 32)
  46. #if defined(IMAGE_BL1) || defined(IMAGE_BL32)
  47. #define MAX_XLAT_TABLES 3
  48. #endif
  49. #ifdef IMAGE_BL31
  50. #define MAX_XLAT_TABLES 4
  51. #endif
  52. #ifdef IMAGE_BL2
  53. #define MAX_XLAT_TABLES 4
  54. #endif
  55. #define MAX_MMAP_REGIONS 16
  56. /*
  57. * Declarations and constants to access the mailboxes safely. Each mailbox is
  58. * aligned on the biggest cache line size in the platform. This is known only
  59. * to the platform as it might have a combination of integrated and external
  60. * caches. Such alignment ensures that two maiboxes do not sit on the same cache
  61. * line at any cache level. They could belong to different cpus/clusters &
  62. * get written while being protected by different locks causing corruption of
  63. * a valid mailbox address.
  64. */
  65. #define CACHE_WRITEBACK_SHIFT 6
  66. #define CACHE_WRITEBACK_GRANULE (1 << CACHE_WRITEBACK_SHIFT)
  67. #endif /* PLATFORM_DEF_H */