Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 1 | /* |
Dan Handley | e83b0ca | 2014-01-14 18:17:09 +0000 | [diff] [blame] | 2 | * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved. |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions are met: |
| 6 | * |
| 7 | * Redistributions of source code must retain the above copyright notice, this |
| 8 | * list of conditions and the following disclaimer. |
| 9 | * |
| 10 | * Redistributions in binary form must reproduce the above copyright notice, |
| 11 | * this list of conditions and the following disclaimer in the documentation |
| 12 | * and/or other materials provided with the distribution. |
| 13 | * |
| 14 | * Neither the name of ARM nor the names of its contributors may be used |
| 15 | * to endorse or promote products derived from this software without specific |
| 16 | * prior written permission. |
| 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 28 | * POSSIBILITY OF SUCH DAMAGE. |
| 29 | */ |
| 30 | |
| 31 | #ifndef __CCI_400_H__ |
| 32 | #define __CCI_400_H__ |
| 33 | |
Vikram Kanigiri | 080c0be | 2015-12-03 17:49:45 +0000 | [diff] [blame] | 34 | /************************************************************** |
| 35 | * THIS DRIVER IS DEPRECATED. Please use the driver in cci.h |
| 36 | **************************************************************/ |
| 37 | #if ERROR_DEPRECATED |
| 38 | #error " The CCI-400 specific driver is deprecated." |
| 39 | #endif |
| 40 | |
| 41 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 42 | /* Slave interface offsets from PERIPHBASE */ |
| 43 | #define SLAVE_IFACE4_OFFSET 0x5000 |
| 44 | #define SLAVE_IFACE3_OFFSET 0x4000 |
| 45 | #define SLAVE_IFACE2_OFFSET 0x3000 |
| 46 | #define SLAVE_IFACE1_OFFSET 0x2000 |
| 47 | #define SLAVE_IFACE0_OFFSET 0x1000 |
Dan Handley | be234f9 | 2014-08-04 16:11:15 +0100 | [diff] [blame] | 48 | #define SLAVE_IFACE_OFFSET(index) SLAVE_IFACE0_OFFSET + \ |
| 49 | (0x1000 * (index)) |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 50 | |
| 51 | /* Control and ID register offsets */ |
| 52 | #define CTRL_OVERRIDE_REG 0x0 |
| 53 | #define SPEC_CTRL_REG 0x4 |
| 54 | #define SECURE_ACCESS_REG 0x8 |
| 55 | #define STATUS_REG 0xc |
| 56 | #define IMPRECISE_ERR_REG 0x10 |
| 57 | #define PERFMON_CTRL_REG 0x100 |
| 58 | |
| 59 | /* Slave interface register offsets */ |
| 60 | #define SNOOP_CTRL_REG 0x0 |
| 61 | #define SH_OVERRIDE_REG 0x4 |
| 62 | #define READ_CHNL_QOS_VAL_OVERRIDE_REG 0x100 |
| 63 | #define WRITE_CHNL_QOS_VAL_OVERRIDE_REG 0x104 |
| 64 | #define QOS_CTRL_REG 0x10c |
| 65 | #define MAX_OT_REG 0x110 |
| 66 | #define TARGET_LATENCY_REG 0x130 |
| 67 | #define LATENCY_REGULATION_REG 0x134 |
| 68 | #define QOS_RANGE_REG 0x138 |
| 69 | |
| 70 | /* Snoop Control register bit definitions */ |
| 71 | #define DVM_EN_BIT (1 << 1) |
| 72 | #define SNOOP_EN_BIT (1 << 0) |
| 73 | |
| 74 | /* Status register bit definitions */ |
| 75 | #define CHANGE_PENDING_BIT (1 << 0) |
| 76 | |
Soby Mathew | 0da9593 | 2014-07-16 09:23:52 +0100 | [diff] [blame] | 77 | #ifndef __ASSEMBLY__ |
| 78 | |
Vikram Kanigiri | 080c0be | 2015-12-03 17:49:45 +0000 | [diff] [blame] | 79 | #include <common_def.h> |
Juan Castillo | 7f1f062 | 2014-09-09 09:49:23 +0100 | [diff] [blame] | 80 | #include <stdint.h> |
| 81 | |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 82 | /* Function declarations */ |
Dan Handley | be234f9 | 2014-08-04 16:11:15 +0100 | [diff] [blame] | 83 | |
| 84 | /* |
| 85 | * The CCI-400 driver must be initialized with the base address of the |
| 86 | * CCI-400 device in the platform memory map, and the cluster indices for |
| 87 | * the CCI-400 slave interfaces 3 and 4 respectively. These are the fully |
| 88 | * coherent ACE slave interfaces of CCI-400. |
| 89 | * The cluster indices must either be 0 or 1, corresponding to the level 1 |
| 90 | * affinity instance of the mpidr representing the cluster. A negative cluster |
| 91 | * index indicates that no cluster is present on that slave interface. |
| 92 | */ |
Juan Castillo | 7f1f062 | 2014-09-09 09:49:23 +0100 | [diff] [blame] | 93 | void cci_init(uintptr_t cci_base, |
Dan Handley | be234f9 | 2014-08-04 16:11:15 +0100 | [diff] [blame] | 94 | int slave_iface3_cluster_ix, |
Vikram Kanigiri | 080c0be | 2015-12-03 17:49:45 +0000 | [diff] [blame] | 95 | int slave_iface4_cluster_ix) __warn_deprecated; |
Dan Handley | be234f9 | 2014-08-04 16:11:15 +0100 | [diff] [blame] | 96 | |
Vikram Kanigiri | 080c0be | 2015-12-03 17:49:45 +0000 | [diff] [blame] | 97 | void cci_enable_cluster_coherency(unsigned long mpidr) __warn_deprecated; |
| 98 | void cci_disable_cluster_coherency(unsigned long mpidr) __warn_deprecated; |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 99 | |
Soby Mathew | 0da9593 | 2014-07-16 09:23:52 +0100 | [diff] [blame] | 100 | #endif /* __ASSEMBLY__ */ |
Achin Gupta | 4f6ad66 | 2013-10-25 09:08:21 +0100 | [diff] [blame] | 101 | #endif /* __CCI_400_H__ */ |