blob: 6622a6f9d4e1cec7fe91e54e396549e4509b3a6a [file] [log] [blame]
Stefan Reinauer52db0b92012-12-07 17:15:04 -08001/*
2 * (C) Copyright 2010
3 * Texas Instruments, <www.ti.com>
4 * Aneesh V <aneesh@ti.com>
5 *
Stefan Reinauer52db0b92012-12-07 17:15:04 -08006 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of
9 * the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Stefan Reinauer52db0b92012-12-07 17:15:04 -080015 */
16#ifndef ARMV7_H
17#define ARMV7_H
18#include <types.h>
19
20/* Cortex-A9 revisions */
21#define MIDR_CORTEX_A9_R0P1 0x410FC091
22#define MIDR_CORTEX_A9_R1P2 0x411FC092
23#define MIDR_CORTEX_A9_R1P3 0x411FC093
24#define MIDR_CORTEX_A9_R2P10 0x412FC09A
25
26/* Cortex-A15 revisions */
27#define MIDR_CORTEX_A15_R0P0 0x410FC0F0
28
29/* CCSIDR */
30#define CCSIDR_LINE_SIZE_OFFSET 0
31#define CCSIDR_LINE_SIZE_MASK 0x7
32#define CCSIDR_ASSOCIATIVITY_OFFSET 3
33#define CCSIDR_ASSOCIATIVITY_MASK (0x3FF << 3)
34#define CCSIDR_NUM_SETS_OFFSET 13
35#define CCSIDR_NUM_SETS_MASK (0x7FFF << 13)
36
37/*
38 * Values for InD field in CSSELR
39 * Selects the type of cache
40 */
41#define ARMV7_CSSELR_IND_DATA_UNIFIED 0
42#define ARMV7_CSSELR_IND_INSTRUCTION 1
43
44/* Values for Ctype fields in CLIDR */
45#define ARMV7_CLIDR_CTYPE_NO_CACHE 0
46#define ARMV7_CLIDR_CTYPE_INSTRUCTION_ONLY 1
47#define ARMV7_CLIDR_CTYPE_DATA_ONLY 2
48#define ARMV7_CLIDR_CTYPE_INSTRUCTION_DATA 3
49#define ARMV7_CLIDR_CTYPE_UNIFIED 4
50
51/*
52 * CP15 Barrier instructions
53 * Please note that we have separate barrier instructions in ARMv7
Martin Roth7b5f8ef2013-07-08 16:22:10 -060054 * However, we use the CP15 based instructions because we use
Stefan Reinauer52db0b92012-12-07 17:15:04 -080055 * -march=armv5 in U-Boot
56 */
57#define CP15ISB asm volatile ("mcr p15, 0, %0, c7, c5, 4" : : "r" (0))
58#define CP15DSB asm volatile ("mcr p15, 0, %0, c7, c10, 4" : : "r" (0))
59#define CP15DMB asm volatile ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0))
60
Edward O'Callaghan569bd3f2014-11-07 13:27:29 +110061#endif /* ARMV7_H */