Sumit Garg | bda9d3c | 2018-06-15 14:50:19 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 7 | #include <platform_def.h> |
| 8 | |
Sumit Garg | bda9d3c | 2018-06-15 14:50:19 +0530 | [diff] [blame] | 9 | #include <arch.h> |
| 10 | #include <arch_helpers.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 11 | #include <drivers/arm/ccn.h> |
Sumit Garg | bda9d3c | 2018-06-15 14:50:19 +0530 | [diff] [blame] | 12 | |
| 13 | static const unsigned char master_to_rn_id_map[] = { |
| 14 | PLAT_SQ_CLUSTER_TO_CCN_ID_MAP |
| 15 | }; |
| 16 | |
| 17 | static const ccn_desc_t sq_ccn_desc = { |
| 18 | .periphbase = PLAT_SQ_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 | |
| 23 | /****************************************************************************** |
| 24 | * Helper function to initialize SQ CCN driver. |
| 25 | *****************************************************************************/ |
| 26 | void plat_sq_interconnect_init(void) |
| 27 | { |
| 28 | ccn_init(&sq_ccn_desc); |
| 29 | } |
| 30 | |
| 31 | /****************************************************************************** |
| 32 | * Helper function to place current master into coherency |
| 33 | *****************************************************************************/ |
| 34 | void plat_sq_interconnect_enter_coherency(void) |
| 35 | { |
| 36 | ccn_enter_snoop_dvm_domain(1 << MPIDR_AFFLVL1_VAL(read_mpidr_el1())); |
| 37 | } |
| 38 | |
| 39 | /****************************************************************************** |
| 40 | * Helper function to remove current master from coherency |
| 41 | *****************************************************************************/ |
| 42 | void plat_sq_interconnect_exit_coherency(void) |
| 43 | { |
| 44 | ccn_exit_snoop_dvm_domain(1 << MPIDR_AFFLVL1_VAL(read_mpidr_el1())); |
| 45 | } |