Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:39

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup RTEMSBSPsARMTMS570
0007  *
0008  * @brief This header file provides POM interfaces.
0009  */
0010 
0011 /* The header file is generated by make_header.py from POM.json */
0012 /* Current script's version can be found at: */
0013 /* https://github.com/AoLaD/rtems-tms570-utils/tree/headers/headers/python */
0014 
0015 /*
0016  * Copyright (c) 2014-2015, Premysl Houdek <kom541000@gmail.com>
0017  *
0018  * Czech Technical University in Prague
0019  * Zikova 1903/4
0020  * 166 36 Praha 6
0021  * Czech Republic
0022  *
0023  * All rights reserved.
0024  *
0025  * Redistribution and use in source and binary forms, with or without
0026  * modification, are permitted provided that the following conditions are met:
0027  *
0028  * 1. Redistributions of source code must retain the above copyright notice, this
0029  *    list of conditions and the following disclaimer.
0030  * 2. Redistributions in binary form must reproduce the above copyright notice,
0031  *    this list of conditions and the following disclaimer in the documentation
0032  *    and/or other materials provided with the distribution.
0033  *
0034  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
0035  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
0036  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
0037  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
0038  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
0039  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
0040  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
0041  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0042  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0043  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0044  *
0045  * The views and conclusions contained in the software and documentation are those
0046  * of the authors and should not be interpreted as representing official policies,
0047  * either expressed or implied, of the FreeBSD Project.
0048 */
0049 #ifndef LIBBSP_ARM_TMS570_POM
0050 #define LIBBSP_ARM_TMS570_POM
0051 
0052 #include <bsp/utility.h>
0053 
0054 typedef struct{
0055   uint32_t PROGSTART;         /*POM Program Region Start Address Register*/
0056   uint32_t OVLSTART;          /*POM Overlay Region Start Address Register*/
0057   uint32_t REGSIZE;           /*POM Region Size Register */
0058   uint32_t Reser;             /*Reserved*/
0059 } tms570_pom_region_t;
0060 
0061 typedef struct{
0062   uint32_t GLBCTRL;           /*POM Global Control Register*/
0063   uint32_t REV;               /*POM Revision ID*/
0064   uint32_t CLKCTRL;           /*POM Clock Gate Control Register*/
0065   uint32_t FLG;               /*POM Status Register*/
0066   uint8_t reserved1 [496];
0067   tms570_pom_region_t REG[32];/*Program Regions*/
0068   uint8_t reserved2 [2816];
0069   uint32_t ITCTRL;            /*POM Integration Control Register*/
0070   uint8_t reserved3 [156];
0071   uint32_t CLAIMSET;          /*POM Claim Set Register*/
0072   uint32_t CLAIMCLR;          /*POM Claim Clear Register*/
0073   uint8_t reserved4 [8];
0074   uint32_t LOCKACCESS;        /*POM Lock Access Register*/
0075   uint32_t LOCKSTATUS;        /*POM Lock Status Register*/
0076   uint32_t AUTHSTATUS;        /*POM Authentication Status Register*/
0077   uint8_t reserved5 [12];
0078   uint32_t DEVID;             /*POM Device ID Register*/
0079   uint32_t DEVTYPE;           /*POM Device Type Register*/
0080   uint32_t PERIPHERALID4;     /*POM Peripheral ID 4 Register*/
0081   uint32_t PERIPHERALID5;     /*POM Peripheral ID 5 Register*/
0082   uint32_t PERIPHERALID6;     /*POM Peripheral ID 6 Register*/
0083   uint32_t PERIPHERALID7;     /*POM Peripheral ID 7 Register*/
0084   uint32_t PERIPHERALID0;     /*POM Peripheral ID 0 Register*/
0085   uint32_t PERIPHERALID1;     /*POM Peripheral ID 1 Register*/
0086   uint32_t PERIPHERALID2;     /*POM Peripheral ID 2 Register*/
0087   uint32_t PERIPHERALID3;     /*POM Peripheral ID 3 Register*/
0088   uint32_t COMPONENTID0;      /*POM Component ID 0 Register*/
0089   uint32_t COMPONENTID1;      /*POM Component ID 1 Register*/
0090   uint32_t COMPONENTID2;      /*POM Component ID 2 Register*/
0091   uint32_t COMPONENTID3;      /*POM Component ID 3 Register*/
0092 } tms570_pom_t;
0093 
0094 
0095 /*--------------------TMS570_POM_PROGSTART--------------------*/
0096 /* field: STARTADDRESS - Defines the start address of the program memory region. */
0097 #define TMS570_POM_PROGSTART_STARTADDRESS(val) BSP_FLD32(val,0, 22)
0098 #define TMS570_POM_PROGSTART_STARTADDRESS_GET(reg) BSP_FLD32GET(reg,0, 22)
0099 #define TMS570_POM_PROGSTART_STARTADDRESS_SET(reg,val) BSP_FLD32SET(reg, val,0, 22)
0100 
0101 
0102 /*--------------------TMS570_POM_OVLSTART--------------------*/
0103 /* field: STARTADDRESS - Defines the start address of the overlay memory region. */
0104 #define TMS570_POM_OVLSTART_STARTADDRESS(val) BSP_FLD32(val,0, 22)
0105 #define TMS570_POM_OVLSTART_STARTADDRESS_GET(reg) BSP_FLD32GET(reg,0, 22)
0106 #define TMS570_POM_OVLSTART_STARTADDRESS_SET(reg,val) BSP_FLD32SET(reg, val,0, 22)
0107 
0108 
0109 /*---------------------TMS570_POM_REGSIZE---------------------*/
0110 /* field: SIZE - Region size */
0111 #define TMS570_POM_REGSIZE_SIZE(val) BSP_FLD32(val,0, 3)
0112 #define TMS570_POM_REGSIZE_SIZE_GET(reg) BSP_FLD32GET(reg,0, 3)
0113 #define TMS570_POM_REGSIZE_SIZE_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
0114 
0115 
0116 /*---------------------TMS570_POM_GLBCTRL---------------------*/
0117 /* field: OTADDR - Overlay target Address. */
0118 #define TMS570_POM_GLBCTRL_OTADDR(val) BSP_FLD32(val,23, 31)
0119 #define TMS570_POM_GLBCTRL_OTADDR_GET(reg) BSP_FLD32GET(reg,23, 31)
0120 #define TMS570_POM_GLBCTRL_OTADDR_SET(reg,val) BSP_FLD32SET(reg, val,23, 31)
0121 
0122 /* field: ETO - Enable Timeout. Refer to Section 18.2.2 for more details on the timeout error. */
0123 #define TMS570_POM_GLBCTRL_ETO(val) BSP_FLD32(val,8, 11)
0124 #define TMS570_POM_GLBCTRL_ETO_GET(reg) BSP_FLD32GET(reg,8, 11)
0125 #define TMS570_POM_GLBCTRL_ETO_SET(reg,val) BSP_FLD32SET(reg, val,8, 11)
0126 
0127 /* field: ON_OFF - Turn functionality of POM on or off. */
0128 #define TMS570_POM_GLBCTRL_ON_OFF(val) BSP_FLD32(val,0, 3)
0129 #define TMS570_POM_GLBCTRL_ON_OFF_GET(reg) BSP_FLD32GET(reg,0, 3)
0130 #define TMS570_POM_GLBCTRL_ON_OFF_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
0131 
0132 
0133 /*-----------------------TMS570_POM_REV-----------------------*/
0134 /* field: SCHEME - Used to distinguish between different ID schemes. */
0135 #define TMS570_POM_REV_SCHEME(val) BSP_FLD32(val,30, 31)
0136 #define TMS570_POM_REV_SCHEME_GET(reg) BSP_FLD32GET(reg,30, 31)
0137 #define TMS570_POM_REV_SCHEME_SET(reg,val) BSP_FLD32SET(reg, val,30, 31)
0138 
0139 /* field: FUNC - Indicates the SW compatible module family */
0140 #define TMS570_POM_REV_FUNC(val) BSP_FLD32(val,16, 27)
0141 #define TMS570_POM_REV_FUNC_GET(reg) BSP_FLD32GET(reg,16, 27)
0142 #define TMS570_POM_REV_FUNC_SET(reg,val) BSP_FLD32SET(reg, val,16, 27)
0143 
0144 /* field: RTL - RTL version number */
0145 #define TMS570_POM_REV_RTL(val) BSP_FLD32(val,11, 15)
0146 #define TMS570_POM_REV_RTL_GET(reg) BSP_FLD32GET(reg,11, 15)
0147 #define TMS570_POM_REV_RTL_SET(reg,val) BSP_FLD32SET(reg, val,11, 15)
0148 
0149 /* field: MAJOR - Major revision number */
0150 #define TMS570_POM_REV_MAJOR(val) BSP_FLD32(val,8, 10)
0151 #define TMS570_POM_REV_MAJOR_GET(reg) BSP_FLD32GET(reg,8, 10)
0152 #define TMS570_POM_REV_MAJOR_SET(reg,val) BSP_FLD32SET(reg, val,8, 10)
0153 
0154 /* field: CUSTOM - Indicates a device specific implementation */
0155 #define TMS570_POM_REV_CUSTOM(val) BSP_FLD32(val,6, 7)
0156 #define TMS570_POM_REV_CUSTOM_GET(reg) BSP_FLD32GET(reg,6, 7)
0157 #define TMS570_POM_REV_CUSTOM_SET(reg,val) BSP_FLD32SET(reg, val,6, 7)
0158 
0159 /* field: 5_0 - MINOR 8h Minor revision number */
0160 #define TMS570_POM_REV_5_0(val) BSP_FLD32(val,0, 5)
0161 #define TMS570_POM_REV_5_0_GET(reg) BSP_FLD32GET(reg,0, 5)
0162 #define TMS570_POM_REV_5_0_SET(reg,val) BSP_FLD32SET(reg, val,0, 5)
0163 
0164 
0165 /*---------------------TMS570_POM_CLKCTRL---------------------*/
0166 /* field: CLK_GATE_OFF - Do not modify this bit. Leave it in its reset state. */
0167 #define TMS570_POM_CLKCTRL_CLK_GATE_OFF BSP_BIT32(0)
0168 
0169 
0170 /*-----------------------TMS570_POM_FLG-----------------------*/
0171 /* field: TO - Timeout. */
0172 #define TMS570_POM_FLG_TO BSP_BIT32(0)
0173 
0174 
0175 /*---------------------TMS570_POM_ITCTRL---------------------*/
0176 /* field: Reserved - Read returns 0. Writes have no effect. */
0177 /* Whole 32 bits */
0178 
0179 /*--------------------TMS570_POM_CLAIMSET--------------------*/
0180 /* field: SET1 - The module is claimed */
0181 #define TMS570_POM_CLAIMSET_SET1 BSP_BIT32(1)
0182 
0183 /* field: SET0 - The module is claimed */
0184 #define TMS570_POM_CLAIMSET_SET0 BSP_BIT32(0)
0185 
0186 
0187 /*--------------------TMS570_POM_CLAIMCLR--------------------*/
0188 /* field: CLR1 - The module is claimed */
0189 #define TMS570_POM_CLAIMCLR_CLR1 BSP_BIT32(1)
0190 
0191 /* field: CLR0 - The module is claimed */
0192 #define TMS570_POM_CLAIMCLR_CLR0 BSP_BIT32(0)
0193 
0194 
0195 /*-------------------TMS570_POM_LOCKACCESS-------------------*/
0196 /* field: Reserved - Read returns 0. Writes have no effect. */
0197 /* Whole 32 bits */
0198 
0199 /*-------------------TMS570_POM_LOCKSTATUS-------------------*/
0200 /* field: Reserved - Read returns 0. Writes have no effect. */
0201 /* Whole 32 bits */
0202 
0203 /*-------------------TMS570_POM_AUTHSTATUS-------------------*/
0204 /* field: Reserved - Read returns 0. Writes have no effect. */
0205 /* Whole 32 bits */
0206 
0207 /*----------------------TMS570_POM_DEVID----------------------*/
0208 /* field: Reserved - Read returns 0. Writes have no effect. */
0209 /* Whole 32 bits */
0210 
0211 /*---------------------TMS570_POM_DEVTYPE---------------------*/
0212 /* field: Sub_Type - Other */
0213 #define TMS570_POM_DEVTYPE_Sub_Type(val) BSP_FLD32(val,4, 7)
0214 #define TMS570_POM_DEVTYPE_Sub_Type_GET(reg) BSP_FLD32GET(reg,4, 7)
0215 #define TMS570_POM_DEVTYPE_Sub_Type_SET(reg,val) BSP_FLD32SET(reg, val,4, 7)
0216 
0217 /* field: Major_Type - Debug Control */
0218 #define TMS570_POM_DEVTYPE_Major_Type(val) BSP_FLD32(val,0, 3)
0219 #define TMS570_POM_DEVTYPE_Major_Type_GET(reg) BSP_FLD32GET(reg,0, 3)
0220 #define TMS570_POM_DEVTYPE_Major_Type_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
0221 
0222 
0223 /*------------------TMS570_POM_PERIPHERALID4------------------*/
0224 /* field: 4KB_Count - Only 4KB implemented */
0225 #define TMS570_POM_PERIPHERALID4_4KB_Count(val) BSP_FLD32(val,4, 7)
0226 #define TMS570_POM_PERIPHERALID4_4KB_Count_GET(reg) BSP_FLD32GET(reg,4, 7)
0227 #define TMS570_POM_PERIPHERALID4_4KB_Count_SET(reg,val) BSP_FLD32SET(reg, val,4, 7)
0228 
0229 /* field: JEP_Continuation - JEP106 Code */
0230 #define TMS570_POM_PERIPHERALID4_JEP_Continuation(val) BSP_FLD32(val,0, 3)
0231 #define TMS570_POM_PERIPHERALID4_JEP_Continuation_GET(reg) BSP_FLD32GET(reg,0, 3)
0232 #define TMS570_POM_PERIPHERALID4_JEP_Continuation_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
0233 
0234 
0235 /*------------------TMS570_POM_PERIPHERALID5------------------*/
0236 /* field: Reserved - Read returns 0. Writes have no effect. */
0237 /* Whole 32 bits */
0238 
0239 /*------------------TMS570_POM_PERIPHERALID6------------------*/
0240 /* field: Reserved - Read returns 0. Writes have no effect. */
0241 /* Whole 32 bits */
0242 
0243 /*------------------TMS570_POM_PERIPHERALID7------------------*/
0244 /* field: Reserved - Read returns 0. Writes have no effect. */
0245 /* Whole 32 bits */
0246 
0247 /*------------------TMS570_POM_PERIPHERALID0------------------*/
0248 /* field: Part_Number - Reads 0, since POMREV defines the module */
0249 #define TMS570_POM_PERIPHERALID0_Part_Number(val) BSP_FLD32(val,0, 7)
0250 #define TMS570_POM_PERIPHERALID0_Part_Number_GET(reg) BSP_FLD32GET(reg,0, 7)
0251 #define TMS570_POM_PERIPHERALID0_Part_Number_SET(reg,val) BSP_FLD32SET(reg, val,0, 7)
0252 
0253 
0254 /*------------------TMS570_POM_PERIPHERALID1------------------*/
0255 /* field: JEP106_Identity - Part of TI JEDEC number */
0256 #define TMS570_POM_PERIPHERALID1_JEP106_Identity(val) BSP_FLD32(val,4, 7)
0257 #define TMS570_POM_PERIPHERALID1_JEP106_Identity_GET(reg) BSP_FLD32GET(reg,4, 7)
0258 #define TMS570_POM_PERIPHERALID1_JEP106_Identity_SET(reg,val) BSP_FLD32SET(reg, val,4, 7)
0259 
0260 /* field: Part_Number - Reads 0, since POMREV defines the module */
0261 #define TMS570_POM_PERIPHERALID1_Part_Number(val) BSP_FLD32(val,0, 3)
0262 #define TMS570_POM_PERIPHERALID1_Part_Number_GET(reg) BSP_FLD32GET(reg,0, 3)
0263 #define TMS570_POM_PERIPHERALID1_Part_Number_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
0264 
0265 
0266 /*------------------TMS570_POM_PERIPHERALID2------------------*/
0267 /* field: Revision - Reads 0, since POMREV defines the module */
0268 #define TMS570_POM_PERIPHERALID2_Revision(val) BSP_FLD32(val,4, 7)
0269 #define TMS570_POM_PERIPHERALID2_Revision_GET(reg) BSP_FLD32GET(reg,4, 7)
0270 #define TMS570_POM_PERIPHERALID2_Revision_SET(reg,val) BSP_FLD32SET(reg, val,4, 7)
0271 
0272 /* field: JEDEC - Indicates JEDEC assigned value */
0273 #define TMS570_POM_PERIPHERALID2_JEDEC BSP_BIT32(3)
0274 
0275 /* field: JEP106_Identity - JEDEC+JEP106 Identity Code (POMPERIPHERALID2)+JEP106 Identity Code */
0276 #define TMS570_POM_PERIPHERALID2_JEP106_Identity(val) BSP_FLD32(val,0, 2)
0277 #define TMS570_POM_PERIPHERALID2_JEP106_Identity_GET(reg) BSP_FLD32GET(reg,0, 2)
0278 #define TMS570_POM_PERIPHERALID2_JEP106_Identity_SET(reg,val) BSP_FLD32SET(reg, val,0, 2)
0279 
0280 
0281 /*------------------TMS570_POM_PERIPHERALID3------------------*/
0282 /* field: Reserved - Read returns 0. Writes have no effect. */
0283 /* Whole 32 bits */
0284 
0285 /*------------------TMS570_POM_COMPONENTID0------------------*/
0286 /* field: Preamble - Preamble */
0287 #define TMS570_POM_COMPONENTID0_Preamble(val) BSP_FLD32(val,0, 7)
0288 #define TMS570_POM_COMPONENTID0_Preamble_GET(reg) BSP_FLD32GET(reg,0, 7)
0289 #define TMS570_POM_COMPONENTID0_Preamble_SET(reg,val) BSP_FLD32SET(reg, val,0, 7)
0290 
0291 
0292 /*------------------TMS570_POM_COMPONENTID1------------------*/
0293 /* field: Component_Class - CoreSight Component */
0294 #define TMS570_POM_COMPONENTID1_Component_Class(val) BSP_FLD32(val,4, 7)
0295 #define TMS570_POM_COMPONENTID1_Component_Class_GET(reg) BSP_FLD32GET(reg,4, 7)
0296 #define TMS570_POM_COMPONENTID1_Component_Class_SET(reg,val) BSP_FLD32SET(reg, val,4, 7)
0297 
0298 /* field: Preamble - Preamble */
0299 #define TMS570_POM_COMPONENTID1_Preamble(val) BSP_FLD32(val,0, 3)
0300 #define TMS570_POM_COMPONENTID1_Preamble_GET(reg) BSP_FLD32GET(reg,0, 3)
0301 #define TMS570_POM_COMPONENTID1_Preamble_SET(reg,val) BSP_FLD32SET(reg, val,0, 3)
0302 
0303 
0304 /*------------------TMS570_POM_COMPONENTID2------------------*/
0305 /* field: Preamble - Preamble */
0306 #define TMS570_POM_COMPONENTID2_Preamble(val) BSP_FLD32(val,0, 7)
0307 #define TMS570_POM_COMPONENTID2_Preamble_GET(reg) BSP_FLD32GET(reg,0, 7)
0308 #define TMS570_POM_COMPONENTID2_Preamble_SET(reg,val) BSP_FLD32SET(reg, val,0, 7)
0309 
0310 
0311 /*------------------TMS570_POM_COMPONENTID3------------------*/
0312 /* field: Preamble - Preamble */
0313 #define TMS570_POM_COMPONENTID3_Preamble(val) BSP_FLD32(val,0, 7)
0314 #define TMS570_POM_COMPONENTID3_Preamble_GET(reg) BSP_FLD32GET(reg,0, 7)
0315 #define TMS570_POM_COMPONENTID3_Preamble_SET(reg,val) BSP_FLD32SET(reg, val,0, 7)
0316 
0317 
0318 
0319 #endif /* LIBBSP_ARM_TMS570_POM */