arch_def.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2022, Mediatek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef ARCH_DEF_H
  7. #define ARCH_DEF_H
  8. /* Topology constants */
  9. #define PLAT_MAX_PWR_LVL (2)
  10. #define PLAT_MAX_RET_STATE (1)
  11. #define PLAT_MAX_OFF_STATE (2)
  12. #define PLATFORM_SYSTEM_COUNT (1)
  13. #define PLATFORM_CLUSTER_COUNT (1)
  14. #define PLATFORM_CLUSTER0_CORE_COUNT (8)
  15. #define PLATFORM_CORE_COUNT (PLATFORM_CLUSTER0_CORE_COUNT)
  16. #define PLATFORM_MAX_CPUS_PER_CLUSTER (8)
  17. #define PLATFORM_NUM_AFFS (PLATFORM_SYSTEM_COUNT + \
  18. PLATFORM_CLUSTER_COUNT + \
  19. PLATFORM_CORE_COUNT)
  20. /*******************************************************************************
  21. * Declarations and constants to access the mailboxes safely. Each mailbox is
  22. * aligned on the biggest cache line size in the platform. This is known only
  23. * to the platform as it might have a combination of integrated and external
  24. * caches. Such alignment ensures that two maiboxes do not sit on the same cache
  25. * line at any cache level. They could belong to different cpus/clusters &
  26. * get written while being protected by different locks causing corruption of
  27. * a valid mailbox address.
  28. ******************************************************************************/
  29. /* Cachline size */
  30. #define CACHE_WRITEBACK_SHIFT (6)
  31. #define CACHE_WRITEBACK_GRANULE (1 << CACHE_WRITEBACK_SHIFT)
  32. #endif /* ARCH_DEF_H */