marvell_cci.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 2018 Marvell International Ltd.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. * https://spdx.org/licenses
  6. */
  7. #include <drivers/arm/cci.h>
  8. #include <plat_marvell.h>
  9. static const int cci_map[] = {
  10. PLAT_MARVELL_CCI_CLUSTER0_SL_IFACE_IX,
  11. PLAT_MARVELL_CCI_CLUSTER1_SL_IFACE_IX
  12. };
  13. /****************************************************************************
  14. * The following functions are defined as weak to allow a platform to override
  15. * the way ARM CCI driver is initialised and used.
  16. ****************************************************************************
  17. */
  18. #pragma weak plat_marvell_interconnect_init
  19. #pragma weak plat_marvell_interconnect_enter_coherency
  20. #pragma weak plat_marvell_interconnect_exit_coherency
  21. /****************************************************************************
  22. * Helper function to initialize ARM CCI driver.
  23. ****************************************************************************
  24. */
  25. void plat_marvell_interconnect_init(void)
  26. {
  27. cci_init(PLAT_MARVELL_CCI_BASE, cci_map, ARRAY_SIZE(cci_map));
  28. }
  29. /****************************************************************************
  30. * Helper function to place current master into coherency
  31. ****************************************************************************
  32. */
  33. void plat_marvell_interconnect_enter_coherency(void)
  34. {
  35. cci_enable_snoop_dvm_reqs(MPIDR_AFFLVL1_VAL(read_mpidr_el1()));
  36. }
  37. /****************************************************************************
  38. * Helper function to remove current master from coherency
  39. ****************************************************************************
  40. */
  41. void plat_marvell_interconnect_exit_coherency(void)
  42. {
  43. cci_disable_snoop_dvm_reqs(MPIDR_AFFLVL1_VAL(read_mpidr_el1()));
  44. }