ls_cci.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright 2020 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #include <arch.h>
  8. #include <cci.h>
  9. #include <plat_arm.h>
  10. /******************************************************************************
  11. * The following functions are defined as weak to allow a platform to override
  12. * the way ARM CCI driver is initialised and used.
  13. *****************************************************************************/
  14. #pragma weak plat_arm_interconnect_enter_coherency
  15. #pragma weak plat_arm_interconnect_exit_coherency
  16. /******************************************************************************
  17. * Helper function to place current master into coherency
  18. *****************************************************************************/
  19. void plat_ls_interconnect_enter_coherency(unsigned int num_clusters)
  20. {
  21. cci_enable_snoop_dvm_reqs(MPIDR_AFFLVL1_VAL(read_mpidr_el1()));
  22. for (uint32_t index = 1U; index < num_clusters; index++) {
  23. cci_enable_snoop_dvm_reqs(index);
  24. }
  25. }
  26. /******************************************************************************
  27. * Helper function to remove current master from coherency
  28. *****************************************************************************/
  29. void plat_ls_interconnect_exit_coherency(void)
  30. {
  31. cci_disable_snoop_dvm_reqs(MPIDR_AFFLVL1_VAL(read_mpidr_el1()));
  32. }