]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v5_4/src/translation_table.S
Update the Xilinx UltraScale+ 64-bit demo to use the hardware definition and BSP...
[freertos] / FreeRTOS / Demo / CORTEX_A53_64-bit_UltraScale_MPSoC / RTOSDemo_A53_bsp / psu_cortexa53_0 / libsrc / standalone_v5_4 / src / translation_table.S
1 /******************************************************************************
2 *
3 * Copyright (C) 2014 - 2015 Xilinx, Inc. All rights reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * Use of the Software is limited solely to applications:
16 * (a) running on a Xilinx device, or
17 * (b) that interact with a Xilinx device through a bus or interconnect.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * XILINX  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 *
27 * Except as contained in this notice, the name of the Xilinx shall not be used
28 * in advertising or otherwise to promote the sale, use or other dealings in
29 * this Software without prior written authorization from Xilinx.
30 *
31 ******************************************************************************/
32 /*****************************************************************************/
33 /**
34 * @file translation_table.s
35 *
36 * This file contains the initialization for the MMU table in RAM
37 * needed by the Cortex A53 processor
38 *
39 * <pre>
40 * MODIFICATION HISTORY:
41 *
42 * Ver   Who  Date     Changes
43 * ----- ---- -------- ---------------------------------------------------
44 * 5.00  pkp  05/21/14 Initial version
45 * 5.04  pkp  12/18/15 Updated the address map according to proper address map
46 *
47 * @note
48 *
49 * None.
50 *
51 ******************************************************************************/
52 #include "xparameters.h"
53
54         .globl  MMUTableL0
55         .globl  MMUTableL1
56         .globl  MMUTableL2
57
58         .set reserved,  0x0                                     /* Fault*/
59         .set Memory,    0x405 | (3 << 8) | (0x0)                /* normal writeback write allocate inner shared read write */
60         .set Device,    0x409 | (1 << 53)| (1 << 54) |(0x0)     /* strongly ordered read write non executable*/
61         .section .mmu_tbl0,"a"
62
63 MMUTableL0:
64
65 .set SECT, MMUTableL1           /* 0x0000_0000 -  0x7F_FFFF_FFFF */
66 .8byte  SECT + 0x3
67 .set SECT, MMUTableL1+0x1000    /* 0x80_0000_0000 - 0xFF_FFFF_FFFF */
68 .8byte  SECT + 0x3
69
70         .section .mmu_tbl1,"a"
71
72 MMUTableL1:
73
74 .set SECT, MMUTableL2           /* 0x0000_0000 - 0x3FFF_FFFF */
75 .8byte  SECT + 0x3              /* 1GB DDR */
76
77 .rept   0x3                     /* 0x4000_0000 - 0xFFFF_FFFF */
78 .set SECT, SECT + 0x1000        /*1GB DDR, 1GB PL, 2GB other devices n memory */
79 .8byte  SECT + 0x3
80 .endr
81
82 .set SECT,0x100000000
83 .rept   0xC                     /* 0x0001_0000_0000 - 0x0003_FFFF_FFFF */
84 .8byte  SECT + reserved         /* 12GB Reserved */
85 .set SECT, SECT + 0x40000000
86 .endr
87
88 .rept   0x10                    /* 0x0004_0000_0000 - 0x0007_FFFF_FFFF */
89 .8byte  SECT + Device           /* 8GB PL, 8GB PCIe */
90 .set SECT, SECT + 0x40000000
91 .endr
92
93 .rept   0x20                    /* 0x0008_0000_0000 - 0x000F_FFFF_FFFF */
94 .8byte  SECT + Memory           /* 32GB DDR */
95 .set SECT, SECT + 0x40000000
96 .endr
97
98 .rept   0x1C0                   /* 0x0010_0000_0000 - 0x007F_FFFF_FFFF */
99 .8byte  SECT + Device           /* 448 GB PL */
100 .set SECT, SECT + 0x40000000
101 .endr
102
103
104 .rept   0x100                   /* 0x0080_0000_0000 - 0x00BF_FFFF_FFFF */
105 .8byte  SECT + Device           /* 256GB PCIe */
106 .set SECT, SECT + 0x40000000
107 .endr
108
109
110 .rept   0x100                   /* 0x00C0_0000_0000 - 0x00FF_FFFF_FFFF */
111 .8byte  SECT + reserved         /* 256GB reserved */
112 .set SECT, SECT + 0x40000000
113 .endr
114
115
116 .section .mmu_tbl2,"a"
117
118 MMUTableL2:
119
120 .set SECT, 0
121
122 #ifdef XPAR_PSU_DDR_0_S_AXI_BASEADDR
123 .set DDR_START, XPAR_PSU_DDR_0_S_AXI_BASEADDR
124 .set DDR_END, XPAR_PSU_DDR_0_S_AXI_HIGHADDR
125 .set DDR_SIZE, (DDR_END - DDR_START)+1
126 .if DDR_SIZE > 0x80000000
127 /* If DDR size is larger than 2GB, truncate to 2GB */
128 .set DDR_REG, 0x400
129 .else
130 .set DDR_REG, DDR_SIZE/0x200000
131 .endif
132 #else
133 .set DDR_REG, 0
134 #endif
135
136 .set UNDEF_REG, 0x400 - DDR_REG
137
138 .rept   DDR_REG                 /* DDR based on size in hdf*/
139 .8byte  SECT + Memory
140 .set    SECT, SECT+0x200000
141 .endr
142
143 .rept   UNDEF_REG               /* reserved for region where ddr is absent */
144 .8byte  SECT + reserved
145 .set    SECT, SECT+0x200000
146 .endr
147
148 .rept   0x0200                  /* 0x8000_0000 - 0xBFFF_FFFF */
149 .8byte  SECT + Device           /* 1GB lower PL */
150 .set    SECT, SECT+0x200000
151 .endr
152
153 .rept   0x0100                  /* 0xC000_0000 - 0xDFFF_FFFF */
154 .8byte  SECT + Device           /* 512MB QSPI */
155 .set    SECT, SECT+0x200000
156 .endr
157
158 .rept   0x080                   /* 0xE000_0000 - 0xEFFF_FFFF */
159 .8byte  SECT + Device           /* 256MB lower PCIe */
160 .set    SECT, SECT+0x200000
161 .endr
162
163 .rept   0x040                   /* 0xF000_0000 - 0xF7FF_FFFF */
164 .8byte  SECT + reserved         /* 128MB Reserved */
165 .set    SECT, SECT+0x200000
166 .endr
167
168 .rept   0x8                     /* 0xF800_0000 - 0xF8FF_FFFF */
169 .8byte  SECT + Device           /* 16MB coresight */
170 .set    SECT, SECT+0x200000
171 .endr
172
173 /* 1MB RPU LLP is marked for 2MB region as the minimum block size in
174    translation table is 2MB and adjacent 63MB reserved region is
175    converted to 62MB */
176
177 .rept   0x1                     /* 0xF900_0000 - 0xF91F_FFFF */
178 .8byte  SECT + Device           /* 2MB RPU low latency port */
179 .set    SECT, SECT+0x200000
180 .endr
181
182 .rept   0x1F                    /* 0xF920_0000 - 0xFCFF_FFFF */
183 .8byte  SECT + reserved         /* 62MB Reserved */
184 .set    SECT, SECT+0x200000
185 .endr
186
187 .rept   0x8                     /* 0xFD00_0000 - 0xFDFF_FFFF */
188 .8byte  SECT + Device           /* 16MB FPS */
189 .set    SECT, SECT+0x200000
190 .endr
191
192 .rept   0xE                     /* 0xFE00_0000 -  0xFFBF_FFFF */
193 .8byte  SECT + Device           /* 28MB LPS */
194 .set    SECT, SECT+0x200000
195 .endr
196
197                                 /* 0xFFC0_0000 - 0xFFDF_FFFF */
198 .8byte  SECT + Device           /*2MB PMU/CSU */
199
200 .set    SECT, SECT+0x200000     /* 0xFFE0_0000 - 0xFFFF_FFFF*/
201 .8byte  SECT + Memory           /*2MB OCM/TCM*/
202
203 .end