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 IOMM interfaces.
0009  */
0010 
0011 /* The header file is generated by make_header.py from IOMM.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_IOMM
0050 #define LIBBSP_ARM_TMS570_IOMM
0051 
0052 #include <bsp/utility.h>
0053 #include <bspopts.h>
0054 
0055 typedef struct{
0056   uint32_t REVISION_REG;      /*Revision Register*/
0057   uint8_t reserved1 [28];
0058   uint32_t ENDIAN_REG;        /*Device Endianness Register*/
0059   uint8_t reserved2 [20];
0060   uint32_t KICK_REG0;         /*Kicker Register 0*/
0061   uint32_t KICK_REG1;         /*Kicker Register 1*/
0062   uint8_t reserved3 [160];
0063   uint32_t ERR_RAW_STATUS_REG;/*Error Raw Status / Set Register*/
0064   uint32_t ERR_ENABLED_STATUS_REG;/*Error Enabled Status / Clear Register*/
0065   uint32_t ERR_ENABLE_REG;    /*Error Signaling Enable Register*/
0066   uint32_t ERR_ENABLE_CLR_REG;/*Error Signaling Enable Clear Register*/
0067   uint8_t reserved4 [4];
0068   uint32_t FAULT_ADDRESS_REG; /*Fault Address Register*/
0069   uint32_t FAULT_STATUS_REG;  /*Fault Status Register*/
0070   uint32_t FAULT_CLEAR_REG;   /*Fault Clear Register*/
0071   uint8_t reserved5 [16];
0072 #if TMS570_VARIANT == 4357
0073   uint32_t PINMMR[180]; /* 0x110 - 1A4 : Output Pin Multiplexing Control
0074                            Registers (38 registers); 0x250 - 0x29C : Input Pin
0075                            Multiplexing Control Registers (20); 0X390 - 3DC :
0076                            Special Functionality Control Registers (20) */
0077 #else
0078   uint32_t PINMMR[30]; /*Pin Multiplexing Control Register 0-30*/
0079 #endif
0080 } tms570_iomm_t;
0081 
0082 
0083 /*--------------------TMS570_IOMM_PINMMRx--------------------*/
0084 /* field: PINMMRx24To31 - Each of these byte-fields control the functionality on a given ball/pin. */
0085 #define TMS570_IOMM_PINMMRx_PINMMRx24To31(val) BSP_FLD32(val,24, 31)
0086 #define TMS570_IOMM_PINMMRx_PINMMRx24To31_GET(reg) BSP_FLD32GET(reg,24, 31)
0087 #define TMS570_IOMM_PINMMRx_PINMMRx24To31_SET(reg,val) BSP_FLD32SET(reg, val,24, 31)
0088 
0089 /* field: PINMMRx16To23 - Each of these byte-fields control the functionality on a given ball/pin. */
0090 #define TMS570_IOMM_PINMMRx_PINMMRx16To23(val) BSP_FLD32(val,16, 23)
0091 #define TMS570_IOMM_PINMMRx_PINMMRx16To23_GET(reg) BSP_FLD32GET(reg,16, 23)
0092 #define TMS570_IOMM_PINMMRx_PINMMRx16To23_SET(reg,val) BSP_FLD32SET(reg, val,16, 23)
0093 
0094 /* field: PINMMRx8To16 - Each of these byte-fields control the functionality on a given ball/pin. */
0095 #define TMS570_IOMM_PINMMRx_PINMMRx8To16(val) BSP_FLD32(val,8, 15)
0096 #define TMS570_IOMM_PINMMRx_PINMMRx8To16_GET(reg) BSP_FLD32GET(reg,8, 15)
0097 #define TMS570_IOMM_PINMMRx_PINMMRx8To16_SET(reg,val) BSP_FLD32SET(reg, val,8, 15)
0098 
0099 /* field: PINMMRx0To7 - Each of these byte-fields control the functionality on a given ball/pin. */
0100 #define TMS570_IOMM_PINMMRx_PINMMRx0To7(val) BSP_FLD32(val,0, 7)
0101 #define TMS570_IOMM_PINMMRx_PINMMRx0To7_GET(reg) BSP_FLD32GET(reg,0, 7)
0102 #define TMS570_IOMM_PINMMRx_PINMMRx0To7_SET(reg,val) BSP_FLD32SET(reg, val,0, 7)
0103 
0104 
0105 /*------------------TMS570_IOMM_REVISION_REG------------------*/
0106 /* field: REV_SCHEME - Revision Scheme */
0107 #define TMS570_IOMM_REVISION_REG_REV_SCHEME(val) BSP_FLD32(val,30, 31)
0108 #define TMS570_IOMM_REVISION_REG_REV_SCHEME_GET(reg) BSP_FLD32GET(reg,30, 31)
0109 #define TMS570_IOMM_REVISION_REG_REV_SCHEME_SET(reg,val) BSP_FLD32SET(reg, val,30, 31)
0110 
0111 /* field: REV_MODULE - Module Id */
0112 #define TMS570_IOMM_REVISION_REG_REV_MODULE(val) BSP_FLD32(val,16, 27)
0113 #define TMS570_IOMM_REVISION_REG_REV_MODULE_GET(reg) BSP_FLD32GET(reg,16, 27)
0114 #define TMS570_IOMM_REVISION_REG_REV_MODULE_SET(reg,val) BSP_FLD32SET(reg, val,16, 27)
0115 
0116 /* field: REV_RTL - RTL Revision */
0117 #define TMS570_IOMM_REVISION_REG_REV_RTL(val) BSP_FLD32(val,11, 15)
0118 #define TMS570_IOMM_REVISION_REG_REV_RTL_GET(reg) BSP_FLD32GET(reg,11, 15)
0119 #define TMS570_IOMM_REVISION_REG_REV_RTL_SET(reg,val) BSP_FLD32SET(reg, val,11, 15)
0120 
0121 /* field: REV_MAJOR - Major Revision */
0122 #define TMS570_IOMM_REVISION_REG_REV_MAJOR(val) BSP_FLD32(val,8, 10)
0123 #define TMS570_IOMM_REVISION_REG_REV_MAJOR_GET(reg) BSP_FLD32GET(reg,8, 10)
0124 #define TMS570_IOMM_REVISION_REG_REV_MAJOR_SET(reg,val) BSP_FLD32SET(reg, val,8, 10)
0125 
0126 /* field: REV_CUSTOM - REV CUSTOM 0 Custom Revision */
0127 #define TMS570_IOMM_REVISION_REG_REV_CUSTOM(val) BSP_FLD32(val,6, 7)
0128 #define TMS570_IOMM_REVISION_REG_REV_CUSTOM_GET(reg) BSP_FLD32GET(reg,6, 7)
0129 #define TMS570_IOMM_REVISION_REG_REV_CUSTOM_SET(reg,val) BSP_FLD32SET(reg, val,6, 7)
0130 
0131 /* field: REV_MINOR - Minor Revision */
0132 #define TMS570_IOMM_REVISION_REG_REV_MINOR(val) BSP_FLD32(val,0, 5)
0133 #define TMS570_IOMM_REVISION_REG_REV_MINOR_GET(reg) BSP_FLD32GET(reg,0, 5)
0134 #define TMS570_IOMM_REVISION_REG_REV_MINOR_SET(reg,val) BSP_FLD32SET(reg, val,0, 5)
0135 
0136 
0137 /*-------------------TMS570_IOMM_ENDIAN_REG-------------------*/
0138 /* field: ENDIAN - Device endianness */
0139 #define TMS570_IOMM_ENDIAN_REG_ENDIAN BSP_BIT32(0)
0140 
0141 
0142 /*-------------------TMS570_IOMM_KICK_REG0-------------------*/
0143 /* field: KICK0 - Kicker 0 Register. */
0144 /* Whole 32 bits */
0145 
0146 /*-------------------TMS570_IOMM_KICK_REG1-------------------*/
0147 /* field: KICK1 - Kicker 1 Register. */
0148 /* Whole 32 bits */
0149 
0150 /*---------------TMS570_IOMM_ERR_RAW_STATUS_REG---------------*/
0151 /* field: ADDR_ERR - Addressing Error Status and Error Signaling Enable. */
0152 #define TMS570_IOMM_ERR_RAW_STATUS_REG_ADDR_ERR BSP_BIT32(1)
0153 
0154 /* field: PROT_ERR - register inside the IOMM is written in the CPU's user mode of operation. */
0155 #define TMS570_IOMM_ERR_RAW_STATUS_REG_PROT_ERR BSP_BIT32(0)
0156 
0157 
0158 /*-------------TMS570_IOMM_ERR_ENABLED_STATUS_REG-------------*/
0159 /* field: ENABLED_ADDR_ERR - Addressing Error Signaling Enable Status and Status Clear */
0160 #define TMS570_IOMM_ERR_ENABLED_STATUS_REG_ENABLED_ADDR_ERR BSP_BIT32(1)
0161 
0162 /* field: ENABLED_PROT_ERR - Protection Error Signaling Enable Status and Status Clear */
0163 #define TMS570_IOMM_ERR_ENABLED_STATUS_REG_ENABLED_PROT_ERR BSP_BIT32(0)
0164 
0165 
0166 /*-----------------TMS570_IOMM_ERR_ENABLE_REG-----------------*/
0167 /* field: ADDR_ERR_EN - Addressing Error Signaling Enable */
0168 #define TMS570_IOMM_ERR_ENABLE_REG_ADDR_ERR_EN BSP_BIT32(1)
0169 
0170 /* field: PROT_ERR_EN - Protection ErrorSignaling Enable */
0171 #define TMS570_IOMM_ERR_ENABLE_REG_PROT_ERR_EN BSP_BIT32(0)
0172 
0173 
0174 /*---------------TMS570_IOMM_ERR_ENABLE_CLR_REG---------------*/
0175 /* field: ADDR_ERR_EN_CLR - Addressing Error Signaling Enable Clear */
0176 #define TMS570_IOMM_ERR_ENABLE_CLR_REG_ADDR_ERR_EN_CLR BSP_BIT32(1)
0177 
0178 /* field: PROT_ERR_EN_CLR - Protection Error Signaling Enable Clear */
0179 #define TMS570_IOMM_ERR_ENABLE_CLR_REG_PROT_ERR_EN_CLR BSP_BIT32(0)
0180 
0181 
0182 /*---------------TMS570_IOMM_FAULT_ADDRESS_REG---------------*/
0183 /* field: FAULT_ADDR - Fault Address. */
0184 /* Whole 32 bits */
0185 
0186 /*----------------TMS570_IOMM_FAULT_STATUS_REG----------------*/
0187 /* field: FAULT_ID - Faulting Transaction ID */
0188 #define TMS570_IOMM_FAULT_STATUS_REG_FAULT_ID(val) BSP_FLD32(val,24, 27)
0189 #define TMS570_IOMM_FAULT_STATUS_REG_FAULT_ID_GET(reg) BSP_FLD32GET(reg,24, 27)
0190 #define TMS570_IOMM_FAULT_STATUS_REG_FAULT_ID_SET(reg,val) BSP_FLD32SET(reg, val,24, 27)
0191 
0192 /* field: FAULT_MSTID - ID of Master that initiated the faulting transaction */
0193 #define TMS570_IOMM_FAULT_STATUS_REG_FAULT_MSTID(val) BSP_FLD32(val,16, 23)
0194 #define TMS570_IOMM_FAULT_STATUS_REG_FAULT_MSTID_GET(reg) BSP_FLD32GET(reg,16, 23)
0195 #define TMS570_IOMM_FAULT_STATUS_REG_FAULT_MSTID_SET(reg,val) BSP_FLD32SET(reg, val,16, 23)
0196 
0197 /* field: FAULT_PRIVID - Faulting Privilege ID */
0198 #define TMS570_IOMM_FAULT_STATUS_REG_FAULT_PRIVID(val) BSP_FLD32(val,9, 12)
0199 #define TMS570_IOMM_FAULT_STATUS_REG_FAULT_PRIVID_GET(reg) BSP_FLD32GET(reg,9, 12)
0200 #define TMS570_IOMM_FAULT_STATUS_REG_FAULT_PRIVID_SET(reg,val) BSP_FLD32SET(reg, val,9, 12)
0201 
0202 /* field: FAULT_TYPE - Type of fault detected */
0203 #define TMS570_IOMM_FAULT_STATUS_REG_FAULT_TYPE(val) BSP_FLD32(val,0, 5)
0204 #define TMS570_IOMM_FAULT_STATUS_REG_FAULT_TYPE_GET(reg) BSP_FLD32GET(reg,0, 5)
0205 #define TMS570_IOMM_FAULT_STATUS_REG_FAULT_TYPE_SET(reg,val) BSP_FLD32SET(reg, val,0, 5)
0206 
0207 
0208 /*----------------TMS570_IOMM_FAULT_CLEAR_REG----------------*/
0209 /* field: FAULT_CLEAR - Fault Clear */
0210 #define TMS570_IOMM_FAULT_CLEAR_REG_FAULT_CLEAR BSP_BIT32(0)
0211 
0212 
0213 /*---------------------TMS570_IOMM_PINMUX---------------------*/
0214 /* field: FAULT_CLEAR - Fault Clear */
0215 #define TMS570_IOMM_PINMUX_FAULT_CLEAR BSP_BIT32(0)
0216 
0217 
0218 
0219 #endif /* LIBBSP_ARM_TMS570_IOMM */