VSF Documented
SMM_MPS2.h
Go to the documentation of this file.
1/*----------------------------------------------------------------------------
2 * Name: SMM_MPS2.h
3 * Purpose: SMM MPS2 definitions
4 *----------------------------------------------------------------------------*/
5
6/* Copyright (c) 2011 - 2017 ARM LIMITED
7
8 All rights reserved.
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions are met:
11 - Redistributions of source code must retain the above copyright
12 notice, this list of conditions and the following disclaimer.
13 - Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
16 - Neither the name of ARM nor the names of its contributors may be used
17 to endorse or promote products derived from this software without
18 specific prior written permission.
19 *
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31 ---------------------------------------------------------------------------*/
32
33#ifndef SMM_MPS2_H_
34#define SMM_MPS2_H_
35
36#include "Device.h" /* device specific header file */
37
38#if defined ( __CC_ARM )
39#pragma anon_unions
40#endif
41
42/*----------------------------------------------------------------------------
43 FPGA System Register declaration
44 *----------------------------------------------------------------------------*/
45typedef struct /* Document SMM_M3.doc */
46{
47 __IO uint32_t LED; /* Offset: 0x000 (R/W) LED connections */
48 /* [31:2] : Reserved */
49 /* [1:0] : LEDs */
50 uint32_t RESERVED0[1];
51 __IO uint32_t BUTTON; /* Offset: 0x008 (R/W) Buttons */
52 /* [31:2] : Reserved */
53 /* [1:0] : Buttons */
54 uint32_t RESERVED1[1];
55 __IO uint32_t CLK1HZ; /* Offset: 0x010 (R/W) 1Hz up counter */
56 __IO uint32_t CLK100HZ; /* Offset: 0x014 (R/W) 100Hz up counter */
57 __IO uint32_t COUNTER; /* Offset: 0x018 (R/W) Cycle Up Counter */
58 /* Increments when 32-bit prescale counter reach zero */
59 uint32_t RESERVED2[1];
60 __IO uint32_t PRESCALE; /* Offset: 0x020 (R/W) Prescaler */
61 /* Bit[31:0] : reload value for prescale counter */
62 __IO uint32_t PSCNTR; /* Offset: 0x024 (R/W) 32-bit Prescale counter */
63 /* current value of the pre-scaler counter */
64 /* The Cycle Up Counter increment when the prescale down counter reach 0 */
65 /* The pre-scaler counter is reloaded with PRESCALE after reaching 0 */
66 uint32_t RESERVED3[9];
67 __IO uint32_t MISC; /* Offset: 0x04C (R/W) Misc control */
68 /* [31:7] : Reserved */
69 /* [6] : CLCD_BL_CTRL */
70 /* [5] : CLCD_RD */
71 /* [4] : CLCD_RS */
72 /* [3] : CLCD_RESET */
73 /* [2] : RESERVED */
74 /* [1] : SPI_nSS */
75 /* [0] : CLCD_CS */
77
78
79/*----------------------------------------------------------------------------
80 SCC Register declaration
81 *----------------------------------------------------------------------------*/
82typedef struct /* Document SMM_M3.doc */
83{
84 __IO uint32_t CFG_REG0; /* Offset: 0x000 (R/W) Remaps block RAM to ZBT */
85 /* [31:1] : Reserved */
86 /* [0] 1 : REMAP BlockRam to ZBT */
87 __IO uint32_t CFG_REG1; /* Offset: 0x004 (R/W) Controls the MCC user LEDs */
88 /* [31:8] : Reserved */
89 /* [7:0] : MCC LEDs */
90 __I uint32_t CFG_REG2; /* Offset: 0x008 (R/ ) Denotes the state of the MCC user switches */
91 /* [31:8] : Reserved */
92 /* [7:0] : These bits indicate state of the MCC switches */
93 __I uint32_t CFG_REG3; /* Offset: 0x00C (R/ ) Denotes the board revision */
94 /* [31:4] : Reserved */
95 /* [3:0] : Used by the MCC to pass PCB revision. 0 = A 1 = B */
96 uint32_t RESERVED0[36];
97 __IO uint32_t SYS_CFGDATA_RTN; /* Offset: 0x0A0 (R/W) User data register */
98 /* [31:0] : Data */
99 __IO uint32_t SYS_CFGDATA_OUT; /* Offset: 0x0A4 (R/W) User data register */
100 /* [31:0] : Data */
101 __IO uint32_t SYS_CFGCTRL; /* Offset: 0x0A8 (R/W) Control register */
102 /* [31] : Start (generates interrupt on write to this bit) */
103 /* [30] : R/W access */
104 /* [29:26] : Reserved */
105 /* [25:20] : Function value */
106 /* [19:12] : Reserved */
107 /* [11:0] : Device (value of 0/1/2 for supported clocks) */
108 __IO uint32_t SYS_CFGSTAT; /* Offset: 0x0AC (R/W) Contains status information */
109 /* [31:2] : Reserved */
110 /* [1] : Error */
111 /* [0] : Complete */
112 __IO uint32_t RESERVED1[20];
113 __IO uint32_t SCC_DLL; /* Offset: 0x100 (R/W) DLL Lock Register */
114 /* [31:24] : DLL LOCK MASK[7:0] - Indicate if the DLL locked is masked */
115 /* [23:16] : DLL LOCK MASK[7:0] - Indicate if the DLLs are locked or unlocked */
116 /* [15:1] : Reserved */
117 /* [0] : This bit indicates if all enabled DLLs are locked */
118 uint32_t RESERVED2[957];
119 __I uint32_t SCC_AID; /* Offset: 0xFF8 (R/ ) SCC AID Register */
120 /* [31:24] : FPGA build number */
121 /* [23:20] : V2M-MPS2 target board revision (A = 0, B = 1) */
122 /* [19:11] : Reserved */
123 /* [10] : if “1” SCC_SW register has been implemented */
124 /* [9] : if “1” SCC_LED register has been implemented */
125 /* [8] : if “1” DLL lock register has been implemented */
126 /* [7:0] : number of SCC configuration register */
127 __I uint32_t SCC_ID; /* Offset: 0xFFC (R/ ) Contains information about the FPGA image */
128 /* [31:24] : Implementer ID: 0x41 = ARM */
129 /* [23:20] : Application note IP variant number */
130 /* [19:16] : IP Architecture: 0x4 =AHB */
131 /* [11:4] : Primary part number: 386 = AN386 */
132 /* [3:0] : Application note IP revision number */
134
135
136/*----------------------------------------------------------------------------
137 SSP Peripheral declaration (Document DDI0194G_ssp_pl022_r1p3_trm.pdf)
138 *----------------------------------------------------------------------------*/
139typedef struct /* Document DDI0194G_ssp_pl022_r1p3_trm.pdf */
140{
141 __IO uint32_t CR0; /* Offset: 0x000 (R/W) Control register 0 */
142 /* [31:16] : Reserved */
143 /* [15:8] : Serial clock rate */
144 /* [7] : SSPCLKOUT phase, applicable to Motorola SPI frame format only */
145 /* [6] : SSPCLKOUT polarity, applicable to Motorola SPI frame format only */
146 /* [5:4] : Frame format */
147 /* [3:0] : Data Size Select */
148 __IO uint32_t CR1; /* Offset: 0x004 (R/W) Control register 1 */
149 /* [31:4] : Reserved */
150 /* [3] : Slave-mode output disable */
151 /* [2] : Master or slave mode select */
152 /* [1] : Synchronous serial port enable */
153 /* [0] : Loop back mode */
154 __IO uint32_t DR; /* Offset: 0x008 (R/W) Data register */
155 /* [31:16] : Reserved */
156 /* [15:0] : Transmit/Receive FIFO */
157 __I uint32_t SR; /* Offset: 0x00C (R/ ) Status register */
158 /* [31:5] : Reserved */
159 /* [4] : PrimeCell SSP busy flag */
160 /* [3] : Receive FIFO full */
161 /* [2] : Receive FIFO not empty */
162 /* [1] : Transmit FIFO not full */
163 /* [0] : Transmit FIFO empty */
164 __IO uint32_t CPSR; /* Offset: 0x010 (R/W) Clock prescale register */
165 /* [31:8] : Reserved */
166 /* [8:0] : Clock prescale divisor */
167 __IO uint32_t IMSC; /* Offset: 0x014 (R/W) Interrupt mask set or clear register */
168 /* [31:4] : Reserved */
169 /* [3] : Transmit FIFO interrupt mask */
170 /* [2] : Receive FIFO interrupt mask */
171 /* [1] : Receive timeout interrupt mask */
172 /* [0] : Receive overrun interrupt mask */
173 __I uint32_t RIS; /* Offset: 0x018 (R/ ) Raw interrupt status register */
174 /* [31:4] : Reserved */
175 /* [3] : raw interrupt state, prior to masking, of the SSPTXINTR interrupt */
176 /* [2] : raw interrupt state, prior to masking, of the SSPRXINTR interrupt */
177 /* [1] : raw interrupt state, prior to masking, of the SSPRTINTR interrupt */
178 /* [0] : raw interrupt state, prior to masking, of the SSPRORINTR interrupt */
179 __I uint32_t MIS; /* Offset: 0x01C (R/ ) Masked interrupt status register */
180 /* [31:4] : Reserved */
181 /* [3] : transmit FIFO masked interrupt state, after masking, of the SSPTXINTR interrupt */
182 /* [2] : receive FIFO masked interrupt state, after masking, of the SSPRXINTR interrupt */
183 /* [1] : receive timeout masked interrupt state, after masking, of the SSPRTINTR interrupt */
184 /* [0] : receive over run masked interrupt status, after masking, of the SSPRORINTR interrupt */
185 __O uint32_t ICR; /* Offset: 0x020 ( /W) Interrupt clear register */
186 /* [31:2] : Reserved */
187 /* [1] : Clears the SSPRTINTR interrupt */
188 /* [0] : Clears the SSPRORINTR interrupt */
189 __IO uint32_t DMACR; /* Offset: 0x024 (R/W) DMA control register */
190 /* [31:2] : Reserved */
191 /* [1] : Transmit DMA Enable */
192 /* [0] : Receive DMA Enable */
194
195
196/*----------------------------------------------------------------------------
197 I2C Peripheral declaration
198 *----------------------------------------------------------------------------*/
199typedef struct /* Document ? */
200{
201 union {
202 __O uint32_t CONTROLS; /* Offset: 0x000 ( /W) CONTROL Set Register */
203 __I uint32_t CONTROL; /* Offset: 0x000 (R/ ) CONTROL Status Register */
204 };
205 /* [31:2] : Reserved */
206 /* [1] : SDA */
207 /* [0] : SCL */
208 __O uint32_t CONTROLC; /* Offset: 0x004 ( /W) CONTROL Clear Register */
210
211
212
213/******************************************************************************/
214/* Peripheral memory map */
215/******************************************************************************/
216
217#define MPS2_FPGAIO_BASE (0x40028000ul)
218#define MPS2_SCC_BASE (0x4002F000ul)
219#define MPS2_SSP0_BASE (0x40021000ul)
220#define MPS2_I2C0_BASE (0x40022000ul)
223/******************************************************************************/
224/* Peripheral declaration */
225/******************************************************************************/
226
227#define MPS2_I2C0 ((MPS2_I2C_TypeDef *) MPS2_I2C0_BASE )
228#define MPS2_FPGAIO ((MPS2_FPGAIO_TypeDef *) MPS2_FPGAIO_BASE )
229#define MPS2_SCC ((MPS2_SCC_TypeDef *) MPS2_SCC_BASE )
230#define MPS2_SSP0 ((MPS2_SSP_TypeDef *) MPS2_SSP0_BASE )
231
232#endif /* SMM_MPS2_H_ */
#define __IO
Definition usbd.c:80
unsigned uint32_t
Definition stdint.h:9
Definition SMM_MPS2.h:46
__IO uint32_t MISC
Definition SMM_MPS2.h:67
__IO uint32_t COUNTER
Definition SMM_MPS2.h:57
__IO uint32_t PSCNTR
Definition SMM_MPS2.h:62
__IO uint32_t CLK1HZ
Definition SMM_MPS2.h:55
__IO uint32_t BUTTON
Definition SMM_MPS2.h:51
__IO uint32_t LED
Definition SMM_MPS2.h:47
__IO uint32_t CLK100HZ
Definition SMM_MPS2.h:56
__IO uint32_t PRESCALE
Definition SMM_MPS2.h:60
Definition SMM_MPS2.h:200
__I uint32_t CONTROL
Definition SMM_MPS2.h:203
__O uint32_t CONTROLC
Definition SMM_MPS2.h:208
__O uint32_t CONTROLS
Definition SMM_MPS2.h:202
Definition SMM_MPS2.h:83
__IO uint32_t CFG_REG1
Definition SMM_MPS2.h:87
__IO uint32_t SYS_CFGDATA_OUT
Definition SMM_MPS2.h:99
__IO uint32_t CFG_REG0
Definition SMM_MPS2.h:84
__I uint32_t SCC_ID
Definition SMM_MPS2.h:127
__IO uint32_t SCC_DLL
Definition SMM_MPS2.h:113
__IO uint32_t SYS_CFGCTRL
Definition SMM_MPS2.h:101
__IO uint32_t SYS_CFGSTAT
Definition SMM_MPS2.h:108
__I uint32_t SCC_AID
Definition SMM_MPS2.h:119
__I uint32_t CFG_REG3
Definition SMM_MPS2.h:93
__I uint32_t CFG_REG2
Definition SMM_MPS2.h:90
__IO uint32_t SYS_CFGDATA_RTN
Definition SMM_MPS2.h:97
Definition SMM_MPS2.h:140
__IO uint32_t CR0
Definition SMM_MPS2.h:141
__I uint32_t MIS
Definition SMM_MPS2.h:179
__O uint32_t ICR
Definition SMM_MPS2.h:185
__IO uint32_t DMACR
Definition SMM_MPS2.h:189
__IO uint32_t DR
Definition SMM_MPS2.h:154
__I uint32_t RIS
Definition SMM_MPS2.h:173
__I uint32_t SR
Definition SMM_MPS2.h:157
__IO uint32_t IMSC
Definition SMM_MPS2.h:167
__IO uint32_t CPSR
Definition SMM_MPS2.h:164
__IO uint32_t CR1
Definition SMM_MPS2.h:148