]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo_bsp/ps7_cortexa9_0/libsrc/standalone_v6_6/src/translation_table.S
Update Zynq, MPSoc Cortex-A53 and MPSoc Cortex-R5 demo projects to build with the...
[freertos] / FreeRTOS / Demo / CORTEX_A9_Zynq_ZC702 / RTOSDemo_bsp / ps7_cortexa9_0 / libsrc / standalone_v6_6 / src / translation_table.S
1 /******************************************************************************
2 *
3 * Copyright (C) 2009 - 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 * @addtogroup a9_boot_code
37 * @{
38 * <h2> translation_table.S </h2>
39 * translation_table.S contains a static page table required by MMU for
40 * cortex-A9. This translation table is flat mapped (input address = output
41 * address) with default memory attributes defined for zynq architecture. It
42 * utilizes short descriptor translation table format with each section defining
43 * 1MB of memory.
44 *
45 * The overview of translation table memory attributes is described below.
46 *
47 *|                       | Memory Range            | Definition in Translation Table   |
48 *|-----------------------|-------------------------|-----------------------------------|
49 *| DDR                   | 0x00000000 - 0x3FFFFFFF | Normal write-back Cacheable       |
50 *| PL                    | 0x40000000 - 0xBFFFFFFF | Strongly Ordered                  |
51 *| Reserved              | 0xC0000000 - 0xDFFFFFFF | Unassigned                        |
52 *| Memory mapped devices | 0xE0000000 - 0xE02FFFFF | Device Memory                     |
53 *| Reserved              | 0xE0300000 - 0xE0FFFFFF | Unassigned                        |
54 *| NAND, NOR             | 0xE1000000 - 0xE3FFFFFF | Device memory                     |
55 *| SRAM                  | 0xE4000000 - 0xE5FFFFFF | Normal write-back Cacheable       |
56 *| Reserved              | 0xE6000000 - 0xF7FFFFFF | Unassigned                        |
57 *| AMBA APB Peripherals  | 0xF8000000 - 0xF8FFFFFF | Device Memory                     |
58 *| Reserved              | 0xF9000000 - 0xFBFFFFFF | Unassigned                        |
59 *| Linear QSPI - XIP     | 0xFC000000 - 0xFDFFFFFF | Normal write-through cacheable    |
60 *| Reserved              | 0xFE000000 - 0xFFEFFFFF | Unassigned                        |
61 *| OCM                   | 0xFFF00000 - 0xFFFFFFFF | Normal inner write-back cacheable |
62 *
63 * @note
64 *
65 * For region 0x00000000 - 0x3FFFFFFF, a system where DDR is less than 1GB,
66 * region after DDR and before PL is marked as undefined/reserved in translation
67 * table. In 0xF8000000 - 0xF8FFFFFF, 0xF8000C00 - 0xF8000FFF, 0xF8010000 -
68 * 0xF88FFFFF and 0xF8F03000 to 0xF8FFFFFF are reserved  but due to granual size
69 * of 1MB, it is not possible to define separate regions for them. For region
70 * 0xFFF00000 - 0xFFFFFFFF, 0xFFF00000 to 0xFFFB0000 is reserved but due to 1MB
71 * granual size, it is not possible to define separate region for it
72 *
73 * <pre>
74 * MODIFICATION HISTORY:
75 *
76 * Ver   Who  Date     Changes
77 * ----- ---- -------- ---------------------------------------------------
78 * 1.00a ecm  10/20/09 Initial version
79 * 3.04a sdm  01/13/12 Updated MMU table to mark DDR memory as Shareable
80 * 3.07a sgd  07/05/2012 Configuring device address spaces as shareable device
81 *                      instead of strongly-ordered.
82 * 3.07a asa  07/17/2012 Changed the property of the ".mmu_tbl" section.
83 * 4.2   pkp  09/02/2014 added entries for 0xfe000000 to 0xffefffff as reserved
84 *                       and  0xe0000000 - 0xe1ffffff is broken down into
85 *                       0xe0000000 - 0xe02fffff (memory mapped devides)
86 *                       0xe0300000 - 0xe0ffffff (reserved) and
87 *                       0xe1000000 - 0xe1ffffff (NAND)
88 * 5.2   pkp  06/08/2015 put a check for XPAR_PS7_DDR_0_S_AXI_BASEADDR to confirm
89 *                       if DDR is present or not and accordingly generate the
90 *                       translation table
91 * 6.1   pkp  07/11/2016 Corrected comments for memory attributes
92 * </pre>
93 *
94 *
95 ******************************************************************************/
96 #include "xparameters.h"
97         .globl  MMUTable
98
99         .section .mmu_tbl,"a"
100
101 MMUTable:
102         /* Each table entry occupies one 32-bit word and there are
103          * 4096 entries, so the entire table takes up 16KB.
104          * Each entry covers a 1MB section.
105          */
106 .set SECT, 0
107
108 #ifdef XPAR_PS7_DDR_0_S_AXI_BASEADDR
109 .set DDR_START, XPAR_PS7_DDR_0_S_AXI_BASEADDR
110 .set DDR_END, XPAR_PS7_DDR_0_S_AXI_HIGHADDR
111 .set DDR_SIZE, (DDR_END - DDR_START)+1
112 .set DDR_REG, DDR_SIZE/0x100000
113 #else
114 .set DDR_REG, 0
115 #endif
116
117 .set UNDEF_REG, 0x3FF - DDR_REG
118
119                                 /*0x00000000 - 0x00100000 (cacheable )*/
120 .word   SECT + 0x15de6          /* S=b1 TEX=b101 AP=b11, Domain=b1111, C=b0, B=b1 */
121 .set    SECT, SECT+0x100000
122
123 .rept   DDR_REG                 /*  (DDR Cacheable) */
124 .word   SECT + 0x15de6          /* S=b1 TEX=b101 AP=b11, Domain=b1111, C=b0, B=b1 */
125 .set    SECT, SECT+0x100000
126 .endr
127
128 .rept   UNDEF_REG                       /*  (unassigned/reserved).
129                                  * Generates a translation fault if accessed */
130 .word   SECT + 0x0              /* S=b0 TEX=b000 AP=b00, Domain=b0, C=b0, B=b0 */
131 .set    SECT, SECT+0x100000
132 .endr
133
134
135 .rept   0x0400                  /* 0x40000000 - 0x7fffffff (FPGA slave0) */
136 .word   SECT + 0xc02            /* S=b0 TEX=b000 AP=b11, Domain=b0, C=b0, B=b0 */
137 .set    SECT, SECT+0x100000
138 .endr
139
140 .rept   0x0400                  /* 0x80000000 - 0xbfffffff (FPGA slave1) */
141 .word   SECT + 0xc02            /* S=b0 TEX=b000 AP=b11, Domain=b0, C=b0, B=b0 */
142 .set    SECT, SECT+0x100000
143 .endr
144
145 .rept   0x0200                  /* 0xc0000000 - 0xdfffffff (unassigned/reserved).
146                                  * Generates a translation fault if accessed */
147 .word   SECT + 0x0              /* S=b0 TEX=b000 AP=b00, Domain=b0, C=b0, B=b0 */
148 .set    SECT, SECT+0x100000
149 .endr
150
151 .rept   0x003                   /* 0xe0000000 - 0xe02fffff (Memory mapped devices)
152                                  * UART/USB/IIC/SPI/CAN/GEM/GPIO/QSPI/SD/NAND */
153 .word   SECT + 0xc06            /* S=b0 TEX=b000 AP=b11, Domain=b0, C=b0, B=b1 */
154 .set    SECT, SECT+0x100000
155 .endr
156
157 .rept   0x0D                    /* 0xe0300000 - 0xe0ffffff (unassigned/reserved).
158                                  * Generates a translation fault if accessed */
159 .word   SECT + 0x0              /* S=b0 TEX=b000 AP=b00, Domain=b0, C=b0, B=b0 */
160 .set    SECT, SECT+0x100000
161 .endr
162
163 .rept   0x0010                  /* 0xe1000000 - 0xe1ffffff (NAND) */
164 .word   SECT + 0xc06            /* S=b0 TEX=b000 AP=b11, Domain=b0, C=b0, B=b1 */
165 .set    SECT, SECT+0x100000
166 .endr
167
168 .rept   0x0020                  /* 0xe2000000 - 0xe3ffffff (NOR) */
169 .word   SECT + 0xc06            /* S=b0 TEX=b000 AP=b11, Domain=b0, C=b0, B=b1 */
170 .set    SECT, SECT+0x100000
171 .endr
172
173 .rept   0x0020                  /* 0xe4000000 - 0xe5ffffff (SRAM) */
174 .word   SECT + 0xc0e            /* S=b0 TEX=b000 AP=b11, Domain=b0, C=b1, B=b1 */
175 .set    SECT, SECT+0x100000
176 .endr
177
178 .rept   0x0120                  /* 0xe6000000 - 0xf7ffffff (unassigned/reserved).
179                                  * Generates a translation fault if accessed */
180 .word   SECT + 0x0              /* S=b0 TEX=b000 AP=b00, Domain=b0, C=b0, B=b0 */
181 .set    SECT, SECT+0x100000
182 .endr
183
184 /* 0xf8000c00 to 0xf8000fff, 0xf8010000 to 0xf88fffff and
185    0xf8f03000 to 0xf8ffffff are reserved  but due to granual size of
186    1MB, it is not possible to define separate regions for them */
187
188 .rept   0x0010                  /* 0xf8000000 - 0xf8ffffff (AMBA APB Peripherals) */
189
190 .word   SECT + 0xc06            /* S=b0 TEX=b000 AP=b11, Domain=b0, C=b0, B=b1 */
191 .set    SECT, SECT+0x100000
192 .endr
193
194 .rept   0x0030                  /* 0xf9000000 - 0xfbffffff (unassigned/reserved).
195                                  * Generates a translation fault if accessed */
196 .word   SECT + 0x0              /* S=b0 TEX=b000 AP=b00, Domain=b0, C=b0, B=b0 */
197 .set    SECT, SECT+0x100000
198 .endr
199
200 .rept   0x0020                  /* 0xfc000000 - 0xfdffffff (Linear QSPI - XIP) */
201 .word   SECT + 0xc0a            /* S=b0 TEX=b000 AP=b11, Domain=b0, C=b1, B=b0 */
202 .set    SECT, SECT+0x100000
203 .endr
204
205 .rept   0x001F                  /* 0xfe000000 - 0xffefffff (unassigned/reserved).
206                                  * Generates a translation fault if accessed */
207 .word   SECT + 0x0              /* S=b0 TEX=b000 AP=b00, Domain=b0, C=b0, B=b0 */
208 .set    SECT, SECT+0x100000
209 .endr
210
211 /* 0xfff00000 to 0xfffb0000 is reserved but due to granual size of
212    1MB, it is not possible to define separate region for  it
213
214  0xfff00000 - 0xffffffff
215    256K OCM when mapped to high address space
216    inner-cacheable */
217 .word   SECT + 0x4c0e           /* S=b0 TEX=b100 AP=b11, Domain=b0, C=b1, B=b1 */
218 .set    SECT, SECT+0x100000
219
220 .end
221 /**
222 * @} End of "addtogroup a9_boot_code".
223 */