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