omap2420sdp: Remove this board because is not being maintained
[pandora-x-loader.git] / cpu / arm1136 / cpu.c
1 /*
2  * (C) Copyright 2004 Texas Insturments
3  *
4  *
5  * See file CREDITS for list of people who contributed to this
6  * project.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  * MA 02111-1307 USA
22  */
23
24 /*
25  * udelay() is CPU specific code
26  */
27
28 #include <common.h>
29
30 /* See also ARM Ref. Man. */
31 #define C1_MMU          (1<<0)          /* mmu off/on */
32 #define C1_ALIGN        (1<<1)          /* alignment faults off/on */
33 #define C1_DC           (1<<2)          /* dcache off/on */
34 #define C1_WB           (1<<3)          /* merging write buffer on/off */
35 #define C1_BIG_ENDIAN   (1<<7)  /* big endian off/on */
36 #define C1_SYS_PROT     (1<<8)          /* system protection */
37 #define C1_ROM_PROT     (1<<9)          /* ROM protection */
38 #define C1_IC           (1<<12)         /* icache off/on */
39 #define C1_HIGH_VECTORS (1<<13) /* location of vectors: low/high addresses */
40 #define RESERVED_1      (0xf << 3)      /* must be 111b for R/W */
41
42 int cpu_init (void)
43 {
44         int i;
45
46         /* turn off I/D-cache */
47         asm ("mrc p15, 0, %0, c1, c0, 0":"=r" (i));
48         i &= ~(C1_DC | C1_IC);
49         asm ("mcr p15, 0, %0, c1, c0, 0": :"r" (i));
50
51         /* flush I/D-cache */
52         i = 0;
53         asm ("mcr p15, 0, %0, c7, c7, 0": :"r" (i));  // invalidate both caches and flush btb
54         asm ("mcr p15, 0, %0, c7, c10, 4": :"r" (i)); // mem barrier to sync things
55
56         return 0;
57 }
58
59
60
61
62
63
64
65