Audit and eliminate redundant #include directives in src/flash headers.
[openocd.git] / src / flash / stellaris.h
1 /***************************************************************************
2 * Copyright (C) 2006 by Magnus Lundin *
3 * lundin@mlu.mine.nu *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #ifndef STELLARIS_FLASH_H
21 #define STELLARIS_FLASH_H
22
23 #include "flash.h"
24
25 typedef struct stellaris_flash_bank_s
26 {
27 /* chip id register */
28 u32 did0;
29 u32 did1;
30 u32 dc0;
31 u32 dc1;
32
33 char * target_name;
34
35 u32 sramsiz;
36 u32 flshsz;
37 /* flash geometry */
38 u32 num_pages;
39 u32 pagesize;
40 u32 pages_in_lockregion;
41
42 /* nv memory bits */
43 u16 num_lockbits;
44 u32 lockbits;
45
46 /* main clock status */
47 u32 rcc;
48 u8 mck_valid;
49 u32 mck_freq;
50
51 } stellaris_flash_bank_t;
52
53 /* STELLARIS control registers */
54 #define SCB_BASE 0x400FE000
55 #define DID0 0x000
56 #define DID1 0x004
57 #define DC0 0x008
58 #define DC1 0x010
59 #define DC2 0x014
60 #define DC3 0x018
61 #define DC4 0x01C
62
63 #define RIS 0x050
64 #define RCC 0x060
65 #define PLLCFG 0x064
66
67 #define FMPRE 0x130
68 #define FMPPE 0x134
69 #define USECRL 0x140
70
71 #define FLASH_CONTROL_BASE 0x400FD000
72 #define FLASH_FMA (FLASH_CONTROL_BASE|0x000)
73 #define FLASH_FMD (FLASH_CONTROL_BASE|0x004)
74 #define FLASH_FMC (FLASH_CONTROL_BASE|0x008)
75 #define FLASH_CRIS (FLASH_CONTROL_BASE|0x00C)
76 #define FLASH_CIM (FLASH_CONTROL_BASE|0x010)
77 #define FLASH_MISC (FLASH_CONTROL_BASE|0x014)
78
79 #define AMISC 1
80 #define PMISC 2
81
82 #define AMASK 1
83 #define PMASK 2
84
85 /* Flash Controller Command bits */
86 #define FMC_WRKEY (0xA442<<16)
87 #define FMC_COMT (1<<3)
88 #define FMC_MERASE (1<<2)
89 #define FMC_ERASE (1<<1)
90 #define FMC_WRITE (1<<0)
91
92 /* STELLARIS constants */
93
94 #endif /* STELLARIS_H */