source: rtems/c/src/lib/libbsp/arm/tms570/include/ti_herc/reg_pom.h @ d6c67ad5

5
Last change on this file since d6c67ad5 was d6c67ad5, checked in by Premysl Houdek <kom541000@…>, on 07/17/15 at 15:04:05

bsp/tms570: skipped 32bit field definitions and corrected single bit fields

there is no need to define access macros for field covering
whole registers. In addition, BSP_FLD32 does not work right
for field 32bit length.

Signed-off-by: Premysl Houdek <kom541000@…>

  • Property mode set to 100644
File size: 13.9 KB
Line 
1/* The header file is generated by make_header.py from POM.json */
2/* Current script's version can be found at: */
3/* https://github.com/AoLaD/rtems-tms570-utils/tree/headers/headers/python */
4
5/*
6 * Copyright (c) 2014-2015, Premysl Houdek <kom541000@gmail.com>
7 *
8 * Czech Technical University in Prague
9 * Zikova 1903/4
10 * 166 36 Praha 6
11 * Czech Republic
12 *
13 * All rights reserved.
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions are met:
17 *
18 * 1. Redistributions of source code must retain the above copyright notice, this
19 *    list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright notice,
21 *    this list of conditions and the following disclaimer in the documentation
22 *    and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
28 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 *
35 * The views and conclusions contained in the software and documentation are those
36 * of the authors and should not be interpreted as representing official policies,
37 * either expressed or implied, of the FreeBSD Project.
38*/
39#ifndef LIBBSP_ARM_TMS570_POM
40#define LIBBSP_ARM_TMS570_POM
41
42#include <bsp/utility.h>
43
44typedef struct{
45  uint32_t PROGSTART;         /*POM Program Region Start Address Register*/
46  uint32_t OVLSTART;          /*POM Overlay Region Start Address Register*/
47  uint32_t REGSIZE;           /*POM Region Size Register */
48  uint32_t Reser;             /*Reserved*/
49} tms570_pom_region_t;
50
51typedef struct{
52  uint32_t GLBCTRL;           /*POM Global Control Register*/
53  uint32_t REV;               /*POM Revision ID*/
54  uint32_t CLKCTRL;           /*POM Clock Gate Control Register*/
55  uint32_t FLG;               /*POM Status Register*/
56  uint8_t reserved1 [496];
57  tms570_pom_region_t REG[32];/*Program Regions*/
58  uint8_t reserved2 [2816];
59  uint32_t ITCTRL;            /*POM Integration Control Register*/
60  uint8_t reserved3 [156];
61  uint32_t CLAIMSET;          /*POM Claim Set Register*/
62  uint32_t CLAIMCLR;          /*POM Claim Clear Register*/
63  uint8_t reserved4 [8];
64  uint32_t LOCKACCESS;        /*POM Lock Access Register*/
65  uint32_t LOCKSTATUS;        /*POM Lock Status Register*/
66  uint32_t AUTHSTATUS;        /*POM Authentication Status Register*/
67  uint8_t reserved5 [12];
68  uint32_t DEVID;             /*POM Device ID Register*/
69  uint32_t DEVTYPE;           /*POM Device Type Register*/
70  uint32_t PERIPHERALID4;     /*POM Peripheral ID 4 Register*/
71  uint32_t PERIPHERALID5;     /*POM Peripheral ID 5 Register*/
72  uint32_t PERIPHERALID6;     /*POM Peripheral ID 6 Register*/
73  uint32_t PERIPHERALID7;     /*POM Peripheral ID 7 Register*/
74  uint32_t PERIPHERALID0;     /*POM Peripheral ID 0 Register*/
75  uint32_t PERIPHERALID1;     /*POM Peripheral ID 1 Register*/
76  uint32_t PERIPHERALID2;     /*POM Peripheral ID 2 Register*/
77  uint32_t PERIPHERALID3;     /*POM Peripheral ID 3 Register*/
78  uint32_t COMPONENTID0;      /*POM Component ID 0 Register*/
79  uint32_t COMPONENTID1;      /*POM Component ID 1 Register*/
80  uint32_t COMPONENTID2;      /*POM Component ID 2 Register*/
81  uint32_t COMPONENTID3;      /*POM Component ID 3 Register*/
82} tms570_pom_t;
83
84
85/*--------------------TMS570_POM_PROGSTART--------------------*/
86/* field: STARTADDRESS - Defines the start address of the program memory region. */
87#define TMS570_POM_PROGSTART_STARTADDRESS(val) BSP_FLD32(val,0, 22)
88#define TMS570_POM_PROGSTART_STARTADDRESS_GET(reg) BSP_FLD32GET(reg,0, 22)
89#define TMS570_POM_PROGSTART_STARTADDRESS_SET(reg,val) BSP_FLD32SET(reg, val,0, 22)
90
91
92/*--------------------TMS570_POM_OVLSTART--------------------*/
93/* field: STARTADDRESS - Defines the start address of the overlay memory region. */
94#define TMS570_POM_OVLSTART_STARTADDRESS(val) BSP_FLD32(val,0, 22)
95#define TMS570_POM_OVLSTART_STARTADDRESS_GET(reg) BSP_FLD32GET(reg,0, 22)
96#define TMS570_POM_OVLSTART_STARTADDRESS_SET(reg,val) BSP_FLD32SET(reg, val,0, 22)
97
98
99/*---------------------TMS570_POM_REGSIZE---------------------*/
100/* field: SIZE - Region size */
101#define TMS570_POM_REGSIZE_SIZE(val) BSP_FLD32(val,0, 3)
102#define TMS570_POM_REGSIZE_SIZE_GET(reg) BSP_FLD32GET(reg,0, 3)
103#define TMS570_POM_REGSIZE_SIZE_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
104
105
106/*---------------------TMS570_POM_GLBCTRL---------------------*/
107/* field: OTADDR - Overlay target Address. */
108#define TMS570_POM_GLBCTRL_OTADDR(val) BSP_FLD32(val,23, 31)
109#define TMS570_POM_GLBCTRL_OTADDR_GET(reg) BSP_FLD32GET(reg,23, 31)
110#define TMS570_POM_GLBCTRL_OTADDR_SET(reg,val) BSP_FLD32SET(reg, val,23, 31)
111
112/* field: ETO - Enable Timeout. Refer to Section 18.2.2 for more details on the timeout error. */
113#define TMS570_POM_GLBCTRL_ETO(val) BSP_FLD32(val,8, 11)
114#define TMS570_POM_GLBCTRL_ETO_GET(reg) BSP_FLD32GET(reg,8, 11)
115#define TMS570_POM_GLBCTRL_ETO_SET(reg,val) BSP_FLD32SET(reg, val,8, 11)
116
117/* field: ON_OFF - Turn functionality of POM on or off. */
118#define TMS570_POM_GLBCTRL_ON_OFF(val) BSP_FLD32(val,0, 3)
119#define TMS570_POM_GLBCTRL_ON_OFF_GET(reg) BSP_FLD32GET(reg,0, 3)
120#define TMS570_POM_GLBCTRL_ON_OFF_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
121
122
123/*-----------------------TMS570_POM_REV-----------------------*/
124/* field: SCHEME - Used to distinguish between different ID schemes. */
125#define TMS570_POM_REV_SCHEME(val) BSP_FLD32(val,30, 31)
126#define TMS570_POM_REV_SCHEME_GET(reg) BSP_FLD32GET(reg,30, 31)
127#define TMS570_POM_REV_SCHEME_SET(reg,val) BSP_FLD32SET(reg, val,30, 31)
128
129/* field: FUNC - Indicates the SW compatible module family */
130#define TMS570_POM_REV_FUNC(val) BSP_FLD32(val,16, 27)
131#define TMS570_POM_REV_FUNC_GET(reg) BSP_FLD32GET(reg,16, 27)
132#define TMS570_POM_REV_FUNC_SET(reg,val) BSP_FLD32SET(reg, val,16, 27)
133
134/* field: RTL - RTL version number */
135#define TMS570_POM_REV_RTL(val) BSP_FLD32(val,11, 15)
136#define TMS570_POM_REV_RTL_GET(reg) BSP_FLD32GET(reg,11, 15)
137#define TMS570_POM_REV_RTL_SET(reg,val) BSP_FLD32SET(reg, val,11, 15)
138
139/* field: MAJOR - Major revision number */
140#define TMS570_POM_REV_MAJOR(val) BSP_FLD32(val,8, 10)
141#define TMS570_POM_REV_MAJOR_GET(reg) BSP_FLD32GET(reg,8, 10)
142#define TMS570_POM_REV_MAJOR_SET(reg,val) BSP_FLD32SET(reg, val,8, 10)
143
144/* field: CUSTOM - Indicates a device specific implementation */
145#define TMS570_POM_REV_CUSTOM(val) BSP_FLD32(val,6, 7)
146#define TMS570_POM_REV_CUSTOM_GET(reg) BSP_FLD32GET(reg,6, 7)
147#define TMS570_POM_REV_CUSTOM_SET(reg,val) BSP_FLD32SET(reg, val,6, 7)
148
149/* field: 5_0 - MINOR 8h Minor revision number */
150#define TMS570_POM_REV_5_0(val) BSP_FLD32(val,0, 5)
151#define TMS570_POM_REV_5_0_GET(reg) BSP_FLD32GET(reg,0, 5)
152#define TMS570_POM_REV_5_0_SET(reg,val) BSP_FLD32SET(reg, val,0, 5)
153
154
155/*---------------------TMS570_POM_CLKCTRL---------------------*/
156/* field: CLK_GATE_OFF - Do not modify this bit. Leave it in its reset state. */
157#define TMS570_POM_CLKCTRL_CLK_GATE_OFF BSP_BIT32(0)
158
159
160/*-----------------------TMS570_POM_FLG-----------------------*/
161/* field: TO - Timeout. */
162#define TMS570_POM_FLG_TO BSP_BIT32(0)
163
164
165/*---------------------TMS570_POM_ITCTRL---------------------*/
166/* field: Reserved - Read returns 0. Writes have no effect. */
167/* Whole 32 bits */
168
169/*--------------------TMS570_POM_CLAIMSET--------------------*/
170/* field: SET1 - The module is claimed */
171#define TMS570_POM_CLAIMSET_SET1 BSP_BIT32(1)
172
173/* field: SET0 - The module is claimed */
174#define TMS570_POM_CLAIMSET_SET0 BSP_BIT32(0)
175
176
177/*--------------------TMS570_POM_CLAIMCLR--------------------*/
178/* field: CLR1 - The module is claimed */
179#define TMS570_POM_CLAIMCLR_CLR1 BSP_BIT32(1)
180
181/* field: CLR0 - The module is claimed */
182#define TMS570_POM_CLAIMCLR_CLR0 BSP_BIT32(0)
183
184
185/*-------------------TMS570_POM_LOCKACCESS-------------------*/
186/* field: Reserved - Read returns 0. Writes have no effect. */
187/* Whole 32 bits */
188
189/*-------------------TMS570_POM_LOCKSTATUS-------------------*/
190/* field: Reserved - Read returns 0. Writes have no effect. */
191/* Whole 32 bits */
192
193/*-------------------TMS570_POM_AUTHSTATUS-------------------*/
194/* field: Reserved - Read returns 0. Writes have no effect. */
195/* Whole 32 bits */
196
197/*----------------------TMS570_POM_DEVID----------------------*/
198/* field: Reserved - Read returns 0. Writes have no effect. */
199/* Whole 32 bits */
200
201/*---------------------TMS570_POM_DEVTYPE---------------------*/
202/* field: Sub_Type - Other */
203#define TMS570_POM_DEVTYPE_Sub_Type(val) BSP_FLD32(val,4, 7)
204#define TMS570_POM_DEVTYPE_Sub_Type_GET(reg) BSP_FLD32GET(reg,4, 7)
205#define TMS570_POM_DEVTYPE_Sub_Type_SET(reg,val) BSP_FLD32SET(reg, val,4, 7)
206
207/* field: Major_Type - Debug Control */
208#define TMS570_POM_DEVTYPE_Major_Type(val) BSP_FLD32(val,0, 3)
209#define TMS570_POM_DEVTYPE_Major_Type_GET(reg) BSP_FLD32GET(reg,0, 3)
210#define TMS570_POM_DEVTYPE_Major_Type_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
211
212
213/*------------------TMS570_POM_PERIPHERALID4------------------*/
214/* field: 4KB_Count - Only 4KB implemented */
215#define TMS570_POM_PERIPHERALID4_4KB_Count(val) BSP_FLD32(val,4, 7)
216#define TMS570_POM_PERIPHERALID4_4KB_Count_GET(reg) BSP_FLD32GET(reg,4, 7)
217#define TMS570_POM_PERIPHERALID4_4KB_Count_SET(reg,val) BSP_FLD32SET(reg, val,4, 7)
218
219/* field: JEP_Continuation - JEP106 Code */
220#define TMS570_POM_PERIPHERALID4_JEP_Continuation(val) BSP_FLD32(val,0, 3)
221#define TMS570_POM_PERIPHERALID4_JEP_Continuation_GET(reg) BSP_FLD32GET(reg,0, 3)
222#define TMS570_POM_PERIPHERALID4_JEP_Continuation_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
223
224
225/*------------------TMS570_POM_PERIPHERALID5------------------*/
226/* field: Reserved - Read returns 0. Writes have no effect. */
227/* Whole 32 bits */
228
229/*------------------TMS570_POM_PERIPHERALID6------------------*/
230/* field: Reserved - Read returns 0. Writes have no effect. */
231/* Whole 32 bits */
232
233/*------------------TMS570_POM_PERIPHERALID7------------------*/
234/* field: Reserved - Read returns 0. Writes have no effect. */
235/* Whole 32 bits */
236
237/*------------------TMS570_POM_PERIPHERALID0------------------*/
238/* field: Part_Number - Reads 0, since POMREV defines the module */
239#define TMS570_POM_PERIPHERALID0_Part_Number(val) BSP_FLD32(val,0, 7)
240#define TMS570_POM_PERIPHERALID0_Part_Number_GET(reg) BSP_FLD32GET(reg,0, 7)
241#define TMS570_POM_PERIPHERALID0_Part_Number_SET(reg,val) BSP_FLD32SET(reg, val,0, 7)
242
243
244/*------------------TMS570_POM_PERIPHERALID1------------------*/
245/* field: JEP106_Identity - Part of TI JEDEC number */
246#define TMS570_POM_PERIPHERALID1_JEP106_Identity(val) BSP_FLD32(val,4, 7)
247#define TMS570_POM_PERIPHERALID1_JEP106_Identity_GET(reg) BSP_FLD32GET(reg,4, 7)
248#define TMS570_POM_PERIPHERALID1_JEP106_Identity_SET(reg,val) BSP_FLD32SET(reg, val,4, 7)
249
250/* field: Part_Number - Reads 0, since POMREV defines the module */
251#define TMS570_POM_PERIPHERALID1_Part_Number(val) BSP_FLD32(val,0, 3)
252#define TMS570_POM_PERIPHERALID1_Part_Number_GET(reg) BSP_FLD32GET(reg,0, 3)
253#define TMS570_POM_PERIPHERALID1_Part_Number_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
254
255
256/*------------------TMS570_POM_PERIPHERALID2------------------*/
257/* field: Revision - Reads 0, since POMREV defines the module */
258#define TMS570_POM_PERIPHERALID2_Revision(val) BSP_FLD32(val,4, 7)
259#define TMS570_POM_PERIPHERALID2_Revision_GET(reg) BSP_FLD32GET(reg,4, 7)
260#define TMS570_POM_PERIPHERALID2_Revision_SET(reg,val) BSP_FLD32SET(reg, val,4, 7)
261
262/* field: JEDEC - Indicates JEDEC assigned value */
263#define TMS570_POM_PERIPHERALID2_JEDEC BSP_BIT32(3)
264
265/* field: JEP106_Identity - JEDEC+JEP106 Identity Code (POMPERIPHERALID2)+JEP106 Identity Code */
266#define TMS570_POM_PERIPHERALID2_JEP106_Identity(val) BSP_FLD32(val,0, 2)
267#define TMS570_POM_PERIPHERALID2_JEP106_Identity_GET(reg) BSP_FLD32GET(reg,0, 2)
268#define TMS570_POM_PERIPHERALID2_JEP106_Identity_SET(reg,val) BSP_FLD32SET(reg, val,0, 2)
269
270
271/*------------------TMS570_POM_PERIPHERALID3------------------*/
272/* field: Reserved - Read returns 0. Writes have no effect. */
273/* Whole 32 bits */
274
275/*------------------TMS570_POM_COMPONENTID0------------------*/
276/* field: Preamble - Preamble */
277#define TMS570_POM_COMPONENTID0_Preamble(val) BSP_FLD32(val,0, 7)
278#define TMS570_POM_COMPONENTID0_Preamble_GET(reg) BSP_FLD32GET(reg,0, 7)
279#define TMS570_POM_COMPONENTID0_Preamble_SET(reg,val) BSP_FLD32SET(reg, val,0, 7)
280
281
282/*------------------TMS570_POM_COMPONENTID1------------------*/
283/* field: Component_Class - CoreSight Component */
284#define TMS570_POM_COMPONENTID1_Component_Class(val) BSP_FLD32(val,4, 7)
285#define TMS570_POM_COMPONENTID1_Component_Class_GET(reg) BSP_FLD32GET(reg,4, 7)
286#define TMS570_POM_COMPONENTID1_Component_Class_SET(reg,val) BSP_FLD32SET(reg, val,4, 7)
287
288/* field: Preamble - Preamble */
289#define TMS570_POM_COMPONENTID1_Preamble(val) BSP_FLD32(val,0, 3)
290#define TMS570_POM_COMPONENTID1_Preamble_GET(reg) BSP_FLD32GET(reg,0, 3)
291#define TMS570_POM_COMPONENTID1_Preamble_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
292
293
294/*------------------TMS570_POM_COMPONENTID2------------------*/
295/* field: Preamble - Preamble */
296#define TMS570_POM_COMPONENTID2_Preamble(val) BSP_FLD32(val,0, 7)
297#define TMS570_POM_COMPONENTID2_Preamble_GET(reg) BSP_FLD32GET(reg,0, 7)
298#define TMS570_POM_COMPONENTID2_Preamble_SET(reg,val) BSP_FLD32SET(reg, val,0, 7)
299
300
301/*------------------TMS570_POM_COMPONENTID3------------------*/
302/* field: Preamble - Preamble */
303#define TMS570_POM_COMPONENTID3_Preamble(val) BSP_FLD32(val,0, 7)
304#define TMS570_POM_COMPONENTID3_Preamble_GET(reg) BSP_FLD32GET(reg,0, 7)
305#define TMS570_POM_COMPONENTID3_Preamble_SET(reg,val) BSP_FLD32SET(reg, val,0, 7)
306
307
308
309#endif /* LIBBSP_ARM_TMS570_POM */
Note: See TracBrowser for help on using the repository browser.