xref: /rk3399_rockchip-uboot/arch/arm/include/asm/armv7.h (revision eed7c0f727cf8255b193dfefd21d66dfd6dbae94)
12c451f78SAneesh V /*
22c451f78SAneesh V  * (C) Copyright 2010
32c451f78SAneesh V  * Texas Instruments, <www.ti.com>
42c451f78SAneesh V  * Aneesh V <aneesh@ti.com>
52c451f78SAneesh V  *
62c451f78SAneesh V  * See file CREDITS for list of people who contributed to this
72c451f78SAneesh V  * project.
82c451f78SAneesh V  *
92c451f78SAneesh V  * This program is free software; you can redistribute it and/or
102c451f78SAneesh V  * modify it under the terms of the GNU General Public License as
112c451f78SAneesh V  * published by the Free Software Foundation; either version 2 of
122c451f78SAneesh V  * the License, or (at your option) any later version.
132c451f78SAneesh V  *
142c451f78SAneesh V  * This program is distributed in the hope that it will be useful,
152c451f78SAneesh V  * but WITHOUT ANY WARRANTY; without even the implied warranty of
162c451f78SAneesh V  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
172c451f78SAneesh V  * GNU General Public License for more details.
182c451f78SAneesh V  *
192c451f78SAneesh V  * You should have received a copy of the GNU General Public License
202c451f78SAneesh V  * along with this program; if not, write to the Free Software
212c451f78SAneesh V  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
222c451f78SAneesh V  * MA 02111-1307 USA
232c451f78SAneesh V  */
242c451f78SAneesh V #ifndef ARMV7_H
252c451f78SAneesh V #define ARMV7_H
262c451f78SAneesh V #include <linux/types.h>
272c451f78SAneesh V 
28ad577c8aSAneesh V /* Cortex-A9 revisions */
29ad577c8aSAneesh V #define MIDR_CORTEX_A9_R0P1	0x410FC091
30ad577c8aSAneesh V #define MIDR_CORTEX_A9_R1P2	0x411FC092
31ad577c8aSAneesh V #define MIDR_CORTEX_A9_R1P3	0x411FC093
325ab12a9eSAneesh V #define MIDR_CORTEX_A9_R2P10	0x412FC09A
33ad577c8aSAneesh V 
34508a58faSSricharan /* Cortex-A15 revisions */
35508a58faSSricharan #define MIDR_CORTEX_A15_R0P0	0x410FC0F0
36*eed7c0f7SSRICHARAN R #define MIDR_CORTEX_A15_R2P2	0x412FC0F2
37508a58faSSricharan 
382c451f78SAneesh V /* CCSIDR */
392c451f78SAneesh V #define CCSIDR_LINE_SIZE_OFFSET		0
402c451f78SAneesh V #define CCSIDR_LINE_SIZE_MASK		0x7
412c451f78SAneesh V #define CCSIDR_ASSOCIATIVITY_OFFSET	3
422c451f78SAneesh V #define CCSIDR_ASSOCIATIVITY_MASK	(0x3FF << 3)
432c451f78SAneesh V #define CCSIDR_NUM_SETS_OFFSET		13
442c451f78SAneesh V #define CCSIDR_NUM_SETS_MASK		(0x7FFF << 13)
452c451f78SAneesh V 
462c451f78SAneesh V /*
472c451f78SAneesh V  * Values for InD field in CSSELR
482c451f78SAneesh V  * Selects the type of cache
492c451f78SAneesh V  */
502c451f78SAneesh V #define ARMV7_CSSELR_IND_DATA_UNIFIED	0
512c451f78SAneesh V #define ARMV7_CSSELR_IND_INSTRUCTION	1
522c451f78SAneesh V 
532c451f78SAneesh V /* Values for Ctype fields in CLIDR */
542c451f78SAneesh V #define ARMV7_CLIDR_CTYPE_NO_CACHE		0
552c451f78SAneesh V #define ARMV7_CLIDR_CTYPE_INSTRUCTION_ONLY	1
562c451f78SAneesh V #define ARMV7_CLIDR_CTYPE_DATA_ONLY		2
572c451f78SAneesh V #define ARMV7_CLIDR_CTYPE_INSTRUCTION_DATA	3
582c451f78SAneesh V #define ARMV7_CLIDR_CTYPE_UNIFIED		4
592c451f78SAneesh V 
602c451f78SAneesh V /*
612c451f78SAneesh V  * CP15 Barrier instructions
622c451f78SAneesh V  * Please note that we have separate barrier instructions in ARMv7
632c451f78SAneesh V  * However, we use the CP15 based instructtions because we use
642c451f78SAneesh V  * -march=armv5 in U-Boot
652c451f78SAneesh V  */
662c451f78SAneesh V #define CP15ISB	asm volatile ("mcr     p15, 0, %0, c7, c5, 4" : : "r" (0))
672c451f78SAneesh V #define CP15DSB	asm volatile ("mcr     p15, 0, %0, c7, c10, 4" : : "r" (0))
682c451f78SAneesh V #define CP15DMB	asm volatile ("mcr     p15, 0, %0, c7, c10, 5" : : "r" (0))
692c451f78SAneesh V 
702c451f78SAneesh V void v7_outer_cache_enable(void);
712c451f78SAneesh V void v7_outer_cache_disable(void);
722c451f78SAneesh V void v7_outer_cache_flush_all(void);
732c451f78SAneesh V void v7_outer_cache_inval_all(void);
742c451f78SAneesh V void v7_outer_cache_flush_range(u32 start, u32 end);
752c451f78SAneesh V void v7_outer_cache_inval_range(u32 start, u32 end);
762c451f78SAneesh V 
772c451f78SAneesh V #endif
78