1 /*
2  * Copyright (c) 2019-2020, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <arch.h>
8 #include <arch_helpers.h>
9 #include <drivers/arm/ccn.h>
10 
11 #include <platform_def.h>
12 
13 static const unsigned char master_to_rn_id_map[] = {
14 	PLAT_BRCM_CLUSTER_TO_CCN_ID_MAP
15 };
16 
17 static const ccn_desc_t bcm_ccn_desc = {
18 	.periphbase = PLAT_BRCM_CCN_BASE,
19 	.num_masters = ARRAY_SIZE(master_to_rn_id_map),
20 	.master_to_rn_id_map = master_to_rn_id_map
21 };
22 
plat_brcm_interconnect_init(void)23 void plat_brcm_interconnect_init(void)
24 {
25 	ccn_init(&bcm_ccn_desc);
26 }
27 
plat_brcm_interconnect_enter_coherency(void)28 void plat_brcm_interconnect_enter_coherency(void)
29 {
30 	ccn_enter_snoop_dvm_domain(1 << MPIDR_AFFLVL1_VAL(read_mpidr_el1()));
31 }
32 
plat_brcm_interconnect_exit_coherency(void)33 void plat_brcm_interconnect_exit_coherency(void)
34 {
35 	ccn_exit_snoop_dvm_domain(1 << MPIDR_AFFLVL1_VAL(read_mpidr_el1()));
36 }
37