sq_ccn.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <platform_def.h>
  7. #include <arch.h>
  8. #include <arch_helpers.h>
  9. #include <drivers/arm/ccn.h>
  10. static const unsigned char master_to_rn_id_map[] = {
  11. PLAT_SQ_CLUSTER_TO_CCN_ID_MAP
  12. };
  13. static const ccn_desc_t sq_ccn_desc = {
  14. .periphbase = PLAT_SQ_CCN_BASE,
  15. .num_masters = ARRAY_SIZE(master_to_rn_id_map),
  16. .master_to_rn_id_map = master_to_rn_id_map
  17. };
  18. /******************************************************************************
  19. * Helper function to initialize SQ CCN driver.
  20. *****************************************************************************/
  21. void plat_sq_interconnect_init(void)
  22. {
  23. ccn_init(&sq_ccn_desc);
  24. }
  25. /******************************************************************************
  26. * Helper function to place current master into coherency
  27. *****************************************************************************/
  28. void plat_sq_interconnect_enter_coherency(void)
  29. {
  30. ccn_enter_snoop_dvm_domain(1 << MPIDR_AFFLVL1_VAL(read_mpidr_el1()));
  31. }
  32. /******************************************************************************
  33. * Helper function to remove current master from coherency
  34. *****************************************************************************/
  35. void plat_sq_interconnect_exit_coherency(void)
  36. {
  37. ccn_exit_snoop_dvm_domain(1 << MPIDR_AFFLVL1_VAL(read_mpidr_el1()));
  38. }