arm_cci.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2016-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 <drivers/arm/cci.h>
  9. #include <lib/utils.h>
  10. #include <plat/arm/common/plat_arm.h>
  11. static const int cci_map[] = {
  12. PLAT_ARM_CCI_CLUSTER0_SL_IFACE_IX,
  13. PLAT_ARM_CCI_CLUSTER1_SL_IFACE_IX
  14. };
  15. /******************************************************************************
  16. * The following functions are defined as weak to allow a platform to override
  17. * the way ARM CCI driver is initialised and used.
  18. *****************************************************************************/
  19. #pragma weak plat_arm_interconnect_init
  20. #pragma weak plat_arm_interconnect_enter_coherency
  21. #pragma weak plat_arm_interconnect_exit_coherency
  22. /******************************************************************************
  23. * Helper function to initialize ARM CCI driver.
  24. *****************************************************************************/
  25. void __init plat_arm_interconnect_init(void)
  26. {
  27. cci_init(PLAT_ARM_CCI_BASE, cci_map, ARRAY_SIZE(cci_map));
  28. }
  29. /******************************************************************************
  30. * Helper function to place current master into coherency
  31. *****************************************************************************/
  32. void plat_arm_interconnect_enter_coherency(void)
  33. {
  34. cci_enable_snoop_dvm_reqs(MPIDR_AFFLVL1_VAL(read_mpidr_el1()));
  35. }
  36. /******************************************************************************
  37. * Helper function to remove current master from coherency
  38. *****************************************************************************/
  39. void plat_arm_interconnect_exit_coherency(void)
  40. {
  41. cci_disable_snoop_dvm_reqs(MPIDR_AFFLVL1_VAL(read_mpidr_el1()));
  42. }