AM65x MCU+ SDK  09.01.00
AddrTranslateP.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018-2023 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef ADDR_TRANSLATEP_H
34 #define ADDR_TRANSLATEP_H
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #include <stdint.h>
41 #include <kernel/dpl/SystemP.h>
42 
55 #define AddrTranslateP_MAX_REGIONS (16u)
56 
60 typedef enum AddrTranslateP_RegionSize_e {
95 
99 typedef struct AddrTranslateP_RegionConfig_ {
100 
101  uint64_t systemAddr;
102  uint32_t localAddr;
103  uint32_t size;
106 
110 typedef struct AddrTranslateP_Params_s {
111 
112  uint32_t numRegions;
113  uint32_t ratBaseAddr;
118 
119 
126 
133 
146 void *AddrTranslateP_getLocalAddr(uint64_t systemAddr);
147 
150 #ifdef __cplusplus
151 }
152 #endif
153 
154 #endif /* ADDR_TRANSLATEP_H */
AddrTranslateP_RegionSize_128M
@ AddrTranslateP_RegionSize_128M
Definition: AddrTranslateP.h:88
AddrTranslateP_RegionSize_64K
@ AddrTranslateP_RegionSize_64K
Definition: AddrTranslateP.h:77
SystemP.h
AddrTranslateP_RegionSize_256K
@ AddrTranslateP_RegionSize_256K
Definition: AddrTranslateP.h:79
AddrTranslateP_RegionSize_32K
@ AddrTranslateP_RegionSize_32K
Definition: AddrTranslateP.h:76
AddrTranslateP_RegionSize
AddrTranslateP_RegionSize
Enum's to represent different possible region size for the address translate module.
Definition: AddrTranslateP.h:60
AddrTranslateP_Params
Parameters for AddrTranslateP_init, this is used by SysConfig and not to be used by end-users directl...
Definition: AddrTranslateP.h:110
AddrTranslateP_RegionSize_64
@ AddrTranslateP_RegionSize_64
Definition: AddrTranslateP.h:67
AddrTranslateP_RegionSize_32
@ AddrTranslateP_RegionSize_32
Definition: AddrTranslateP.h:66
AddrTranslateP_RegionSize_4G
@ AddrTranslateP_RegionSize_4G
Definition: AddrTranslateP.h:93
AddrTranslateP_RegionSize_64M
@ AddrTranslateP_RegionSize_64M
Definition: AddrTranslateP.h:87
AddrTranslateP_Params::regionConfig
AddrTranslateP_RegionConfig * regionConfig
Definition: AddrTranslateP.h:114
AddrTranslateP_RegionSize_8K
@ AddrTranslateP_RegionSize_8K
Definition: AddrTranslateP.h:74
AddrTranslateP_RegionSize_2K
@ AddrTranslateP_RegionSize_2K
Definition: AddrTranslateP.h:72
AddrTranslateP_Params_init
void AddrTranslateP_Params_init(AddrTranslateP_Params *params)
Set default value for address translate parameters.
AddrTranslateP_RegionConfig
Region config structure, this is used by SysConfig and not to be used by end-users directly.
Definition: AddrTranslateP.h:99
AddrTranslateP_RegionSize_128
@ AddrTranslateP_RegionSize_128
Definition: AddrTranslateP.h:68
AddrTranslateP_RegionSize_128K
@ AddrTranslateP_RegionSize_128K
Definition: AddrTranslateP.h:78
AddrTranslateP_RegionSize_1
@ AddrTranslateP_RegionSize_1
Definition: AddrTranslateP.h:61
AddrTranslateP_RegionSize_4
@ AddrTranslateP_RegionSize_4
Definition: AddrTranslateP.h:63
AddrTranslateP_RegionSize_256
@ AddrTranslateP_RegionSize_256
Definition: AddrTranslateP.h:69
AddrTranslateP_Params::numRegions
uint32_t numRegions
Definition: AddrTranslateP.h:112
AddrTranslateP_RegionSize_16K
@ AddrTranslateP_RegionSize_16K
Definition: AddrTranslateP.h:75
AddrTranslateP_RegionSize_512K
@ AddrTranslateP_RegionSize_512K
Definition: AddrTranslateP.h:80
AddrTranslateP_getLocalAddr
void * AddrTranslateP_getLocalAddr(uint64_t systemAddr)
Translate from 48b system address to a CPU address as seen via the RAT module.
AddrTranslateP_RegionSize_8M
@ AddrTranslateP_RegionSize_8M
Definition: AddrTranslateP.h:84
AddrTranslateP_RegionConfig::systemAddr
uint64_t systemAddr
Definition: AddrTranslateP.h:101
AddrTranslateP_RegionSize_8
@ AddrTranslateP_RegionSize_8
Definition: AddrTranslateP.h:64
AddrTranslateP_RegionSize_1G
@ AddrTranslateP_RegionSize_1G
Definition: AddrTranslateP.h:91
AddrTranslateP_RegionConfig::localAddr
uint32_t localAddr
Definition: AddrTranslateP.h:102
AddrTranslateP_RegionSize_32M
@ AddrTranslateP_RegionSize_32M
Definition: AddrTranslateP.h:86
AddrTranslateP_init
void AddrTranslateP_init(AddrTranslateP_Params *params)
Initialize Address translate sub-system, called by SysConfig, not to be called by end users.
AddrTranslateP_RegionSize_2M
@ AddrTranslateP_RegionSize_2M
Definition: AddrTranslateP.h:82
AddrTranslateP_RegionSize_4M
@ AddrTranslateP_RegionSize_4M
Definition: AddrTranslateP.h:83
AddrTranslateP_Params::ratBaseAddr
uint32_t ratBaseAddr
Definition: AddrTranslateP.h:113
AddrTranslateP_RegionSize_2G
@ AddrTranslateP_RegionSize_2G
Definition: AddrTranslateP.h:92
AddrTranslateP_RegionSize_256M
@ AddrTranslateP_RegionSize_256M
Definition: AddrTranslateP.h:89
AddrTranslateP_RegionSize_16
@ AddrTranslateP_RegionSize_16
Definition: AddrTranslateP.h:65
AddrTranslateP_RegionSize_16M
@ AddrTranslateP_RegionSize_16M
Definition: AddrTranslateP.h:85
AddrTranslateP_RegionSize_2
@ AddrTranslateP_RegionSize_2
Definition: AddrTranslateP.h:62
AddrTranslateP_RegionConfig::size
uint32_t size
Definition: AddrTranslateP.h:103
AddrTranslateP_RegionSize_512M
@ AddrTranslateP_RegionSize_512M
Definition: AddrTranslateP.h:90
AddrTranslateP_RegionSize_1K
@ AddrTranslateP_RegionSize_1K
Definition: AddrTranslateP.h:71
AddrTranslateP_RegionSize_1M
@ AddrTranslateP_RegionSize_1M
Definition: AddrTranslateP.h:81
AddrTranslateP_RegionSize_4K
@ AddrTranslateP_RegionSize_4K
Definition: AddrTranslateP.h:73
AddrTranslateP_RegionSize_512
@ AddrTranslateP_RegionSize_512
Definition: AddrTranslateP.h:70