]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A53_64-bit_UltraScale_MPSoC/RTOSDemo_A53_bsp/psu_cortexa53_0/libsrc/standalone_v6_1/src/translation_table.S
Update Zynq MPSoC hardware definition and BSP files to be those shipped with the...
[freertos] / FreeRTOS / Demo / CORTEX_A53_64-bit_UltraScale_MPSoC / RTOSDemo_A53_bsp / psu_cortexa53_0 / libsrc / standalone_v6_1 / 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 * 6.0   mus  07/20/16 Added warning for ddrless HW design CR-954977
47 *
48 * @note
49 *
50 * None.
51 *
52 ******************************************************************************/
53 #include "xparameters.h"
54
55         .globl  MMUTableL0
56         .globl  MMUTableL1
57         .globl  MMUTableL2
58
59         .set reserved,  0x0                                     /* Fault*/
60         .set Memory,    0x405 | (3 << 8) | (0x0)                /* normal writeback write allocate inner shared read write */
61         .set Device,    0x409 | (1 << 53)| (1 << 54) |(0x0)     /* strongly ordered read write non executable*/
62         .section .mmu_tbl0,"a"
63
64 MMUTableL0:
65
66 .set SECT, MMUTableL1           /* 0x0000_0000 -  0x7F_FFFF_FFFF */
67 .8byte  SECT + 0x3
68 .set SECT, MMUTableL1+0x1000    /* 0x80_0000_0000 - 0xFF_FFFF_FFFF */
69 .8byte  SECT + 0x3
70
71         .section .mmu_tbl1,"a"
72
73 MMUTableL1:
74
75 .set SECT, MMUTableL2           /* 0x0000_0000 - 0x3FFF_FFFF */
76 .8byte  SECT + 0x3              /* 1GB DDR */
77
78 .rept   0x3                     /* 0x4000_0000 - 0xFFFF_FFFF */
79 .set SECT, SECT + 0x1000        /*1GB DDR, 1GB PL, 2GB other devices n memory */
80 .8byte  SECT + 0x3
81 .endr
82
83 .set SECT,0x100000000
84 .rept   0xC                     /* 0x0001_0000_0000 - 0x0003_FFFF_FFFF */
85 .8byte  SECT + reserved         /* 12GB Reserved */
86 .set SECT, SECT + 0x40000000
87 .endr
88
89 .rept   0x10                    /* 0x0004_0000_0000 - 0x0007_FFFF_FFFF */
90 .8byte  SECT + Device           /* 8GB PL, 8GB PCIe */
91 .set SECT, SECT + 0x40000000
92 .endr
93
94 .rept   0x20                    /* 0x0008_0000_0000 - 0x000F_FFFF_FFFF */
95 .8byte  SECT + Memory           /* 32GB DDR */
96 .set SECT, SECT + 0x40000000
97 .endr
98
99 .rept   0x1C0                   /* 0x0010_0000_0000 - 0x007F_FFFF_FFFF */
100 .8byte  SECT + Device           /* 448 GB PL */
101 .set SECT, SECT + 0x40000000
102 .endr
103
104
105 .rept   0x100                   /* 0x0080_0000_0000 - 0x00BF_FFFF_FFFF */
106 .8byte  SECT + Device           /* 256GB PCIe */
107 .set SECT, SECT + 0x40000000
108 .endr
109
110
111 .rept   0x100                   /* 0x00C0_0000_0000 - 0x00FF_FFFF_FFFF */
112 .8byte  SECT + reserved         /* 256GB reserved */
113 .set SECT, SECT + 0x40000000
114 .endr
115
116
117 .section .mmu_tbl2,"a"
118
119 MMUTableL2:
120
121 .set SECT, 0
122
123 #ifdef XPAR_PSU_DDR_0_S_AXI_BASEADDR
124 .set DDR_START, XPAR_PSU_DDR_0_S_AXI_BASEADDR
125 .set DDR_END, XPAR_PSU_DDR_0_S_AXI_HIGHADDR
126 .set DDR_SIZE, (DDR_END - DDR_START)+1
127 .if DDR_SIZE > 0x80000000
128 /* If DDR size is larger than 2GB, truncate to 2GB */
129 .set DDR_REG, 0x400
130 .else
131 .set DDR_REG, DDR_SIZE/0x200000
132 .endif
133 #else
134 .set DDR_REG, 0
135 #warning "There's no DDR in the HW design. MMU translation table marks 2 GB DDR address space as undefined"
136 #endif
137
138 .set UNDEF_REG, 0x400 - DDR_REG
139
140 .rept   DDR_REG                 /* DDR based on size in hdf*/
141 .8byte  SECT + Memory
142 .set    SECT, SECT+0x200000
143 .endr
144
145 .rept   UNDEF_REG               /* reserved for region where ddr is absent */
146 .8byte  SECT + reserved
147 .set    SECT, SECT+0x200000
148 .endr
149
150 .rept   0x0200                  /* 0x8000_0000 - 0xBFFF_FFFF */
151 .8byte  SECT + Device           /* 1GB lower PL */
152 .set    SECT, SECT+0x200000
153 .endr
154
155 .rept   0x0100                  /* 0xC000_0000 - 0xDFFF_FFFF */
156 .8byte  SECT + Device           /* 512MB QSPI */
157 .set    SECT, SECT+0x200000
158 .endr
159
160 .rept   0x080                   /* 0xE000_0000 - 0xEFFF_FFFF */
161 .8byte  SECT + Device           /* 256MB lower PCIe */
162 .set    SECT, SECT+0x200000
163 .endr
164
165 .rept   0x040                   /* 0xF000_0000 - 0xF7FF_FFFF */
166 .8byte  SECT + reserved         /* 128MB Reserved */
167 .set    SECT, SECT+0x200000
168 .endr
169
170 .rept   0x8                     /* 0xF800_0000 - 0xF8FF_FFFF */
171 .8byte  SECT + Device           /* 16MB coresight */
172 .set    SECT, SECT+0x200000
173 .endr
174
175 /* 1MB RPU LLP is marked for 2MB region as the minimum block size in
176    translation table is 2MB and adjacent 63MB reserved region is
177    converted to 62MB */
178
179 .rept   0x1                     /* 0xF900_0000 - 0xF91F_FFFF */
180 .8byte  SECT + Device           /* 2MB RPU low latency port */
181 .set    SECT, SECT+0x200000
182 .endr
183
184 .rept   0x1F                    /* 0xF920_0000 - 0xFCFF_FFFF */
185 .8byte  SECT + reserved         /* 62MB Reserved */
186 .set    SECT, SECT+0x200000
187 .endr
188
189 .rept   0x8                     /* 0xFD00_0000 - 0xFDFF_FFFF */
190 .8byte  SECT + Device           /* 16MB FPS */
191 .set    SECT, SECT+0x200000
192 .endr
193
194 .rept   0xE                     /* 0xFE00_0000 -  0xFFBF_FFFF */
195 .8byte  SECT + Device           /* 28MB LPS */
196 .set    SECT, SECT+0x200000
197 .endr
198
199                                 /* 0xFFC0_0000 - 0xFFDF_FFFF */
200 .8byte  SECT + Device           /*2MB PMU/CSU */
201
202 .set    SECT, SECT+0x200000     /* 0xFFE0_0000 - 0xFFFF_FFFF*/
203 .8byte  SECT + Memory           /*2MB OCM/TCM*/
204
205 .end