blob: a5dc9a0327ca456456e62eaadf080a70fa3d78a2 [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
Dan Handleye83b0ca2014-01-14 18:17:09 +00002 * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved.
Achin Gupta4f6ad662013-10-25 09:08:21 +01003 *
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 Kanigiri080c0be2015-12-03 17:49:45 +000034/**************************************************************
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 Gupta4f6ad662013-10-25 09:08:21 +010042/* 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 Handleybe234f92014-08-04 16:11:15 +010048#define SLAVE_IFACE_OFFSET(index) SLAVE_IFACE0_OFFSET + \
49 (0x1000 * (index))
Achin Gupta4f6ad662013-10-25 09:08:21 +010050
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 Mathew0da95932014-07-16 09:23:52 +010077#ifndef __ASSEMBLY__
78
Vikram Kanigiri080c0be2015-12-03 17:49:45 +000079#include <common_def.h>
Juan Castillo7f1f0622014-09-09 09:49:23 +010080#include <stdint.h>
81
Achin Gupta4f6ad662013-10-25 09:08:21 +010082/* Function declarations */
Dan Handleybe234f92014-08-04 16:11:15 +010083
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 Castillo7f1f0622014-09-09 09:49:23 +010093void cci_init(uintptr_t cci_base,
Dan Handleybe234f92014-08-04 16:11:15 +010094 int slave_iface3_cluster_ix,
Vikram Kanigiri080c0be2015-12-03 17:49:45 +000095 int slave_iface4_cluster_ix) __warn_deprecated;
Dan Handleybe234f92014-08-04 16:11:15 +010096
Vikram Kanigiri080c0be2015-12-03 17:49:45 +000097void cci_enable_cluster_coherency(unsigned long mpidr) __warn_deprecated;
98void cci_disable_cluster_coherency(unsigned long mpidr) __warn_deprecated;
Achin Gupta4f6ad662013-10-25 09:08:21 +010099
Soby Mathew0da95932014-07-16 09:23:52 +0100100#endif /* __ASSEMBLY__ */
Achin Gupta4f6ad662013-10-25 09:08:21 +0100101#endif /* __CCI_400_H__ */