Commit 44262327aa288b111a41ce067bed235759db4c1c

Authored by Ahmed Mansour
Committed by York Sun
1 parent 1b76f3b8ab

drivers/misc: Share qbman init between archs

This patch adds changes necessary to move functionality present in
PowerPC folders with ARM architectures that have DPAA1 QBMan hardware

- Create new board/freescale/common/fsl_portals.c to house shared
  device tree fixups for DPAA1 devices with ARM and PowerPC cores
- Add new header file to top includes directory to allow files in
  both architectures to grab the function prototypes
- Port inhibit_portals() from PowerPC to ARM. This function is used in
  setup to disable interrupts on all QMan and BMan portals. It is
  needed because the interrupts are enabled by default for all portals
  including unused/uninitialised portals. When the kernel attempts to
  go to deep sleep the unused portals prevent it from doing so

Signed-off-by: Ahmed Mansour <ahmed.mansour@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>

Showing 18 changed files with 454 additions and 351 deletions Inline Diff

arch/arm/cpu/armv8/fsl-layerscape/cpu.c
1 /* 1 /*
2 * Copyright 2017 NXP 2 * Copyright 2017 NXP
3 * Copyright 2014-2015 Freescale Semiconductor, Inc. 3 * Copyright 2014-2015 Freescale Semiconductor, Inc.
4 * 4 *
5 * SPDX-License-Identifier: GPL-2.0+ 5 * SPDX-License-Identifier: GPL-2.0+
6 */ 6 */
7 7
8 #include <common.h> 8 #include <common.h>
9 #include <fsl_ddr_sdram.h> 9 #include <fsl_ddr_sdram.h>
10 #include <asm/io.h> 10 #include <asm/io.h>
11 #include <linux/errno.h> 11 #include <linux/errno.h>
12 #include <asm/system.h> 12 #include <asm/system.h>
13 #include <asm/armv8/mmu.h> 13 #include <asm/armv8/mmu.h>
14 #include <asm/io.h> 14 #include <asm/io.h>
15 #include <asm/arch/fsl_serdes.h> 15 #include <asm/arch/fsl_serdes.h>
16 #include <asm/arch/soc.h> 16 #include <asm/arch/soc.h>
17 #include <asm/arch/cpu.h> 17 #include <asm/arch/cpu.h>
18 #include <asm/arch/speed.h> 18 #include <asm/arch/speed.h>
19 #include <fsl_immap.h> 19 #include <fsl_immap.h>
20 #include <asm/arch/mp.h> 20 #include <asm/arch/mp.h>
21 #include <efi_loader.h> 21 #include <efi_loader.h>
22 #include <fm_eth.h> 22 #include <fm_eth.h>
23 #include <fsl-mc/fsl_mc.h> 23 #include <fsl-mc/fsl_mc.h>
24 #ifdef CONFIG_FSL_ESDHC 24 #ifdef CONFIG_FSL_ESDHC
25 #include <fsl_esdhc.h> 25 #include <fsl_esdhc.h>
26 #endif 26 #endif
27 #include <asm/armv8/sec_firmware.h> 27 #include <asm/armv8/sec_firmware.h>
28 #ifdef CONFIG_SYS_FSL_DDR 28 #ifdef CONFIG_SYS_FSL_DDR
29 #include <fsl_ddr.h> 29 #include <fsl_ddr.h>
30 #endif 30 #endif
31 #include <asm/arch/clock.h> 31 #include <asm/arch/clock.h>
32 #include <hwconfig.h> 32 #include <hwconfig.h>
33 #include <fsl_qbman.h>
33 34
34 DECLARE_GLOBAL_DATA_PTR; 35 DECLARE_GLOBAL_DATA_PTR;
35 36
36 struct mm_region *mem_map = early_map; 37 struct mm_region *mem_map = early_map;
37 38
38 void cpu_name(char *name) 39 void cpu_name(char *name)
39 { 40 {
40 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); 41 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
41 unsigned int i, svr, ver; 42 unsigned int i, svr, ver;
42 43
43 svr = gur_in32(&gur->svr); 44 svr = gur_in32(&gur->svr);
44 ver = SVR_SOC_VER(svr); 45 ver = SVR_SOC_VER(svr);
45 46
46 for (i = 0; i < ARRAY_SIZE(cpu_type_list); i++) 47 for (i = 0; i < ARRAY_SIZE(cpu_type_list); i++)
47 if ((cpu_type_list[i].soc_ver & SVR_WO_E) == ver) { 48 if ((cpu_type_list[i].soc_ver & SVR_WO_E) == ver) {
48 strcpy(name, cpu_type_list[i].name); 49 strcpy(name, cpu_type_list[i].name);
49 50
50 if (IS_E_PROCESSOR(svr)) 51 if (IS_E_PROCESSOR(svr))
51 strcat(name, "E"); 52 strcat(name, "E");
52 53
53 sprintf(name + strlen(name), " Rev%d.%d", 54 sprintf(name + strlen(name), " Rev%d.%d",
54 SVR_MAJ(svr), SVR_MIN(svr)); 55 SVR_MAJ(svr), SVR_MIN(svr));
55 break; 56 break;
56 } 57 }
57 58
58 if (i == ARRAY_SIZE(cpu_type_list)) 59 if (i == ARRAY_SIZE(cpu_type_list))
59 strcpy(name, "unknown"); 60 strcpy(name, "unknown");
60 } 61 }
61 62
62 #ifndef CONFIG_SYS_DCACHE_OFF 63 #ifndef CONFIG_SYS_DCACHE_OFF
63 /* 64 /*
64 * To start MMU before DDR is available, we create MMU table in SRAM. 65 * To start MMU before DDR is available, we create MMU table in SRAM.
65 * The base address of SRAM is CONFIG_SYS_FSL_OCRAM_BASE. We use three 66 * The base address of SRAM is CONFIG_SYS_FSL_OCRAM_BASE. We use three
66 * levels of translation tables here to cover 40-bit address space. 67 * levels of translation tables here to cover 40-bit address space.
67 * We use 4KB granule size, with 40 bits physical address, T0SZ=24 68 * We use 4KB granule size, with 40 bits physical address, T0SZ=24
68 * Address above EARLY_PGTABLE_SIZE (0x5000) is free for other purpose. 69 * Address above EARLY_PGTABLE_SIZE (0x5000) is free for other purpose.
69 * Note, the debug print in cache_v8.c is not usable for debugging 70 * Note, the debug print in cache_v8.c is not usable for debugging
70 * these early MMU tables because UART is not yet available. 71 * these early MMU tables because UART is not yet available.
71 */ 72 */
72 static inline void early_mmu_setup(void) 73 static inline void early_mmu_setup(void)
73 { 74 {
74 unsigned int el = current_el(); 75 unsigned int el = current_el();
75 76
76 /* global data is already setup, no allocation yet */ 77 /* global data is already setup, no allocation yet */
77 gd->arch.tlb_addr = CONFIG_SYS_FSL_OCRAM_BASE; 78 gd->arch.tlb_addr = CONFIG_SYS_FSL_OCRAM_BASE;
78 gd->arch.tlb_fillptr = gd->arch.tlb_addr; 79 gd->arch.tlb_fillptr = gd->arch.tlb_addr;
79 gd->arch.tlb_size = EARLY_PGTABLE_SIZE; 80 gd->arch.tlb_size = EARLY_PGTABLE_SIZE;
80 81
81 /* Create early page tables */ 82 /* Create early page tables */
82 setup_pgtables(); 83 setup_pgtables();
83 84
84 /* point TTBR to the new table */ 85 /* point TTBR to the new table */
85 set_ttbr_tcr_mair(el, gd->arch.tlb_addr, 86 set_ttbr_tcr_mair(el, gd->arch.tlb_addr,
86 get_tcr(el, NULL, NULL) & 87 get_tcr(el, NULL, NULL) &
87 ~(TCR_ORGN_MASK | TCR_IRGN_MASK), 88 ~(TCR_ORGN_MASK | TCR_IRGN_MASK),
88 MEMORY_ATTRIBUTES); 89 MEMORY_ATTRIBUTES);
89 90
90 set_sctlr(get_sctlr() | CR_M); 91 set_sctlr(get_sctlr() | CR_M);
91 } 92 }
92 93
93 static void fix_pcie_mmu_map(void) 94 static void fix_pcie_mmu_map(void)
94 { 95 {
95 #ifdef CONFIG_ARCH_LS2080A 96 #ifdef CONFIG_ARCH_LS2080A
96 unsigned int i; 97 unsigned int i;
97 u32 svr, ver; 98 u32 svr, ver;
98 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); 99 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
99 100
100 svr = gur_in32(&gur->svr); 101 svr = gur_in32(&gur->svr);
101 ver = SVR_SOC_VER(svr); 102 ver = SVR_SOC_VER(svr);
102 103
103 /* Fix PCIE base and size for LS2088A */ 104 /* Fix PCIE base and size for LS2088A */
104 if ((ver == SVR_LS2088A) || (ver == SVR_LS2084A) || 105 if ((ver == SVR_LS2088A) || (ver == SVR_LS2084A) ||
105 (ver == SVR_LS2048A) || (ver == SVR_LS2044A) || 106 (ver == SVR_LS2048A) || (ver == SVR_LS2044A) ||
106 (ver == SVR_LS2081A) || (ver == SVR_LS2041A)) { 107 (ver == SVR_LS2081A) || (ver == SVR_LS2041A)) {
107 for (i = 0; i < ARRAY_SIZE(final_map); i++) { 108 for (i = 0; i < ARRAY_SIZE(final_map); i++) {
108 switch (final_map[i].phys) { 109 switch (final_map[i].phys) {
109 case CONFIG_SYS_PCIE1_PHYS_ADDR: 110 case CONFIG_SYS_PCIE1_PHYS_ADDR:
110 final_map[i].phys = 0x2000000000ULL; 111 final_map[i].phys = 0x2000000000ULL;
111 final_map[i].virt = 0x2000000000ULL; 112 final_map[i].virt = 0x2000000000ULL;
112 final_map[i].size = 0x800000000ULL; 113 final_map[i].size = 0x800000000ULL;
113 break; 114 break;
114 case CONFIG_SYS_PCIE2_PHYS_ADDR: 115 case CONFIG_SYS_PCIE2_PHYS_ADDR:
115 final_map[i].phys = 0x2800000000ULL; 116 final_map[i].phys = 0x2800000000ULL;
116 final_map[i].virt = 0x2800000000ULL; 117 final_map[i].virt = 0x2800000000ULL;
117 final_map[i].size = 0x800000000ULL; 118 final_map[i].size = 0x800000000ULL;
118 break; 119 break;
119 case CONFIG_SYS_PCIE3_PHYS_ADDR: 120 case CONFIG_SYS_PCIE3_PHYS_ADDR:
120 final_map[i].phys = 0x3000000000ULL; 121 final_map[i].phys = 0x3000000000ULL;
121 final_map[i].virt = 0x3000000000ULL; 122 final_map[i].virt = 0x3000000000ULL;
122 final_map[i].size = 0x800000000ULL; 123 final_map[i].size = 0x800000000ULL;
123 break; 124 break;
124 case CONFIG_SYS_PCIE4_PHYS_ADDR: 125 case CONFIG_SYS_PCIE4_PHYS_ADDR:
125 final_map[i].phys = 0x3800000000ULL; 126 final_map[i].phys = 0x3800000000ULL;
126 final_map[i].virt = 0x3800000000ULL; 127 final_map[i].virt = 0x3800000000ULL;
127 final_map[i].size = 0x800000000ULL; 128 final_map[i].size = 0x800000000ULL;
128 break; 129 break;
129 default: 130 default:
130 break; 131 break;
131 } 132 }
132 } 133 }
133 } 134 }
134 #endif 135 #endif
135 } 136 }
136 137
137 /* 138 /*
138 * The final tables look similar to early tables, but different in detail. 139 * The final tables look similar to early tables, but different in detail.
139 * These tables are in DRAM. Sub tables are added to enable cache for 140 * These tables are in DRAM. Sub tables are added to enable cache for
140 * QBMan and OCRAM. 141 * QBMan and OCRAM.
141 * 142 *
142 * Put the MMU table in secure memory if gd->arch.secure_ram is valid. 143 * Put the MMU table in secure memory if gd->arch.secure_ram is valid.
143 * OCRAM will be not used for this purpose so gd->arch.secure_ram can't be 0. 144 * OCRAM will be not used for this purpose so gd->arch.secure_ram can't be 0.
144 */ 145 */
145 static inline void final_mmu_setup(void) 146 static inline void final_mmu_setup(void)
146 { 147 {
147 u64 tlb_addr_save = gd->arch.tlb_addr; 148 u64 tlb_addr_save = gd->arch.tlb_addr;
148 unsigned int el = current_el(); 149 unsigned int el = current_el();
149 int index; 150 int index;
150 151
151 /* fix the final_map before filling in the block entries */ 152 /* fix the final_map before filling in the block entries */
152 fix_pcie_mmu_map(); 153 fix_pcie_mmu_map();
153 154
154 mem_map = final_map; 155 mem_map = final_map;
155 156
156 /* Update mapping for DDR to actual size */ 157 /* Update mapping for DDR to actual size */
157 for (index = 0; index < ARRAY_SIZE(final_map) - 2; index++) { 158 for (index = 0; index < ARRAY_SIZE(final_map) - 2; index++) {
158 /* 159 /*
159 * Find the entry for DDR mapping and update the address and 160 * Find the entry for DDR mapping and update the address and
160 * size. Zero-sized mapping will be skipped when creating MMU 161 * size. Zero-sized mapping will be skipped when creating MMU
161 * table. 162 * table.
162 */ 163 */
163 switch (final_map[index].virt) { 164 switch (final_map[index].virt) {
164 case CONFIG_SYS_FSL_DRAM_BASE1: 165 case CONFIG_SYS_FSL_DRAM_BASE1:
165 final_map[index].virt = gd->bd->bi_dram[0].start; 166 final_map[index].virt = gd->bd->bi_dram[0].start;
166 final_map[index].phys = gd->bd->bi_dram[0].start; 167 final_map[index].phys = gd->bd->bi_dram[0].start;
167 final_map[index].size = gd->bd->bi_dram[0].size; 168 final_map[index].size = gd->bd->bi_dram[0].size;
168 break; 169 break;
169 #ifdef CONFIG_SYS_FSL_DRAM_BASE2 170 #ifdef CONFIG_SYS_FSL_DRAM_BASE2
170 case CONFIG_SYS_FSL_DRAM_BASE2: 171 case CONFIG_SYS_FSL_DRAM_BASE2:
171 #if (CONFIG_NR_DRAM_BANKS >= 2) 172 #if (CONFIG_NR_DRAM_BANKS >= 2)
172 final_map[index].virt = gd->bd->bi_dram[1].start; 173 final_map[index].virt = gd->bd->bi_dram[1].start;
173 final_map[index].phys = gd->bd->bi_dram[1].start; 174 final_map[index].phys = gd->bd->bi_dram[1].start;
174 final_map[index].size = gd->bd->bi_dram[1].size; 175 final_map[index].size = gd->bd->bi_dram[1].size;
175 #else 176 #else
176 final_map[index].size = 0; 177 final_map[index].size = 0;
177 #endif 178 #endif
178 break; 179 break;
179 #endif 180 #endif
180 #ifdef CONFIG_SYS_FSL_DRAM_BASE3 181 #ifdef CONFIG_SYS_FSL_DRAM_BASE3
181 case CONFIG_SYS_FSL_DRAM_BASE3: 182 case CONFIG_SYS_FSL_DRAM_BASE3:
182 #if (CONFIG_NR_DRAM_BANKS >= 3) 183 #if (CONFIG_NR_DRAM_BANKS >= 3)
183 final_map[index].virt = gd->bd->bi_dram[2].start; 184 final_map[index].virt = gd->bd->bi_dram[2].start;
184 final_map[index].phys = gd->bd->bi_dram[2].start; 185 final_map[index].phys = gd->bd->bi_dram[2].start;
185 final_map[index].size = gd->bd->bi_dram[2].size; 186 final_map[index].size = gd->bd->bi_dram[2].size;
186 #else 187 #else
187 final_map[index].size = 0; 188 final_map[index].size = 0;
188 #endif 189 #endif
189 break; 190 break;
190 #endif 191 #endif
191 default: 192 default:
192 break; 193 break;
193 } 194 }
194 } 195 }
195 196
196 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE 197 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE
197 if (gd->arch.secure_ram & MEM_RESERVE_SECURE_MAINTAINED) { 198 if (gd->arch.secure_ram & MEM_RESERVE_SECURE_MAINTAINED) {
198 if (el == 3) { 199 if (el == 3) {
199 /* 200 /*
200 * Only use gd->arch.secure_ram if the address is 201 * Only use gd->arch.secure_ram if the address is
201 * recalculated. Align to 4KB for MMU table. 202 * recalculated. Align to 4KB for MMU table.
202 */ 203 */
203 /* put page tables in secure ram */ 204 /* put page tables in secure ram */
204 index = ARRAY_SIZE(final_map) - 2; 205 index = ARRAY_SIZE(final_map) - 2;
205 gd->arch.tlb_addr = gd->arch.secure_ram & ~0xfff; 206 gd->arch.tlb_addr = gd->arch.secure_ram & ~0xfff;
206 final_map[index].virt = gd->arch.secure_ram & ~0x3; 207 final_map[index].virt = gd->arch.secure_ram & ~0x3;
207 final_map[index].phys = final_map[index].virt; 208 final_map[index].phys = final_map[index].virt;
208 final_map[index].size = CONFIG_SYS_MEM_RESERVE_SECURE; 209 final_map[index].size = CONFIG_SYS_MEM_RESERVE_SECURE;
209 final_map[index].attrs = PTE_BLOCK_OUTER_SHARE; 210 final_map[index].attrs = PTE_BLOCK_OUTER_SHARE;
210 gd->arch.secure_ram |= MEM_RESERVE_SECURE_SECURED; 211 gd->arch.secure_ram |= MEM_RESERVE_SECURE_SECURED;
211 tlb_addr_save = gd->arch.tlb_addr; 212 tlb_addr_save = gd->arch.tlb_addr;
212 } else { 213 } else {
213 /* Use allocated (board_f.c) memory for TLB */ 214 /* Use allocated (board_f.c) memory for TLB */
214 tlb_addr_save = gd->arch.tlb_allocated; 215 tlb_addr_save = gd->arch.tlb_allocated;
215 gd->arch.tlb_addr = tlb_addr_save; 216 gd->arch.tlb_addr = tlb_addr_save;
216 } 217 }
217 } 218 }
218 #endif 219 #endif
219 220
220 /* Reset the fill ptr */ 221 /* Reset the fill ptr */
221 gd->arch.tlb_fillptr = tlb_addr_save; 222 gd->arch.tlb_fillptr = tlb_addr_save;
222 223
223 /* Create normal system page tables */ 224 /* Create normal system page tables */
224 setup_pgtables(); 225 setup_pgtables();
225 226
226 /* Create emergency page tables */ 227 /* Create emergency page tables */
227 gd->arch.tlb_addr = gd->arch.tlb_fillptr; 228 gd->arch.tlb_addr = gd->arch.tlb_fillptr;
228 gd->arch.tlb_emerg = gd->arch.tlb_addr; 229 gd->arch.tlb_emerg = gd->arch.tlb_addr;
229 setup_pgtables(); 230 setup_pgtables();
230 gd->arch.tlb_addr = tlb_addr_save; 231 gd->arch.tlb_addr = tlb_addr_save;
231 232
232 /* Disable cache and MMU */ 233 /* Disable cache and MMU */
233 dcache_disable(); /* TLBs are invalidated */ 234 dcache_disable(); /* TLBs are invalidated */
234 invalidate_icache_all(); 235 invalidate_icache_all();
235 236
236 /* point TTBR to the new table */ 237 /* point TTBR to the new table */
237 set_ttbr_tcr_mair(el, gd->arch.tlb_addr, get_tcr(el, NULL, NULL), 238 set_ttbr_tcr_mair(el, gd->arch.tlb_addr, get_tcr(el, NULL, NULL),
238 MEMORY_ATTRIBUTES); 239 MEMORY_ATTRIBUTES);
239 240
240 set_sctlr(get_sctlr() | CR_M); 241 set_sctlr(get_sctlr() | CR_M);
241 } 242 }
242 243
243 u64 get_page_table_size(void) 244 u64 get_page_table_size(void)
244 { 245 {
245 return 0x10000; 246 return 0x10000;
246 } 247 }
247 248
248 int arch_cpu_init(void) 249 int arch_cpu_init(void)
249 { 250 {
250 /* 251 /*
251 * This function is called before U-Boot relocates itself to speed up 252 * This function is called before U-Boot relocates itself to speed up
252 * on system running. It is not necessary to run if performance is not 253 * on system running. It is not necessary to run if performance is not
253 * critical. Skip if MMU is already enabled by SPL or other means. 254 * critical. Skip if MMU is already enabled by SPL or other means.
254 */ 255 */
255 if (get_sctlr() & CR_M) 256 if (get_sctlr() & CR_M)
256 return 0; 257 return 0;
257 258
258 icache_enable(); 259 icache_enable();
259 __asm_invalidate_dcache_all(); 260 __asm_invalidate_dcache_all();
260 __asm_invalidate_tlb_all(); 261 __asm_invalidate_tlb_all();
261 early_mmu_setup(); 262 early_mmu_setup();
262 set_sctlr(get_sctlr() | CR_C); 263 set_sctlr(get_sctlr() | CR_C);
263 return 0; 264 return 0;
264 } 265 }
265 266
266 void mmu_setup(void) 267 void mmu_setup(void)
267 { 268 {
268 final_mmu_setup(); 269 final_mmu_setup();
269 } 270 }
270 271
271 /* 272 /*
272 * This function is called from common/board_r.c. 273 * This function is called from common/board_r.c.
273 * It recreates MMU table in main memory. 274 * It recreates MMU table in main memory.
274 */ 275 */
275 void enable_caches(void) 276 void enable_caches(void)
276 { 277 {
277 mmu_setup(); 278 mmu_setup();
278 __asm_invalidate_tlb_all(); 279 __asm_invalidate_tlb_all();
279 icache_enable(); 280 icache_enable();
280 dcache_enable(); 281 dcache_enable();
281 } 282 }
282 #endif 283 #endif
283 284
284 u32 initiator_type(u32 cluster, int init_id) 285 u32 initiator_type(u32 cluster, int init_id)
285 { 286 {
286 struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); 287 struct ccsr_gur *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
287 u32 idx = (cluster >> (init_id * 8)) & TP_CLUSTER_INIT_MASK; 288 u32 idx = (cluster >> (init_id * 8)) & TP_CLUSTER_INIT_MASK;
288 u32 type = 0; 289 u32 type = 0;
289 290
290 type = gur_in32(&gur->tp_ityp[idx]); 291 type = gur_in32(&gur->tp_ityp[idx]);
291 if (type & TP_ITYP_AV) 292 if (type & TP_ITYP_AV)
292 return type; 293 return type;
293 294
294 return 0; 295 return 0;
295 } 296 }
296 297
297 u32 cpu_pos_mask(void) 298 u32 cpu_pos_mask(void)
298 { 299 {
299 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); 300 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
300 int i = 0; 301 int i = 0;
301 u32 cluster, type, mask = 0; 302 u32 cluster, type, mask = 0;
302 303
303 do { 304 do {
304 int j; 305 int j;
305 306
306 cluster = gur_in32(&gur->tp_cluster[i].lower); 307 cluster = gur_in32(&gur->tp_cluster[i].lower);
307 for (j = 0; j < TP_INIT_PER_CLUSTER; j++) { 308 for (j = 0; j < TP_INIT_PER_CLUSTER; j++) {
308 type = initiator_type(cluster, j); 309 type = initiator_type(cluster, j);
309 if (type && (TP_ITYP_TYPE(type) == TP_ITYP_TYPE_ARM)) 310 if (type && (TP_ITYP_TYPE(type) == TP_ITYP_TYPE_ARM))
310 mask |= 1 << (i * TP_INIT_PER_CLUSTER + j); 311 mask |= 1 << (i * TP_INIT_PER_CLUSTER + j);
311 } 312 }
312 i++; 313 i++;
313 } while ((cluster & TP_CLUSTER_EOC) == 0x0); 314 } while ((cluster & TP_CLUSTER_EOC) == 0x0);
314 315
315 return mask; 316 return mask;
316 } 317 }
317 318
318 u32 cpu_mask(void) 319 u32 cpu_mask(void)
319 { 320 {
320 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); 321 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
321 int i = 0, count = 0; 322 int i = 0, count = 0;
322 u32 cluster, type, mask = 0; 323 u32 cluster, type, mask = 0;
323 324
324 do { 325 do {
325 int j; 326 int j;
326 327
327 cluster = gur_in32(&gur->tp_cluster[i].lower); 328 cluster = gur_in32(&gur->tp_cluster[i].lower);
328 for (j = 0; j < TP_INIT_PER_CLUSTER; j++) { 329 for (j = 0; j < TP_INIT_PER_CLUSTER; j++) {
329 type = initiator_type(cluster, j); 330 type = initiator_type(cluster, j);
330 if (type) { 331 if (type) {
331 if (TP_ITYP_TYPE(type) == TP_ITYP_TYPE_ARM) 332 if (TP_ITYP_TYPE(type) == TP_ITYP_TYPE_ARM)
332 mask |= 1 << count; 333 mask |= 1 << count;
333 count++; 334 count++;
334 } 335 }
335 } 336 }
336 i++; 337 i++;
337 } while ((cluster & TP_CLUSTER_EOC) == 0x0); 338 } while ((cluster & TP_CLUSTER_EOC) == 0x0);
338 339
339 return mask; 340 return mask;
340 } 341 }
341 342
342 /* 343 /*
343 * Return the number of cores on this SOC. 344 * Return the number of cores on this SOC.
344 */ 345 */
345 int cpu_numcores(void) 346 int cpu_numcores(void)
346 { 347 {
347 return hweight32(cpu_mask()); 348 return hweight32(cpu_mask());
348 } 349 }
349 350
350 int fsl_qoriq_core_to_cluster(unsigned int core) 351 int fsl_qoriq_core_to_cluster(unsigned int core)
351 { 352 {
352 struct ccsr_gur __iomem *gur = 353 struct ccsr_gur __iomem *gur =
353 (void __iomem *)(CONFIG_SYS_FSL_GUTS_ADDR); 354 (void __iomem *)(CONFIG_SYS_FSL_GUTS_ADDR);
354 int i = 0, count = 0; 355 int i = 0, count = 0;
355 u32 cluster; 356 u32 cluster;
356 357
357 do { 358 do {
358 int j; 359 int j;
359 360
360 cluster = gur_in32(&gur->tp_cluster[i].lower); 361 cluster = gur_in32(&gur->tp_cluster[i].lower);
361 for (j = 0; j < TP_INIT_PER_CLUSTER; j++) { 362 for (j = 0; j < TP_INIT_PER_CLUSTER; j++) {
362 if (initiator_type(cluster, j)) { 363 if (initiator_type(cluster, j)) {
363 if (count == core) 364 if (count == core)
364 return i; 365 return i;
365 count++; 366 count++;
366 } 367 }
367 } 368 }
368 i++; 369 i++;
369 } while ((cluster & TP_CLUSTER_EOC) == 0x0); 370 } while ((cluster & TP_CLUSTER_EOC) == 0x0);
370 371
371 return -1; /* cannot identify the cluster */ 372 return -1; /* cannot identify the cluster */
372 } 373 }
373 374
374 u32 fsl_qoriq_core_to_type(unsigned int core) 375 u32 fsl_qoriq_core_to_type(unsigned int core)
375 { 376 {
376 struct ccsr_gur __iomem *gur = 377 struct ccsr_gur __iomem *gur =
377 (void __iomem *)(CONFIG_SYS_FSL_GUTS_ADDR); 378 (void __iomem *)(CONFIG_SYS_FSL_GUTS_ADDR);
378 int i = 0, count = 0; 379 int i = 0, count = 0;
379 u32 cluster, type; 380 u32 cluster, type;
380 381
381 do { 382 do {
382 int j; 383 int j;
383 384
384 cluster = gur_in32(&gur->tp_cluster[i].lower); 385 cluster = gur_in32(&gur->tp_cluster[i].lower);
385 for (j = 0; j < TP_INIT_PER_CLUSTER; j++) { 386 for (j = 0; j < TP_INIT_PER_CLUSTER; j++) {
386 type = initiator_type(cluster, j); 387 type = initiator_type(cluster, j);
387 if (type) { 388 if (type) {
388 if (count == core) 389 if (count == core)
389 return type; 390 return type;
390 count++; 391 count++;
391 } 392 }
392 } 393 }
393 i++; 394 i++;
394 } while ((cluster & TP_CLUSTER_EOC) == 0x0); 395 } while ((cluster & TP_CLUSTER_EOC) == 0x0);
395 396
396 return -1; /* cannot identify the cluster */ 397 return -1; /* cannot identify the cluster */
397 } 398 }
398 399
399 #ifndef CONFIG_FSL_LSCH3 400 #ifndef CONFIG_FSL_LSCH3
400 uint get_svr(void) 401 uint get_svr(void)
401 { 402 {
402 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); 403 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
403 404
404 return gur_in32(&gur->svr); 405 return gur_in32(&gur->svr);
405 } 406 }
406 #endif 407 #endif
407 408
408 #ifdef CONFIG_DISPLAY_CPUINFO 409 #ifdef CONFIG_DISPLAY_CPUINFO
409 int print_cpuinfo(void) 410 int print_cpuinfo(void)
410 { 411 {
411 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); 412 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
412 struct sys_info sysinfo; 413 struct sys_info sysinfo;
413 char buf[32]; 414 char buf[32];
414 unsigned int i, core; 415 unsigned int i, core;
415 u32 type, rcw, svr = gur_in32(&gur->svr); 416 u32 type, rcw, svr = gur_in32(&gur->svr);
416 417
417 puts("SoC: "); 418 puts("SoC: ");
418 419
419 cpu_name(buf); 420 cpu_name(buf);
420 printf(" %s (0x%x)\n", buf, svr); 421 printf(" %s (0x%x)\n", buf, svr);
421 memset((u8 *)buf, 0x00, ARRAY_SIZE(buf)); 422 memset((u8 *)buf, 0x00, ARRAY_SIZE(buf));
422 get_sys_info(&sysinfo); 423 get_sys_info(&sysinfo);
423 puts("Clock Configuration:"); 424 puts("Clock Configuration:");
424 for_each_cpu(i, core, cpu_numcores(), cpu_mask()) { 425 for_each_cpu(i, core, cpu_numcores(), cpu_mask()) {
425 if (!(i % 3)) 426 if (!(i % 3))
426 puts("\n "); 427 puts("\n ");
427 type = TP_ITYP_VER(fsl_qoriq_core_to_type(core)); 428 type = TP_ITYP_VER(fsl_qoriq_core_to_type(core));
428 printf("CPU%d(%s):%-4s MHz ", core, 429 printf("CPU%d(%s):%-4s MHz ", core,
429 type == TY_ITYP_VER_A7 ? "A7 " : 430 type == TY_ITYP_VER_A7 ? "A7 " :
430 (type == TY_ITYP_VER_A53 ? "A53" : 431 (type == TY_ITYP_VER_A53 ? "A53" :
431 (type == TY_ITYP_VER_A57 ? "A57" : 432 (type == TY_ITYP_VER_A57 ? "A57" :
432 (type == TY_ITYP_VER_A72 ? "A72" : " "))), 433 (type == TY_ITYP_VER_A72 ? "A72" : " "))),
433 strmhz(buf, sysinfo.freq_processor[core])); 434 strmhz(buf, sysinfo.freq_processor[core]));
434 } 435 }
435 /* Display platform clock as Bus frequency. */ 436 /* Display platform clock as Bus frequency. */
436 printf("\n Bus: %-4s MHz ", 437 printf("\n Bus: %-4s MHz ",
437 strmhz(buf, sysinfo.freq_systembus / CONFIG_SYS_FSL_PCLK_DIV)); 438 strmhz(buf, sysinfo.freq_systembus / CONFIG_SYS_FSL_PCLK_DIV));
438 printf("DDR: %-4s MT/s", strmhz(buf, sysinfo.freq_ddrbus)); 439 printf("DDR: %-4s MT/s", strmhz(buf, sysinfo.freq_ddrbus));
439 #ifdef CONFIG_SYS_DPAA_FMAN 440 #ifdef CONFIG_SYS_DPAA_FMAN
440 printf(" FMAN: %-4s MHz", strmhz(buf, sysinfo.freq_fman[0])); 441 printf(" FMAN: %-4s MHz", strmhz(buf, sysinfo.freq_fman[0]));
441 #endif 442 #endif
442 #ifdef CONFIG_SYS_FSL_HAS_DP_DDR 443 #ifdef CONFIG_SYS_FSL_HAS_DP_DDR
443 if (soc_has_dp_ddr()) { 444 if (soc_has_dp_ddr()) {
444 printf(" DP-DDR: %-4s MT/s", 445 printf(" DP-DDR: %-4s MT/s",
445 strmhz(buf, sysinfo.freq_ddrbus2)); 446 strmhz(buf, sysinfo.freq_ddrbus2));
446 } 447 }
447 #endif 448 #endif
448 puts("\n"); 449 puts("\n");
449 450
450 /* 451 /*
451 * Display the RCW, so that no one gets confused as to what RCW 452 * Display the RCW, so that no one gets confused as to what RCW
452 * we're actually using for this boot. 453 * we're actually using for this boot.
453 */ 454 */
454 puts("Reset Configuration Word (RCW):"); 455 puts("Reset Configuration Word (RCW):");
455 for (i = 0; i < ARRAY_SIZE(gur->rcwsr); i++) { 456 for (i = 0; i < ARRAY_SIZE(gur->rcwsr); i++) {
456 rcw = gur_in32(&gur->rcwsr[i]); 457 rcw = gur_in32(&gur->rcwsr[i]);
457 if ((i % 4) == 0) 458 if ((i % 4) == 0)
458 printf("\n %08x:", i * 4); 459 printf("\n %08x:", i * 4);
459 printf(" %08x", rcw); 460 printf(" %08x", rcw);
460 } 461 }
461 puts("\n"); 462 puts("\n");
462 463
463 return 0; 464 return 0;
464 } 465 }
465 #endif 466 #endif
466 467
467 #ifdef CONFIG_FSL_ESDHC 468 #ifdef CONFIG_FSL_ESDHC
468 int cpu_mmc_init(bd_t *bis) 469 int cpu_mmc_init(bd_t *bis)
469 { 470 {
470 return fsl_esdhc_mmc_init(bis); 471 return fsl_esdhc_mmc_init(bis);
471 } 472 }
472 #endif 473 #endif
473 474
474 int cpu_eth_init(bd_t *bis) 475 int cpu_eth_init(bd_t *bis)
475 { 476 {
476 int error = 0; 477 int error = 0;
477 478
478 #if defined(CONFIG_FSL_MC_ENET) && !defined(CONFIG_SPL_BUILD) 479 #if defined(CONFIG_FSL_MC_ENET) && !defined(CONFIG_SPL_BUILD)
479 error = fsl_mc_ldpaa_init(bis); 480 error = fsl_mc_ldpaa_init(bis);
480 #endif 481 #endif
481 #ifdef CONFIG_FMAN_ENET 482 #ifdef CONFIG_FMAN_ENET
482 fm_standard_init(bis); 483 fm_standard_init(bis);
483 #endif 484 #endif
484 return error; 485 return error;
485 } 486 }
486 487
487 static inline int check_psci(void) 488 static inline int check_psci(void)
488 { 489 {
489 unsigned int psci_ver; 490 unsigned int psci_ver;
490 491
491 psci_ver = sec_firmware_support_psci_version(); 492 psci_ver = sec_firmware_support_psci_version();
492 if (psci_ver == PSCI_INVALID_VER) 493 if (psci_ver == PSCI_INVALID_VER)
493 return 1; 494 return 1;
494 495
495 return 0; 496 return 0;
496 } 497 }
497 498
498 static void config_core_prefetch(void) 499 static void config_core_prefetch(void)
499 { 500 {
500 char *buf = NULL; 501 char *buf = NULL;
501 char buffer[HWCONFIG_BUFFER_SIZE]; 502 char buffer[HWCONFIG_BUFFER_SIZE];
502 const char *prefetch_arg = NULL; 503 const char *prefetch_arg = NULL;
503 size_t arglen; 504 size_t arglen;
504 unsigned int mask; 505 unsigned int mask;
505 struct pt_regs regs; 506 struct pt_regs regs;
506 507
507 if (env_get_f("hwconfig", buffer, sizeof(buffer)) > 0) 508 if (env_get_f("hwconfig", buffer, sizeof(buffer)) > 0)
508 buf = buffer; 509 buf = buffer;
509 510
510 prefetch_arg = hwconfig_subarg_f("core_prefetch", "disable", 511 prefetch_arg = hwconfig_subarg_f("core_prefetch", "disable",
511 &arglen, buf); 512 &arglen, buf);
512 513
513 if (prefetch_arg) { 514 if (prefetch_arg) {
514 mask = simple_strtoul(prefetch_arg, NULL, 0) & 0xff; 515 mask = simple_strtoul(prefetch_arg, NULL, 0) & 0xff;
515 if (mask & 0x1) { 516 if (mask & 0x1) {
516 printf("Core0 prefetch can't be disabled\n"); 517 printf("Core0 prefetch can't be disabled\n");
517 return; 518 return;
518 } 519 }
519 520
520 #define SIP_PREFETCH_DISABLE_64 0xC200FF13 521 #define SIP_PREFETCH_DISABLE_64 0xC200FF13
521 regs.regs[0] = SIP_PREFETCH_DISABLE_64; 522 regs.regs[0] = SIP_PREFETCH_DISABLE_64;
522 regs.regs[1] = mask; 523 regs.regs[1] = mask;
523 smc_call(&regs); 524 smc_call(&regs);
524 525
525 if (regs.regs[0]) 526 if (regs.regs[0])
526 printf("Prefetch disable config failed for mask "); 527 printf("Prefetch disable config failed for mask ");
527 else 528 else
528 printf("Prefetch disable config passed for mask "); 529 printf("Prefetch disable config passed for mask ");
529 printf("0x%x\n", mask); 530 printf("0x%x\n", mask);
530 } 531 }
531 } 532 }
532 533
533 int arch_early_init_r(void) 534 int arch_early_init_r(void)
534 { 535 {
535 #ifdef CONFIG_SYS_FSL_ERRATUM_A009635 536 #ifdef CONFIG_SYS_FSL_ERRATUM_A009635
536 u32 svr_dev_id; 537 u32 svr_dev_id;
537 /* 538 /*
538 * erratum A009635 is valid only for LS2080A SoC and 539 * erratum A009635 is valid only for LS2080A SoC and
539 * its personalitiesi 540 * its personalitiesi
540 */ 541 */
541 svr_dev_id = get_svr(); 542 svr_dev_id = get_svr();
542 if (IS_SVR_DEV(svr_dev_id, SVR_DEV(SVR_LS2080A))) 543 if (IS_SVR_DEV(svr_dev_id, SVR_DEV(SVR_LS2080A)))
543 erratum_a009635(); 544 erratum_a009635();
544 #endif 545 #endif
545 #if defined(CONFIG_SYS_FSL_ERRATUM_A009942) && defined(CONFIG_SYS_FSL_DDR) 546 #if defined(CONFIG_SYS_FSL_ERRATUM_A009942) && defined(CONFIG_SYS_FSL_DDR)
546 erratum_a009942_check_cpo(); 547 erratum_a009942_check_cpo();
547 #endif 548 #endif
548 if (check_psci()) { 549 if (check_psci()) {
549 debug("PSCI: PSCI does not exist.\n"); 550 debug("PSCI: PSCI does not exist.\n");
550 551
551 /* if PSCI does not exist, boot secondary cores here */ 552 /* if PSCI does not exist, boot secondary cores here */
552 if (fsl_layerscape_wake_seconday_cores()) 553 if (fsl_layerscape_wake_seconday_cores())
553 printf("Did not wake secondary cores\n"); 554 printf("Did not wake secondary cores\n");
554 } 555 }
555 556
556 #ifdef CONFIG_SYS_FSL_HAS_RGMII 557 #ifdef CONFIG_SYS_FSL_HAS_RGMII
557 fsl_rgmii_init(); 558 fsl_rgmii_init();
558 #endif 559 #endif
559 560
560 config_core_prefetch(); 561 config_core_prefetch();
561 562
562 #ifdef CONFIG_SYS_HAS_SERDES 563 #ifdef CONFIG_SYS_HAS_SERDES
563 fsl_serdes_init(); 564 fsl_serdes_init();
564 #endif 565 #endif
565 #ifdef CONFIG_FMAN_ENET 566 #ifdef CONFIG_FMAN_ENET
566 fman_enet_init(); 567 fman_enet_init();
568 #endif
569 #ifdef CONFIG_SYS_DPAA_QBMAN
570 setup_qbman_portals();
567 #endif 571 #endif
568 return 0; 572 return 0;
569 } 573 }
570 574
571 int timer_init(void) 575 int timer_init(void)
572 { 576 {
573 u32 __iomem *cntcr = (u32 *)CONFIG_SYS_FSL_TIMER_ADDR; 577 u32 __iomem *cntcr = (u32 *)CONFIG_SYS_FSL_TIMER_ADDR;
574 #ifdef CONFIG_FSL_LSCH3 578 #ifdef CONFIG_FSL_LSCH3
575 u32 __iomem *cltbenr = (u32 *)CONFIG_SYS_FSL_PMU_CLTBENR; 579 u32 __iomem *cltbenr = (u32 *)CONFIG_SYS_FSL_PMU_CLTBENR;
576 #endif 580 #endif
577 #ifdef CONFIG_ARCH_LS2080A 581 #ifdef CONFIG_ARCH_LS2080A
578 u32 __iomem *pctbenr = (u32 *)FSL_PMU_PCTBENR_OFFSET; 582 u32 __iomem *pctbenr = (u32 *)FSL_PMU_PCTBENR_OFFSET;
579 u32 svr_dev_id; 583 u32 svr_dev_id;
580 #endif 584 #endif
581 #ifdef COUNTER_FREQUENCY_REAL 585 #ifdef COUNTER_FREQUENCY_REAL
582 unsigned long cntfrq = COUNTER_FREQUENCY_REAL; 586 unsigned long cntfrq = COUNTER_FREQUENCY_REAL;
583 587
584 /* Update with accurate clock frequency */ 588 /* Update with accurate clock frequency */
585 if (current_el() == 3) 589 if (current_el() == 3)
586 asm volatile("msr cntfrq_el0, %0" : : "r" (cntfrq) : "memory"); 590 asm volatile("msr cntfrq_el0, %0" : : "r" (cntfrq) : "memory");
587 #endif 591 #endif
588 592
589 #ifdef CONFIG_FSL_LSCH3 593 #ifdef CONFIG_FSL_LSCH3
590 /* Enable timebase for all clusters. 594 /* Enable timebase for all clusters.
591 * It is safe to do so even some clusters are not enabled. 595 * It is safe to do so even some clusters are not enabled.
592 */ 596 */
593 out_le32(cltbenr, 0xf); 597 out_le32(cltbenr, 0xf);
594 #endif 598 #endif
595 599
596 #ifdef CONFIG_ARCH_LS2080A 600 #ifdef CONFIG_ARCH_LS2080A
597 /* 601 /*
598 * In certain Layerscape SoCs, the clock for each core's 602 * In certain Layerscape SoCs, the clock for each core's
599 * has an enable bit in the PMU Physical Core Time Base Enable 603 * has an enable bit in the PMU Physical Core Time Base Enable
600 * Register (PCTBENR), which allows the watchdog to operate. 604 * Register (PCTBENR), which allows the watchdog to operate.
601 */ 605 */
602 setbits_le32(pctbenr, 0xff); 606 setbits_le32(pctbenr, 0xff);
603 /* 607 /*
604 * For LS2080A SoC and its personalities, timer controller 608 * For LS2080A SoC and its personalities, timer controller
605 * offset is different 609 * offset is different
606 */ 610 */
607 svr_dev_id = get_svr(); 611 svr_dev_id = get_svr();
608 if (IS_SVR_DEV(svr_dev_id, SVR_DEV(SVR_LS2080A))) 612 if (IS_SVR_DEV(svr_dev_id, SVR_DEV(SVR_LS2080A)))
609 cntcr = (u32 *)SYS_FSL_LS2080A_LS2085A_TIMER_ADDR; 613 cntcr = (u32 *)SYS_FSL_LS2080A_LS2085A_TIMER_ADDR;
610 614
611 #endif 615 #endif
612 616
613 /* Enable clock for timer 617 /* Enable clock for timer
614 * This is a global setting. 618 * This is a global setting.
615 */ 619 */
616 out_le32(cntcr, 0x1); 620 out_le32(cntcr, 0x1);
617 621
618 return 0; 622 return 0;
619 } 623 }
620 624
621 __efi_runtime_data u32 __iomem *rstcr = (u32 *)CONFIG_SYS_FSL_RST_ADDR; 625 __efi_runtime_data u32 __iomem *rstcr = (u32 *)CONFIG_SYS_FSL_RST_ADDR;
622 626
623 void __efi_runtime reset_cpu(ulong addr) 627 void __efi_runtime reset_cpu(ulong addr)
624 { 628 {
625 u32 val; 629 u32 val;
626 630
627 /* Raise RESET_REQ_B */ 631 /* Raise RESET_REQ_B */
628 val = scfg_in32(rstcr); 632 val = scfg_in32(rstcr);
629 val |= 0x02; 633 val |= 0x02;
630 scfg_out32(rstcr, val); 634 scfg_out32(rstcr, val);
631 } 635 }
632 636
633 #ifdef CONFIG_EFI_LOADER 637 #ifdef CONFIG_EFI_LOADER
634 638
635 void __efi_runtime EFIAPI efi_reset_system( 639 void __efi_runtime EFIAPI efi_reset_system(
636 enum efi_reset_type reset_type, 640 enum efi_reset_type reset_type,
637 efi_status_t reset_status, 641 efi_status_t reset_status,
638 unsigned long data_size, void *reset_data) 642 unsigned long data_size, void *reset_data)
639 { 643 {
640 switch (reset_type) { 644 switch (reset_type) {
641 case EFI_RESET_COLD: 645 case EFI_RESET_COLD:
642 case EFI_RESET_WARM: 646 case EFI_RESET_WARM:
643 reset_cpu(0); 647 reset_cpu(0);
644 break; 648 break;
645 case EFI_RESET_SHUTDOWN: 649 case EFI_RESET_SHUTDOWN:
646 /* Nothing we can do */ 650 /* Nothing we can do */
647 break; 651 break;
648 } 652 }
649 653
650 while (1) { } 654 while (1) { }
651 } 655 }
652 656
653 void efi_reset_system_init(void) 657 void efi_reset_system_init(void)
654 { 658 {
655 efi_add_runtime_mmio(&rstcr, sizeof(*rstcr)); 659 efi_add_runtime_mmio(&rstcr, sizeof(*rstcr));
656 } 660 }
657 661
658 #endif 662 #endif
659 663
660 /* 664 /*
661 * Calculate reserved memory with given memory bank 665 * Calculate reserved memory with given memory bank
662 * Return aligned memory size on success 666 * Return aligned memory size on success
663 * Return (ram_size + needed size) for failure 667 * Return (ram_size + needed size) for failure
664 */ 668 */
665 phys_size_t board_reserve_ram_top(phys_size_t ram_size) 669 phys_size_t board_reserve_ram_top(phys_size_t ram_size)
666 { 670 {
667 phys_size_t ram_top = ram_size; 671 phys_size_t ram_top = ram_size;
668 672
669 #if defined(CONFIG_FSL_MC_ENET) && !defined(CONFIG_SPL_BUILD) 673 #if defined(CONFIG_FSL_MC_ENET) && !defined(CONFIG_SPL_BUILD)
670 ram_top = mc_get_dram_block_size(); 674 ram_top = mc_get_dram_block_size();
671 if (ram_top > ram_size) 675 if (ram_top > ram_size)
672 return ram_size + ram_top; 676 return ram_size + ram_top;
673 677
674 ram_top = ram_size - ram_top; 678 ram_top = ram_size - ram_top;
675 /* The start address of MC reserved memory needs to be aligned. */ 679 /* The start address of MC reserved memory needs to be aligned. */
676 ram_top &= ~(CONFIG_SYS_MC_RSV_MEM_ALIGN - 1); 680 ram_top &= ~(CONFIG_SYS_MC_RSV_MEM_ALIGN - 1);
677 #endif 681 #endif
678 682
679 return ram_size - ram_top; 683 return ram_size - ram_top;
680 } 684 }
681 685
682 phys_size_t get_effective_memsize(void) 686 phys_size_t get_effective_memsize(void)
683 { 687 {
684 phys_size_t ea_size, rem = 0; 688 phys_size_t ea_size, rem = 0;
685 689
686 /* 690 /*
687 * For ARMv8 SoCs, DDR memory is split into two or three regions. The 691 * For ARMv8 SoCs, DDR memory is split into two or three regions. The
688 * first region is 2GB space at 0x8000_0000. Secure memory needs to 692 * first region is 2GB space at 0x8000_0000. Secure memory needs to
689 * allocated from first region. If the memory extends to the second 693 * allocated from first region. If the memory extends to the second
690 * region (or the third region if applicable), Management Complex (MC) 694 * region (or the third region if applicable), Management Complex (MC)
691 * memory should be put into the highest region, i.e. the end of DDR 695 * memory should be put into the highest region, i.e. the end of DDR
692 * memory. CONFIG_MAX_MEM_MAPPED is set to the size of first region so 696 * memory. CONFIG_MAX_MEM_MAPPED is set to the size of first region so
693 * U-Boot doesn't relocate itself into higher address. Should DDR be 697 * U-Boot doesn't relocate itself into higher address. Should DDR be
694 * configured to skip the first region, this function needs to be 698 * configured to skip the first region, this function needs to be
695 * adjusted. 699 * adjusted.
696 */ 700 */
697 if (gd->ram_size > CONFIG_MAX_MEM_MAPPED) { 701 if (gd->ram_size > CONFIG_MAX_MEM_MAPPED) {
698 ea_size = CONFIG_MAX_MEM_MAPPED; 702 ea_size = CONFIG_MAX_MEM_MAPPED;
699 rem = gd->ram_size - ea_size; 703 rem = gd->ram_size - ea_size;
700 } else { 704 } else {
701 ea_size = gd->ram_size; 705 ea_size = gd->ram_size;
702 } 706 }
703 707
704 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE 708 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE
705 /* Check if we have enough space for secure memory */ 709 /* Check if we have enough space for secure memory */
706 if (ea_size > CONFIG_SYS_MEM_RESERVE_SECURE) 710 if (ea_size > CONFIG_SYS_MEM_RESERVE_SECURE)
707 ea_size -= CONFIG_SYS_MEM_RESERVE_SECURE; 711 ea_size -= CONFIG_SYS_MEM_RESERVE_SECURE;
708 else 712 else
709 printf("Error: No enough space for secure memory.\n"); 713 printf("Error: No enough space for secure memory.\n");
710 #endif 714 #endif
711 /* Check if we have enough memory for MC */ 715 /* Check if we have enough memory for MC */
712 if (rem < board_reserve_ram_top(rem)) { 716 if (rem < board_reserve_ram_top(rem)) {
713 /* Not enough memory in high region to reserve */ 717 /* Not enough memory in high region to reserve */
714 if (ea_size > board_reserve_ram_top(ea_size)) 718 if (ea_size > board_reserve_ram_top(ea_size))
715 ea_size -= board_reserve_ram_top(ea_size); 719 ea_size -= board_reserve_ram_top(ea_size);
716 else 720 else
717 printf("Error: No enough space for reserved memory.\n"); 721 printf("Error: No enough space for reserved memory.\n");
718 } 722 }
719 723
720 return ea_size; 724 return ea_size;
721 } 725 }
722 726
723 int dram_init_banksize(void) 727 int dram_init_banksize(void)
724 { 728 {
725 #ifdef CONFIG_SYS_DP_DDR_BASE_PHY 729 #ifdef CONFIG_SYS_DP_DDR_BASE_PHY
726 phys_size_t dp_ddr_size; 730 phys_size_t dp_ddr_size;
727 #endif 731 #endif
728 732
729 /* 733 /*
730 * gd->ram_size has the total size of DDR memory, less reserved secure 734 * gd->ram_size has the total size of DDR memory, less reserved secure
731 * memory. The DDR extends from low region to high region(s) presuming 735 * memory. The DDR extends from low region to high region(s) presuming
732 * no hole is created with DDR configuration. gd->arch.secure_ram tracks 736 * no hole is created with DDR configuration. gd->arch.secure_ram tracks
733 * the location of secure memory. gd->arch.resv_ram tracks the location 737 * the location of secure memory. gd->arch.resv_ram tracks the location
734 * of reserved memory for Management Complex (MC). Because gd->ram_size 738 * of reserved memory for Management Complex (MC). Because gd->ram_size
735 * is reduced by this function if secure memory is reserved, checking 739 * is reduced by this function if secure memory is reserved, checking
736 * gd->arch.secure_ram should be done to avoid running it repeatedly. 740 * gd->arch.secure_ram should be done to avoid running it repeatedly.
737 */ 741 */
738 742
739 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE 743 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE
740 if (gd->arch.secure_ram & MEM_RESERVE_SECURE_MAINTAINED) { 744 if (gd->arch.secure_ram & MEM_RESERVE_SECURE_MAINTAINED) {
741 debug("No need to run again, skip %s\n", __func__); 745 debug("No need to run again, skip %s\n", __func__);
742 746
743 return 0; 747 return 0;
744 } 748 }
745 #endif 749 #endif
746 750
747 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; 751 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
748 if (gd->ram_size > CONFIG_SYS_DDR_BLOCK1_SIZE) { 752 if (gd->ram_size > CONFIG_SYS_DDR_BLOCK1_SIZE) {
749 gd->bd->bi_dram[0].size = CONFIG_SYS_DDR_BLOCK1_SIZE; 753 gd->bd->bi_dram[0].size = CONFIG_SYS_DDR_BLOCK1_SIZE;
750 gd->bd->bi_dram[1].start = CONFIG_SYS_DDR_BLOCK2_BASE; 754 gd->bd->bi_dram[1].start = CONFIG_SYS_DDR_BLOCK2_BASE;
751 gd->bd->bi_dram[1].size = gd->ram_size - 755 gd->bd->bi_dram[1].size = gd->ram_size -
752 CONFIG_SYS_DDR_BLOCK1_SIZE; 756 CONFIG_SYS_DDR_BLOCK1_SIZE;
753 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE 757 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE
754 if (gd->bi_dram[1].size > CONFIG_SYS_DDR_BLOCK2_SIZE) { 758 if (gd->bi_dram[1].size > CONFIG_SYS_DDR_BLOCK2_SIZE) {
755 gd->bd->bi_dram[2].start = CONFIG_SYS_DDR_BLOCK3_BASE; 759 gd->bd->bi_dram[2].start = CONFIG_SYS_DDR_BLOCK3_BASE;
756 gd->bd->bi_dram[2].size = gd->bd->bi_dram[1].size - 760 gd->bd->bi_dram[2].size = gd->bd->bi_dram[1].size -
757 CONFIG_SYS_DDR_BLOCK2_SIZE; 761 CONFIG_SYS_DDR_BLOCK2_SIZE;
758 gd->bd->bi_dram[1].size = CONFIG_SYS_DDR_BLOCK2_SIZE; 762 gd->bd->bi_dram[1].size = CONFIG_SYS_DDR_BLOCK2_SIZE;
759 } 763 }
760 #endif 764 #endif
761 } else { 765 } else {
762 gd->bd->bi_dram[0].size = gd->ram_size; 766 gd->bd->bi_dram[0].size = gd->ram_size;
763 } 767 }
764 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE 768 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE
765 if (gd->bd->bi_dram[0].size > 769 if (gd->bd->bi_dram[0].size >
766 CONFIG_SYS_MEM_RESERVE_SECURE) { 770 CONFIG_SYS_MEM_RESERVE_SECURE) {
767 gd->bd->bi_dram[0].size -= 771 gd->bd->bi_dram[0].size -=
768 CONFIG_SYS_MEM_RESERVE_SECURE; 772 CONFIG_SYS_MEM_RESERVE_SECURE;
769 gd->arch.secure_ram = gd->bd->bi_dram[0].start + 773 gd->arch.secure_ram = gd->bd->bi_dram[0].start +
770 gd->bd->bi_dram[0].size; 774 gd->bd->bi_dram[0].size;
771 gd->arch.secure_ram |= MEM_RESERVE_SECURE_MAINTAINED; 775 gd->arch.secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;
772 gd->ram_size -= CONFIG_SYS_MEM_RESERVE_SECURE; 776 gd->ram_size -= CONFIG_SYS_MEM_RESERVE_SECURE;
773 } 777 }
774 #endif /* CONFIG_SYS_MEM_RESERVE_SECURE */ 778 #endif /* CONFIG_SYS_MEM_RESERVE_SECURE */
775 779
776 #if defined(CONFIG_FSL_MC_ENET) && !defined(CONFIG_SPL_BUILD) 780 #if defined(CONFIG_FSL_MC_ENET) && !defined(CONFIG_SPL_BUILD)
777 /* Assign memory for MC */ 781 /* Assign memory for MC */
778 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE 782 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE
779 if (gd->bd->bi_dram[2].size >= 783 if (gd->bd->bi_dram[2].size >=
780 board_reserve_ram_top(gd->bd->bi_dram[2].size)) { 784 board_reserve_ram_top(gd->bd->bi_dram[2].size)) {
781 gd->arch.resv_ram = gd->bd->bi_dram[2].start + 785 gd->arch.resv_ram = gd->bd->bi_dram[2].start +
782 gd->bd->bi_dram[2].size - 786 gd->bd->bi_dram[2].size -
783 board_reserve_ram_top(gd->bd->bi_dram[2].size); 787 board_reserve_ram_top(gd->bd->bi_dram[2].size);
784 } else 788 } else
785 #endif 789 #endif
786 { 790 {
787 if (gd->bd->bi_dram[1].size >= 791 if (gd->bd->bi_dram[1].size >=
788 board_reserve_ram_top(gd->bd->bi_dram[1].size)) { 792 board_reserve_ram_top(gd->bd->bi_dram[1].size)) {
789 gd->arch.resv_ram = gd->bd->bi_dram[1].start + 793 gd->arch.resv_ram = gd->bd->bi_dram[1].start +
790 gd->bd->bi_dram[1].size - 794 gd->bd->bi_dram[1].size -
791 board_reserve_ram_top(gd->bd->bi_dram[1].size); 795 board_reserve_ram_top(gd->bd->bi_dram[1].size);
792 } else if (gd->bd->bi_dram[0].size > 796 } else if (gd->bd->bi_dram[0].size >
793 board_reserve_ram_top(gd->bd->bi_dram[0].size)) { 797 board_reserve_ram_top(gd->bd->bi_dram[0].size)) {
794 gd->arch.resv_ram = gd->bd->bi_dram[0].start + 798 gd->arch.resv_ram = gd->bd->bi_dram[0].start +
795 gd->bd->bi_dram[0].size - 799 gd->bd->bi_dram[0].size -
796 board_reserve_ram_top(gd->bd->bi_dram[0].size); 800 board_reserve_ram_top(gd->bd->bi_dram[0].size);
797 } 801 }
798 } 802 }
799 #endif /* CONFIG_FSL_MC_ENET */ 803 #endif /* CONFIG_FSL_MC_ENET */
800 804
801 #ifdef CONFIG_SYS_DP_DDR_BASE_PHY 805 #ifdef CONFIG_SYS_DP_DDR_BASE_PHY
802 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE 806 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE
803 #error "This SoC shouldn't have DP DDR" 807 #error "This SoC shouldn't have DP DDR"
804 #endif 808 #endif
805 if (soc_has_dp_ddr()) { 809 if (soc_has_dp_ddr()) {
806 /* initialize DP-DDR here */ 810 /* initialize DP-DDR here */
807 puts("DP-DDR: "); 811 puts("DP-DDR: ");
808 /* 812 /*
809 * DDR controller use 0 as the base address for binding. 813 * DDR controller use 0 as the base address for binding.
810 * It is mapped to CONFIG_SYS_DP_DDR_BASE for core to access. 814 * It is mapped to CONFIG_SYS_DP_DDR_BASE for core to access.
811 */ 815 */
812 dp_ddr_size = fsl_other_ddr_sdram(CONFIG_SYS_DP_DDR_BASE_PHY, 816 dp_ddr_size = fsl_other_ddr_sdram(CONFIG_SYS_DP_DDR_BASE_PHY,
813 CONFIG_DP_DDR_CTRL, 817 CONFIG_DP_DDR_CTRL,
814 CONFIG_DP_DDR_NUM_CTRLS, 818 CONFIG_DP_DDR_NUM_CTRLS,
815 CONFIG_DP_DDR_DIMM_SLOTS_PER_CTLR, 819 CONFIG_DP_DDR_DIMM_SLOTS_PER_CTLR,
816 NULL, NULL, NULL); 820 NULL, NULL, NULL);
817 if (dp_ddr_size) { 821 if (dp_ddr_size) {
818 gd->bd->bi_dram[2].start = CONFIG_SYS_DP_DDR_BASE; 822 gd->bd->bi_dram[2].start = CONFIG_SYS_DP_DDR_BASE;
819 gd->bd->bi_dram[2].size = dp_ddr_size; 823 gd->bd->bi_dram[2].size = dp_ddr_size;
820 } else { 824 } else {
821 puts("Not detected"); 825 puts("Not detected");
822 } 826 }
823 } 827 }
824 #endif 828 #endif
825 829
826 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE 830 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE
827 debug("%s is called. gd->ram_size is reduced to %lu\n", 831 debug("%s is called. gd->ram_size is reduced to %lu\n",
828 __func__, (ulong)gd->ram_size); 832 __func__, (ulong)gd->ram_size);
829 #endif 833 #endif
830 834
831 return 0; 835 return 0;
832 } 836 }
833 837
834 #if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD) 838 #if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
835 void efi_add_known_memory(void) 839 void efi_add_known_memory(void)
836 { 840 {
837 int i; 841 int i;
838 phys_addr_t ram_start, start; 842 phys_addr_t ram_start, start;
839 phys_size_t ram_size; 843 phys_size_t ram_size;
840 u64 pages; 844 u64 pages;
841 845
842 /* Add RAM */ 846 /* Add RAM */
843 for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { 847 for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
844 #ifdef CONFIG_SYS_DP_DDR_BASE_PHY 848 #ifdef CONFIG_SYS_DP_DDR_BASE_PHY
845 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE 849 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE
846 #error "This SoC shouldn't have DP DDR" 850 #error "This SoC shouldn't have DP DDR"
847 #endif 851 #endif
848 if (i == 2) 852 if (i == 2)
849 continue; /* skip DP-DDR */ 853 continue; /* skip DP-DDR */
850 #endif 854 #endif
851 ram_start = gd->bd->bi_dram[i].start; 855 ram_start = gd->bd->bi_dram[i].start;
852 ram_size = gd->bd->bi_dram[i].size; 856 ram_size = gd->bd->bi_dram[i].size;
853 #ifdef CONFIG_RESV_RAM 857 #ifdef CONFIG_RESV_RAM
854 if (gd->arch.resv_ram >= ram_start && 858 if (gd->arch.resv_ram >= ram_start &&
855 gd->arch.resv_ram < ram_start + ram_size) 859 gd->arch.resv_ram < ram_start + ram_size)
856 ram_size = gd->arch.resv_ram - ram_start; 860 ram_size = gd->arch.resv_ram - ram_start;
857 #endif 861 #endif
858 start = (ram_start + EFI_PAGE_MASK) & ~EFI_PAGE_MASK; 862 start = (ram_start + EFI_PAGE_MASK) & ~EFI_PAGE_MASK;
859 pages = (ram_size + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT; 863 pages = (ram_size + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
860 864
861 efi_add_memory_map(start, pages, EFI_CONVENTIONAL_MEMORY, 865 efi_add_memory_map(start, pages, EFI_CONVENTIONAL_MEMORY,
862 false); 866 false);
863 } 867 }
864 } 868 }
865 #endif 869 #endif
866 870
867 /* 871 /*
868 * Before DDR size is known, early MMU table have DDR mapped as device memory 872 * Before DDR size is known, early MMU table have DDR mapped as device memory
869 * to avoid speculative access. To relocate U-Boot to DDR, "normal memory" 873 * to avoid speculative access. To relocate U-Boot to DDR, "normal memory"
870 * needs to be set for these mappings. 874 * needs to be set for these mappings.
871 * If a special case configures DDR with holes in the mapping, the holes need 875 * If a special case configures DDR with holes in the mapping, the holes need
872 * to be marked as invalid. This is not implemented in this function. 876 * to be marked as invalid. This is not implemented in this function.
873 */ 877 */
874 void update_early_mmu_table(void) 878 void update_early_mmu_table(void)
875 { 879 {
876 if (!gd->arch.tlb_addr) 880 if (!gd->arch.tlb_addr)
877 return; 881 return;
878 882
879 if (gd->ram_size <= CONFIG_SYS_FSL_DRAM_SIZE1) { 883 if (gd->ram_size <= CONFIG_SYS_FSL_DRAM_SIZE1) {
880 mmu_change_region_attr( 884 mmu_change_region_attr(
881 CONFIG_SYS_SDRAM_BASE, 885 CONFIG_SYS_SDRAM_BASE,
882 gd->ram_size, 886 gd->ram_size,
883 PTE_BLOCK_MEMTYPE(MT_NORMAL) | 887 PTE_BLOCK_MEMTYPE(MT_NORMAL) |
884 PTE_BLOCK_OUTER_SHARE | 888 PTE_BLOCK_OUTER_SHARE |
885 PTE_BLOCK_NS | 889 PTE_BLOCK_NS |
886 PTE_TYPE_VALID); 890 PTE_TYPE_VALID);
887 } else { 891 } else {
888 mmu_change_region_attr( 892 mmu_change_region_attr(
889 CONFIG_SYS_SDRAM_BASE, 893 CONFIG_SYS_SDRAM_BASE,
890 CONFIG_SYS_DDR_BLOCK1_SIZE, 894 CONFIG_SYS_DDR_BLOCK1_SIZE,
891 PTE_BLOCK_MEMTYPE(MT_NORMAL) | 895 PTE_BLOCK_MEMTYPE(MT_NORMAL) |
892 PTE_BLOCK_OUTER_SHARE | 896 PTE_BLOCK_OUTER_SHARE |
893 PTE_BLOCK_NS | 897 PTE_BLOCK_NS |
894 PTE_TYPE_VALID); 898 PTE_TYPE_VALID);
895 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE 899 #ifdef CONFIG_SYS_DDR_BLOCK3_BASE
896 #ifndef CONFIG_SYS_DDR_BLOCK2_SIZE 900 #ifndef CONFIG_SYS_DDR_BLOCK2_SIZE
897 #error "Missing CONFIG_SYS_DDR_BLOCK2_SIZE" 901 #error "Missing CONFIG_SYS_DDR_BLOCK2_SIZE"
898 #endif 902 #endif
899 if (gd->ram_size - CONFIG_SYS_DDR_BLOCK1_SIZE > 903 if (gd->ram_size - CONFIG_SYS_DDR_BLOCK1_SIZE >
900 CONFIG_SYS_DDR_BLOCK2_SIZE) { 904 CONFIG_SYS_DDR_BLOCK2_SIZE) {
901 mmu_change_region_attr( 905 mmu_change_region_attr(
902 CONFIG_SYS_DDR_BLOCK2_BASE, 906 CONFIG_SYS_DDR_BLOCK2_BASE,
903 CONFIG_SYS_DDR_BLOCK2_SIZE, 907 CONFIG_SYS_DDR_BLOCK2_SIZE,
904 PTE_BLOCK_MEMTYPE(MT_NORMAL) | 908 PTE_BLOCK_MEMTYPE(MT_NORMAL) |
905 PTE_BLOCK_OUTER_SHARE | 909 PTE_BLOCK_OUTER_SHARE |
906 PTE_BLOCK_NS | 910 PTE_BLOCK_NS |
907 PTE_TYPE_VALID); 911 PTE_TYPE_VALID);
908 mmu_change_region_attr( 912 mmu_change_region_attr(
909 CONFIG_SYS_DDR_BLOCK3_BASE, 913 CONFIG_SYS_DDR_BLOCK3_BASE,
910 gd->ram_size - 914 gd->ram_size -
911 CONFIG_SYS_DDR_BLOCK1_SIZE - 915 CONFIG_SYS_DDR_BLOCK1_SIZE -
912 CONFIG_SYS_DDR_BLOCK2_SIZE, 916 CONFIG_SYS_DDR_BLOCK2_SIZE,
913 PTE_BLOCK_MEMTYPE(MT_NORMAL) | 917 PTE_BLOCK_MEMTYPE(MT_NORMAL) |
914 PTE_BLOCK_OUTER_SHARE | 918 PTE_BLOCK_OUTER_SHARE |
915 PTE_BLOCK_NS | 919 PTE_BLOCK_NS |
916 PTE_TYPE_VALID); 920 PTE_TYPE_VALID);
917 } else 921 } else
918 #endif 922 #endif
919 { 923 {
920 mmu_change_region_attr( 924 mmu_change_region_attr(
921 CONFIG_SYS_DDR_BLOCK2_BASE, 925 CONFIG_SYS_DDR_BLOCK2_BASE,
922 gd->ram_size - 926 gd->ram_size -
923 CONFIG_SYS_DDR_BLOCK1_SIZE, 927 CONFIG_SYS_DDR_BLOCK1_SIZE,
924 PTE_BLOCK_MEMTYPE(MT_NORMAL) | 928 PTE_BLOCK_MEMTYPE(MT_NORMAL) |
925 PTE_BLOCK_OUTER_SHARE | 929 PTE_BLOCK_OUTER_SHARE |
926 PTE_BLOCK_NS | 930 PTE_BLOCK_NS |
927 PTE_TYPE_VALID); 931 PTE_TYPE_VALID);
928 } 932 }
929 } 933 }
930 } 934 }
931 935
932 __weak int dram_init(void) 936 __weak int dram_init(void)
933 { 937 {
934 fsl_initdram(); 938 fsl_initdram();
935 #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) 939 #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
936 /* This will break-before-make MMU for DDR */ 940 /* This will break-before-make MMU for DDR */
937 update_early_mmu_table(); 941 update_early_mmu_table();
938 #endif 942 #endif
939 943
940 return 0; 944 return 0;
941 } 945 }
942 946
arch/arm/cpu/armv8/fsl-layerscape/fdt.c
1 /* 1 /*
2 * Copyright 2014-2015 Freescale Semiconductor, Inc. 2 * Copyright 2014-2015 Freescale Semiconductor, Inc.
3 * 3 *
4 * SPDX-License-Identifier: GPL-2.0+ 4 * SPDX-License-Identifier: GPL-2.0+
5 */ 5 */
6 6
7 #include <common.h> 7 #include <common.h>
8 #include <efi_loader.h> 8 #include <efi_loader.h>
9 #include <libfdt.h> 9 #include <libfdt.h>
10 #include <fdt_support.h> 10 #include <fdt_support.h>
11 #include <phy.h> 11 #include <phy.h>
12 #ifdef CONFIG_FSL_LSCH3 12 #ifdef CONFIG_FSL_LSCH3
13 #include <asm/arch/fdt.h> 13 #include <asm/arch/fdt.h>
14 #endif 14 #endif
15 #ifdef CONFIG_FSL_ESDHC 15 #ifdef CONFIG_FSL_ESDHC
16 #include <fsl_esdhc.h> 16 #include <fsl_esdhc.h>
17 #endif 17 #endif
18 #ifdef CONFIG_SYS_DPAA_FMAN 18 #ifdef CONFIG_SYS_DPAA_FMAN
19 #include <fsl_fman.h> 19 #include <fsl_fman.h>
20 #endif 20 #endif
21 #ifdef CONFIG_MP 21 #ifdef CONFIG_MP
22 #include <asm/arch/mp.h> 22 #include <asm/arch/mp.h>
23 #endif 23 #endif
24 #include <fsl_sec.h> 24 #include <fsl_sec.h>
25 #include <asm/arch-fsl-layerscape/soc.h> 25 #include <asm/arch-fsl-layerscape/soc.h>
26 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT 26 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
27 #include <asm/armv8/sec_firmware.h> 27 #include <asm/armv8/sec_firmware.h>
28 #endif 28 #endif
29 #include <asm/arch/speed.h>
30 #include <fsl_qbman.h>
29 31
30 int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc) 32 int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc)
31 { 33 {
32 return fdt_setprop_string(blob, offset, "phy-connection-type", 34 return fdt_setprop_string(blob, offset, "phy-connection-type",
33 phy_string_for_interface(phyc)); 35 phy_string_for_interface(phyc));
34 } 36 }
35 37
36 #ifdef CONFIG_MP 38 #ifdef CONFIG_MP
37 void ft_fixup_cpu(void *blob) 39 void ft_fixup_cpu(void *blob)
38 { 40 {
39 int off; 41 int off;
40 __maybe_unused u64 spin_tbl_addr = (u64)get_spin_tbl_addr(); 42 __maybe_unused u64 spin_tbl_addr = (u64)get_spin_tbl_addr();
41 fdt32_t *reg; 43 fdt32_t *reg;
42 int addr_cells; 44 int addr_cells;
43 u64 val, core_id; 45 u64 val, core_id;
44 size_t *boot_code_size = &(__secondary_boot_code_size); 46 size_t *boot_code_size = &(__secondary_boot_code_size);
45 u32 mask = cpu_pos_mask(); 47 u32 mask = cpu_pos_mask();
46 int off_prev = -1; 48 int off_prev = -1;
47 49
48 off = fdt_path_offset(blob, "/cpus"); 50 off = fdt_path_offset(blob, "/cpus");
49 if (off < 0) { 51 if (off < 0) {
50 puts("couldn't find /cpus node\n"); 52 puts("couldn't find /cpus node\n");
51 return; 53 return;
52 } 54 }
53 55
54 fdt_support_default_count_cells(blob, off, &addr_cells, NULL); 56 fdt_support_default_count_cells(blob, off, &addr_cells, NULL);
55 57
56 off = fdt_node_offset_by_prop_value(blob, off_prev, "device_type", 58 off = fdt_node_offset_by_prop_value(blob, off_prev, "device_type",
57 "cpu", 4); 59 "cpu", 4);
58 while (off != -FDT_ERR_NOTFOUND) { 60 while (off != -FDT_ERR_NOTFOUND) {
59 reg = (fdt32_t *)fdt_getprop(blob, off, "reg", 0); 61 reg = (fdt32_t *)fdt_getprop(blob, off, "reg", 0);
60 if (reg) { 62 if (reg) {
61 core_id = fdt_read_number(reg, addr_cells); 63 core_id = fdt_read_number(reg, addr_cells);
62 if (!test_bit(id_to_core(core_id), &mask)) { 64 if (!test_bit(id_to_core(core_id), &mask)) {
63 fdt_del_node(blob, off); 65 fdt_del_node(blob, off);
64 off = off_prev; 66 off = off_prev;
65 } 67 }
66 } 68 }
67 off_prev = off; 69 off_prev = off;
68 off = fdt_node_offset_by_prop_value(blob, off_prev, 70 off = fdt_node_offset_by_prop_value(blob, off_prev,
69 "device_type", "cpu", 4); 71 "device_type", "cpu", 4);
70 } 72 }
71 73
72 #if defined(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT) && \ 74 #if defined(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT) && \
73 defined(CONFIG_SEC_FIRMWARE_ARMV8_PSCI) 75 defined(CONFIG_SEC_FIRMWARE_ARMV8_PSCI)
74 int node; 76 int node;
75 u32 psci_ver; 77 u32 psci_ver;
76 78
77 /* Check the psci version to determine if the psci is supported */ 79 /* Check the psci version to determine if the psci is supported */
78 psci_ver = sec_firmware_support_psci_version(); 80 psci_ver = sec_firmware_support_psci_version();
79 if (psci_ver == 0xffffffff) { 81 if (psci_ver == 0xffffffff) {
80 /* remove psci DT node */ 82 /* remove psci DT node */
81 node = fdt_path_offset(blob, "/psci"); 83 node = fdt_path_offset(blob, "/psci");
82 if (node >= 0) 84 if (node >= 0)
83 goto remove_psci_node; 85 goto remove_psci_node;
84 86
85 node = fdt_node_offset_by_compatible(blob, -1, "arm,psci"); 87 node = fdt_node_offset_by_compatible(blob, -1, "arm,psci");
86 if (node >= 0) 88 if (node >= 0)
87 goto remove_psci_node; 89 goto remove_psci_node;
88 90
89 node = fdt_node_offset_by_compatible(blob, -1, "arm,psci-0.2"); 91 node = fdt_node_offset_by_compatible(blob, -1, "arm,psci-0.2");
90 if (node >= 0) 92 if (node >= 0)
91 goto remove_psci_node; 93 goto remove_psci_node;
92 94
93 node = fdt_node_offset_by_compatible(blob, -1, "arm,psci-1.0"); 95 node = fdt_node_offset_by_compatible(blob, -1, "arm,psci-1.0");
94 if (node >= 0) 96 if (node >= 0)
95 goto remove_psci_node; 97 goto remove_psci_node;
96 98
97 remove_psci_node: 99 remove_psci_node:
98 if (node >= 0) 100 if (node >= 0)
99 fdt_del_node(blob, node); 101 fdt_del_node(blob, node);
100 } else { 102 } else {
101 return; 103 return;
102 } 104 }
103 #endif 105 #endif
104 off = fdt_path_offset(blob, "/cpus"); 106 off = fdt_path_offset(blob, "/cpus");
105 if (off < 0) { 107 if (off < 0) {
106 puts("couldn't find /cpus node\n"); 108 puts("couldn't find /cpus node\n");
107 return; 109 return;
108 } 110 }
109 fdt_support_default_count_cells(blob, off, &addr_cells, NULL); 111 fdt_support_default_count_cells(blob, off, &addr_cells, NULL);
110 112
111 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); 113 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
112 while (off != -FDT_ERR_NOTFOUND) { 114 while (off != -FDT_ERR_NOTFOUND) {
113 reg = (fdt32_t *)fdt_getprop(blob, off, "reg", 0); 115 reg = (fdt32_t *)fdt_getprop(blob, off, "reg", 0);
114 if (reg) { 116 if (reg) {
115 core_id = fdt_read_number(reg, addr_cells); 117 core_id = fdt_read_number(reg, addr_cells);
116 if (core_id == 0 || (is_core_online(core_id))) { 118 if (core_id == 0 || (is_core_online(core_id))) {
117 val = spin_tbl_addr; 119 val = spin_tbl_addr;
118 val += id_to_core(core_id) * 120 val += id_to_core(core_id) *
119 SPIN_TABLE_ELEM_SIZE; 121 SPIN_TABLE_ELEM_SIZE;
120 val = cpu_to_fdt64(val); 122 val = cpu_to_fdt64(val);
121 fdt_setprop_string(blob, off, "enable-method", 123 fdt_setprop_string(blob, off, "enable-method",
122 "spin-table"); 124 "spin-table");
123 fdt_setprop(blob, off, "cpu-release-addr", 125 fdt_setprop(blob, off, "cpu-release-addr",
124 &val, sizeof(val)); 126 &val, sizeof(val));
125 } else { 127 } else {
126 debug("skipping offline core\n"); 128 debug("skipping offline core\n");
127 } 129 }
128 } else { 130 } else {
129 puts("Warning: found cpu node without reg property\n"); 131 puts("Warning: found cpu node without reg property\n");
130 } 132 }
131 off = fdt_node_offset_by_prop_value(blob, off, "device_type", 133 off = fdt_node_offset_by_prop_value(blob, off, "device_type",
132 "cpu", 4); 134 "cpu", 4);
133 } 135 }
134 136
135 fdt_add_mem_rsv(blob, (uintptr_t)&secondary_boot_code, 137 fdt_add_mem_rsv(blob, (uintptr_t)&secondary_boot_code,
136 *boot_code_size); 138 *boot_code_size);
137 #if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD) 139 #if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
138 efi_add_memory_map((uintptr_t)&secondary_boot_code, 140 efi_add_memory_map((uintptr_t)&secondary_boot_code,
139 ALIGN(*boot_code_size, EFI_PAGE_SIZE) >> EFI_PAGE_SHIFT, 141 ALIGN(*boot_code_size, EFI_PAGE_SIZE) >> EFI_PAGE_SHIFT,
140 EFI_RESERVED_MEMORY_TYPE, false); 142 EFI_RESERVED_MEMORY_TYPE, false);
141 #endif 143 #endif
142 } 144 }
143 #endif 145 #endif
144 146
145 void fsl_fdt_disable_usb(void *blob) 147 void fsl_fdt_disable_usb(void *blob)
146 { 148 {
147 int off; 149 int off;
148 /* 150 /*
149 * SYSCLK is used as a reference clock for USB. When the USB 151 * SYSCLK is used as a reference clock for USB. When the USB
150 * controller is used, SYSCLK must meet the additional requirement 152 * controller is used, SYSCLK must meet the additional requirement
151 * of 100 MHz. 153 * of 100 MHz.
152 */ 154 */
153 if (CONFIG_SYS_CLK_FREQ != 100000000) { 155 if (CONFIG_SYS_CLK_FREQ != 100000000) {
154 off = fdt_node_offset_by_compatible(blob, -1, "snps,dwc3"); 156 off = fdt_node_offset_by_compatible(blob, -1, "snps,dwc3");
155 while (off != -FDT_ERR_NOTFOUND) { 157 while (off != -FDT_ERR_NOTFOUND) {
156 fdt_status_disabled(blob, off); 158 fdt_status_disabled(blob, off);
157 off = fdt_node_offset_by_compatible(blob, off, 159 off = fdt_node_offset_by_compatible(blob, off,
158 "snps,dwc3"); 160 "snps,dwc3");
159 } 161 }
160 } 162 }
161 } 163 }
162 164
163 #ifdef CONFIG_HAS_FEATURE_GIC64K_ALIGN 165 #ifdef CONFIG_HAS_FEATURE_GIC64K_ALIGN
164 static void fdt_fixup_gic(void *blob) 166 static void fdt_fixup_gic(void *blob)
165 { 167 {
166 int offset, err; 168 int offset, err;
167 u64 reg[8]; 169 u64 reg[8];
168 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); 170 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
169 unsigned int val; 171 unsigned int val;
170 struct ccsr_scfg __iomem *scfg = (void *)CONFIG_SYS_FSL_SCFG_ADDR; 172 struct ccsr_scfg __iomem *scfg = (void *)CONFIG_SYS_FSL_SCFG_ADDR;
171 int align_64k = 0; 173 int align_64k = 0;
172 174
173 val = gur_in32(&gur->svr); 175 val = gur_in32(&gur->svr);
174 176
175 if (!IS_SVR_DEV(val, SVR_DEV(SVR_LS1043A))) { 177 if (!IS_SVR_DEV(val, SVR_DEV(SVR_LS1043A))) {
176 align_64k = 1; 178 align_64k = 1;
177 } else if (SVR_REV(val) != REV1_0) { 179 } else if (SVR_REV(val) != REV1_0) {
178 val = scfg_in32(&scfg->gic_align) & (0x01 << GIC_ADDR_BIT); 180 val = scfg_in32(&scfg->gic_align) & (0x01 << GIC_ADDR_BIT);
179 if (!val) 181 if (!val)
180 align_64k = 1; 182 align_64k = 1;
181 } 183 }
182 184
183 offset = fdt_subnode_offset(blob, 0, "interrupt-controller@1400000"); 185 offset = fdt_subnode_offset(blob, 0, "interrupt-controller@1400000");
184 if (offset < 0) { 186 if (offset < 0) {
185 printf("WARNING: fdt_subnode_offset can't find node %s: %s\n", 187 printf("WARNING: fdt_subnode_offset can't find node %s: %s\n",
186 "interrupt-controller@1400000", fdt_strerror(offset)); 188 "interrupt-controller@1400000", fdt_strerror(offset));
187 return; 189 return;
188 } 190 }
189 191
190 /* Fixup gic node align with 64K */ 192 /* Fixup gic node align with 64K */
191 if (align_64k) { 193 if (align_64k) {
192 reg[0] = cpu_to_fdt64(GICD_BASE_64K); 194 reg[0] = cpu_to_fdt64(GICD_BASE_64K);
193 reg[1] = cpu_to_fdt64(GICD_SIZE_64K); 195 reg[1] = cpu_to_fdt64(GICD_SIZE_64K);
194 reg[2] = cpu_to_fdt64(GICC_BASE_64K); 196 reg[2] = cpu_to_fdt64(GICC_BASE_64K);
195 reg[3] = cpu_to_fdt64(GICC_SIZE_64K); 197 reg[3] = cpu_to_fdt64(GICC_SIZE_64K);
196 reg[4] = cpu_to_fdt64(GICH_BASE_64K); 198 reg[4] = cpu_to_fdt64(GICH_BASE_64K);
197 reg[5] = cpu_to_fdt64(GICH_SIZE_64K); 199 reg[5] = cpu_to_fdt64(GICH_SIZE_64K);
198 reg[6] = cpu_to_fdt64(GICV_BASE_64K); 200 reg[6] = cpu_to_fdt64(GICV_BASE_64K);
199 reg[7] = cpu_to_fdt64(GICV_SIZE_64K); 201 reg[7] = cpu_to_fdt64(GICV_SIZE_64K);
200 } else { 202 } else {
201 /* Fixup gic node align with default */ 203 /* Fixup gic node align with default */
202 reg[0] = cpu_to_fdt64(GICD_BASE); 204 reg[0] = cpu_to_fdt64(GICD_BASE);
203 reg[1] = cpu_to_fdt64(GICD_SIZE); 205 reg[1] = cpu_to_fdt64(GICD_SIZE);
204 reg[2] = cpu_to_fdt64(GICC_BASE); 206 reg[2] = cpu_to_fdt64(GICC_BASE);
205 reg[3] = cpu_to_fdt64(GICC_SIZE); 207 reg[3] = cpu_to_fdt64(GICC_SIZE);
206 reg[4] = cpu_to_fdt64(GICH_BASE); 208 reg[4] = cpu_to_fdt64(GICH_BASE);
207 reg[5] = cpu_to_fdt64(GICH_SIZE); 209 reg[5] = cpu_to_fdt64(GICH_SIZE);
208 reg[6] = cpu_to_fdt64(GICV_BASE); 210 reg[6] = cpu_to_fdt64(GICV_BASE);
209 reg[7] = cpu_to_fdt64(GICV_SIZE); 211 reg[7] = cpu_to_fdt64(GICV_SIZE);
210 } 212 }
211 213
212 err = fdt_setprop(blob, offset, "reg", reg, sizeof(reg)); 214 err = fdt_setprop(blob, offset, "reg", reg, sizeof(reg));
213 if (err < 0) { 215 if (err < 0) {
214 printf("WARNING: fdt_setprop can't set %s from node %s: %s\n", 216 printf("WARNING: fdt_setprop can't set %s from node %s: %s\n",
215 "reg", "interrupt-controller@1400000", 217 "reg", "interrupt-controller@1400000",
216 fdt_strerror(err)); 218 fdt_strerror(err));
217 return; 219 return;
218 } 220 }
219 221
220 return; 222 return;
221 } 223 }
222 #endif 224 #endif
223 225
224 #ifdef CONFIG_HAS_FEATURE_ENHANCED_MSI 226 #ifdef CONFIG_HAS_FEATURE_ENHANCED_MSI
225 static int _fdt_fixup_msi_node(void *blob, const char *name, 227 static int _fdt_fixup_msi_node(void *blob, const char *name,
226 int irq_0, int irq_1, int rev) 228 int irq_0, int irq_1, int rev)
227 { 229 {
228 int err, offset, len; 230 int err, offset, len;
229 u32 tmp[4][3]; 231 u32 tmp[4][3];
230 void *p; 232 void *p;
231 233
232 offset = fdt_path_offset(blob, name); 234 offset = fdt_path_offset(blob, name);
233 if (offset < 0) { 235 if (offset < 0) {
234 printf("WARNING: fdt_path_offset can't find path %s: %s\n", 236 printf("WARNING: fdt_path_offset can't find path %s: %s\n",
235 name, fdt_strerror(offset)); 237 name, fdt_strerror(offset));
236 return 0; 238 return 0;
237 } 239 }
238 240
239 /*fixup the property of interrupts*/ 241 /*fixup the property of interrupts*/
240 242
241 tmp[0][0] = cpu_to_fdt32(0x0); 243 tmp[0][0] = cpu_to_fdt32(0x0);
242 tmp[0][1] = cpu_to_fdt32(irq_0); 244 tmp[0][1] = cpu_to_fdt32(irq_0);
243 tmp[0][2] = cpu_to_fdt32(0x4); 245 tmp[0][2] = cpu_to_fdt32(0x4);
244 246
245 if (rev > REV1_0) { 247 if (rev > REV1_0) {
246 tmp[1][0] = cpu_to_fdt32(0x0); 248 tmp[1][0] = cpu_to_fdt32(0x0);
247 tmp[1][1] = cpu_to_fdt32(irq_1); 249 tmp[1][1] = cpu_to_fdt32(irq_1);
248 tmp[1][2] = cpu_to_fdt32(0x4); 250 tmp[1][2] = cpu_to_fdt32(0x4);
249 tmp[2][0] = cpu_to_fdt32(0x0); 251 tmp[2][0] = cpu_to_fdt32(0x0);
250 tmp[2][1] = cpu_to_fdt32(irq_1 + 1); 252 tmp[2][1] = cpu_to_fdt32(irq_1 + 1);
251 tmp[2][2] = cpu_to_fdt32(0x4); 253 tmp[2][2] = cpu_to_fdt32(0x4);
252 tmp[3][0] = cpu_to_fdt32(0x0); 254 tmp[3][0] = cpu_to_fdt32(0x0);
253 tmp[3][1] = cpu_to_fdt32(irq_1 + 2); 255 tmp[3][1] = cpu_to_fdt32(irq_1 + 2);
254 tmp[3][2] = cpu_to_fdt32(0x4); 256 tmp[3][2] = cpu_to_fdt32(0x4);
255 len = sizeof(tmp); 257 len = sizeof(tmp);
256 } else { 258 } else {
257 len = sizeof(tmp[0]); 259 len = sizeof(tmp[0]);
258 } 260 }
259 261
260 err = fdt_setprop(blob, offset, "interrupts", tmp, len); 262 err = fdt_setprop(blob, offset, "interrupts", tmp, len);
261 if (err < 0) { 263 if (err < 0) {
262 printf("WARNING: fdt_setprop can't set %s from node %s: %s\n", 264 printf("WARNING: fdt_setprop can't set %s from node %s: %s\n",
263 "interrupts", name, fdt_strerror(err)); 265 "interrupts", name, fdt_strerror(err));
264 return 0; 266 return 0;
265 } 267 }
266 268
267 /*fixup the property of reg*/ 269 /*fixup the property of reg*/
268 p = (char *)fdt_getprop(blob, offset, "reg", &len); 270 p = (char *)fdt_getprop(blob, offset, "reg", &len);
269 if (!p) { 271 if (!p) {
270 printf("WARNING: fdt_getprop can't get %s from node %s\n", 272 printf("WARNING: fdt_getprop can't get %s from node %s\n",
271 "reg", name); 273 "reg", name);
272 return 0; 274 return 0;
273 } 275 }
274 276
275 memcpy((char *)tmp, p, len); 277 memcpy((char *)tmp, p, len);
276 278
277 if (rev > REV1_0) 279 if (rev > REV1_0)
278 *((u32 *)tmp + 3) = cpu_to_fdt32(0x1000); 280 *((u32 *)tmp + 3) = cpu_to_fdt32(0x1000);
279 else 281 else
280 *((u32 *)tmp + 3) = cpu_to_fdt32(0x8); 282 *((u32 *)tmp + 3) = cpu_to_fdt32(0x8);
281 283
282 err = fdt_setprop(blob, offset, "reg", tmp, len); 284 err = fdt_setprop(blob, offset, "reg", tmp, len);
283 if (err < 0) { 285 if (err < 0) {
284 printf("WARNING: fdt_setprop can't set %s from node %s: %s\n", 286 printf("WARNING: fdt_setprop can't set %s from node %s: %s\n",
285 "reg", name, fdt_strerror(err)); 287 "reg", name, fdt_strerror(err));
286 return 0; 288 return 0;
287 } 289 }
288 290
289 /*fixup the property of compatible*/ 291 /*fixup the property of compatible*/
290 if (rev > REV1_0) 292 if (rev > REV1_0)
291 err = fdt_setprop_string(blob, offset, "compatible", 293 err = fdt_setprop_string(blob, offset, "compatible",
292 "fsl,ls1043a-v1.1-msi"); 294 "fsl,ls1043a-v1.1-msi");
293 else 295 else
294 err = fdt_setprop_string(blob, offset, "compatible", 296 err = fdt_setprop_string(blob, offset, "compatible",
295 "fsl,ls1043a-msi"); 297 "fsl,ls1043a-msi");
296 if (err < 0) { 298 if (err < 0) {
297 printf("WARNING: fdt_setprop can't set %s from node %s: %s\n", 299 printf("WARNING: fdt_setprop can't set %s from node %s: %s\n",
298 "compatible", name, fdt_strerror(err)); 300 "compatible", name, fdt_strerror(err));
299 return 0; 301 return 0;
300 } 302 }
301 303
302 return 1; 304 return 1;
303 } 305 }
304 306
305 static int _fdt_fixup_pci_msi(void *blob, const char *name, int rev) 307 static int _fdt_fixup_pci_msi(void *blob, const char *name, int rev)
306 { 308 {
307 int offset, len, err; 309 int offset, len, err;
308 void *p; 310 void *p;
309 int val; 311 int val;
310 u32 tmp[4][8]; 312 u32 tmp[4][8];
311 313
312 offset = fdt_path_offset(blob, name); 314 offset = fdt_path_offset(blob, name);
313 if (offset < 0) { 315 if (offset < 0) {
314 printf("WARNING: fdt_path_offset can't find path %s: %s\n", 316 printf("WARNING: fdt_path_offset can't find path %s: %s\n",
315 name, fdt_strerror(offset)); 317 name, fdt_strerror(offset));
316 return 0; 318 return 0;
317 } 319 }
318 320
319 p = (char *)fdt_getprop(blob, offset, "interrupt-map", &len); 321 p = (char *)fdt_getprop(blob, offset, "interrupt-map", &len);
320 if (!p || len != sizeof(tmp)) { 322 if (!p || len != sizeof(tmp)) {
321 printf("WARNING: fdt_getprop can't get %s from node %s\n", 323 printf("WARNING: fdt_getprop can't get %s from node %s\n",
322 "interrupt-map", name); 324 "interrupt-map", name);
323 return 0; 325 return 0;
324 } 326 }
325 327
326 memcpy((char *)tmp, p, len); 328 memcpy((char *)tmp, p, len);
327 329
328 val = fdt32_to_cpu(tmp[0][6]); 330 val = fdt32_to_cpu(tmp[0][6]);
329 if (rev > REV1_0) { 331 if (rev > REV1_0) {
330 tmp[1][6] = cpu_to_fdt32(val + 1); 332 tmp[1][6] = cpu_to_fdt32(val + 1);
331 tmp[2][6] = cpu_to_fdt32(val + 2); 333 tmp[2][6] = cpu_to_fdt32(val + 2);
332 tmp[3][6] = cpu_to_fdt32(val + 3); 334 tmp[3][6] = cpu_to_fdt32(val + 3);
333 } else { 335 } else {
334 tmp[1][6] = cpu_to_fdt32(val); 336 tmp[1][6] = cpu_to_fdt32(val);
335 tmp[2][6] = cpu_to_fdt32(val); 337 tmp[2][6] = cpu_to_fdt32(val);
336 tmp[3][6] = cpu_to_fdt32(val); 338 tmp[3][6] = cpu_to_fdt32(val);
337 } 339 }
338 340
339 err = fdt_setprop(blob, offset, "interrupt-map", tmp, sizeof(tmp)); 341 err = fdt_setprop(blob, offset, "interrupt-map", tmp, sizeof(tmp));
340 if (err < 0) { 342 if (err < 0) {
341 printf("WARNING: fdt_setprop can't set %s from node %s: %s.\n", 343 printf("WARNING: fdt_setprop can't set %s from node %s: %s.\n",
342 "interrupt-map", name, fdt_strerror(err)); 344 "interrupt-map", name, fdt_strerror(err));
343 return 0; 345 return 0;
344 } 346 }
345 return 1; 347 return 1;
346 } 348 }
347 349
348 /* Fixup msi node for ls1043a rev1.1*/ 350 /* Fixup msi node for ls1043a rev1.1*/
349 351
350 static void fdt_fixup_msi(void *blob) 352 static void fdt_fixup_msi(void *blob)
351 { 353 {
352 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); 354 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
353 unsigned int rev; 355 unsigned int rev;
354 356
355 rev = gur_in32(&gur->svr); 357 rev = gur_in32(&gur->svr);
356 358
357 if (!IS_SVR_DEV(rev, SVR_DEV(SVR_LS1043A))) 359 if (!IS_SVR_DEV(rev, SVR_DEV(SVR_LS1043A)))
358 return; 360 return;
359 361
360 rev = SVR_REV(rev); 362 rev = SVR_REV(rev);
361 363
362 _fdt_fixup_msi_node(blob, "/soc/msi-controller1@1571000", 364 _fdt_fixup_msi_node(blob, "/soc/msi-controller1@1571000",
363 116, 111, rev); 365 116, 111, rev);
364 _fdt_fixup_msi_node(blob, "/soc/msi-controller2@1572000", 366 _fdt_fixup_msi_node(blob, "/soc/msi-controller2@1572000",
365 126, 121, rev); 367 126, 121, rev);
366 _fdt_fixup_msi_node(blob, "/soc/msi-controller3@1573000", 368 _fdt_fixup_msi_node(blob, "/soc/msi-controller3@1573000",
367 160, 155, rev); 369 160, 155, rev);
368 370
369 _fdt_fixup_pci_msi(blob, "/soc/pcie@3400000", rev); 371 _fdt_fixup_pci_msi(blob, "/soc/pcie@3400000", rev);
370 _fdt_fixup_pci_msi(blob, "/soc/pcie@3500000", rev); 372 _fdt_fixup_pci_msi(blob, "/soc/pcie@3500000", rev);
371 _fdt_fixup_pci_msi(blob, "/soc/pcie@3600000", rev); 373 _fdt_fixup_pci_msi(blob, "/soc/pcie@3600000", rev);
372 } 374 }
373 #endif 375 #endif
374 376
375 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT 377 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
376 /* Remove JR node used by SEC firmware */ 378 /* Remove JR node used by SEC firmware */
377 void fdt_fixup_remove_jr(void *blob) 379 void fdt_fixup_remove_jr(void *blob)
378 { 380 {
379 int jr_node, addr_cells, len; 381 int jr_node, addr_cells, len;
380 int crypto_node = fdt_path_offset(blob, "crypto"); 382 int crypto_node = fdt_path_offset(blob, "crypto");
381 u64 jr_offset, used_jr; 383 u64 jr_offset, used_jr;
382 fdt32_t *reg; 384 fdt32_t *reg;
383 385
384 used_jr = sec_firmware_used_jobring_offset(); 386 used_jr = sec_firmware_used_jobring_offset();
385 fdt_support_default_count_cells(blob, crypto_node, &addr_cells, NULL); 387 fdt_support_default_count_cells(blob, crypto_node, &addr_cells, NULL);
386 388
387 jr_node = fdt_node_offset_by_compatible(blob, crypto_node, 389 jr_node = fdt_node_offset_by_compatible(blob, crypto_node,
388 "fsl,sec-v4.0-job-ring"); 390 "fsl,sec-v4.0-job-ring");
389 391
390 while (jr_node != -FDT_ERR_NOTFOUND) { 392 while (jr_node != -FDT_ERR_NOTFOUND) {
391 reg = (fdt32_t *)fdt_getprop(blob, jr_node, "reg", &len); 393 reg = (fdt32_t *)fdt_getprop(blob, jr_node, "reg", &len);
392 jr_offset = fdt_read_number(reg, addr_cells); 394 jr_offset = fdt_read_number(reg, addr_cells);
393 if (jr_offset == used_jr) { 395 if (jr_offset == used_jr) {
394 fdt_del_node(blob, jr_node); 396 fdt_del_node(blob, jr_node);
395 break; 397 break;
396 } 398 }
397 jr_node = fdt_node_offset_by_compatible(blob, jr_node, 399 jr_node = fdt_node_offset_by_compatible(blob, jr_node,
398 "fsl,sec-v4.0-job-ring"); 400 "fsl,sec-v4.0-job-ring");
399 } 401 }
400 } 402 }
401 #endif 403 #endif
402 404
403 void ft_cpu_setup(void *blob, bd_t *bd) 405 void ft_cpu_setup(void *blob, bd_t *bd)
404 { 406 {
405 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); 407 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
406 unsigned int svr = gur_in32(&gur->svr); 408 unsigned int svr = gur_in32(&gur->svr);
407 409
408 /* delete crypto node if not on an E-processor */ 410 /* delete crypto node if not on an E-processor */
409 if (!IS_E_PROCESSOR(svr)) 411 if (!IS_E_PROCESSOR(svr))
410 fdt_fixup_crypto_node(blob, 0); 412 fdt_fixup_crypto_node(blob, 0);
411 #if CONFIG_SYS_FSL_SEC_COMPAT >= 4 413 #if CONFIG_SYS_FSL_SEC_COMPAT >= 4
412 else { 414 else {
413 ccsr_sec_t __iomem *sec; 415 ccsr_sec_t __iomem *sec;
414 416
415 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT 417 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
416 if (fdt_fixup_kaslr(blob)) 418 if (fdt_fixup_kaslr(blob))
417 fdt_fixup_remove_jr(blob); 419 fdt_fixup_remove_jr(blob);
418 #endif 420 #endif
419 421
420 sec = (void __iomem *)CONFIG_SYS_FSL_SEC_ADDR; 422 sec = (void __iomem *)CONFIG_SYS_FSL_SEC_ADDR;
421 fdt_fixup_crypto_node(blob, sec_in32(&sec->secvid_ms)); 423 fdt_fixup_crypto_node(blob, sec_in32(&sec->secvid_ms));
422 } 424 }
423 #endif 425 #endif
424 426
425 #ifdef CONFIG_MP 427 #ifdef CONFIG_MP
426 ft_fixup_cpu(blob); 428 ft_fixup_cpu(blob);
427 #endif 429 #endif
428 430
429 #ifdef CONFIG_SYS_NS16550 431 #ifdef CONFIG_SYS_NS16550
430 do_fixup_by_compat_u32(blob, "fsl,ns16550", 432 do_fixup_by_compat_u32(blob, "fsl,ns16550",
431 "clock-frequency", CONFIG_SYS_NS16550_CLK, 1); 433 "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);
432 #endif 434 #endif
433 435
434 do_fixup_by_path_u32(blob, "/sysclk", "clock-frequency", 436 do_fixup_by_path_u32(blob, "/sysclk", "clock-frequency",
435 CONFIG_SYS_CLK_FREQ, 1); 437 CONFIG_SYS_CLK_FREQ, 1);
436 438
437 #ifdef CONFIG_PCI 439 #ifdef CONFIG_PCI
438 ft_pci_setup(blob, bd); 440 ft_pci_setup(blob, bd);
439 #endif 441 #endif
440 442
441 #ifdef CONFIG_FSL_ESDHC 443 #ifdef CONFIG_FSL_ESDHC
442 fdt_fixup_esdhc(blob, bd); 444 fdt_fixup_esdhc(blob, bd);
445 #endif
446
447 #ifdef CONFIG_SYS_DPAA_QBMAN
448 fdt_fixup_bportals(blob);
449 fdt_fixup_qportals(blob);
450 do_fixup_by_compat_u32(blob, "fsl,qman",
451 "clock-frequency", get_qman_freq(), 1);
443 #endif 452 #endif
444 453
445 #ifdef CONFIG_SYS_DPAA_FMAN 454 #ifdef CONFIG_SYS_DPAA_FMAN
446 fdt_fixup_fman_firmware(blob); 455 fdt_fixup_fman_firmware(blob);
447 #endif 456 #endif
448 #ifndef CONFIG_ARCH_LS1012A 457 #ifndef CONFIG_ARCH_LS1012A
449 fsl_fdt_disable_usb(blob); 458 fsl_fdt_disable_usb(blob);
450 #endif 459 #endif
451 #ifdef CONFIG_HAS_FEATURE_GIC64K_ALIGN 460 #ifdef CONFIG_HAS_FEATURE_GIC64K_ALIGN
452 fdt_fixup_gic(blob); 461 fdt_fixup_gic(blob);
453 #endif 462 #endif
454 #ifdef CONFIG_HAS_FEATURE_ENHANCED_MSI 463 #ifdef CONFIG_HAS_FEATURE_ENHANCED_MSI
455 fdt_fixup_msi(blob); 464 fdt_fixup_msi(blob);
456 #endif 465 #endif
457 } 466 }
458 467
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
1 /* 1 /*
2 * Copyright 2015 Freescale Semiconductor, Inc. 2 * Copyright 2015 Freescale Semiconductor, Inc.
3 * 3 *
4 * SPDX-License-Identifier: GPL-2.0+ 4 * SPDX-License-Identifier: GPL-2.0+
5 */ 5 */
6 6
7 #include <common.h> 7 #include <common.h>
8 #include <linux/compiler.h> 8 #include <linux/compiler.h>
9 #include <asm/io.h> 9 #include <asm/io.h>
10 #include <asm/processor.h> 10 #include <asm/processor.h>
11 #include <asm/arch/clock.h> 11 #include <asm/arch/clock.h>
12 #include <asm/arch/soc.h> 12 #include <asm/arch/soc.h>
13 #include <fsl_ifc.h> 13 #include <fsl_ifc.h>
14 #include "cpu.h" 14 #include "cpu.h"
15 15
16 DECLARE_GLOBAL_DATA_PTR; 16 DECLARE_GLOBAL_DATA_PTR;
17 17
18 #ifndef CONFIG_SYS_FSL_NUM_CC_PLLS 18 #ifndef CONFIG_SYS_FSL_NUM_CC_PLLS
19 #define CONFIG_SYS_FSL_NUM_CC_PLLS 2 19 #define CONFIG_SYS_FSL_NUM_CC_PLLS 2
20 #endif 20 #endif
21 21
22 void get_sys_info(struct sys_info *sys_info) 22 void get_sys_info(struct sys_info *sys_info)
23 { 23 {
24 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR); 24 struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
25 #if (defined(CONFIG_FSL_ESDHC) &&\ 25 #if (defined(CONFIG_FSL_ESDHC) &&\
26 defined(CONFIG_FSL_ESDHC_USE_PERIPHERAL_CLK)) ||\ 26 defined(CONFIG_FSL_ESDHC_USE_PERIPHERAL_CLK)) ||\
27 defined(CONFIG_SYS_DPAA_FMAN) 27 defined(CONFIG_SYS_DPAA_FMAN)
28 28
29 u32 rcw_tmp; 29 u32 rcw_tmp;
30 #endif 30 #endif
31 struct ccsr_clk *clk = (void *)(CONFIG_SYS_FSL_CLK_ADDR); 31 struct ccsr_clk *clk = (void *)(CONFIG_SYS_FSL_CLK_ADDR);
32 unsigned int cpu; 32 unsigned int cpu;
33 const u8 core_cplx_pll[8] = { 33 const u8 core_cplx_pll[8] = {
34 [0] = 0, /* CC1 PPL / 1 */ 34 [0] = 0, /* CC1 PPL / 1 */
35 [1] = 0, /* CC1 PPL / 2 */ 35 [1] = 0, /* CC1 PPL / 2 */
36 [4] = 1, /* CC2 PPL / 1 */ 36 [4] = 1, /* CC2 PPL / 1 */
37 [5] = 1, /* CC2 PPL / 2 */ 37 [5] = 1, /* CC2 PPL / 2 */
38 }; 38 };
39 39
40 const u8 core_cplx_pll_div[8] = { 40 const u8 core_cplx_pll_div[8] = {
41 [0] = 1, /* CC1 PPL / 1 */ 41 [0] = 1, /* CC1 PPL / 1 */
42 [1] = 2, /* CC1 PPL / 2 */ 42 [1] = 2, /* CC1 PPL / 2 */
43 [4] = 1, /* CC2 PPL / 1 */ 43 [4] = 1, /* CC2 PPL / 1 */
44 [5] = 2, /* CC2 PPL / 2 */ 44 [5] = 2, /* CC2 PPL / 2 */
45 }; 45 };
46 46
47 uint i, cluster; 47 uint i, cluster;
48 uint freq_c_pll[CONFIG_SYS_FSL_NUM_CC_PLLS]; 48 uint freq_c_pll[CONFIG_SYS_FSL_NUM_CC_PLLS];
49 uint ratio[CONFIG_SYS_FSL_NUM_CC_PLLS]; 49 uint ratio[CONFIG_SYS_FSL_NUM_CC_PLLS];
50 unsigned long sysclk = CONFIG_SYS_CLK_FREQ; 50 unsigned long sysclk = CONFIG_SYS_CLK_FREQ;
51 unsigned long cluster_clk; 51 unsigned long cluster_clk;
52 52
53 sys_info->freq_systembus = sysclk; 53 sys_info->freq_systembus = sysclk;
54 #ifndef CONFIG_CLUSTER_CLK_FREQ 54 #ifndef CONFIG_CLUSTER_CLK_FREQ
55 #define CONFIG_CLUSTER_CLK_FREQ CONFIG_SYS_CLK_FREQ 55 #define CONFIG_CLUSTER_CLK_FREQ CONFIG_SYS_CLK_FREQ
56 #endif 56 #endif
57 cluster_clk = CONFIG_CLUSTER_CLK_FREQ; 57 cluster_clk = CONFIG_CLUSTER_CLK_FREQ;
58 58
59 #ifdef CONFIG_DDR_CLK_FREQ 59 #ifdef CONFIG_DDR_CLK_FREQ
60 sys_info->freq_ddrbus = CONFIG_DDR_CLK_FREQ; 60 sys_info->freq_ddrbus = CONFIG_DDR_CLK_FREQ;
61 #else 61 #else
62 sys_info->freq_ddrbus = sysclk; 62 sys_info->freq_ddrbus = sysclk;
63 #endif 63 #endif
64 64
65 /* The freq_systembus is used to record frequency of platform PLL */ 65 /* The freq_systembus is used to record frequency of platform PLL */
66 sys_info->freq_systembus *= (gur_in32(&gur->rcwsr[0]) >> 66 sys_info->freq_systembus *= (gur_in32(&gur->rcwsr[0]) >>
67 FSL_CHASSIS2_RCWSR0_SYS_PLL_RAT_SHIFT) & 67 FSL_CHASSIS2_RCWSR0_SYS_PLL_RAT_SHIFT) &
68 FSL_CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK; 68 FSL_CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK;
69 69
70 #ifdef CONFIG_ARCH_LS1012A 70 #ifdef CONFIG_ARCH_LS1012A
71 sys_info->freq_ddrbus = 2 * sys_info->freq_systembus; 71 sys_info->freq_ddrbus = 2 * sys_info->freq_systembus;
72 #else 72 #else
73 sys_info->freq_ddrbus *= (gur_in32(&gur->rcwsr[0]) >> 73 sys_info->freq_ddrbus *= (gur_in32(&gur->rcwsr[0]) >>
74 FSL_CHASSIS2_RCWSR0_MEM_PLL_RAT_SHIFT) & 74 FSL_CHASSIS2_RCWSR0_MEM_PLL_RAT_SHIFT) &
75 FSL_CHASSIS2_RCWSR0_MEM_PLL_RAT_MASK; 75 FSL_CHASSIS2_RCWSR0_MEM_PLL_RAT_MASK;
76 #endif 76 #endif
77 77
78 for (i = 0; i < CONFIG_SYS_FSL_NUM_CC_PLLS; i++) { 78 for (i = 0; i < CONFIG_SYS_FSL_NUM_CC_PLLS; i++) {
79 ratio[i] = (in_be32(&clk->pllcgsr[i].pllcngsr) >> 1) & 0xff; 79 ratio[i] = (in_be32(&clk->pllcgsr[i].pllcngsr) >> 1) & 0xff;
80 if (ratio[i] > 4) 80 if (ratio[i] > 4)
81 freq_c_pll[i] = cluster_clk * ratio[i]; 81 freq_c_pll[i] = cluster_clk * ratio[i];
82 else 82 else
83 freq_c_pll[i] = sys_info->freq_systembus * ratio[i]; 83 freq_c_pll[i] = sys_info->freq_systembus * ratio[i];
84 } 84 }
85 85
86 for_each_cpu(i, cpu, cpu_numcores(), cpu_mask()) { 86 for_each_cpu(i, cpu, cpu_numcores(), cpu_mask()) {
87 cluster = fsl_qoriq_core_to_cluster(cpu); 87 cluster = fsl_qoriq_core_to_cluster(cpu);
88 u32 c_pll_sel = (in_be32(&clk->clkcsr[cluster].clkcncsr) >> 27) 88 u32 c_pll_sel = (in_be32(&clk->clkcsr[cluster].clkcncsr) >> 27)
89 & 0xf; 89 & 0xf;
90 u32 cplx_pll = core_cplx_pll[c_pll_sel]; 90 u32 cplx_pll = core_cplx_pll[c_pll_sel];
91 91
92 sys_info->freq_processor[cpu] = 92 sys_info->freq_processor[cpu] =
93 freq_c_pll[cplx_pll] / core_cplx_pll_div[c_pll_sel]; 93 freq_c_pll[cplx_pll] / core_cplx_pll_div[c_pll_sel];
94 } 94 }
95 95
96 #define HWA_CGA_M1_CLK_SEL 0xe0000000 96 #define HWA_CGA_M1_CLK_SEL 0xe0000000
97 #define HWA_CGA_M1_CLK_SHIFT 29 97 #define HWA_CGA_M1_CLK_SHIFT 29
98 #ifdef CONFIG_SYS_DPAA_FMAN 98 #ifdef CONFIG_SYS_DPAA_FMAN
99 rcw_tmp = in_be32(&gur->rcwsr[7]); 99 rcw_tmp = in_be32(&gur->rcwsr[7]);
100 switch ((rcw_tmp & HWA_CGA_M1_CLK_SEL) >> HWA_CGA_M1_CLK_SHIFT) { 100 switch ((rcw_tmp & HWA_CGA_M1_CLK_SEL) >> HWA_CGA_M1_CLK_SHIFT) {
101 case 2: 101 case 2:
102 sys_info->freq_fman[0] = freq_c_pll[0] / 2; 102 sys_info->freq_fman[0] = freq_c_pll[0] / 2;
103 break; 103 break;
104 case 3: 104 case 3:
105 sys_info->freq_fman[0] = freq_c_pll[0] / 3; 105 sys_info->freq_fman[0] = freq_c_pll[0] / 3;
106 break; 106 break;
107 case 4: 107 case 4:
108 sys_info->freq_fman[0] = freq_c_pll[0] / 4; 108 sys_info->freq_fman[0] = freq_c_pll[0] / 4;
109 break; 109 break;
110 case 5: 110 case 5:
111 sys_info->freq_fman[0] = sys_info->freq_systembus; 111 sys_info->freq_fman[0] = sys_info->freq_systembus;
112 break; 112 break;
113 case 6: 113 case 6:
114 sys_info->freq_fman[0] = freq_c_pll[1] / 2; 114 sys_info->freq_fman[0] = freq_c_pll[1] / 2;
115 break; 115 break;
116 case 7: 116 case 7:
117 sys_info->freq_fman[0] = freq_c_pll[1] / 3; 117 sys_info->freq_fman[0] = freq_c_pll[1] / 3;
118 break; 118 break;
119 default: 119 default:
120 printf("Error: Unknown FMan1 clock select!\n"); 120 printf("Error: Unknown FMan1 clock select!\n");
121 break; 121 break;
122 } 122 }
123 #endif 123 #endif
124 124
125 #define HWA_CGA_M2_CLK_SEL 0x00000007 125 #define HWA_CGA_M2_CLK_SEL 0x00000007
126 #define HWA_CGA_M2_CLK_SHIFT 0 126 #define HWA_CGA_M2_CLK_SHIFT 0
127 #ifdef CONFIG_FSL_ESDHC 127 #ifdef CONFIG_FSL_ESDHC
128 #ifdef CONFIG_FSL_ESDHC_USE_PERIPHERAL_CLK 128 #ifdef CONFIG_FSL_ESDHC_USE_PERIPHERAL_CLK
129 rcw_tmp = in_be32(&gur->rcwsr[15]); 129 rcw_tmp = in_be32(&gur->rcwsr[15]);
130 switch ((rcw_tmp & HWA_CGA_M2_CLK_SEL) >> HWA_CGA_M2_CLK_SHIFT) { 130 switch ((rcw_tmp & HWA_CGA_M2_CLK_SEL) >> HWA_CGA_M2_CLK_SHIFT) {
131 case 1: 131 case 1:
132 sys_info->freq_sdhc = freq_c_pll[1]; 132 sys_info->freq_sdhc = freq_c_pll[1];
133 break; 133 break;
134 case 2: 134 case 2:
135 sys_info->freq_sdhc = freq_c_pll[1] / 2; 135 sys_info->freq_sdhc = freq_c_pll[1] / 2;
136 break; 136 break;
137 case 3: 137 case 3:
138 sys_info->freq_sdhc = freq_c_pll[1] / 3; 138 sys_info->freq_sdhc = freq_c_pll[1] / 3;
139 break; 139 break;
140 case 6: 140 case 6:
141 sys_info->freq_sdhc = freq_c_pll[0] / 2; 141 sys_info->freq_sdhc = freq_c_pll[0] / 2;
142 break; 142 break;
143 default: 143 default:
144 printf("Error: Unknown ESDHC clock select!\n"); 144 printf("Error: Unknown ESDHC clock select!\n");
145 break; 145 break;
146 } 146 }
147 #else 147 #else
148 sys_info->freq_sdhc = (sys_info->freq_systembus / 148 sys_info->freq_sdhc = (sys_info->freq_systembus /
149 CONFIG_SYS_FSL_PCLK_DIV) / 149 CONFIG_SYS_FSL_PCLK_DIV) /
150 CONFIG_SYS_FSL_SDHC_CLK_DIV; 150 CONFIG_SYS_FSL_SDHC_CLK_DIV;
151 #endif 151 #endif
152 #endif 152 #endif
153 153
154 #if defined(CONFIG_FSL_IFC) 154 #if defined(CONFIG_FSL_IFC)
155 sys_info->freq_localbus = sys_info->freq_systembus / 155 sys_info->freq_localbus = sys_info->freq_systembus /
156 CONFIG_SYS_FSL_IFC_CLK_DIV; 156 CONFIG_SYS_FSL_IFC_CLK_DIV;
157 #endif 157 #endif
158 #ifdef CONFIG_SYS_DPAA_QBMAN
159 sys_info->freq_qman = sys_info->freq_systembus;
160 #endif
158 } 161 }
162
163 #ifdef CONFIG_SYS_DPAA_QBMAN
164 unsigned long get_qman_freq(void)
165 {
166 struct sys_info sys_info;
167
168 get_sys_info(&sys_info);
169
170 return sys_info.freq_qman;
171 }
172 #endif
159 173
160 int get_clocks(void) 174 int get_clocks(void)
161 { 175 {
162 struct sys_info sys_info; 176 struct sys_info sys_info;
163 177
164 get_sys_info(&sys_info); 178 get_sys_info(&sys_info);
165 gd->cpu_clk = sys_info.freq_processor[0]; 179 gd->cpu_clk = sys_info.freq_processor[0];
166 gd->bus_clk = sys_info.freq_systembus / CONFIG_SYS_FSL_PCLK_DIV; 180 gd->bus_clk = sys_info.freq_systembus / CONFIG_SYS_FSL_PCLK_DIV;
167 gd->mem_clk = sys_info.freq_ddrbus; 181 gd->mem_clk = sys_info.freq_ddrbus;
168 182
169 #ifdef CONFIG_FSL_ESDHC 183 #ifdef CONFIG_FSL_ESDHC
170 gd->arch.sdhc_clk = sys_info.freq_sdhc; 184 gd->arch.sdhc_clk = sys_info.freq_sdhc;
171 #endif 185 #endif
172 186
173 if (gd->cpu_clk != 0) 187 if (gd->cpu_clk != 0)
174 return 0; 188 return 0;
175 else 189 else
176 return 1; 190 return 1;
177 } 191 }
178 192
179 /******************************************** 193 /********************************************
180 * get_bus_freq 194 * get_bus_freq
181 * return platform clock in Hz 195 * return platform clock in Hz
182 *********************************************/ 196 *********************************************/
183 ulong get_bus_freq(ulong dummy) 197 ulong get_bus_freq(ulong dummy)
184 { 198 {
185 if (!gd->bus_clk) 199 if (!gd->bus_clk)
186 get_clocks(); 200 get_clocks();
187 201
188 return gd->bus_clk; 202 return gd->bus_clk;
189 } 203 }
190 204
191 ulong get_ddr_freq(ulong dummy) 205 ulong get_ddr_freq(ulong dummy)
192 { 206 {
193 if (!gd->mem_clk) 207 if (!gd->mem_clk)
194 get_clocks(); 208 get_clocks();
195 209
196 return gd->mem_clk; 210 return gd->mem_clk;
197 } 211 }
198 212
199 #ifdef CONFIG_FSL_ESDHC 213 #ifdef CONFIG_FSL_ESDHC
200 int get_sdhc_freq(ulong dummy) 214 int get_sdhc_freq(ulong dummy)
201 { 215 {
202 if (!gd->arch.sdhc_clk) 216 if (!gd->arch.sdhc_clk)
203 get_clocks(); 217 get_clocks();
204 218
205 return gd->arch.sdhc_clk; 219 return gd->arch.sdhc_clk;
206 } 220 }
207 #endif 221 #endif
208 222
209 int get_serial_clock(void) 223 int get_serial_clock(void)
210 { 224 {
211 return get_bus_freq(0) / CONFIG_SYS_FSL_DUART_CLK_DIV; 225 return get_bus_freq(0) / CONFIG_SYS_FSL_DUART_CLK_DIV;
212 } 226 }
213 227
214 int get_i2c_freq(ulong dummy) 228 int get_i2c_freq(ulong dummy)
215 { 229 {
216 return get_bus_freq(0) / CONFIG_SYS_FSL_I2C_CLK_DIV; 230 return get_bus_freq(0) / CONFIG_SYS_FSL_I2C_CLK_DIV;
217 } 231 }
218 232
219 int get_dspi_freq(ulong dummy) 233 int get_dspi_freq(ulong dummy)
220 { 234 {
221 return get_bus_freq(0) / CONFIG_SYS_FSL_DSPI_CLK_DIV; 235 return get_bus_freq(0) / CONFIG_SYS_FSL_DSPI_CLK_DIV;
222 } 236 }
223 237
224 #ifdef CONFIG_FSL_LPUART 238 #ifdef CONFIG_FSL_LPUART
225 int get_uart_freq(ulong dummy) 239 int get_uart_freq(ulong dummy)
226 { 240 {
227 return get_bus_freq(0) / CONFIG_SYS_FSL_LPUART_CLK_DIV; 241 return get_bus_freq(0) / CONFIG_SYS_FSL_LPUART_CLK_DIV;
228 } 242 }
229 #endif 243 #endif
230 244
231 unsigned int mxc_get_clock(enum mxc_clock clk) 245 unsigned int mxc_get_clock(enum mxc_clock clk)
232 { 246 {
233 switch (clk) { 247 switch (clk) {
234 case MXC_I2C_CLK: 248 case MXC_I2C_CLK:
235 return get_i2c_freq(0); 249 return get_i2c_freq(0);
236 #if defined(CONFIG_FSL_ESDHC) 250 #if defined(CONFIG_FSL_ESDHC)
237 case MXC_ESDHC_CLK: 251 case MXC_ESDHC_CLK:
238 return get_sdhc_freq(0); 252 return get_sdhc_freq(0);
239 #endif 253 #endif
240 case MXC_DSPI_CLK: 254 case MXC_DSPI_CLK:
241 return get_dspi_freq(0); 255 return get_dspi_freq(0);
242 #ifdef CONFIG_FSL_LPUART 256 #ifdef CONFIG_FSL_LPUART
243 case MXC_UART_CLK: 257 case MXC_UART_CLK:
244 return get_uart_freq(0); 258 return get_uart_freq(0);
245 #endif 259 #endif
246 default: 260 default:
247 printf("Unsupported clock\n"); 261 printf("Unsupported clock\n");
248 } 262 }
249 return 0; 263 return 0;
250 } 264 }
251 265
arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
1 /* 1 /*
2 * Copyright 2013-2015 Freescale Semiconductor, Inc. 2 * Copyright 2013-2015 Freescale Semiconductor, Inc.
3 * 3 *
4 * SPDX-License-Identifier: GPL-2.0+ 4 * SPDX-License-Identifier: GPL-2.0+
5 */ 5 */
6 6
7 #ifndef __ARCH_FSL_LSCH2_IMMAP_H__ 7 #ifndef __ARCH_FSL_LSCH2_IMMAP_H__
8 #define __ARCH_FSL_LSCH2_IMMAP_H__ 8 #define __ARCH_FSL_LSCH2_IMMAP_H__
9 9
10 #include <fsl_immap.h> 10 #include <fsl_immap.h>
11 11
12 #define CONFIG_SYS_IMMR 0x01000000 12 #define CONFIG_SYS_IMMR 0x01000000
13 #define CONFIG_SYS_DCSRBAR 0x20000000 13 #define CONFIG_SYS_DCSRBAR 0x20000000
14 #define CONFIG_SYS_DCSR_DCFG_ADDR (CONFIG_SYS_DCSRBAR + 0x00140000) 14 #define CONFIG_SYS_DCSR_DCFG_ADDR (CONFIG_SYS_DCSRBAR + 0x00140000)
15 #define CONFIG_SYS_DCSR_COP_CCP_ADDR (CONFIG_SYS_DCSRBAR + 0x02008040) 15 #define CONFIG_SYS_DCSR_COP_CCP_ADDR (CONFIG_SYS_DCSRBAR + 0x02008040)
16 16
17 #define CONFIG_SYS_FSL_DDR_ADDR (CONFIG_SYS_IMMR + 0x00080000) 17 #define CONFIG_SYS_FSL_DDR_ADDR (CONFIG_SYS_IMMR + 0x00080000)
18 #define CONFIG_SYS_GIC400_ADDR (CONFIG_SYS_IMMR + 0x00400000) 18 #define CONFIG_SYS_GIC400_ADDR (CONFIG_SYS_IMMR + 0x00400000)
19 #define CONFIG_SYS_IFC_ADDR (CONFIG_SYS_IMMR + 0x00530000) 19 #define CONFIG_SYS_IFC_ADDR (CONFIG_SYS_IMMR + 0x00530000)
20 #define SYS_FSL_QSPI_ADDR (CONFIG_SYS_IMMR + 0x00550000) 20 #define SYS_FSL_QSPI_ADDR (CONFIG_SYS_IMMR + 0x00550000)
21 #define CONFIG_SYS_FSL_ESDHC_ADDR (CONFIG_SYS_IMMR + 0x00560000) 21 #define CONFIG_SYS_FSL_ESDHC_ADDR (CONFIG_SYS_IMMR + 0x00560000)
22 #define CONFIG_SYS_FSL_CSU_ADDR (CONFIG_SYS_IMMR + 0x00510000) 22 #define CONFIG_SYS_FSL_CSU_ADDR (CONFIG_SYS_IMMR + 0x00510000)
23 #define CONFIG_SYS_FSL_GUTS_ADDR (CONFIG_SYS_IMMR + 0x00ee0000) 23 #define CONFIG_SYS_FSL_GUTS_ADDR (CONFIG_SYS_IMMR + 0x00ee0000)
24 #define CONFIG_SYS_FSL_RST_ADDR (CONFIG_SYS_IMMR + 0x00ee00b0) 24 #define CONFIG_SYS_FSL_RST_ADDR (CONFIG_SYS_IMMR + 0x00ee00b0)
25 #define CONFIG_SYS_FSL_SCFG_ADDR (CONFIG_SYS_IMMR + 0x00570000) 25 #define CONFIG_SYS_FSL_SCFG_ADDR (CONFIG_SYS_IMMR + 0x00570000)
26 #define CONFIG_SYS_FSL_BMAN_ADDR (CONFIG_SYS_IMMR + 0x00890000)
27 #define CONFIG_SYS_FSL_QMAN_ADDR (CONFIG_SYS_IMMR + 0x00880000)
26 #define CONFIG_SYS_FSL_FMAN_ADDR (CONFIG_SYS_IMMR + 0x00a00000) 28 #define CONFIG_SYS_FSL_FMAN_ADDR (CONFIG_SYS_IMMR + 0x00a00000)
27 #define CONFIG_SYS_FSL_SERDES_ADDR (CONFIG_SYS_IMMR + 0x00ea0000) 29 #define CONFIG_SYS_FSL_SERDES_ADDR (CONFIG_SYS_IMMR + 0x00ea0000)
28 #define CONFIG_SYS_FSL_DCFG_ADDR (CONFIG_SYS_IMMR + 0x00ee0000) 30 #define CONFIG_SYS_FSL_DCFG_ADDR (CONFIG_SYS_IMMR + 0x00ee0000)
29 #define CONFIG_SYS_FSL_CLK_ADDR (CONFIG_SYS_IMMR + 0x00ee1000) 31 #define CONFIG_SYS_FSL_CLK_ADDR (CONFIG_SYS_IMMR + 0x00ee1000)
30 #define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR + 0x011c0500) 32 #define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_IMMR + 0x011c0500)
31 #define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR + 0x011c0600) 33 #define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_IMMR + 0x011c0600)
32 #define CONFIG_SYS_NS16550_COM3 (CONFIG_SYS_IMMR + 0x011d0500) 34 #define CONFIG_SYS_NS16550_COM3 (CONFIG_SYS_IMMR + 0x011d0500)
33 #define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_IMMR + 0x011d0600) 35 #define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_IMMR + 0x011d0600)
34 #define CONFIG_SYS_XHCI_USB1_ADDR (CONFIG_SYS_IMMR + 0x01f00000) 36 #define CONFIG_SYS_XHCI_USB1_ADDR (CONFIG_SYS_IMMR + 0x01f00000)
35 #define CONFIG_SYS_XHCI_USB2_ADDR (CONFIG_SYS_IMMR + 0x02000000) 37 #define CONFIG_SYS_XHCI_USB2_ADDR (CONFIG_SYS_IMMR + 0x02000000)
36 #define CONFIG_SYS_XHCI_USB3_ADDR (CONFIG_SYS_IMMR + 0x02100000) 38 #define CONFIG_SYS_XHCI_USB3_ADDR (CONFIG_SYS_IMMR + 0x02100000)
37 #define CONFIG_SYS_EHCI_USB1_ADDR (CONFIG_SYS_IMMR + 0x07600000) 39 #define CONFIG_SYS_EHCI_USB1_ADDR (CONFIG_SYS_IMMR + 0x07600000)
38 #define CONFIG_SYS_PCIE1_ADDR (CONFIG_SYS_IMMR + 0x2400000) 40 #define CONFIG_SYS_PCIE1_ADDR (CONFIG_SYS_IMMR + 0x2400000)
39 #define CONFIG_SYS_PCIE2_ADDR (CONFIG_SYS_IMMR + 0x2500000) 41 #define CONFIG_SYS_PCIE2_ADDR (CONFIG_SYS_IMMR + 0x2500000)
40 #define CONFIG_SYS_PCIE3_ADDR (CONFIG_SYS_IMMR + 0x2600000) 42 #define CONFIG_SYS_PCIE3_ADDR (CONFIG_SYS_IMMR + 0x2600000)
41 #define CONFIG_SYS_SEC_MON_ADDR (CONFIG_SYS_IMMR + 0xe90000) 43 #define CONFIG_SYS_SEC_MON_ADDR (CONFIG_SYS_IMMR + 0xe90000)
42 #define CONFIG_SYS_SFP_ADDR (CONFIG_SYS_IMMR + 0xe80200) 44 #define CONFIG_SYS_SFP_ADDR (CONFIG_SYS_IMMR + 0xe80200)
45
46 #define CONFIG_SYS_BMAN_NUM_PORTALS 10
47 #define CONFIG_SYS_BMAN_MEM_BASE 0x508000000
48 #define CONFIG_SYS_BMAN_MEM_PHYS (0xf00000000ull + \
49 CONFIG_SYS_BMAN_MEM_BASE)
50 #define CONFIG_SYS_BMAN_MEM_SIZE 0x08000000
51 #define CONFIG_SYS_BMAN_SP_CENA_SIZE 0x10000
52 #define CONFIG_SYS_BMAN_SP_CINH_SIZE 0x10000
53 #define CONFIG_SYS_BMAN_CENA_BASE CONFIG_SYS_BMAN_MEM_BASE
54 #define CONFIG_SYS_BMAN_CENA_SIZE (CONFIG_SYS_BMAN_MEM_SIZE >> 1)
55 #define CONFIG_SYS_BMAN_CINH_BASE (CONFIG_SYS_BMAN_MEM_BASE + \
56 CONFIG_SYS_BMAN_CENA_SIZE)
57 #define CONFIG_SYS_BMAN_CINH_SIZE (CONFIG_SYS_BMAN_MEM_SIZE >> 1)
58 #define CONFIG_SYS_BMAN_SWP_ISDR_REG 0x3E80
59 #define CONFIG_SYS_QMAN_NUM_PORTALS 10
60 #define CONFIG_SYS_QMAN_MEM_BASE 0x500000000
61 #define CONFIG_SYS_QMAN_MEM_PHYS (0xf00000000ull + \
62 CONFIG_SYS_QMAN_MEM_BASE)
63 #define CONFIG_SYS_QMAN_MEM_SIZE 0x08000000
64 #define CONFIG_SYS_QMAN_SP_CENA_SIZE 0x10000
65 #define CONFIG_SYS_QMAN_SP_CINH_SIZE 0x10000
66 #define CONFIG_SYS_QMAN_CENA_BASE CONFIG_SYS_QMAN_MEM_BASE
67 #define CONFIG_SYS_QMAN_CENA_SIZE (CONFIG_SYS_QMAN_MEM_SIZE >> 1)
68 #define CONFIG_SYS_QMAN_CINH_BASE (CONFIG_SYS_QMAN_MEM_BASE + \
69 CONFIG_SYS_QMAN_CENA_SIZE)
70 #define CONFIG_SYS_QMAN_CINH_SIZE (CONFIG_SYS_QMAN_MEM_SIZE >> 1)
71 #define CONFIG_SYS_QMAN_SWP_ISDR_REG 0x3680
43 72
44 #define CONFIG_SYS_FSL_TIMER_ADDR 0x02b00000 73 #define CONFIG_SYS_FSL_TIMER_ADDR 0x02b00000
45 74
46 #define I2C1_BASE_ADDR (CONFIG_SYS_IMMR + 0x01180000) 75 #define I2C1_BASE_ADDR (CONFIG_SYS_IMMR + 0x01180000)
47 #define I2C2_BASE_ADDR (CONFIG_SYS_IMMR + 0x01190000) 76 #define I2C2_BASE_ADDR (CONFIG_SYS_IMMR + 0x01190000)
48 #define I2C3_BASE_ADDR (CONFIG_SYS_IMMR + 0x011a0000) 77 #define I2C3_BASE_ADDR (CONFIG_SYS_IMMR + 0x011a0000)
49 #define I2C4_BASE_ADDR (CONFIG_SYS_IMMR + 0x011b0000) 78 #define I2C4_BASE_ADDR (CONFIG_SYS_IMMR + 0x011b0000)
50 79
51 #define WDOG1_BASE_ADDR (CONFIG_SYS_IMMR + 0x01ad0000) 80 #define WDOG1_BASE_ADDR (CONFIG_SYS_IMMR + 0x01ad0000)
52 81
53 #define QSPI0_BASE_ADDR (CONFIG_SYS_IMMR + 0x00550000) 82 #define QSPI0_BASE_ADDR (CONFIG_SYS_IMMR + 0x00550000)
54 #define DSPI1_BASE_ADDR (CONFIG_SYS_IMMR + 0x01100000) 83 #define DSPI1_BASE_ADDR (CONFIG_SYS_IMMR + 0x01100000)
55 84
56 #define LPUART_BASE (CONFIG_SYS_IMMR + 0x01950000) 85 #define LPUART_BASE (CONFIG_SYS_IMMR + 0x01950000)
57 86
58 #define AHCI_BASE_ADDR (CONFIG_SYS_IMMR + 0x02200000) 87 #define AHCI_BASE_ADDR (CONFIG_SYS_IMMR + 0x02200000)
59 88
60 #define CONFIG_SYS_PCIE1_PHYS_ADDR 0x4000000000ULL 89 #define CONFIG_SYS_PCIE1_PHYS_ADDR 0x4000000000ULL
61 #define CONFIG_SYS_PCIE2_PHYS_ADDR 0x4800000000ULL 90 #define CONFIG_SYS_PCIE2_PHYS_ADDR 0x4800000000ULL
62 #define CONFIG_SYS_PCIE3_PHYS_ADDR 0x5000000000ULL 91 #define CONFIG_SYS_PCIE3_PHYS_ADDR 0x5000000000ULL
63 /* LUT registers */ 92 /* LUT registers */
64 #ifdef CONFIG_ARCH_LS1012A 93 #ifdef CONFIG_ARCH_LS1012A
65 #define PCIE_LUT_BASE 0xC0000 94 #define PCIE_LUT_BASE 0xC0000
66 #else 95 #else
67 #define PCIE_LUT_BASE 0x10000 96 #define PCIE_LUT_BASE 0x10000
68 #endif 97 #endif
69 #define PCIE_LUT_LCTRL0 0x7F8 98 #define PCIE_LUT_LCTRL0 0x7F8
70 #define PCIE_LUT_DBG 0x7FC 99 #define PCIE_LUT_DBG 0x7FC
71 100
72 /* TZ Address Space Controller Definitions */ 101 /* TZ Address Space Controller Definitions */
73 #define TZASC1_BASE 0x01100000 /* as per CCSR map. */ 102 #define TZASC1_BASE 0x01100000 /* as per CCSR map. */
74 #define TZASC2_BASE 0x01110000 /* as per CCSR map. */ 103 #define TZASC2_BASE 0x01110000 /* as per CCSR map. */
75 #define TZASC3_BASE 0x01120000 /* as per CCSR map. */ 104 #define TZASC3_BASE 0x01120000 /* as per CCSR map. */
76 #define TZASC4_BASE 0x01130000 /* as per CCSR map. */ 105 #define TZASC4_BASE 0x01130000 /* as per CCSR map. */
77 #define TZASC_BUILD_CONFIG_REG(x) ((TZASC1_BASE + (x * 0x10000))) 106 #define TZASC_BUILD_CONFIG_REG(x) ((TZASC1_BASE + (x * 0x10000)))
78 #define TZASC_ACTION_REG(x) ((TZASC1_BASE + (x * 0x10000)) + 0x004) 107 #define TZASC_ACTION_REG(x) ((TZASC1_BASE + (x * 0x10000)) + 0x004)
79 #define TZASC_GATE_KEEPER(x) ((TZASC1_BASE + (x * 0x10000)) + 0x008) 108 #define TZASC_GATE_KEEPER(x) ((TZASC1_BASE + (x * 0x10000)) + 0x008)
80 #define TZASC_REGION_BASE_LOW_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x100) 109 #define TZASC_REGION_BASE_LOW_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x100)
81 #define TZASC_REGION_BASE_HIGH_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x104) 110 #define TZASC_REGION_BASE_HIGH_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x104)
82 #define TZASC_REGION_TOP_LOW_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x108) 111 #define TZASC_REGION_TOP_LOW_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x108)
83 #define TZASC_REGION_TOP_HIGH_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x10C) 112 #define TZASC_REGION_TOP_HIGH_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x10C)
84 #define TZASC_REGION_ATTRIBUTES_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x110) 113 #define TZASC_REGION_ATTRIBUTES_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x110)
85 #define TZASC_REGION_ID_ACCESS_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x114) 114 #define TZASC_REGION_ID_ACCESS_0(x) ((TZASC1_BASE + (x * 0x10000)) + 0x114)
86 115
87 #define TP_ITYP_AV 0x00000001 /* Initiator available */ 116 #define TP_ITYP_AV 0x00000001 /* Initiator available */
88 #define TP_ITYP_TYPE(x) (((x) & 0x6) >> 1) /* Initiator Type */ 117 #define TP_ITYP_TYPE(x) (((x) & 0x6) >> 1) /* Initiator Type */
89 #define TP_ITYP_TYPE_ARM 0x0 118 #define TP_ITYP_TYPE_ARM 0x0
90 #define TP_ITYP_TYPE_PPC 0x1 /* PowerPC */ 119 #define TP_ITYP_TYPE_PPC 0x1 /* PowerPC */
91 #define TP_ITYP_TYPE_OTHER 0x2 /* StarCore DSP */ 120 #define TP_ITYP_TYPE_OTHER 0x2 /* StarCore DSP */
92 #define TP_ITYP_TYPE_HA 0x3 /* HW Accelerator */ 121 #define TP_ITYP_TYPE_HA 0x3 /* HW Accelerator */
93 #define TP_ITYP_THDS(x) (((x) & 0x18) >> 3) /* # threads */ 122 #define TP_ITYP_THDS(x) (((x) & 0x18) >> 3) /* # threads */
94 #define TP_ITYP_VER(x) (((x) & 0xe0) >> 5) /* Initiator Version */ 123 #define TP_ITYP_VER(x) (((x) & 0xe0) >> 5) /* Initiator Version */
95 #define TY_ITYP_VER_A7 0x1 124 #define TY_ITYP_VER_A7 0x1
96 #define TY_ITYP_VER_A53 0x2 125 #define TY_ITYP_VER_A53 0x2
97 #define TY_ITYP_VER_A57 0x3 126 #define TY_ITYP_VER_A57 0x3
98 #define TY_ITYP_VER_A72 0x4 127 #define TY_ITYP_VER_A72 0x4
99 128
100 #define TP_CLUSTER_EOC 0xc0000000 /* end of clusters */ 129 #define TP_CLUSTER_EOC 0xc0000000 /* end of clusters */
101 #define TP_CLUSTER_INIT_MASK 0x0000003f /* initiator mask */ 130 #define TP_CLUSTER_INIT_MASK 0x0000003f /* initiator mask */
102 #define TP_INIT_PER_CLUSTER 4 131 #define TP_INIT_PER_CLUSTER 4
103 132
104 /* 133 /*
105 * Define default values for some CCSR macros to make header files cleaner* 134 * Define default values for some CCSR macros to make header files cleaner*
106 * 135 *
107 * To completely disable CCSR relocation in a board header file, define 136 * To completely disable CCSR relocation in a board header file, define
108 * CONFIG_SYS_CCSR_DO_NOT_RELOCATE. This will force CONFIG_SYS_CCSRBAR_PHYS 137 * CONFIG_SYS_CCSR_DO_NOT_RELOCATE. This will force CONFIG_SYS_CCSRBAR_PHYS
109 * to a value that is the same as CONFIG_SYS_CCSRBAR. 138 * to a value that is the same as CONFIG_SYS_CCSRBAR.
110 */ 139 */
111 140
112 #ifdef CONFIG_SYS_CCSRBAR_PHYS 141 #ifdef CONFIG_SYS_CCSRBAR_PHYS
113 #error "Do not define CONFIG_SYS_CCSRBAR_PHYS directly. Use \ 142 #error "Do not define CONFIG_SYS_CCSRBAR_PHYS directly. Use \
114 CONFIG_SYS_CCSRBAR_PHYS_LOW and/or CONFIG_SYS_CCSRBAR_PHYS_HIGH instead." 143 CONFIG_SYS_CCSRBAR_PHYS_LOW and/or CONFIG_SYS_CCSRBAR_PHYS_HIGH instead."
115 #endif 144 #endif
116 145
117 #ifdef CONFIG_SYS_CCSR_DO_NOT_RELOCATE 146 #ifdef CONFIG_SYS_CCSR_DO_NOT_RELOCATE
118 #undef CONFIG_SYS_CCSRBAR_PHYS_HIGH 147 #undef CONFIG_SYS_CCSRBAR_PHYS_HIGH
119 #undef CONFIG_SYS_CCSRBAR_PHYS_LOW 148 #undef CONFIG_SYS_CCSRBAR_PHYS_LOW
120 #define CONFIG_SYS_CCSRBAR_PHYS_HIGH 0 149 #define CONFIG_SYS_CCSRBAR_PHYS_HIGH 0
121 #endif 150 #endif
122 151
123 #ifndef CONFIG_SYS_CCSRBAR 152 #ifndef CONFIG_SYS_CCSRBAR
124 #define CONFIG_SYS_CCSRBAR 0x01000000 153 #define CONFIG_SYS_CCSRBAR 0x01000000
125 #endif 154 #endif
126 155
127 #ifndef CONFIG_SYS_CCSRBAR_PHYS_HIGH 156 #ifndef CONFIG_SYS_CCSRBAR_PHYS_HIGH
128 #define CONFIG_SYS_CCSRBAR_PHYS_HIGH 0 157 #define CONFIG_SYS_CCSRBAR_PHYS_HIGH 0
129 #endif 158 #endif
130 159
131 #ifndef CONFIG_SYS_CCSRBAR_PHYS_LOW 160 #ifndef CONFIG_SYS_CCSRBAR_PHYS_LOW
132 #define CONFIG_SYS_CCSRBAR_PHYS_LOW 0x01000000 161 #define CONFIG_SYS_CCSRBAR_PHYS_LOW 0x01000000
133 #endif 162 #endif
134 163
135 #define CONFIG_SYS_CCSRBAR_PHYS ((CONFIG_SYS_CCSRBAR_PHYS_HIGH * 1ull) << 32 | \ 164 #define CONFIG_SYS_CCSRBAR_PHYS ((CONFIG_SYS_CCSRBAR_PHYS_HIGH * 1ull) << 32 | \
136 CONFIG_SYS_CCSRBAR_PHYS_LOW) 165 CONFIG_SYS_CCSRBAR_PHYS_LOW)
137 166
138 struct sys_info { 167 struct sys_info {
139 unsigned long freq_processor[CONFIG_MAX_CPUS]; 168 unsigned long freq_processor[CONFIG_MAX_CPUS];
140 /* frequency of platform PLL */ 169 /* frequency of platform PLL */
141 unsigned long freq_systembus; 170 unsigned long freq_systembus;
142 unsigned long freq_ddrbus; 171 unsigned long freq_ddrbus;
143 unsigned long freq_localbus; 172 unsigned long freq_localbus;
144 unsigned long freq_sdhc; 173 unsigned long freq_sdhc;
145 #ifdef CONFIG_SYS_DPAA_FMAN 174 #ifdef CONFIG_SYS_DPAA_FMAN
146 unsigned long freq_fman[CONFIG_SYS_NUM_FMAN]; 175 unsigned long freq_fman[CONFIG_SYS_NUM_FMAN];
147 #endif 176 #endif
148 unsigned long freq_qman; 177 unsigned long freq_qman;
149 }; 178 };
150 179
151 #define CONFIG_SYS_FSL_FM1_OFFSET 0xa00000 180 #define CONFIG_SYS_FSL_FM1_OFFSET 0xa00000
152 #define CONFIG_SYS_FSL_FM1_RX0_1G_OFFSET 0xa88000 181 #define CONFIG_SYS_FSL_FM1_RX0_1G_OFFSET 0xa88000
153 #define CONFIG_SYS_FSL_FM1_RX1_1G_OFFSET 0xa89000 182 #define CONFIG_SYS_FSL_FM1_RX1_1G_OFFSET 0xa89000
154 #define CONFIG_SYS_FSL_FM1_RX2_1G_OFFSET 0xa8a000 183 #define CONFIG_SYS_FSL_FM1_RX2_1G_OFFSET 0xa8a000
155 #define CONFIG_SYS_FSL_FM1_RX3_1G_OFFSET 0xa8b000 184 #define CONFIG_SYS_FSL_FM1_RX3_1G_OFFSET 0xa8b000
156 #define CONFIG_SYS_FSL_FM1_RX4_1G_OFFSET 0xa8c000 185 #define CONFIG_SYS_FSL_FM1_RX4_1G_OFFSET 0xa8c000
157 #define CONFIG_SYS_FSL_FM1_RX5_1G_OFFSET 0xa8d000 186 #define CONFIG_SYS_FSL_FM1_RX5_1G_OFFSET 0xa8d000
158 187
159 #define CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET 0xae0000 188 #define CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET 0xae0000
160 #define CONFIG_SYS_FSL_FM1_ADDR \ 189 #define CONFIG_SYS_FSL_FM1_ADDR \
161 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_FM1_OFFSET) 190 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_FM1_OFFSET)
162 #define CONFIG_SYS_FSL_FM1_DTSEC1_ADDR \ 191 #define CONFIG_SYS_FSL_FM1_DTSEC1_ADDR \
163 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET) 192 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET)
164 193
165 #define CONFIG_SYS_FSL_SEC_OFFSET 0x700000ull 194 #define CONFIG_SYS_FSL_SEC_OFFSET 0x700000ull
166 #define CONFIG_SYS_FSL_JR0_OFFSET 0x710000ull 195 #define CONFIG_SYS_FSL_JR0_OFFSET 0x710000ull
167 #define CONFIG_SYS_FSL_SEC_ADDR \ 196 #define CONFIG_SYS_FSL_SEC_ADDR \
168 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_SEC_OFFSET) 197 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_SEC_OFFSET)
169 #define CONFIG_SYS_FSL_JR0_ADDR \ 198 #define CONFIG_SYS_FSL_JR0_ADDR \
170 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_JR0_OFFSET) 199 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_JR0_OFFSET)
171 200
172 /* Device Configuration and Pin Control */ 201 /* Device Configuration and Pin Control */
173 #define DCFG_DCSR_PORCR1 0x0 202 #define DCFG_DCSR_PORCR1 0x0
174 203
175 struct ccsr_gur { 204 struct ccsr_gur {
176 u32 porsr1; /* POR status 1 */ 205 u32 porsr1; /* POR status 1 */
177 #define FSL_CHASSIS2_CCSR_PORSR1_RCW_MASK 0xFF800000 206 #define FSL_CHASSIS2_CCSR_PORSR1_RCW_MASK 0xFF800000
178 u32 porsr2; /* POR status 2 */ 207 u32 porsr2; /* POR status 2 */
179 u8 res_008[0x20-0x8]; 208 u8 res_008[0x20-0x8];
180 u32 gpporcr1; /* General-purpose POR configuration */ 209 u32 gpporcr1; /* General-purpose POR configuration */
181 u32 gpporcr2; 210 u32 gpporcr2;
182 #define FSL_CHASSIS2_DCFG_FUSESR_VID_SHIFT 25 211 #define FSL_CHASSIS2_DCFG_FUSESR_VID_SHIFT 25
183 #define FSL_CHASSIS2_DCFG_FUSESR_VID_MASK 0x1F 212 #define FSL_CHASSIS2_DCFG_FUSESR_VID_MASK 0x1F
184 #define FSL_CHASSIS2_DCFG_FUSESR_ALTVID_SHIFT 20 213 #define FSL_CHASSIS2_DCFG_FUSESR_ALTVID_SHIFT 20
185 #define FSL_CHASSIS2_DCFG_FUSESR_ALTVID_MASK 0x1F 214 #define FSL_CHASSIS2_DCFG_FUSESR_ALTVID_MASK 0x1F
186 u32 dcfg_fusesr; /* Fuse status register */ 215 u32 dcfg_fusesr; /* Fuse status register */
187 u8 res_02c[0x70-0x2c]; 216 u8 res_02c[0x70-0x2c];
188 u32 devdisr; /* Device disable control */ 217 u32 devdisr; /* Device disable control */
189 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_1 0x80000000 218 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_1 0x80000000
190 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_2 0x40000000 219 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_2 0x40000000
191 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_3 0x20000000 220 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_3 0x20000000
192 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_4 0x10000000 221 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_4 0x10000000
193 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_5 0x08000000 222 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_5 0x08000000
194 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_6 0x04000000 223 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_6 0x04000000
195 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_9 0x00800000 224 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_9 0x00800000
196 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_10 0x00400000 225 #define FSL_CHASSIS2_DEVDISR2_DTSEC1_10 0x00400000
197 #define FSL_CHASSIS2_DEVDISR2_10GEC1_1 0x00800000 226 #define FSL_CHASSIS2_DEVDISR2_10GEC1_1 0x00800000
198 #define FSL_CHASSIS2_DEVDISR2_10GEC1_2 0x00400000 227 #define FSL_CHASSIS2_DEVDISR2_10GEC1_2 0x00400000
199 #define FSL_CHASSIS2_DEVDISR2_10GEC1_3 0x80000000 228 #define FSL_CHASSIS2_DEVDISR2_10GEC1_3 0x80000000
200 #define FSL_CHASSIS2_DEVDISR2_10GEC1_4 0x40000000 229 #define FSL_CHASSIS2_DEVDISR2_10GEC1_4 0x40000000
201 u32 devdisr2; /* Device disable control 2 */ 230 u32 devdisr2; /* Device disable control 2 */
202 u32 devdisr3; /* Device disable control 3 */ 231 u32 devdisr3; /* Device disable control 3 */
203 u32 devdisr4; /* Device disable control 4 */ 232 u32 devdisr4; /* Device disable control 4 */
204 u32 devdisr5; /* Device disable control 5 */ 233 u32 devdisr5; /* Device disable control 5 */
205 u32 devdisr6; /* Device disable control 6 */ 234 u32 devdisr6; /* Device disable control 6 */
206 u32 devdisr7; /* Device disable control 7 */ 235 u32 devdisr7; /* Device disable control 7 */
207 u8 res_08c[0x94-0x8c]; 236 u8 res_08c[0x94-0x8c];
208 u32 coredisru; /* uppper portion for support of 64 cores */ 237 u32 coredisru; /* uppper portion for support of 64 cores */
209 u32 coredisrl; /* lower portion for support of 64 cores */ 238 u32 coredisrl; /* lower portion for support of 64 cores */
210 u8 res_09c[0xa0-0x9c]; 239 u8 res_09c[0xa0-0x9c];
211 u32 pvr; /* Processor version */ 240 u32 pvr; /* Processor version */
212 u32 svr; /* System version */ 241 u32 svr; /* System version */
213 u32 mvr; /* Manufacturing version */ 242 u32 mvr; /* Manufacturing version */
214 u8 res_0ac[0xb0-0xac]; 243 u8 res_0ac[0xb0-0xac];
215 u32 rstcr; /* Reset control */ 244 u32 rstcr; /* Reset control */
216 u32 rstrqpblsr; /* Reset request preboot loader status */ 245 u32 rstrqpblsr; /* Reset request preboot loader status */
217 u8 res_0b8[0xc0-0xb8]; 246 u8 res_0b8[0xc0-0xb8];
218 u32 rstrqmr1; /* Reset request mask */ 247 u32 rstrqmr1; /* Reset request mask */
219 u8 res_0c4[0xc8-0xc4]; 248 u8 res_0c4[0xc8-0xc4];
220 u32 rstrqsr1; /* Reset request status */ 249 u32 rstrqsr1; /* Reset request status */
221 u8 res_0cc[0xd4-0xcc]; 250 u8 res_0cc[0xd4-0xcc];
222 u32 rstrqwdtmrl; /* Reset request WDT mask */ 251 u32 rstrqwdtmrl; /* Reset request WDT mask */
223 u8 res_0d8[0xdc-0xd8]; 252 u8 res_0d8[0xdc-0xd8];
224 u32 rstrqwdtsrl; /* Reset request WDT status */ 253 u32 rstrqwdtsrl; /* Reset request WDT status */
225 u8 res_0e0[0xe4-0xe0]; 254 u8 res_0e0[0xe4-0xe0];
226 u32 brrl; /* Boot release */ 255 u32 brrl; /* Boot release */
227 u8 res_0e8[0x100-0xe8]; 256 u8 res_0e8[0x100-0xe8];
228 u32 rcwsr[16]; /* Reset control word status */ 257 u32 rcwsr[16]; /* Reset control word status */
229 #define FSL_CHASSIS2_RCWSR0_SYS_PLL_RAT_SHIFT 25 258 #define FSL_CHASSIS2_RCWSR0_SYS_PLL_RAT_SHIFT 25
230 #define FSL_CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK 0x1f 259 #define FSL_CHASSIS2_RCWSR0_SYS_PLL_RAT_MASK 0x1f
231 #define FSL_CHASSIS2_RCWSR0_MEM_PLL_RAT_SHIFT 16 260 #define FSL_CHASSIS2_RCWSR0_MEM_PLL_RAT_SHIFT 16
232 #define FSL_CHASSIS2_RCWSR0_MEM_PLL_RAT_MASK 0x3f 261 #define FSL_CHASSIS2_RCWSR0_MEM_PLL_RAT_MASK 0x3f
233 #define FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_MASK 0xffff0000 262 #define FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_MASK 0xffff0000
234 #define FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_SHIFT 16 263 #define FSL_CHASSIS2_RCWSR4_SRDS1_PRTCL_SHIFT 16
235 #define FSL_CHASSIS2_RCWSR4_SRDS2_PRTCL_MASK 0x0000ffff 264 #define FSL_CHASSIS2_RCWSR4_SRDS2_PRTCL_MASK 0x0000ffff
236 #define FSL_CHASSIS2_RCWSR4_SRDS2_PRTCL_SHIFT 0 265 #define FSL_CHASSIS2_RCWSR4_SRDS2_PRTCL_SHIFT 0
237 #define RCW_SB_EN_REG_INDEX 7 266 #define RCW_SB_EN_REG_INDEX 7
238 #define RCW_SB_EN_MASK 0x00200000 267 #define RCW_SB_EN_MASK 0x00200000
239 268
240 u8 res_140[0x200-0x140]; 269 u8 res_140[0x200-0x140];
241 u32 scratchrw[4]; /* Scratch Read/Write */ 270 u32 scratchrw[4]; /* Scratch Read/Write */
242 u8 res_210[0x300-0x210]; 271 u8 res_210[0x300-0x210];
243 u32 scratchw1r[4]; /* Scratch Read (Write once) */ 272 u32 scratchw1r[4]; /* Scratch Read (Write once) */
244 u8 res_310[0x400-0x310]; 273 u8 res_310[0x400-0x310];
245 u32 crstsr[12]; 274 u32 crstsr[12];
246 u8 res_430[0x500-0x430]; 275 u8 res_430[0x500-0x430];
247 276
248 /* PCI Express n Logical I/O Device Number register */ 277 /* PCI Express n Logical I/O Device Number register */
249 u32 dcfg_ccsr_pex1liodnr; 278 u32 dcfg_ccsr_pex1liodnr;
250 u32 dcfg_ccsr_pex2liodnr; 279 u32 dcfg_ccsr_pex2liodnr;
251 u32 dcfg_ccsr_pex3liodnr; 280 u32 dcfg_ccsr_pex3liodnr;
252 u32 dcfg_ccsr_pex4liodnr; 281 u32 dcfg_ccsr_pex4liodnr;
253 /* RIO n Logical I/O Device Number register */ 282 /* RIO n Logical I/O Device Number register */
254 u32 dcfg_ccsr_rio1liodnr; 283 u32 dcfg_ccsr_rio1liodnr;
255 u32 dcfg_ccsr_rio2liodnr; 284 u32 dcfg_ccsr_rio2liodnr;
256 u32 dcfg_ccsr_rio3liodnr; 285 u32 dcfg_ccsr_rio3liodnr;
257 u32 dcfg_ccsr_rio4liodnr; 286 u32 dcfg_ccsr_rio4liodnr;
258 /* USB Logical I/O Device Number register */ 287 /* USB Logical I/O Device Number register */
259 u32 dcfg_ccsr_usb1liodnr; 288 u32 dcfg_ccsr_usb1liodnr;
260 u32 dcfg_ccsr_usb2liodnr; 289 u32 dcfg_ccsr_usb2liodnr;
261 u32 dcfg_ccsr_usb3liodnr; 290 u32 dcfg_ccsr_usb3liodnr;
262 u32 dcfg_ccsr_usb4liodnr; 291 u32 dcfg_ccsr_usb4liodnr;
263 /* SD/MMC Logical I/O Device Number register */ 292 /* SD/MMC Logical I/O Device Number register */
264 u32 dcfg_ccsr_sdmmc1liodnr; 293 u32 dcfg_ccsr_sdmmc1liodnr;
265 u32 dcfg_ccsr_sdmmc2liodnr; 294 u32 dcfg_ccsr_sdmmc2liodnr;
266 u32 dcfg_ccsr_sdmmc3liodnr; 295 u32 dcfg_ccsr_sdmmc3liodnr;
267 u32 dcfg_ccsr_sdmmc4liodnr; 296 u32 dcfg_ccsr_sdmmc4liodnr;
268 /* RIO Message Unit Logical I/O Device Number register */ 297 /* RIO Message Unit Logical I/O Device Number register */
269 u32 dcfg_ccsr_riomaintliodnr; 298 u32 dcfg_ccsr_riomaintliodnr;
270 299
271 u8 res_544[0x550-0x544]; 300 u8 res_544[0x550-0x544];
272 u32 sataliodnr[4]; 301 u32 sataliodnr[4];
273 u8 res_560[0x570-0x560]; 302 u8 res_560[0x570-0x560];
274 303
275 u32 dcfg_ccsr_misc1liodnr; 304 u32 dcfg_ccsr_misc1liodnr;
276 u32 dcfg_ccsr_misc2liodnr; 305 u32 dcfg_ccsr_misc2liodnr;
277 u32 dcfg_ccsr_misc3liodnr; 306 u32 dcfg_ccsr_misc3liodnr;
278 u32 dcfg_ccsr_misc4liodnr; 307 u32 dcfg_ccsr_misc4liodnr;
279 u32 dcfg_ccsr_dma1liodnr; 308 u32 dcfg_ccsr_dma1liodnr;
280 u32 dcfg_ccsr_dma2liodnr; 309 u32 dcfg_ccsr_dma2liodnr;
281 u32 dcfg_ccsr_dma3liodnr; 310 u32 dcfg_ccsr_dma3liodnr;
282 u32 dcfg_ccsr_dma4liodnr; 311 u32 dcfg_ccsr_dma4liodnr;
283 u32 dcfg_ccsr_spare1liodnr; 312 u32 dcfg_ccsr_spare1liodnr;
284 u32 dcfg_ccsr_spare2liodnr; 313 u32 dcfg_ccsr_spare2liodnr;
285 u32 dcfg_ccsr_spare3liodnr; 314 u32 dcfg_ccsr_spare3liodnr;
286 u32 dcfg_ccsr_spare4liodnr; 315 u32 dcfg_ccsr_spare4liodnr;
287 u8 res_5a0[0x600-0x5a0]; 316 u8 res_5a0[0x600-0x5a0];
288 u32 dcfg_ccsr_pblsr; 317 u32 dcfg_ccsr_pblsr;
289 318
290 u32 pamubypenr; 319 u32 pamubypenr;
291 u32 dmacr1; 320 u32 dmacr1;
292 321
293 u8 res_60c[0x610-0x60c]; 322 u8 res_60c[0x610-0x60c];
294 u32 dcfg_ccsr_gensr1; 323 u32 dcfg_ccsr_gensr1;
295 u32 dcfg_ccsr_gensr2; 324 u32 dcfg_ccsr_gensr2;
296 u32 dcfg_ccsr_gensr3; 325 u32 dcfg_ccsr_gensr3;
297 u32 dcfg_ccsr_gensr4; 326 u32 dcfg_ccsr_gensr4;
298 u32 dcfg_ccsr_gencr1; 327 u32 dcfg_ccsr_gencr1;
299 u32 dcfg_ccsr_gencr2; 328 u32 dcfg_ccsr_gencr2;
300 u32 dcfg_ccsr_gencr3; 329 u32 dcfg_ccsr_gencr3;
301 u32 dcfg_ccsr_gencr4; 330 u32 dcfg_ccsr_gencr4;
302 u32 dcfg_ccsr_gencr5; 331 u32 dcfg_ccsr_gencr5;
303 u32 dcfg_ccsr_gencr6; 332 u32 dcfg_ccsr_gencr6;
304 u32 dcfg_ccsr_gencr7; 333 u32 dcfg_ccsr_gencr7;
305 u8 res_63c[0x658-0x63c]; 334 u8 res_63c[0x658-0x63c];
306 u32 dcfg_ccsr_cgensr1; 335 u32 dcfg_ccsr_cgensr1;
307 u32 dcfg_ccsr_cgensr0; 336 u32 dcfg_ccsr_cgensr0;
308 u8 res_660[0x678-0x660]; 337 u8 res_660[0x678-0x660];
309 u32 dcfg_ccsr_cgencr1; 338 u32 dcfg_ccsr_cgencr1;
310 339
311 u32 dcfg_ccsr_cgencr0; 340 u32 dcfg_ccsr_cgencr0;
312 u8 res_680[0x700-0x680]; 341 u8 res_680[0x700-0x680];
313 u32 dcfg_ccsr_sriopstecr; 342 u32 dcfg_ccsr_sriopstecr;
314 u32 dcfg_ccsr_dcsrcr; 343 u32 dcfg_ccsr_dcsrcr;
315 344
316 u8 res_708[0x740-0x708]; /* add more registers when needed */ 345 u8 res_708[0x740-0x708]; /* add more registers when needed */
317 u32 tp_ityp[64]; /* Topology Initiator Type Register */ 346 u32 tp_ityp[64]; /* Topology Initiator Type Register */
318 struct { 347 struct {
319 u32 upper; 348 u32 upper;
320 u32 lower; 349 u32 lower;
321 } tp_cluster[16]; 350 } tp_cluster[16];
322 u8 res_8c0[0xa00-0x8c0]; /* add more registers when needed */ 351 u8 res_8c0[0xa00-0x8c0]; /* add more registers when needed */
323 u32 dcfg_ccsr_qmbm_warmrst; 352 u32 dcfg_ccsr_qmbm_warmrst;
324 u8 res_a04[0xa20-0xa04]; /* add more registers when needed */ 353 u8 res_a04[0xa20-0xa04]; /* add more registers when needed */
325 u32 dcfg_ccsr_reserved0; 354 u32 dcfg_ccsr_reserved0;
326 u32 dcfg_ccsr_reserved1; 355 u32 dcfg_ccsr_reserved1;
327 }; 356 };
328 357
329 #define SCFG_QSPI_CLKSEL 0x40100000 358 #define SCFG_QSPI_CLKSEL 0x40100000
330 #define SCFG_USBDRVVBUS_SELCR_USB1 0x00000000 359 #define SCFG_USBDRVVBUS_SELCR_USB1 0x00000000
331 #define SCFG_USBDRVVBUS_SELCR_USB2 0x00000001 360 #define SCFG_USBDRVVBUS_SELCR_USB2 0x00000001
332 #define SCFG_USBDRVVBUS_SELCR_USB3 0x00000002 361 #define SCFG_USBDRVVBUS_SELCR_USB3 0x00000002
333 #define SCFG_USBPWRFAULT_INACTIVE 0x00000000 362 #define SCFG_USBPWRFAULT_INACTIVE 0x00000000
334 #define SCFG_USBPWRFAULT_SHARED 0x00000001 363 #define SCFG_USBPWRFAULT_SHARED 0x00000001
335 #define SCFG_USBPWRFAULT_DEDICATED 0x00000002 364 #define SCFG_USBPWRFAULT_DEDICATED 0x00000002
336 #define SCFG_USBPWRFAULT_USB3_SHIFT 4 365 #define SCFG_USBPWRFAULT_USB3_SHIFT 4
337 #define SCFG_USBPWRFAULT_USB2_SHIFT 2 366 #define SCFG_USBPWRFAULT_USB2_SHIFT 2
338 #define SCFG_USBPWRFAULT_USB1_SHIFT 0 367 #define SCFG_USBPWRFAULT_USB1_SHIFT 0
339 368
340 #define SCFG_BASE 0x01570000 369 #define SCFG_BASE 0x01570000
341 #define SCFG_USB3PRM1CR_USB1 0x070 370 #define SCFG_USB3PRM1CR_USB1 0x070
342 #define SCFG_USB3PRM2CR_USB1 0x074 371 #define SCFG_USB3PRM2CR_USB1 0x074
343 #define SCFG_USB3PRM1CR_USB2 0x07C 372 #define SCFG_USB3PRM1CR_USB2 0x07C
344 #define SCFG_USB3PRM2CR_USB2 0x080 373 #define SCFG_USB3PRM2CR_USB2 0x080
345 #define SCFG_USB3PRM1CR_USB3 0x088 374 #define SCFG_USB3PRM1CR_USB3 0x088
346 #define SCFG_USB3PRM2CR_USB3 0x08c 375 #define SCFG_USB3PRM2CR_USB3 0x08c
347 #define SCFG_USB_TXVREFTUNE 0x9 376 #define SCFG_USB_TXVREFTUNE 0x9
348 #define SCFG_USB_SQRXTUNE_MASK 0x7 377 #define SCFG_USB_SQRXTUNE_MASK 0x7
349 #define SCFG_USB_PCSTXSWINGFULL 0x47 378 #define SCFG_USB_PCSTXSWINGFULL 0x47
350 #define SCFG_USB_PHY1 0x084F0000 379 #define SCFG_USB_PHY1 0x084F0000
351 #define SCFG_USB_PHY2 0x08500000 380 #define SCFG_USB_PHY2 0x08500000
352 #define SCFG_USB_PHY3 0x08510000 381 #define SCFG_USB_PHY3 0x08510000
353 #define SCFG_USB_PHY_RX_OVRD_IN_HI 0x200c 382 #define SCFG_USB_PHY_RX_OVRD_IN_HI 0x200c
354 #define USB_PHY_RX_EQ_VAL_1 0x0000 383 #define USB_PHY_RX_EQ_VAL_1 0x0000
355 #define USB_PHY_RX_EQ_VAL_2 0x0080 384 #define USB_PHY_RX_EQ_VAL_2 0x0080
356 #define USB_PHY_RX_EQ_VAL_3 0x0380 385 #define USB_PHY_RX_EQ_VAL_3 0x0380
357 #define USB_PHY_RX_EQ_VAL_4 0x0b80 386 #define USB_PHY_RX_EQ_VAL_4 0x0b80
358 387
359 #define SCFG_SNPCNFGCR_SECRDSNP 0x80000000 388 #define SCFG_SNPCNFGCR_SECRDSNP 0x80000000
360 #define SCFG_SNPCNFGCR_SECWRSNP 0x40000000 389 #define SCFG_SNPCNFGCR_SECWRSNP 0x40000000
361 #define SCFG_SNPCNFGCR_SATARDSNP 0x00800000 390 #define SCFG_SNPCNFGCR_SATARDSNP 0x00800000
362 #define SCFG_SNPCNFGCR_SATAWRSNP 0x00400000 391 #define SCFG_SNPCNFGCR_SATAWRSNP 0x00400000
363 392
364 /* Supplemental Configuration Unit */ 393 /* Supplemental Configuration Unit */
365 struct ccsr_scfg { 394 struct ccsr_scfg {
366 u8 res_000[0x100-0x000]; 395 u8 res_000[0x100-0x000];
367 u32 usb2_icid; 396 u32 usb2_icid;
368 u32 usb3_icid; 397 u32 usb3_icid;
369 u8 res_108[0x114-0x108]; 398 u8 res_108[0x114-0x108];
370 u32 dma_icid; 399 u32 dma_icid;
371 u32 sata_icid; 400 u32 sata_icid;
372 u32 usb1_icid; 401 u32 usb1_icid;
373 u32 qe_icid; 402 u32 qe_icid;
374 u32 sdhc_icid; 403 u32 sdhc_icid;
375 u32 edma_icid; 404 u32 edma_icid;
376 u32 etr_icid; 405 u32 etr_icid;
377 u32 core_sft_rst[4]; 406 u32 core_sft_rst[4];
378 u8 res_140[0x158-0x140]; 407 u8 res_140[0x158-0x140];
379 u32 altcbar; 408 u32 altcbar;
380 u32 qspi_cfg; 409 u32 qspi_cfg;
381 u8 res_160[0x180-0x160]; 410 u8 res_160[0x180-0x160];
382 u32 dmamcr; 411 u32 dmamcr;
383 u8 res_184[0x188-0x184]; 412 u8 res_184[0x188-0x184];
384 u32 gic_align; 413 u32 gic_align;
385 u32 debug_icid; 414 u32 debug_icid;
386 u8 res_190[0x1a4-0x190]; 415 u8 res_190[0x1a4-0x190];
387 u32 snpcnfgcr; 416 u32 snpcnfgcr;
388 u8 res_1a8[0x1ac-0x1a8]; 417 u8 res_1a8[0x1ac-0x1a8];
389 u32 intpcr; 418 u32 intpcr;
390 u8 res_1b0[0x204-0x1b0]; 419 u8 res_1b0[0x204-0x1b0];
391 u32 coresrencr; 420 u32 coresrencr;
392 u8 res_208[0x220-0x208]; 421 u8 res_208[0x220-0x208];
393 u32 rvbar0_0; 422 u32 rvbar0_0;
394 u32 rvbar0_1; 423 u32 rvbar0_1;
395 u32 rvbar1_0; 424 u32 rvbar1_0;
396 u32 rvbar1_1; 425 u32 rvbar1_1;
397 u32 rvbar2_0; 426 u32 rvbar2_0;
398 u32 rvbar2_1; 427 u32 rvbar2_1;
399 u32 rvbar3_0; 428 u32 rvbar3_0;
400 u32 rvbar3_1; 429 u32 rvbar3_1;
401 u32 lpmcsr; 430 u32 lpmcsr;
402 u8 res_244[0x400-0x244]; 431 u8 res_244[0x400-0x244];
403 u32 qspidqscr; 432 u32 qspidqscr;
404 u32 ecgtxcmcr; 433 u32 ecgtxcmcr;
405 u32 sdhciovselcr; 434 u32 sdhciovselcr;
406 u32 rcwpmuxcr0; 435 u32 rcwpmuxcr0;
407 u32 usbdrvvbus_selcr; 436 u32 usbdrvvbus_selcr;
408 u32 usbpwrfault_selcr; 437 u32 usbpwrfault_selcr;
409 u32 usb_refclk_selcr1; 438 u32 usb_refclk_selcr1;
410 u32 usb_refclk_selcr2; 439 u32 usb_refclk_selcr2;
411 u32 usb_refclk_selcr3; 440 u32 usb_refclk_selcr3;
412 u8 res_424[0x600-0x424]; 441 u8 res_424[0x600-0x424];
413 u32 scratchrw[4]; 442 u32 scratchrw[4];
414 u8 res_610[0x680-0x610]; 443 u8 res_610[0x680-0x610];
415 u32 corebcr; 444 u32 corebcr;
416 u8 res_684[0x1000-0x684]; 445 u8 res_684[0x1000-0x684];
417 u32 pex1msiir; 446 u32 pex1msiir;
418 u32 pex1msir; 447 u32 pex1msir;
419 u8 res_1008[0x2000-0x1008]; 448 u8 res_1008[0x2000-0x1008];
420 u32 pex2; 449 u32 pex2;
421 u32 pex2msir; 450 u32 pex2msir;
422 u8 res_2008[0x3000-0x2008]; 451 u8 res_2008[0x3000-0x2008];
423 u32 pex3msiir; 452 u32 pex3msiir;
424 u32 pex3msir; 453 u32 pex3msir;
425 }; 454 };
426 455
427 /* Clocking */ 456 /* Clocking */
428 struct ccsr_clk { 457 struct ccsr_clk {
429 struct { 458 struct {
430 u32 clkcncsr; /* core cluster n clock control status */ 459 u32 clkcncsr; /* core cluster n clock control status */
431 u8 res_004[0x0c]; 460 u8 res_004[0x0c];
432 u32 clkcghwacsr; /* Clock generator n hardware accelerator */ 461 u32 clkcghwacsr; /* Clock generator n hardware accelerator */
433 u8 res_014[0x0c]; 462 u8 res_014[0x0c];
434 } clkcsr[4]; 463 } clkcsr[4];
435 u8 res_040[0x780]; /* 0x100 */ 464 u8 res_040[0x780]; /* 0x100 */
436 struct { 465 struct {
437 u32 pllcngsr; 466 u32 pllcngsr;
438 u8 res_804[0x1c]; 467 u8 res_804[0x1c];
439 } pllcgsr[2]; 468 } pllcgsr[2];
440 u8 res_840[0x1c0]; 469 u8 res_840[0x1c0];
441 u32 clkpcsr; /* 0xa00 Platform clock domain control/status */ 470 u32 clkpcsr; /* 0xa00 Platform clock domain control/status */
442 u8 res_a04[0x1fc]; 471 u8 res_a04[0x1fc];
443 u32 pllpgsr; /* 0xc00 Platform PLL General Status */ 472 u32 pllpgsr; /* 0xc00 Platform PLL General Status */
444 u8 res_c04[0x1c]; 473 u8 res_c04[0x1c];
445 u32 plldgsr; /* 0xc20 DDR PLL General Status */ 474 u32 plldgsr; /* 0xc20 DDR PLL General Status */
446 u8 res_c24[0x3dc]; 475 u8 res_c24[0x3dc];
447 }; 476 };
448 477
449 /* System Counter */ 478 /* System Counter */
450 struct sctr_regs { 479 struct sctr_regs {
451 u32 cntcr; 480 u32 cntcr;
452 u32 cntsr; 481 u32 cntsr;
453 u32 cntcv1; 482 u32 cntcv1;
454 u32 cntcv2; 483 u32 cntcv2;
455 u32 resv1[4]; 484 u32 resv1[4];
456 u32 cntfid0; 485 u32 cntfid0;
457 u32 cntfid1; 486 u32 cntfid1;
458 u32 resv2[1002]; 487 u32 resv2[1002];
459 u32 counterid[12]; 488 u32 counterid[12];
460 }; 489 };
461 490
462 #define SRDS_MAX_LANES 4 491 #define SRDS_MAX_LANES 4
463 struct ccsr_serdes { 492 struct ccsr_serdes {
464 struct { 493 struct {
465 u32 rstctl; /* Reset Control Register */ 494 u32 rstctl; /* Reset Control Register */
466 #define SRDS_RSTCTL_RST 0x80000000 495 #define SRDS_RSTCTL_RST 0x80000000
467 #define SRDS_RSTCTL_RSTDONE 0x40000000 496 #define SRDS_RSTCTL_RSTDONE 0x40000000
468 #define SRDS_RSTCTL_RSTERR 0x20000000 497 #define SRDS_RSTCTL_RSTERR 0x20000000
469 #define SRDS_RSTCTL_SWRST 0x10000000 498 #define SRDS_RSTCTL_SWRST 0x10000000
470 #define SRDS_RSTCTL_SDEN 0x00000020 499 #define SRDS_RSTCTL_SDEN 0x00000020
471 #define SRDS_RSTCTL_SDRST_B 0x00000040 500 #define SRDS_RSTCTL_SDRST_B 0x00000040
472 #define SRDS_RSTCTL_PLLRST_B 0x00000080 501 #define SRDS_RSTCTL_PLLRST_B 0x00000080
473 u32 pllcr0; /* PLL Control Register 0 */ 502 u32 pllcr0; /* PLL Control Register 0 */
474 #define SRDS_PLLCR0_POFF 0x80000000 503 #define SRDS_PLLCR0_POFF 0x80000000
475 #define SRDS_PLLCR0_RFCK_SEL_MASK 0x70000000 504 #define SRDS_PLLCR0_RFCK_SEL_MASK 0x70000000
476 #define SRDS_PLLCR0_RFCK_SEL_100 0x00000000 505 #define SRDS_PLLCR0_RFCK_SEL_100 0x00000000
477 #define SRDS_PLLCR0_RFCK_SEL_125 0x10000000 506 #define SRDS_PLLCR0_RFCK_SEL_125 0x10000000
478 #define SRDS_PLLCR0_RFCK_SEL_156_25 0x20000000 507 #define SRDS_PLLCR0_RFCK_SEL_156_25 0x20000000
479 #define SRDS_PLLCR0_RFCK_SEL_150 0x30000000 508 #define SRDS_PLLCR0_RFCK_SEL_150 0x30000000
480 #define SRDS_PLLCR0_RFCK_SEL_161_13 0x40000000 509 #define SRDS_PLLCR0_RFCK_SEL_161_13 0x40000000
481 #define SRDS_PLLCR0_RFCK_SEL_122_88 0x50000000 510 #define SRDS_PLLCR0_RFCK_SEL_122_88 0x50000000
482 #define SRDS_PLLCR0_PLL_LCK 0x00800000 511 #define SRDS_PLLCR0_PLL_LCK 0x00800000
483 #define SRDS_PLLCR0_FRATE_SEL_MASK 0x000f0000 512 #define SRDS_PLLCR0_FRATE_SEL_MASK 0x000f0000
484 #define SRDS_PLLCR0_FRATE_SEL_5 0x00000000 513 #define SRDS_PLLCR0_FRATE_SEL_5 0x00000000
485 #define SRDS_PLLCR0_FRATE_SEL_3_75 0x00050000 514 #define SRDS_PLLCR0_FRATE_SEL_3_75 0x00050000
486 #define SRDS_PLLCR0_FRATE_SEL_5_15 0x00060000 515 #define SRDS_PLLCR0_FRATE_SEL_5_15 0x00060000
487 #define SRDS_PLLCR0_FRATE_SEL_4 0x00070000 516 #define SRDS_PLLCR0_FRATE_SEL_4 0x00070000
488 #define SRDS_PLLCR0_FRATE_SEL_3_12 0x00090000 517 #define SRDS_PLLCR0_FRATE_SEL_3_12 0x00090000
489 #define SRDS_PLLCR0_FRATE_SEL_3 0x000a0000 518 #define SRDS_PLLCR0_FRATE_SEL_3 0x000a0000
490 u32 pllcr1; /* PLL Control Register 1 */ 519 u32 pllcr1; /* PLL Control Register 1 */
491 #define SRDS_PLLCR1_PLL_BWSEL 0x08000000 520 #define SRDS_PLLCR1_PLL_BWSEL 0x08000000
492 u32 res_0c; /* 0x00c */ 521 u32 res_0c; /* 0x00c */
493 u32 pllcr3; 522 u32 pllcr3;
494 u32 pllcr4; 523 u32 pllcr4;
495 u32 pllcr5; /* 0x018 SerDes PLL1 Control 5 */ 524 u32 pllcr5; /* 0x018 SerDes PLL1 Control 5 */
496 u8 res_1c[0x20-0x1c]; 525 u8 res_1c[0x20-0x1c];
497 } bank[2]; 526 } bank[2];
498 u8 res_40[0x90-0x40]; 527 u8 res_40[0x90-0x40];
499 u32 srdstcalcr; /* 0x90 TX Calibration Control */ 528 u32 srdstcalcr; /* 0x90 TX Calibration Control */
500 u8 res_94[0xa0-0x94]; 529 u8 res_94[0xa0-0x94];
501 u32 srdsrcalcr; /* 0xa0 RX Calibration Control */ 530 u32 srdsrcalcr; /* 0xa0 RX Calibration Control */
502 u8 res_a4[0xb0-0xa4]; 531 u8 res_a4[0xb0-0xa4];
503 u32 srdsgr0; /* 0xb0 General Register 0 */ 532 u32 srdsgr0; /* 0xb0 General Register 0 */
504 u8 res_b4[0x100-0xb4]; 533 u8 res_b4[0x100-0xb4];
505 struct { 534 struct {
506 u32 lnpssr0; /* 0x100, 0x120, 0x140, 0x160 */ 535 u32 lnpssr0; /* 0x100, 0x120, 0x140, 0x160 */
507 u8 res_104[0x120-0x104]; 536 u8 res_104[0x120-0x104];
508 } lnpssr[4]; /* Lane A, B, C, D */ 537 } lnpssr[4]; /* Lane A, B, C, D */
509 u8 res_180[0x200-0x180]; 538 u8 res_180[0x200-0x180];
510 u32 srdspccr0; /* 0x200 Protocol Configuration 0 */ 539 u32 srdspccr0; /* 0x200 Protocol Configuration 0 */
511 u32 srdspccr1; /* 0x204 Protocol Configuration 1 */ 540 u32 srdspccr1; /* 0x204 Protocol Configuration 1 */
512 u32 srdspccr2; /* 0x208 Protocol Configuration 2 */ 541 u32 srdspccr2; /* 0x208 Protocol Configuration 2 */
513 u32 srdspccr3; /* 0x20c Protocol Configuration 3 */ 542 u32 srdspccr3; /* 0x20c Protocol Configuration 3 */
514 u32 srdspccr4; /* 0x210 Protocol Configuration 4 */ 543 u32 srdspccr4; /* 0x210 Protocol Configuration 4 */
515 u32 srdspccr5; /* 0x214 Protocol Configuration 5 */ 544 u32 srdspccr5; /* 0x214 Protocol Configuration 5 */
516 u32 srdspccr6; /* 0x218 Protocol Configuration 6 */ 545 u32 srdspccr6; /* 0x218 Protocol Configuration 6 */
517 u32 srdspccr7; /* 0x21c Protocol Configuration 7 */ 546 u32 srdspccr7; /* 0x21c Protocol Configuration 7 */
518 u32 srdspccr8; /* 0x220 Protocol Configuration 8 */ 547 u32 srdspccr8; /* 0x220 Protocol Configuration 8 */
519 u32 srdspccr9; /* 0x224 Protocol Configuration 9 */ 548 u32 srdspccr9; /* 0x224 Protocol Configuration 9 */
520 u32 srdspccra; /* 0x228 Protocol Configuration A */ 549 u32 srdspccra; /* 0x228 Protocol Configuration A */
521 u32 srdspccrb; /* 0x22c Protocol Configuration B */ 550 u32 srdspccrb; /* 0x22c Protocol Configuration B */
522 u8 res_230[0x800-0x230]; 551 u8 res_230[0x800-0x230];
523 struct { 552 struct {
524 u32 gcr0; /* 0x800 General Control Register 0 */ 553 u32 gcr0; /* 0x800 General Control Register 0 */
525 u32 gcr1; /* 0x804 General Control Register 1 */ 554 u32 gcr1; /* 0x804 General Control Register 1 */
526 u32 gcr2; /* 0x808 General Control Register 2 */ 555 u32 gcr2; /* 0x808 General Control Register 2 */
527 u32 sscr0; 556 u32 sscr0;
528 u32 recr0; /* 0x810 Receive Equalization Control */ 557 u32 recr0; /* 0x810 Receive Equalization Control */
529 u32 recr1; 558 u32 recr1;
530 u32 tecr0; /* 0x818 Transmit Equalization Control */ 559 u32 tecr0; /* 0x818 Transmit Equalization Control */
531 u32 sscr1; 560 u32 sscr1;
532 u32 ttlcr0; /* 0x820 Transition Tracking Loop Ctrl 0 */ 561 u32 ttlcr0; /* 0x820 Transition Tracking Loop Ctrl 0 */
533 u8 res_824[0x83c-0x824]; 562 u8 res_824[0x83c-0x824];
534 u32 tcsr3; 563 u32 tcsr3;
535 } lane[4]; /* Lane A, B, C, D */ 564 } lane[4]; /* Lane A, B, C, D */
536 u8 res_900[0x1000-0x900]; /* from 0x900 to 0xfff */ 565 u8 res_900[0x1000-0x900]; /* from 0x900 to 0xfff */
537 struct { 566 struct {
538 u32 srdspexcr0; /* 0x1000, 0x1040, 0x1080 */ 567 u32 srdspexcr0; /* 0x1000, 0x1040, 0x1080 */
539 u8 res_1004[0x1040-0x1004]; 568 u8 res_1004[0x1040-0x1004];
540 } pcie[3]; 569 } pcie[3];
541 u8 res_10c0[0x1800-0x10c0]; 570 u8 res_10c0[0x1800-0x10c0];
542 struct { 571 struct {
543 u8 res_1800[0x1804-0x1800]; 572 u8 res_1800[0x1804-0x1800];
544 u32 srdssgmiicr1; /* 0x1804 SGMII Protocol Control 1 */ 573 u32 srdssgmiicr1; /* 0x1804 SGMII Protocol Control 1 */
545 u8 res_1808[0x180c-0x1808]; 574 u8 res_1808[0x180c-0x1808];
546 u32 srdssgmiicr3; /* 0x180c SGMII Protocol Control 3 */ 575 u32 srdssgmiicr3; /* 0x180c SGMII Protocol Control 3 */
547 } sgmii[4]; /* Lane A, B, C, D */ 576 } sgmii[4]; /* Lane A, B, C, D */
548 u8 res_1840[0x1880-0x1840]; 577 u8 res_1840[0x1880-0x1840];
549 struct { 578 struct {
550 u8 res_1880[0x1884-0x1880]; 579 u8 res_1880[0x1884-0x1880];
551 u32 srdsqsgmiicr1; /* 0x1884 QSGMII Protocol Control 1 */ 580 u32 srdsqsgmiicr1; /* 0x1884 QSGMII Protocol Control 1 */
552 u8 res_1888[0x188c-0x1888]; 581 u8 res_1888[0x188c-0x1888];
553 u32 srdsqsgmiicr3; /* 0x188c QSGMII Protocol Control 3 */ 582 u32 srdsqsgmiicr3; /* 0x188c QSGMII Protocol Control 3 */
554 } qsgmii[2]; /* Lane A, B */ 583 } qsgmii[2]; /* Lane A, B */
555 u8 res_18a0[0x1980-0x18a0]; 584 u8 res_18a0[0x1980-0x18a0];
556 struct { 585 struct {
557 u8 res_1980[0x1984-0x1980]; 586 u8 res_1980[0x1984-0x1980];
558 u32 srdsxficr1; /* 0x1984 XFI Protocol Control 1 */ 587 u32 srdsxficr1; /* 0x1984 XFI Protocol Control 1 */
559 u8 res_1988[0x198c-0x1988]; 588 u8 res_1988[0x198c-0x1988];
560 u32 srdsxficr3; /* 0x198c XFI Protocol Control 3 */ 589 u32 srdsxficr3; /* 0x198c XFI Protocol Control 3 */
561 } xfi[2]; /* Lane A, B */ 590 } xfi[2]; /* Lane A, B */
562 u8 res_19a0[0x2000-0x19a0]; /* from 0x19a0 to 0x1fff */ 591 u8 res_19a0[0x2000-0x19a0]; /* from 0x19a0 to 0x1fff */
563 }; 592 };
564 593
565 /* MMU 500 */ 594 /* MMU 500 */
566 #define SMMU_SCR0 (SMMU_BASE + 0x0) 595 #define SMMU_SCR0 (SMMU_BASE + 0x0)
567 #define SMMU_SCR1 (SMMU_BASE + 0x4) 596 #define SMMU_SCR1 (SMMU_BASE + 0x4)
568 #define SMMU_SCR2 (SMMU_BASE + 0x8) 597 #define SMMU_SCR2 (SMMU_BASE + 0x8)
569 #define SMMU_SACR (SMMU_BASE + 0x10) 598 #define SMMU_SACR (SMMU_BASE + 0x10)
570 #define SMMU_IDR0 (SMMU_BASE + 0x20) 599 #define SMMU_IDR0 (SMMU_BASE + 0x20)
571 #define SMMU_IDR1 (SMMU_BASE + 0x24) 600 #define SMMU_IDR1 (SMMU_BASE + 0x24)
572 601
573 #define SMMU_NSCR0 (SMMU_BASE + 0x400) 602 #define SMMU_NSCR0 (SMMU_BASE + 0x400)
574 #define SMMU_NSCR2 (SMMU_BASE + 0x408) 603 #define SMMU_NSCR2 (SMMU_BASE + 0x408)
575 #define SMMU_NSACR (SMMU_BASE + 0x410) 604 #define SMMU_NSACR (SMMU_BASE + 0x410)
576 605
577 #define SCR0_CLIENTPD_MASK 0x00000001 606 #define SCR0_CLIENTPD_MASK 0x00000001
578 #define SCR0_USFCFG_MASK 0x00000400 607 #define SCR0_USFCFG_MASK 0x00000400
579 608
580 uint get_svr(void); 609 uint get_svr(void);
581 610
582 #endif /* __ARCH_FSL_LSCH2_IMMAP_H__*/ 611 #endif /* __ARCH_FSL_LSCH2_IMMAP_H__*/
583 612
arch/arm/include/asm/arch-fsl-layerscape/speed.h
1 /* 1 /*
2 * Copyright 2014-2015, Freescale Semiconductor, Inc. 2 * Copyright 2014-2015, Freescale Semiconductor, Inc.
3 * 3 *
4 * SPDX-License-Identifier: GPL-2.0+ 4 * SPDX-License-Identifier: GPL-2.0+
5 */ 5 */
6 6
7 #ifndef _FSL_LAYERSCAPE_SPEED_H 7 #ifndef _FSL_LAYERSCAPE_SPEED_H
8 #define _FSL_LAYERSCAPE_SPEED_H 8 #define _FSL_LAYERSCAPE_SPEED_H
9 void get_sys_info(struct sys_info *sys_info); 9 void get_sys_info(struct sys_info *sys_info);
10 #ifdef CONFIG_SYS_DPAA_QBMAN
11 unsigned long get_qman_freq(void);
12 #endif
10 #endif /* _FSL_LAYERSCAPE_SPEED_H */ 13 #endif /* _FSL_LAYERSCAPE_SPEED_H */
11 14
arch/powerpc/cpu/mpc85xx/cpu_init.c
1 /* 1 /*
2 * Copyright 2007-2011 Freescale Semiconductor, Inc. 2 * Copyright 2007-2011 Freescale Semiconductor, Inc.
3 * 3 *
4 * (C) Copyright 2003 Motorola Inc. 4 * (C) Copyright 2003 Motorola Inc.
5 * Modified by Xianghua Xiao, X.Xiao@motorola.com 5 * Modified by Xianghua Xiao, X.Xiao@motorola.com
6 * 6 *
7 * (C) Copyright 2000 7 * (C) Copyright 2000
8 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 8 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
9 * 9 *
10 * SPDX-License-Identifier: GPL-2.0+ 10 * SPDX-License-Identifier: GPL-2.0+
11 */ 11 */
12 12
13 #include <common.h> 13 #include <common.h>
14 #include <watchdog.h> 14 #include <watchdog.h>
15 #include <asm/processor.h> 15 #include <asm/processor.h>
16 #include <ioports.h> 16 #include <ioports.h>
17 #include <sata.h> 17 #include <sata.h>
18 #include <fm_eth.h> 18 #include <fm_eth.h>
19 #include <asm/io.h> 19 #include <asm/io.h>
20 #include <asm/cache.h> 20 #include <asm/cache.h>
21 #include <asm/mmu.h> 21 #include <asm/mmu.h>
22 #include <fsl_errata.h> 22 #include <fsl_errata.h>
23 #include <asm/fsl_law.h> 23 #include <asm/fsl_law.h>
24 #include <asm/fsl_serdes.h> 24 #include <asm/fsl_serdes.h>
25 #include <asm/fsl_srio.h> 25 #include <asm/fsl_srio.h>
26 #ifdef CONFIG_FSL_CORENET 26 #ifdef CONFIG_FSL_CORENET
27 #include <asm/fsl_portals.h> 27 #include <asm/fsl_portals.h>
28 #include <asm/fsl_liodn.h> 28 #include <asm/fsl_liodn.h>
29 #include <fsl_qbman.h>
29 #endif 30 #endif
30 #include <fsl_usb.h> 31 #include <fsl_usb.h>
31 #include <hwconfig.h> 32 #include <hwconfig.h>
32 #include <linux/compiler.h> 33 #include <linux/compiler.h>
33 #include "mp.h" 34 #include "mp.h"
34 #ifdef CONFIG_CHAIN_OF_TRUST 35 #ifdef CONFIG_CHAIN_OF_TRUST
35 #include <fsl_validate.h> 36 #include <fsl_validate.h>
36 #endif 37 #endif
37 #ifdef CONFIG_FSL_CAAM 38 #ifdef CONFIG_FSL_CAAM
38 #include <fsl_sec.h> 39 #include <fsl_sec.h>
39 #endif 40 #endif
40 #if defined(CONFIG_SECURE_BOOT) && defined(CONFIG_FSL_CORENET) 41 #if defined(CONFIG_SECURE_BOOT) && defined(CONFIG_FSL_CORENET)
41 #include <asm/fsl_pamu.h> 42 #include <asm/fsl_pamu.h>
42 #include <fsl_secboot_err.h> 43 #include <fsl_secboot_err.h>
43 #endif 44 #endif
44 #ifdef CONFIG_SYS_QE_FMAN_FW_IN_NAND 45 #ifdef CONFIG_SYS_QE_FMAN_FW_IN_NAND
45 #include <nand.h> 46 #include <nand.h>
46 #include <errno.h> 47 #include <errno.h>
47 #endif 48 #endif
48 #ifndef CONFIG_ARCH_QEMU_E500 49 #ifndef CONFIG_ARCH_QEMU_E500
49 #include <fsl_ddr.h> 50 #include <fsl_ddr.h>
50 #endif 51 #endif
51 #include "../../../../drivers/ata/fsl_sata.h" 52 #include "../../../../drivers/ata/fsl_sata.h"
52 #ifdef CONFIG_U_QE 53 #ifdef CONFIG_U_QE
53 #include <fsl_qe.h> 54 #include <fsl_qe.h>
54 #endif 55 #endif
55 56
56 DECLARE_GLOBAL_DATA_PTR; 57 DECLARE_GLOBAL_DATA_PTR;
57 58
58 #ifdef CONFIG_SYS_FSL_SINGLE_SOURCE_CLK 59 #ifdef CONFIG_SYS_FSL_SINGLE_SOURCE_CLK
59 /* 60 /*
60 * For deriving usb clock from 100MHz sysclk, reference divisor is set 61 * For deriving usb clock from 100MHz sysclk, reference divisor is set
61 * to a value of 5, which gives an intermediate value 20(100/5). The 62 * to a value of 5, which gives an intermediate value 20(100/5). The
62 * multiplication factor integer is set to 24, which when multiplied to 63 * multiplication factor integer is set to 24, which when multiplied to
63 * above intermediate value provides clock for usb ip. 64 * above intermediate value provides clock for usb ip.
64 */ 65 */
65 void usb_single_source_clk_configure(struct ccsr_usb_phy *usb_phy) 66 void usb_single_source_clk_configure(struct ccsr_usb_phy *usb_phy)
66 { 67 {
67 sys_info_t sysinfo; 68 sys_info_t sysinfo;
68 69
69 get_sys_info(&sysinfo); 70 get_sys_info(&sysinfo);
70 if (sysinfo.diff_sysclk == 1) { 71 if (sysinfo.diff_sysclk == 1) {
71 clrbits_be32(&usb_phy->pllprg[1], 72 clrbits_be32(&usb_phy->pllprg[1],
72 CONFIG_SYS_FSL_USB_PLLPRG2_MFI); 73 CONFIG_SYS_FSL_USB_PLLPRG2_MFI);
73 setbits_be32(&usb_phy->pllprg[1], 74 setbits_be32(&usb_phy->pllprg[1],
74 CONFIG_SYS_FSL_USB_PLLPRG2_REF_DIV_INTERNAL_CLK | 75 CONFIG_SYS_FSL_USB_PLLPRG2_REF_DIV_INTERNAL_CLK |
75 CONFIG_SYS_FSL_USB_PLLPRG2_MFI_INTERNAL_CLK | 76 CONFIG_SYS_FSL_USB_PLLPRG2_MFI_INTERNAL_CLK |
76 CONFIG_SYS_FSL_USB_INTERNAL_SOC_CLK_EN); 77 CONFIG_SYS_FSL_USB_INTERNAL_SOC_CLK_EN);
77 } 78 }
78 } 79 }
79 #endif 80 #endif
80 81
81 #ifdef CONFIG_SYS_FSL_ERRATUM_A006261 82 #ifdef CONFIG_SYS_FSL_ERRATUM_A006261
82 void fsl_erratum_a006261_workaround(struct ccsr_usb_phy __iomem *usb_phy) 83 void fsl_erratum_a006261_workaround(struct ccsr_usb_phy __iomem *usb_phy)
83 { 84 {
84 #ifdef CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE 85 #ifdef CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE
85 u32 xcvrprg = in_be32(&usb_phy->port1.xcvrprg); 86 u32 xcvrprg = in_be32(&usb_phy->port1.xcvrprg);
86 87
87 /* Increase Disconnect Threshold by 50mV */ 88 /* Increase Disconnect Threshold by 50mV */
88 xcvrprg &= ~CONFIG_SYS_FSL_USB_XCVRPRG_HS_DCNT_PROG_MASK | 89 xcvrprg &= ~CONFIG_SYS_FSL_USB_XCVRPRG_HS_DCNT_PROG_MASK |
89 INC_DCNT_THRESHOLD_50MV; 90 INC_DCNT_THRESHOLD_50MV;
90 /* Enable programming of USB High speed Disconnect threshold */ 91 /* Enable programming of USB High speed Disconnect threshold */
91 xcvrprg |= CONFIG_SYS_FSL_USB_XCVRPRG_HS_DCNT_PROG_EN; 92 xcvrprg |= CONFIG_SYS_FSL_USB_XCVRPRG_HS_DCNT_PROG_EN;
92 out_be32(&usb_phy->port1.xcvrprg, xcvrprg); 93 out_be32(&usb_phy->port1.xcvrprg, xcvrprg);
93 94
94 xcvrprg = in_be32(&usb_phy->port2.xcvrprg); 95 xcvrprg = in_be32(&usb_phy->port2.xcvrprg);
95 /* Increase Disconnect Threshold by 50mV */ 96 /* Increase Disconnect Threshold by 50mV */
96 xcvrprg &= ~CONFIG_SYS_FSL_USB_XCVRPRG_HS_DCNT_PROG_MASK | 97 xcvrprg &= ~CONFIG_SYS_FSL_USB_XCVRPRG_HS_DCNT_PROG_MASK |
97 INC_DCNT_THRESHOLD_50MV; 98 INC_DCNT_THRESHOLD_50MV;
98 /* Enable programming of USB High speed Disconnect threshold */ 99 /* Enable programming of USB High speed Disconnect threshold */
99 xcvrprg |= CONFIG_SYS_FSL_USB_XCVRPRG_HS_DCNT_PROG_EN; 100 xcvrprg |= CONFIG_SYS_FSL_USB_XCVRPRG_HS_DCNT_PROG_EN;
100 out_be32(&usb_phy->port2.xcvrprg, xcvrprg); 101 out_be32(&usb_phy->port2.xcvrprg, xcvrprg);
101 #else 102 #else
102 103
103 u32 temp = 0; 104 u32 temp = 0;
104 u32 status = in_be32(&usb_phy->status1); 105 u32 status = in_be32(&usb_phy->status1);
105 106
106 u32 squelch_prog_rd_0_2 = 107 u32 squelch_prog_rd_0_2 =
107 (status >> CONFIG_SYS_FSL_USB_SQUELCH_PROG_RD_0) 108 (status >> CONFIG_SYS_FSL_USB_SQUELCH_PROG_RD_0)
108 & CONFIG_SYS_FSL_USB_SQUELCH_PROG_MASK; 109 & CONFIG_SYS_FSL_USB_SQUELCH_PROG_MASK;
109 110
110 u32 squelch_prog_rd_3_5 = 111 u32 squelch_prog_rd_3_5 =
111 (status >> CONFIG_SYS_FSL_USB_SQUELCH_PROG_RD_3) 112 (status >> CONFIG_SYS_FSL_USB_SQUELCH_PROG_RD_3)
112 & CONFIG_SYS_FSL_USB_SQUELCH_PROG_MASK; 113 & CONFIG_SYS_FSL_USB_SQUELCH_PROG_MASK;
113 114
114 setbits_be32(&usb_phy->config1, 115 setbits_be32(&usb_phy->config1,
115 CONFIG_SYS_FSL_USB_HS_DISCNCT_INC); 116 CONFIG_SYS_FSL_USB_HS_DISCNCT_INC);
116 setbits_be32(&usb_phy->config2, 117 setbits_be32(&usb_phy->config2,
117 CONFIG_SYS_FSL_USB_RX_AUTO_CAL_RD_WR_SEL); 118 CONFIG_SYS_FSL_USB_RX_AUTO_CAL_RD_WR_SEL);
118 119
119 temp = squelch_prog_rd_0_2 << CONFIG_SYS_FSL_USB_SQUELCH_PROG_WR_3; 120 temp = squelch_prog_rd_0_2 << CONFIG_SYS_FSL_USB_SQUELCH_PROG_WR_3;
120 out_be32(&usb_phy->config2, in_be32(&usb_phy->config2) | temp); 121 out_be32(&usb_phy->config2, in_be32(&usb_phy->config2) | temp);
121 122
122 temp = squelch_prog_rd_3_5 << CONFIG_SYS_FSL_USB_SQUELCH_PROG_WR_0; 123 temp = squelch_prog_rd_3_5 << CONFIG_SYS_FSL_USB_SQUELCH_PROG_WR_0;
123 out_be32(&usb_phy->config2, in_be32(&usb_phy->config2) | temp); 124 out_be32(&usb_phy->config2, in_be32(&usb_phy->config2) | temp);
124 #endif 125 #endif
125 } 126 }
126 #endif 127 #endif
127 128
128 129
129 #if defined(CONFIG_QE) && !defined(CONFIG_U_QE) 130 #if defined(CONFIG_QE) && !defined(CONFIG_U_QE)
130 extern qe_iop_conf_t qe_iop_conf_tab[]; 131 extern qe_iop_conf_t qe_iop_conf_tab[];
131 extern void qe_config_iopin(u8 port, u8 pin, int dir, 132 extern void qe_config_iopin(u8 port, u8 pin, int dir,
132 int open_drain, int assign); 133 int open_drain, int assign);
133 extern void qe_init(uint qe_base); 134 extern void qe_init(uint qe_base);
134 extern void qe_reset(void); 135 extern void qe_reset(void);
135 136
136 static void config_qe_ioports(void) 137 static void config_qe_ioports(void)
137 { 138 {
138 u8 port, pin; 139 u8 port, pin;
139 int dir, open_drain, assign; 140 int dir, open_drain, assign;
140 int i; 141 int i;
141 142
142 for (i = 0; qe_iop_conf_tab[i].assign != QE_IOP_TAB_END; i++) { 143 for (i = 0; qe_iop_conf_tab[i].assign != QE_IOP_TAB_END; i++) {
143 port = qe_iop_conf_tab[i].port; 144 port = qe_iop_conf_tab[i].port;
144 pin = qe_iop_conf_tab[i].pin; 145 pin = qe_iop_conf_tab[i].pin;
145 dir = qe_iop_conf_tab[i].dir; 146 dir = qe_iop_conf_tab[i].dir;
146 open_drain = qe_iop_conf_tab[i].open_drain; 147 open_drain = qe_iop_conf_tab[i].open_drain;
147 assign = qe_iop_conf_tab[i].assign; 148 assign = qe_iop_conf_tab[i].assign;
148 qe_config_iopin(port, pin, dir, open_drain, assign); 149 qe_config_iopin(port, pin, dir, open_drain, assign);
149 } 150 }
150 } 151 }
151 #endif 152 #endif
152 153
153 #ifdef CONFIG_CPM2 154 #ifdef CONFIG_CPM2
154 void config_8560_ioports (volatile ccsr_cpm_t * cpm) 155 void config_8560_ioports (volatile ccsr_cpm_t * cpm)
155 { 156 {
156 int portnum; 157 int portnum;
157 158
158 for (portnum = 0; portnum < 4; portnum++) { 159 for (portnum = 0; portnum < 4; portnum++) {
159 uint pmsk = 0, 160 uint pmsk = 0,
160 ppar = 0, 161 ppar = 0,
161 psor = 0, 162 psor = 0,
162 pdir = 0, 163 pdir = 0,
163 podr = 0, 164 podr = 0,
164 pdat = 0; 165 pdat = 0;
165 iop_conf_t *iopc = (iop_conf_t *) & iop_conf_tab[portnum][0]; 166 iop_conf_t *iopc = (iop_conf_t *) & iop_conf_tab[portnum][0];
166 iop_conf_t *eiopc = iopc + 32; 167 iop_conf_t *eiopc = iopc + 32;
167 uint msk = 1; 168 uint msk = 1;
168 169
169 /* 170 /*
170 * NOTE: 171 * NOTE:
171 * index 0 refers to pin 31, 172 * index 0 refers to pin 31,
172 * index 31 refers to pin 0 173 * index 31 refers to pin 0
173 */ 174 */
174 while (iopc < eiopc) { 175 while (iopc < eiopc) {
175 if (iopc->conf) { 176 if (iopc->conf) {
176 pmsk |= msk; 177 pmsk |= msk;
177 if (iopc->ppar) 178 if (iopc->ppar)
178 ppar |= msk; 179 ppar |= msk;
179 if (iopc->psor) 180 if (iopc->psor)
180 psor |= msk; 181 psor |= msk;
181 if (iopc->pdir) 182 if (iopc->pdir)
182 pdir |= msk; 183 pdir |= msk;
183 if (iopc->podr) 184 if (iopc->podr)
184 podr |= msk; 185 podr |= msk;
185 if (iopc->pdat) 186 if (iopc->pdat)
186 pdat |= msk; 187 pdat |= msk;
187 } 188 }
188 189
189 msk <<= 1; 190 msk <<= 1;
190 iopc++; 191 iopc++;
191 } 192 }
192 193
193 if (pmsk != 0) { 194 if (pmsk != 0) {
194 volatile ioport_t *iop = ioport_addr (cpm, portnum); 195 volatile ioport_t *iop = ioport_addr (cpm, portnum);
195 uint tpmsk = ~pmsk; 196 uint tpmsk = ~pmsk;
196 197
197 /* 198 /*
198 * the (somewhat confused) paragraph at the 199 * the (somewhat confused) paragraph at the
199 * bottom of page 35-5 warns that there might 200 * bottom of page 35-5 warns that there might
200 * be "unknown behaviour" when programming 201 * be "unknown behaviour" when programming
201 * PSORx and PDIRx, if PPARx = 1, so I 202 * PSORx and PDIRx, if PPARx = 1, so I
202 * decided this meant I had to disable the 203 * decided this meant I had to disable the
203 * dedicated function first, and enable it 204 * dedicated function first, and enable it
204 * last. 205 * last.
205 */ 206 */
206 iop->ppar &= tpmsk; 207 iop->ppar &= tpmsk;
207 iop->psor = (iop->psor & tpmsk) | psor; 208 iop->psor = (iop->psor & tpmsk) | psor;
208 iop->podr = (iop->podr & tpmsk) | podr; 209 iop->podr = (iop->podr & tpmsk) | podr;
209 iop->pdat = (iop->pdat & tpmsk) | pdat; 210 iop->pdat = (iop->pdat & tpmsk) | pdat;
210 iop->pdir = (iop->pdir & tpmsk) | pdir; 211 iop->pdir = (iop->pdir & tpmsk) | pdir;
211 iop->ppar |= ppar; 212 iop->ppar |= ppar;
212 } 213 }
213 } 214 }
214 } 215 }
215 #endif 216 #endif
216 217
217 #ifdef CONFIG_SYS_FSL_CPC 218 #ifdef CONFIG_SYS_FSL_CPC
218 #if defined(CONFIG_RAMBOOT_PBL) || defined(CONFIG_SYS_CPC_REINIT_F) 219 #if defined(CONFIG_RAMBOOT_PBL) || defined(CONFIG_SYS_CPC_REINIT_F)
219 void disable_cpc_sram(void) 220 void disable_cpc_sram(void)
220 { 221 {
221 int i; 222 int i;
222 223
223 cpc_corenet_t *cpc = (cpc_corenet_t *)CONFIG_SYS_FSL_CPC_ADDR; 224 cpc_corenet_t *cpc = (cpc_corenet_t *)CONFIG_SYS_FSL_CPC_ADDR;
224 225
225 for (i = 0; i < CONFIG_SYS_NUM_CPC; i++, cpc++) { 226 for (i = 0; i < CONFIG_SYS_NUM_CPC; i++, cpc++) {
226 if (in_be32(&cpc->cpcsrcr0) & CPC_SRCR0_SRAMEN) { 227 if (in_be32(&cpc->cpcsrcr0) & CPC_SRCR0_SRAMEN) {
227 /* find and disable LAW of SRAM */ 228 /* find and disable LAW of SRAM */
228 struct law_entry law = find_law(CONFIG_SYS_INIT_L3_ADDR); 229 struct law_entry law = find_law(CONFIG_SYS_INIT_L3_ADDR);
229 230
230 if (law.index == -1) { 231 if (law.index == -1) {
231 printf("\nFatal error happened\n"); 232 printf("\nFatal error happened\n");
232 return; 233 return;
233 } 234 }
234 disable_law(law.index); 235 disable_law(law.index);
235 236
236 clrbits_be32(&cpc->cpchdbcr0, CPC_HDBCR0_CDQ_SPEC_DIS); 237 clrbits_be32(&cpc->cpchdbcr0, CPC_HDBCR0_CDQ_SPEC_DIS);
237 out_be32(&cpc->cpccsr0, 0); 238 out_be32(&cpc->cpccsr0, 0);
238 out_be32(&cpc->cpcsrcr0, 0); 239 out_be32(&cpc->cpcsrcr0, 0);
239 } 240 }
240 } 241 }
241 } 242 }
242 #endif 243 #endif
243 244
244 #if defined(T1040_TDM_QUIRK_CCSR_BASE) 245 #if defined(T1040_TDM_QUIRK_CCSR_BASE)
245 #ifdef CONFIG_POST 246 #ifdef CONFIG_POST
246 #error POST memory test cannot be enabled with TDM 247 #error POST memory test cannot be enabled with TDM
247 #endif 248 #endif
248 static void enable_tdm_law(void) 249 static void enable_tdm_law(void)
249 { 250 {
250 int ret; 251 int ret;
251 char buffer[HWCONFIG_BUFFER_SIZE] = {0}; 252 char buffer[HWCONFIG_BUFFER_SIZE] = {0};
252 int tdm_hwconfig_enabled = 0; 253 int tdm_hwconfig_enabled = 0;
253 254
254 /* 255 /*
255 * Extract hwconfig from environment since environment 256 * Extract hwconfig from environment since environment
256 * is not setup properly yet. Search for tdm entry in 257 * is not setup properly yet. Search for tdm entry in
257 * hwconfig. 258 * hwconfig.
258 */ 259 */
259 ret = env_get_f("hwconfig", buffer, sizeof(buffer)); 260 ret = env_get_f("hwconfig", buffer, sizeof(buffer));
260 if (ret > 0) { 261 if (ret > 0) {
261 tdm_hwconfig_enabled = hwconfig_f("tdm", buffer); 262 tdm_hwconfig_enabled = hwconfig_f("tdm", buffer);
262 /* If tdm is defined in hwconfig, set law for tdm workaround */ 263 /* If tdm is defined in hwconfig, set law for tdm workaround */
263 if (tdm_hwconfig_enabled) 264 if (tdm_hwconfig_enabled)
264 set_next_law(T1040_TDM_QUIRK_CCSR_BASE, LAW_SIZE_16M, 265 set_next_law(T1040_TDM_QUIRK_CCSR_BASE, LAW_SIZE_16M,
265 LAW_TRGT_IF_CCSR); 266 LAW_TRGT_IF_CCSR);
266 } 267 }
267 } 268 }
268 #endif 269 #endif
269 270
270 void enable_cpc(void) 271 void enable_cpc(void)
271 { 272 {
272 int i; 273 int i;
273 int ret; 274 int ret;
274 u32 size = 0; 275 u32 size = 0;
275 u32 cpccfg0; 276 u32 cpccfg0;
276 char buffer[HWCONFIG_BUFFER_SIZE]; 277 char buffer[HWCONFIG_BUFFER_SIZE];
277 char cpc_subarg[16]; 278 char cpc_subarg[16];
278 bool have_hwconfig = false; 279 bool have_hwconfig = false;
279 int cpc_args = 0; 280 int cpc_args = 0;
280 cpc_corenet_t *cpc = (cpc_corenet_t *)CONFIG_SYS_FSL_CPC_ADDR; 281 cpc_corenet_t *cpc = (cpc_corenet_t *)CONFIG_SYS_FSL_CPC_ADDR;
281 282
282 /* Extract hwconfig from environment */ 283 /* Extract hwconfig from environment */
283 ret = env_get_f("hwconfig", buffer, sizeof(buffer)); 284 ret = env_get_f("hwconfig", buffer, sizeof(buffer));
284 if (ret > 0) { 285 if (ret > 0) {
285 /* 286 /*
286 * If "en_cpc" is not defined in hwconfig then by default all 287 * If "en_cpc" is not defined in hwconfig then by default all
287 * cpcs are enable. If this config is defined then individual 288 * cpcs are enable. If this config is defined then individual
288 * cpcs which have to be enabled should also be defined. 289 * cpcs which have to be enabled should also be defined.
289 * e.g en_cpc:cpc1,cpc2; 290 * e.g en_cpc:cpc1,cpc2;
290 */ 291 */
291 if (hwconfig_f("en_cpc", buffer)) 292 if (hwconfig_f("en_cpc", buffer))
292 have_hwconfig = true; 293 have_hwconfig = true;
293 } 294 }
294 295
295 for (i = 0; i < CONFIG_SYS_NUM_CPC; i++, cpc++) { 296 for (i = 0; i < CONFIG_SYS_NUM_CPC; i++, cpc++) {
296 if (have_hwconfig) { 297 if (have_hwconfig) {
297 sprintf(cpc_subarg, "cpc%u", i + 1); 298 sprintf(cpc_subarg, "cpc%u", i + 1);
298 cpc_args = hwconfig_sub_f("en_cpc", cpc_subarg, buffer); 299 cpc_args = hwconfig_sub_f("en_cpc", cpc_subarg, buffer);
299 if (cpc_args == 0) 300 if (cpc_args == 0)
300 continue; 301 continue;
301 } 302 }
302 cpccfg0 = in_be32(&cpc->cpccfg0); 303 cpccfg0 = in_be32(&cpc->cpccfg0);
303 size += CPC_CFG0_SZ_K(cpccfg0); 304 size += CPC_CFG0_SZ_K(cpccfg0);
304 305
305 #ifdef CONFIG_SYS_FSL_ERRATUM_CPC_A002 306 #ifdef CONFIG_SYS_FSL_ERRATUM_CPC_A002
306 setbits_be32(&cpc->cpchdbcr0, CPC_HDBCR0_TAG_ECC_SCRUB_DIS); 307 setbits_be32(&cpc->cpchdbcr0, CPC_HDBCR0_TAG_ECC_SCRUB_DIS);
307 #endif 308 #endif
308 #ifdef CONFIG_SYS_FSL_ERRATUM_CPC_A003 309 #ifdef CONFIG_SYS_FSL_ERRATUM_CPC_A003
309 setbits_be32(&cpc->cpchdbcr0, CPC_HDBCR0_DATA_ECC_SCRUB_DIS); 310 setbits_be32(&cpc->cpchdbcr0, CPC_HDBCR0_DATA_ECC_SCRUB_DIS);
310 #endif 311 #endif
311 #ifdef CONFIG_SYS_FSL_ERRATUM_A006593 312 #ifdef CONFIG_SYS_FSL_ERRATUM_A006593
312 setbits_be32(&cpc->cpchdbcr0, 1 << (31 - 21)); 313 setbits_be32(&cpc->cpchdbcr0, 1 << (31 - 21));
313 #endif 314 #endif
314 #ifdef CONFIG_SYS_FSL_ERRATUM_A006379 315 #ifdef CONFIG_SYS_FSL_ERRATUM_A006379
315 if (has_erratum_a006379()) { 316 if (has_erratum_a006379()) {
316 setbits_be32(&cpc->cpchdbcr0, 317 setbits_be32(&cpc->cpchdbcr0,
317 CPC_HDBCR0_SPLRU_LEVEL_EN); 318 CPC_HDBCR0_SPLRU_LEVEL_EN);
318 } 319 }
319 #endif 320 #endif
320 321
321 out_be32(&cpc->cpccsr0, CPC_CSR0_CE | CPC_CSR0_PE); 322 out_be32(&cpc->cpccsr0, CPC_CSR0_CE | CPC_CSR0_PE);
322 /* Read back to sync write */ 323 /* Read back to sync write */
323 in_be32(&cpc->cpccsr0); 324 in_be32(&cpc->cpccsr0);
324 325
325 } 326 }
326 327
327 puts("Corenet Platform Cache: "); 328 puts("Corenet Platform Cache: ");
328 print_size(size * 1024, " enabled\n"); 329 print_size(size * 1024, " enabled\n");
329 } 330 }
330 331
331 static void invalidate_cpc(void) 332 static void invalidate_cpc(void)
332 { 333 {
333 int i; 334 int i;
334 cpc_corenet_t *cpc = (cpc_corenet_t *)CONFIG_SYS_FSL_CPC_ADDR; 335 cpc_corenet_t *cpc = (cpc_corenet_t *)CONFIG_SYS_FSL_CPC_ADDR;
335 336
336 for (i = 0; i < CONFIG_SYS_NUM_CPC; i++, cpc++) { 337 for (i = 0; i < CONFIG_SYS_NUM_CPC; i++, cpc++) {
337 /* skip CPC when it used as all SRAM */ 338 /* skip CPC when it used as all SRAM */
338 if (in_be32(&cpc->cpcsrcr0) & CPC_SRCR0_SRAMEN) 339 if (in_be32(&cpc->cpcsrcr0) & CPC_SRCR0_SRAMEN)
339 continue; 340 continue;
340 /* Flash invalidate the CPC and clear all the locks */ 341 /* Flash invalidate the CPC and clear all the locks */
341 out_be32(&cpc->cpccsr0, CPC_CSR0_FI | CPC_CSR0_LFC); 342 out_be32(&cpc->cpccsr0, CPC_CSR0_FI | CPC_CSR0_LFC);
342 while (in_be32(&cpc->cpccsr0) & (CPC_CSR0_FI | CPC_CSR0_LFC)) 343 while (in_be32(&cpc->cpccsr0) & (CPC_CSR0_FI | CPC_CSR0_LFC))
343 ; 344 ;
344 } 345 }
345 } 346 }
346 #else 347 #else
347 #define enable_cpc() 348 #define enable_cpc()
348 #define invalidate_cpc() 349 #define invalidate_cpc()
349 #define disable_cpc_sram() 350 #define disable_cpc_sram()
350 #endif /* CONFIG_SYS_FSL_CPC */ 351 #endif /* CONFIG_SYS_FSL_CPC */
351 352
352 /* 353 /*
353 * Breathe some life into the CPU... 354 * Breathe some life into the CPU...
354 * 355 *
355 * Set up the memory map 356 * Set up the memory map
356 * initialize a bunch of registers 357 * initialize a bunch of registers
357 */ 358 */
358 359
359 #ifdef CONFIG_FSL_CORENET 360 #ifdef CONFIG_FSL_CORENET
360 static void corenet_tb_init(void) 361 static void corenet_tb_init(void)
361 { 362 {
362 volatile ccsr_rcpm_t *rcpm = 363 volatile ccsr_rcpm_t *rcpm =
363 (void *)(CONFIG_SYS_FSL_CORENET_RCPM_ADDR); 364 (void *)(CONFIG_SYS_FSL_CORENET_RCPM_ADDR);
364 volatile ccsr_pic_t *pic = 365 volatile ccsr_pic_t *pic =
365 (void *)(CONFIG_SYS_MPC8xxx_PIC_ADDR); 366 (void *)(CONFIG_SYS_MPC8xxx_PIC_ADDR);
366 u32 whoami = in_be32(&pic->whoami); 367 u32 whoami = in_be32(&pic->whoami);
367 368
368 /* Enable the timebase register for this core */ 369 /* Enable the timebase register for this core */
369 out_be32(&rcpm->ctbenrl, (1 << whoami)); 370 out_be32(&rcpm->ctbenrl, (1 << whoami));
370 } 371 }
371 #endif 372 #endif
372 373
373 #ifdef CONFIG_SYS_FSL_ERRATUM_A007212 374 #ifdef CONFIG_SYS_FSL_ERRATUM_A007212
374 void fsl_erratum_a007212_workaround(void) 375 void fsl_erratum_a007212_workaround(void)
375 { 376 {
376 ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); 377 ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
377 u32 ddr_pll_ratio; 378 u32 ddr_pll_ratio;
378 u32 __iomem *plldgdcr1 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c20); 379 u32 __iomem *plldgdcr1 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c20);
379 u32 __iomem *plldadcr1 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c28); 380 u32 __iomem *plldadcr1 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c28);
380 u32 __iomem *dpdovrcr4 = (void *)(CONFIG_SYS_DCSRBAR + 0x21e80); 381 u32 __iomem *dpdovrcr4 = (void *)(CONFIG_SYS_DCSRBAR + 0x21e80);
381 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 2) 382 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 2)
382 u32 __iomem *plldgdcr2 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c40); 383 u32 __iomem *plldgdcr2 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c40);
383 u32 __iomem *plldadcr2 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c48); 384 u32 __iomem *plldadcr2 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c48);
384 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 3) 385 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 3)
385 u32 __iomem *plldgdcr3 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c60); 386 u32 __iomem *plldgdcr3 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c60);
386 u32 __iomem *plldadcr3 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c68); 387 u32 __iomem *plldadcr3 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c68);
387 #endif 388 #endif
388 #endif 389 #endif
389 /* 390 /*
390 * Even this workaround applies to selected version of SoCs, it is 391 * Even this workaround applies to selected version of SoCs, it is
391 * safe to apply to all versions, with the limitation of odd ratios. 392 * safe to apply to all versions, with the limitation of odd ratios.
392 * If RCW has disabled DDR PLL, we have to apply this workaround, 393 * If RCW has disabled DDR PLL, we have to apply this workaround,
393 * otherwise DDR will not work. 394 * otherwise DDR will not work.
394 */ 395 */
395 ddr_pll_ratio = (in_be32(&gur->rcwsr[0]) >> 396 ddr_pll_ratio = (in_be32(&gur->rcwsr[0]) >>
396 FSL_CORENET_RCWSR0_MEM_PLL_RAT_SHIFT) & 397 FSL_CORENET_RCWSR0_MEM_PLL_RAT_SHIFT) &
397 FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK; 398 FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK;
398 /* check if RCW sets ratio to 0, required by this workaround */ 399 /* check if RCW sets ratio to 0, required by this workaround */
399 if (ddr_pll_ratio != 0) 400 if (ddr_pll_ratio != 0)
400 return; 401 return;
401 ddr_pll_ratio = (in_be32(&gur->rcwsr[0]) >> 402 ddr_pll_ratio = (in_be32(&gur->rcwsr[0]) >>
402 FSL_CORENET_RCWSR0_MEM_PLL_RAT_RESV_SHIFT) & 403 FSL_CORENET_RCWSR0_MEM_PLL_RAT_RESV_SHIFT) &
403 FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK; 404 FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK;
404 /* check if reserved bits have the desired ratio */ 405 /* check if reserved bits have the desired ratio */
405 if (ddr_pll_ratio == 0) { 406 if (ddr_pll_ratio == 0) {
406 printf("Error: Unknown DDR PLL ratio!\n"); 407 printf("Error: Unknown DDR PLL ratio!\n");
407 return; 408 return;
408 } 409 }
409 ddr_pll_ratio >>= 1; 410 ddr_pll_ratio >>= 1;
410 411
411 setbits_be32(plldadcr1, 0x02000001); 412 setbits_be32(plldadcr1, 0x02000001);
412 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 2) 413 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 2)
413 setbits_be32(plldadcr2, 0x02000001); 414 setbits_be32(plldadcr2, 0x02000001);
414 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 3) 415 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 3)
415 setbits_be32(plldadcr3, 0x02000001); 416 setbits_be32(plldadcr3, 0x02000001);
416 #endif 417 #endif
417 #endif 418 #endif
418 setbits_be32(dpdovrcr4, 0xe0000000); 419 setbits_be32(dpdovrcr4, 0xe0000000);
419 out_be32(plldgdcr1, 0x08000001 | (ddr_pll_ratio << 1)); 420 out_be32(plldgdcr1, 0x08000001 | (ddr_pll_ratio << 1));
420 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 2) 421 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 2)
421 out_be32(plldgdcr2, 0x08000001 | (ddr_pll_ratio << 1)); 422 out_be32(plldgdcr2, 0x08000001 | (ddr_pll_ratio << 1));
422 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 3) 423 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 3)
423 out_be32(plldgdcr3, 0x08000001 | (ddr_pll_ratio << 1)); 424 out_be32(plldgdcr3, 0x08000001 | (ddr_pll_ratio << 1));
424 #endif 425 #endif
425 #endif 426 #endif
426 udelay(100); 427 udelay(100);
427 clrbits_be32(plldadcr1, 0x02000001); 428 clrbits_be32(plldadcr1, 0x02000001);
428 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 2) 429 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 2)
429 clrbits_be32(plldadcr2, 0x02000001); 430 clrbits_be32(plldadcr2, 0x02000001);
430 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 3) 431 #if (CONFIG_SYS_NUM_DDR_CTLRS >= 3)
431 clrbits_be32(plldadcr3, 0x02000001); 432 clrbits_be32(plldadcr3, 0x02000001);
432 #endif 433 #endif
433 #endif 434 #endif
434 clrbits_be32(dpdovrcr4, 0xe0000000); 435 clrbits_be32(dpdovrcr4, 0xe0000000);
435 } 436 }
436 #endif 437 #endif
437 438
438 ulong cpu_init_f(void) 439 ulong cpu_init_f(void)
439 { 440 {
440 extern void m8560_cpm_reset (void); 441 extern void m8560_cpm_reset (void);
441 #ifdef CONFIG_SYS_DCSRBAR_PHYS 442 #ifdef CONFIG_SYS_DCSRBAR_PHYS
442 ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); 443 ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
443 #endif 444 #endif
444 #if defined(CONFIG_SECURE_BOOT) && !defined(CONFIG_SYS_RAMBOOT) 445 #if defined(CONFIG_SECURE_BOOT) && !defined(CONFIG_SYS_RAMBOOT)
445 struct law_entry law; 446 struct law_entry law;
446 #endif 447 #endif
447 #ifdef CONFIG_ARCH_MPC8548 448 #ifdef CONFIG_ARCH_MPC8548
448 ccsr_local_ecm_t *ecm = (void *)(CONFIG_SYS_MPC85xx_ECM_ADDR); 449 ccsr_local_ecm_t *ecm = (void *)(CONFIG_SYS_MPC85xx_ECM_ADDR);
449 uint svr = get_svr(); 450 uint svr = get_svr();
450 451
451 /* 452 /*
452 * CPU2 errata workaround: A core hang possible while executing 453 * CPU2 errata workaround: A core hang possible while executing
453 * a msync instruction and a snoopable transaction from an I/O 454 * a msync instruction and a snoopable transaction from an I/O
454 * master tagged to make quick forward progress is present. 455 * master tagged to make quick forward progress is present.
455 * Fixed in silicon rev 2.1. 456 * Fixed in silicon rev 2.1.
456 */ 457 */
457 if ((SVR_MAJ(svr) == 1) || ((SVR_MAJ(svr) == 2 && SVR_MIN(svr) == 0x0))) 458 if ((SVR_MAJ(svr) == 1) || ((SVR_MAJ(svr) == 2 && SVR_MIN(svr) == 0x0)))
458 out_be32(&ecm->eebpcr, in_be32(&ecm->eebpcr) | (1 << 16)); 459 out_be32(&ecm->eebpcr, in_be32(&ecm->eebpcr) | (1 << 16));
459 #endif 460 #endif
460 461
461 disable_tlb(14); 462 disable_tlb(14);
462 disable_tlb(15); 463 disable_tlb(15);
463 464
464 #if defined(CONFIG_SECURE_BOOT) && !defined(CONFIG_SYS_RAMBOOT) 465 #if defined(CONFIG_SECURE_BOOT) && !defined(CONFIG_SYS_RAMBOOT)
465 /* Disable the LAW created for NOR flash by the PBI commands */ 466 /* Disable the LAW created for NOR flash by the PBI commands */
466 law = find_law(CONFIG_SYS_PBI_FLASH_BASE); 467 law = find_law(CONFIG_SYS_PBI_FLASH_BASE);
467 if (law.index != -1) 468 if (law.index != -1)
468 disable_law(law.index); 469 disable_law(law.index);
469 470
470 #if defined(CONFIG_SYS_CPC_REINIT_F) 471 #if defined(CONFIG_SYS_CPC_REINIT_F)
471 disable_cpc_sram(); 472 disable_cpc_sram();
472 #endif 473 #endif
473 #endif 474 #endif
474 475
475 #ifdef CONFIG_CPM2 476 #ifdef CONFIG_CPM2
476 config_8560_ioports((ccsr_cpm_t *)CONFIG_SYS_MPC85xx_CPM_ADDR); 477 config_8560_ioports((ccsr_cpm_t *)CONFIG_SYS_MPC85xx_CPM_ADDR);
477 #endif 478 #endif
478 479
479 init_early_memctl_regs(); 480 init_early_memctl_regs();
480 481
481 #if defined(CONFIG_CPM2) 482 #if defined(CONFIG_CPM2)
482 m8560_cpm_reset(); 483 m8560_cpm_reset();
483 #endif 484 #endif
484 485
485 #if defined(CONFIG_QE) && !defined(CONFIG_U_QE) 486 #if defined(CONFIG_QE) && !defined(CONFIG_U_QE)
486 /* Config QE ioports */ 487 /* Config QE ioports */
487 config_qe_ioports(); 488 config_qe_ioports();
488 #endif 489 #endif
489 490
490 #if defined(CONFIG_FSL_DMA) 491 #if defined(CONFIG_FSL_DMA)
491 dma_init(); 492 dma_init();
492 #endif 493 #endif
493 #ifdef CONFIG_FSL_CORENET 494 #ifdef CONFIG_FSL_CORENET
494 corenet_tb_init(); 495 corenet_tb_init();
495 #endif 496 #endif
496 init_used_tlb_cams(); 497 init_used_tlb_cams();
497 498
498 /* Invalidate the CPC before DDR gets enabled */ 499 /* Invalidate the CPC before DDR gets enabled */
499 invalidate_cpc(); 500 invalidate_cpc();
500 501
501 #ifdef CONFIG_SYS_DCSRBAR_PHYS 502 #ifdef CONFIG_SYS_DCSRBAR_PHYS
502 /* set DCSRCR so that DCSR space is 1G */ 503 /* set DCSRCR so that DCSR space is 1G */
503 setbits_be32(&gur->dcsrcr, FSL_CORENET_DCSR_SZ_1G); 504 setbits_be32(&gur->dcsrcr, FSL_CORENET_DCSR_SZ_1G);
504 in_be32(&gur->dcsrcr); 505 in_be32(&gur->dcsrcr);
505 #endif 506 #endif
506 507
507 #ifdef CONFIG_SYS_FSL_ERRATUM_A007212 508 #ifdef CONFIG_SYS_FSL_ERRATUM_A007212
508 fsl_erratum_a007212_workaround(); 509 fsl_erratum_a007212_workaround();
509 #endif 510 #endif
510 511
511 return 0; 512 return 0;
512 } 513 }
513 514
514 /* Implement a dummy function for those platforms w/o SERDES */ 515 /* Implement a dummy function for those platforms w/o SERDES */
515 static void __fsl_serdes__init(void) 516 static void __fsl_serdes__init(void)
516 { 517 {
517 return ; 518 return ;
518 } 519 }
519 __attribute__((weak, alias("__fsl_serdes__init"))) void fsl_serdes_init(void); 520 __attribute__((weak, alias("__fsl_serdes__init"))) void fsl_serdes_init(void);
520 521
521 #if defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && defined(CONFIG_E6500) 522 #if defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && defined(CONFIG_E6500)
522 int enable_cluster_l2(void) 523 int enable_cluster_l2(void)
523 { 524 {
524 int i = 0; 525 int i = 0;
525 u32 cluster, svr = get_svr(); 526 u32 cluster, svr = get_svr();
526 ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); 527 ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
527 struct ccsr_cluster_l2 __iomem *l2cache; 528 struct ccsr_cluster_l2 __iomem *l2cache;
528 529
529 /* only the L2 of first cluster should be enabled as expected on T4080, 530 /* only the L2 of first cluster should be enabled as expected on T4080,
530 * but there is no EOC in the first cluster as HW sake, so return here 531 * but there is no EOC in the first cluster as HW sake, so return here
531 * to skip enabling L2 cache of the 2nd cluster. 532 * to skip enabling L2 cache of the 2nd cluster.
532 */ 533 */
533 if (SVR_SOC_VER(svr) == SVR_T4080) 534 if (SVR_SOC_VER(svr) == SVR_T4080)
534 return 0; 535 return 0;
535 536
536 cluster = in_be32(&gur->tp_cluster[i].lower); 537 cluster = in_be32(&gur->tp_cluster[i].lower);
537 if (cluster & TP_CLUSTER_EOC) 538 if (cluster & TP_CLUSTER_EOC)
538 return 0; 539 return 0;
539 540
540 /* The first cache has already been set up, so skip it */ 541 /* The first cache has already been set up, so skip it */
541 i++; 542 i++;
542 543
543 /* Look through the remaining clusters, and set up their caches */ 544 /* Look through the remaining clusters, and set up their caches */
544 do { 545 do {
545 int j, cluster_valid = 0; 546 int j, cluster_valid = 0;
546 547
547 l2cache = (void __iomem *)(CONFIG_SYS_FSL_CLUSTER_1_L2 + i * 0x40000); 548 l2cache = (void __iomem *)(CONFIG_SYS_FSL_CLUSTER_1_L2 + i * 0x40000);
548 549
549 cluster = in_be32(&gur->tp_cluster[i].lower); 550 cluster = in_be32(&gur->tp_cluster[i].lower);
550 551
551 /* check that at least one core/accel is enabled in cluster */ 552 /* check that at least one core/accel is enabled in cluster */
552 for (j = 0; j < 4; j++) { 553 for (j = 0; j < 4; j++) {
553 u32 idx = (cluster >> (j*8)) & TP_CLUSTER_INIT_MASK; 554 u32 idx = (cluster >> (j*8)) & TP_CLUSTER_INIT_MASK;
554 u32 type = in_be32(&gur->tp_ityp[idx]); 555 u32 type = in_be32(&gur->tp_ityp[idx]);
555 556
556 if ((type & TP_ITYP_AV) && 557 if ((type & TP_ITYP_AV) &&
557 TP_ITYP_TYPE(type) == TP_ITYP_TYPE_PPC) 558 TP_ITYP_TYPE(type) == TP_ITYP_TYPE_PPC)
558 cluster_valid = 1; 559 cluster_valid = 1;
559 } 560 }
560 561
561 if (cluster_valid) { 562 if (cluster_valid) {
562 /* set stash ID to (cluster) * 2 + 32 + 1 */ 563 /* set stash ID to (cluster) * 2 + 32 + 1 */
563 clrsetbits_be32(&l2cache->l2csr1, 0xff, 32 + i * 2 + 1); 564 clrsetbits_be32(&l2cache->l2csr1, 0xff, 32 + i * 2 + 1);
564 565
565 printf("enable l2 for cluster %d %p\n", i, l2cache); 566 printf("enable l2 for cluster %d %p\n", i, l2cache);
566 567
567 out_be32(&l2cache->l2csr0, L2CSR0_L2FI|L2CSR0_L2LFC); 568 out_be32(&l2cache->l2csr0, L2CSR0_L2FI|L2CSR0_L2LFC);
568 while ((in_be32(&l2cache->l2csr0) 569 while ((in_be32(&l2cache->l2csr0)
569 & (L2CSR0_L2FI|L2CSR0_L2LFC)) != 0) 570 & (L2CSR0_L2FI|L2CSR0_L2LFC)) != 0)
570 ; 571 ;
571 out_be32(&l2cache->l2csr0, L2CSR0_L2E|L2CSR0_L2PE|L2CSR0_L2REP_MODE); 572 out_be32(&l2cache->l2csr0, L2CSR0_L2E|L2CSR0_L2PE|L2CSR0_L2REP_MODE);
572 } 573 }
573 i++; 574 i++;
574 } while (!(cluster & TP_CLUSTER_EOC)); 575 } while (!(cluster & TP_CLUSTER_EOC));
575 576
576 return 0; 577 return 0;
577 } 578 }
578 #endif 579 #endif
579 580
580 /* 581 /*
581 * Initialize L2 as cache. 582 * Initialize L2 as cache.
582 */ 583 */
583 int l2cache_init(void) 584 int l2cache_init(void)
584 { 585 {
585 __maybe_unused u32 svr = get_svr(); 586 __maybe_unused u32 svr = get_svr();
586 #ifdef CONFIG_L2_CACHE 587 #ifdef CONFIG_L2_CACHE
587 ccsr_l2cache_t *l2cache = (void __iomem *)CONFIG_SYS_MPC85xx_L2_ADDR; 588 ccsr_l2cache_t *l2cache = (void __iomem *)CONFIG_SYS_MPC85xx_L2_ADDR;
588 #elif defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && defined(CONFIG_E6500) 589 #elif defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && defined(CONFIG_E6500)
589 struct ccsr_cluster_l2 * l2cache = (void __iomem *)CONFIG_SYS_FSL_CLUSTER_1_L2; 590 struct ccsr_cluster_l2 * l2cache = (void __iomem *)CONFIG_SYS_FSL_CLUSTER_1_L2;
590 #endif 591 #endif
591 592
592 puts ("L2: "); 593 puts ("L2: ");
593 594
594 #if defined(CONFIG_L2_CACHE) 595 #if defined(CONFIG_L2_CACHE)
595 volatile uint cache_ctl; 596 volatile uint cache_ctl;
596 uint ver; 597 uint ver;
597 u32 l2siz_field; 598 u32 l2siz_field;
598 599
599 ver = SVR_SOC_VER(svr); 600 ver = SVR_SOC_VER(svr);
600 601
601 asm("msync;isync"); 602 asm("msync;isync");
602 cache_ctl = l2cache->l2ctl; 603 cache_ctl = l2cache->l2ctl;
603 604
604 #if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR) 605 #if defined(CONFIG_SYS_RAMBOOT) && defined(CONFIG_SYS_INIT_L2_ADDR)
605 if (cache_ctl & MPC85xx_L2CTL_L2E) { 606 if (cache_ctl & MPC85xx_L2CTL_L2E) {
606 /* Clear L2 SRAM memory-mapped base address */ 607 /* Clear L2 SRAM memory-mapped base address */
607 out_be32(&l2cache->l2srbar0, 0x0); 608 out_be32(&l2cache->l2srbar0, 0x0);
608 out_be32(&l2cache->l2srbar1, 0x0); 609 out_be32(&l2cache->l2srbar1, 0x0);
609 610
610 /* set MBECCDIS=0, SBECCDIS=0 */ 611 /* set MBECCDIS=0, SBECCDIS=0 */
611 clrbits_be32(&l2cache->l2errdis, 612 clrbits_be32(&l2cache->l2errdis,
612 (MPC85xx_L2ERRDIS_MBECC | 613 (MPC85xx_L2ERRDIS_MBECC |
613 MPC85xx_L2ERRDIS_SBECC)); 614 MPC85xx_L2ERRDIS_SBECC));
614 615
615 /* set L2E=0, L2SRAM=0 */ 616 /* set L2E=0, L2SRAM=0 */
616 clrbits_be32(&l2cache->l2ctl, 617 clrbits_be32(&l2cache->l2ctl,
617 (MPC85xx_L2CTL_L2E | 618 (MPC85xx_L2CTL_L2E |
618 MPC85xx_L2CTL_L2SRAM_ENTIRE)); 619 MPC85xx_L2CTL_L2SRAM_ENTIRE));
619 } 620 }
620 #endif 621 #endif
621 622
622 l2siz_field = (cache_ctl >> 28) & 0x3; 623 l2siz_field = (cache_ctl >> 28) & 0x3;
623 624
624 switch (l2siz_field) { 625 switch (l2siz_field) {
625 case 0x0: 626 case 0x0:
626 printf(" unknown size (0x%08x)\n", cache_ctl); 627 printf(" unknown size (0x%08x)\n", cache_ctl);
627 return -1; 628 return -1;
628 break; 629 break;
629 case 0x1: 630 case 0x1:
630 if (ver == SVR_8540 || ver == SVR_8560 || 631 if (ver == SVR_8540 || ver == SVR_8560 ||
631 ver == SVR_8541 || ver == SVR_8555) { 632 ver == SVR_8541 || ver == SVR_8555) {
632 puts("128 KiB "); 633 puts("128 KiB ");
633 /* set L2E=1, L2I=1, & L2BLKSZ=1 (128 KiBibyte) */ 634 /* set L2E=1, L2I=1, & L2BLKSZ=1 (128 KiBibyte) */
634 cache_ctl = 0xc4000000; 635 cache_ctl = 0xc4000000;
635 } else { 636 } else {
636 puts("256 KiB "); 637 puts("256 KiB ");
637 cache_ctl = 0xc0000000; /* set L2E=1, L2I=1, & L2SRAM=0 */ 638 cache_ctl = 0xc0000000; /* set L2E=1, L2I=1, & L2SRAM=0 */
638 } 639 }
639 break; 640 break;
640 case 0x2: 641 case 0x2:
641 if (ver == SVR_8540 || ver == SVR_8560 || 642 if (ver == SVR_8540 || ver == SVR_8560 ||
642 ver == SVR_8541 || ver == SVR_8555) { 643 ver == SVR_8541 || ver == SVR_8555) {
643 puts("256 KiB "); 644 puts("256 KiB ");
644 /* set L2E=1, L2I=1, & L2BLKSZ=2 (256 KiBibyte) */ 645 /* set L2E=1, L2I=1, & L2BLKSZ=2 (256 KiBibyte) */
645 cache_ctl = 0xc8000000; 646 cache_ctl = 0xc8000000;
646 } else { 647 } else {
647 puts("512 KiB "); 648 puts("512 KiB ");
648 /* set L2E=1, L2I=1, & L2SRAM=0 */ 649 /* set L2E=1, L2I=1, & L2SRAM=0 */
649 cache_ctl = 0xc0000000; 650 cache_ctl = 0xc0000000;
650 } 651 }
651 break; 652 break;
652 case 0x3: 653 case 0x3:
653 puts("1024 KiB "); 654 puts("1024 KiB ");
654 /* set L2E=1, L2I=1, & L2SRAM=0 */ 655 /* set L2E=1, L2I=1, & L2SRAM=0 */
655 cache_ctl = 0xc0000000; 656 cache_ctl = 0xc0000000;
656 break; 657 break;
657 } 658 }
658 659
659 if (l2cache->l2ctl & MPC85xx_L2CTL_L2E) { 660 if (l2cache->l2ctl & MPC85xx_L2CTL_L2E) {
660 puts("already enabled"); 661 puts("already enabled");
661 #if defined(CONFIG_SYS_INIT_L2_ADDR) && defined(CONFIG_SYS_FLASH_BASE) 662 #if defined(CONFIG_SYS_INIT_L2_ADDR) && defined(CONFIG_SYS_FLASH_BASE)
662 u32 l2srbar = l2cache->l2srbar0; 663 u32 l2srbar = l2cache->l2srbar0;
663 if (l2cache->l2ctl & MPC85xx_L2CTL_L2SRAM_ENTIRE 664 if (l2cache->l2ctl & MPC85xx_L2CTL_L2SRAM_ENTIRE
664 && l2srbar >= CONFIG_SYS_FLASH_BASE) { 665 && l2srbar >= CONFIG_SYS_FLASH_BASE) {
665 l2srbar = CONFIG_SYS_INIT_L2_ADDR; 666 l2srbar = CONFIG_SYS_INIT_L2_ADDR;
666 l2cache->l2srbar0 = l2srbar; 667 l2cache->l2srbar0 = l2srbar;
667 printf(", moving to 0x%08x", CONFIG_SYS_INIT_L2_ADDR); 668 printf(", moving to 0x%08x", CONFIG_SYS_INIT_L2_ADDR);
668 } 669 }
669 #endif /* CONFIG_SYS_INIT_L2_ADDR */ 670 #endif /* CONFIG_SYS_INIT_L2_ADDR */
670 puts("\n"); 671 puts("\n");
671 } else { 672 } else {
672 asm("msync;isync"); 673 asm("msync;isync");
673 l2cache->l2ctl = cache_ctl; /* invalidate & enable */ 674 l2cache->l2ctl = cache_ctl; /* invalidate & enable */
674 asm("msync;isync"); 675 asm("msync;isync");
675 puts("enabled\n"); 676 puts("enabled\n");
676 } 677 }
677 #elif defined(CONFIG_BACKSIDE_L2_CACHE) 678 #elif defined(CONFIG_BACKSIDE_L2_CACHE)
678 if (SVR_SOC_VER(svr) == SVR_P2040) { 679 if (SVR_SOC_VER(svr) == SVR_P2040) {
679 puts("N/A\n"); 680 puts("N/A\n");
680 goto skip_l2; 681 goto skip_l2;
681 } 682 }
682 683
683 u32 l2cfg0 = mfspr(SPRN_L2CFG0); 684 u32 l2cfg0 = mfspr(SPRN_L2CFG0);
684 685
685 /* invalidate the L2 cache */ 686 /* invalidate the L2 cache */
686 mtspr(SPRN_L2CSR0, (L2CSR0_L2FI|L2CSR0_L2LFC)); 687 mtspr(SPRN_L2CSR0, (L2CSR0_L2FI|L2CSR0_L2LFC));
687 while (mfspr(SPRN_L2CSR0) & (L2CSR0_L2FI|L2CSR0_L2LFC)) 688 while (mfspr(SPRN_L2CSR0) & (L2CSR0_L2FI|L2CSR0_L2LFC))
688 ; 689 ;
689 690
690 #ifdef CONFIG_SYS_CACHE_STASHING 691 #ifdef CONFIG_SYS_CACHE_STASHING
691 /* set stash id to (coreID) * 2 + 32 + L2 (1) */ 692 /* set stash id to (coreID) * 2 + 32 + L2 (1) */
692 mtspr(SPRN_L2CSR1, (32 + 1)); 693 mtspr(SPRN_L2CSR1, (32 + 1));
693 #endif 694 #endif
694 695
695 /* enable the cache */ 696 /* enable the cache */
696 mtspr(SPRN_L2CSR0, CONFIG_SYS_INIT_L2CSR0); 697 mtspr(SPRN_L2CSR0, CONFIG_SYS_INIT_L2CSR0);
697 698
698 if (CONFIG_SYS_INIT_L2CSR0 & L2CSR0_L2E) { 699 if (CONFIG_SYS_INIT_L2CSR0 & L2CSR0_L2E) {
699 while (!(mfspr(SPRN_L2CSR0) & L2CSR0_L2E)) 700 while (!(mfspr(SPRN_L2CSR0) & L2CSR0_L2E))
700 ; 701 ;
701 print_size((l2cfg0 & 0x3fff) * 64 * 1024, " enabled\n"); 702 print_size((l2cfg0 & 0x3fff) * 64 * 1024, " enabled\n");
702 } 703 }
703 704
704 skip_l2: 705 skip_l2:
705 #elif defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && defined(CONFIG_E6500) 706 #elif defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && defined(CONFIG_E6500)
706 if (l2cache->l2csr0 & L2CSR0_L2E) 707 if (l2cache->l2csr0 & L2CSR0_L2E)
707 print_size((l2cache->l2cfg0 & 0x3fff) * 64 * 1024, 708 print_size((l2cache->l2cfg0 & 0x3fff) * 64 * 1024,
708 " enabled\n"); 709 " enabled\n");
709 710
710 enable_cluster_l2(); 711 enable_cluster_l2();
711 #else 712 #else
712 puts("disabled\n"); 713 puts("disabled\n");
713 #endif 714 #endif
714 715
715 return 0; 716 return 0;
716 } 717 }
717 718
718 /* 719 /*
719 * 720 *
720 * The newer 8548, etc, parts have twice as much cache, but 721 * The newer 8548, etc, parts have twice as much cache, but
721 * use the same bit-encoding as the older 8555, etc, parts. 722 * use the same bit-encoding as the older 8555, etc, parts.
722 * 723 *
723 */ 724 */
724 int cpu_init_r(void) 725 int cpu_init_r(void)
725 { 726 {
726 __maybe_unused u32 svr = get_svr(); 727 __maybe_unused u32 svr = get_svr();
727 #ifdef CONFIG_SYS_LBC_LCRR 728 #ifdef CONFIG_SYS_LBC_LCRR
728 fsl_lbc_t *lbc = (void __iomem *)LBC_BASE_ADDR; 729 fsl_lbc_t *lbc = (void __iomem *)LBC_BASE_ADDR;
729 #endif 730 #endif
730 #if defined(CONFIG_PPC_SPINTABLE_COMPATIBLE) && defined(CONFIG_MP) 731 #if defined(CONFIG_PPC_SPINTABLE_COMPATIBLE) && defined(CONFIG_MP)
731 extern int spin_table_compat; 732 extern int spin_table_compat;
732 const char *spin; 733 const char *spin;
733 #endif 734 #endif
734 #ifdef CONFIG_SYS_FSL_ERRATUM_SEC_A003571 735 #ifdef CONFIG_SYS_FSL_ERRATUM_SEC_A003571
735 ccsr_sec_t __iomem *sec = (void *)CONFIG_SYS_FSL_SEC_ADDR; 736 ccsr_sec_t __iomem *sec = (void *)CONFIG_SYS_FSL_SEC_ADDR;
736 #endif 737 #endif
737 #if defined(CONFIG_SYS_P4080_ERRATUM_CPU22) || \ 738 #if defined(CONFIG_SYS_P4080_ERRATUM_CPU22) || \
738 defined(CONFIG_SYS_FSL_ERRATUM_NMG_CPU_A011) 739 defined(CONFIG_SYS_FSL_ERRATUM_NMG_CPU_A011)
739 /* 740 /*
740 * CPU22 and NMG_CPU_A011 share the same workaround. 741 * CPU22 and NMG_CPU_A011 share the same workaround.
741 * CPU22 applies to P4080 rev 1.0, 2.0, fixed in 3.0 742 * CPU22 applies to P4080 rev 1.0, 2.0, fixed in 3.0
742 * NMG_CPU_A011 applies to P4080 rev 1.0, 2.0, fixed in 3.0 743 * NMG_CPU_A011 applies to P4080 rev 1.0, 2.0, fixed in 3.0
743 * also applies to P3041 rev 1.0, 1.1, P2041 rev 1.0, 1.1, both 744 * also applies to P3041 rev 1.0, 1.1, P2041 rev 1.0, 1.1, both
744 * fixed in 2.0. NMG_CPU_A011 is activated by default and can 745 * fixed in 2.0. NMG_CPU_A011 is activated by default and can
745 * be disabled by hwconfig with syntax: 746 * be disabled by hwconfig with syntax:
746 * 747 *
747 * fsl_cpu_a011:disable 748 * fsl_cpu_a011:disable
748 */ 749 */
749 extern int enable_cpu_a011_workaround; 750 extern int enable_cpu_a011_workaround;
750 #ifdef CONFIG_SYS_P4080_ERRATUM_CPU22 751 #ifdef CONFIG_SYS_P4080_ERRATUM_CPU22
751 enable_cpu_a011_workaround = (SVR_MAJ(svr) < 3); 752 enable_cpu_a011_workaround = (SVR_MAJ(svr) < 3);
752 #else 753 #else
753 char buffer[HWCONFIG_BUFFER_SIZE]; 754 char buffer[HWCONFIG_BUFFER_SIZE];
754 char *buf = NULL; 755 char *buf = NULL;
755 int n, res; 756 int n, res;
756 757
757 n = env_get_f("hwconfig", buffer, sizeof(buffer)); 758 n = env_get_f("hwconfig", buffer, sizeof(buffer));
758 if (n > 0) 759 if (n > 0)
759 buf = buffer; 760 buf = buffer;
760 761
761 res = hwconfig_arg_cmp_f("fsl_cpu_a011", "disable", buf); 762 res = hwconfig_arg_cmp_f("fsl_cpu_a011", "disable", buf);
762 if (res > 0) { 763 if (res > 0) {
763 enable_cpu_a011_workaround = 0; 764 enable_cpu_a011_workaround = 0;
764 } else { 765 } else {
765 if (n >= HWCONFIG_BUFFER_SIZE) { 766 if (n >= HWCONFIG_BUFFER_SIZE) {
766 printf("fsl_cpu_a011 was not found. hwconfig variable " 767 printf("fsl_cpu_a011 was not found. hwconfig variable "
767 "may be too long\n"); 768 "may be too long\n");
768 } 769 }
769 enable_cpu_a011_workaround = 770 enable_cpu_a011_workaround =
770 (SVR_SOC_VER(svr) == SVR_P4080 && SVR_MAJ(svr) < 3) || 771 (SVR_SOC_VER(svr) == SVR_P4080 && SVR_MAJ(svr) < 3) ||
771 (SVR_SOC_VER(svr) != SVR_P4080 && SVR_MAJ(svr) < 2); 772 (SVR_SOC_VER(svr) != SVR_P4080 && SVR_MAJ(svr) < 2);
772 } 773 }
773 #endif 774 #endif
774 if (enable_cpu_a011_workaround) { 775 if (enable_cpu_a011_workaround) {
775 flush_dcache(); 776 flush_dcache();
776 mtspr(L1CSR2, (mfspr(L1CSR2) | L1CSR2_DCWS)); 777 mtspr(L1CSR2, (mfspr(L1CSR2) | L1CSR2_DCWS));
777 sync(); 778 sync();
778 } 779 }
779 #endif 780 #endif
780 781
781 #ifdef CONFIG_SYS_FSL_ERRATUM_A007907 782 #ifdef CONFIG_SYS_FSL_ERRATUM_A007907
782 flush_dcache(); 783 flush_dcache();
783 mtspr(L1CSR2, (mfspr(L1CSR2) & ~L1CSR2_DCSTASHID)); 784 mtspr(L1CSR2, (mfspr(L1CSR2) & ~L1CSR2_DCSTASHID));
784 sync(); 785 sync();
785 #endif 786 #endif
786 787
787 #ifdef CONFIG_SYS_FSL_ERRATUM_A005812 788 #ifdef CONFIG_SYS_FSL_ERRATUM_A005812
788 /* 789 /*
789 * A-005812 workaround sets bit 32 of SPR 976 for SoCs running 790 * A-005812 workaround sets bit 32 of SPR 976 for SoCs running
790 * in write shadow mode. Checking DCWS before setting SPR 976. 791 * in write shadow mode. Checking DCWS before setting SPR 976.
791 */ 792 */
792 if (mfspr(L1CSR2) & L1CSR2_DCWS) 793 if (mfspr(L1CSR2) & L1CSR2_DCWS)
793 mtspr(SPRN_HDBCR0, (mfspr(SPRN_HDBCR0) | 0x80000000)); 794 mtspr(SPRN_HDBCR0, (mfspr(SPRN_HDBCR0) | 0x80000000));
794 #endif 795 #endif
795 796
796 #if defined(CONFIG_PPC_SPINTABLE_COMPATIBLE) && defined(CONFIG_MP) 797 #if defined(CONFIG_PPC_SPINTABLE_COMPATIBLE) && defined(CONFIG_MP)
797 spin = env_get("spin_table_compat"); 798 spin = env_get("spin_table_compat");
798 if (spin && (*spin == 'n')) 799 if (spin && (*spin == 'n'))
799 spin_table_compat = 0; 800 spin_table_compat = 0;
800 else 801 else
801 spin_table_compat = 1; 802 spin_table_compat = 1;
802 #endif 803 #endif
803 804
804 #ifdef CONFIG_FSL_CORENET 805 #ifdef CONFIG_FSL_CORENET
805 set_liodns(); 806 set_liodns();
806 #ifdef CONFIG_SYS_DPAA_QBMAN 807 #ifdef CONFIG_SYS_DPAA_QBMAN
807 setup_portals(); 808 setup_qbman_portals();
808 #endif 809 #endif
809 #endif 810 #endif
810 811
811 l2cache_init(); 812 l2cache_init();
812 #if defined(CONFIG_RAMBOOT_PBL) 813 #if defined(CONFIG_RAMBOOT_PBL)
813 disable_cpc_sram(); 814 disable_cpc_sram();
814 #endif 815 #endif
815 enable_cpc(); 816 enable_cpc();
816 #if defined(T1040_TDM_QUIRK_CCSR_BASE) 817 #if defined(T1040_TDM_QUIRK_CCSR_BASE)
817 enable_tdm_law(); 818 enable_tdm_law();
818 #endif 819 #endif
819 820
820 #ifndef CONFIG_SYS_FSL_NO_SERDES 821 #ifndef CONFIG_SYS_FSL_NO_SERDES
821 /* needs to be in ram since code uses global static vars */ 822 /* needs to be in ram since code uses global static vars */
822 fsl_serdes_init(); 823 fsl_serdes_init();
823 #endif 824 #endif
824 825
825 #ifdef CONFIG_SYS_FSL_ERRATUM_SEC_A003571 826 #ifdef CONFIG_SYS_FSL_ERRATUM_SEC_A003571
826 #define MCFGR_AXIPIPE 0x000000f0 827 #define MCFGR_AXIPIPE 0x000000f0
827 if (IS_SVR_REV(svr, 1, 0)) 828 if (IS_SVR_REV(svr, 1, 0))
828 sec_clrbits32(&sec->mcfgr, MCFGR_AXIPIPE); 829 sec_clrbits32(&sec->mcfgr, MCFGR_AXIPIPE);
829 #endif 830 #endif
830 831
831 #ifdef CONFIG_SYS_FSL_ERRATUM_A005871 832 #ifdef CONFIG_SYS_FSL_ERRATUM_A005871
832 if (IS_SVR_REV(svr, 1, 0)) { 833 if (IS_SVR_REV(svr, 1, 0)) {
833 int i; 834 int i;
834 __be32 *p = (void __iomem *)CONFIG_SYS_DCSRBAR + 0xb004c; 835 __be32 *p = (void __iomem *)CONFIG_SYS_DCSRBAR + 0xb004c;
835 836
836 for (i = 0; i < 12; i++) { 837 for (i = 0; i < 12; i++) {
837 p += i + (i > 5 ? 11 : 0); 838 p += i + (i > 5 ? 11 : 0);
838 out_be32(p, 0x2); 839 out_be32(p, 0x2);
839 } 840 }
840 p = (void __iomem *)CONFIG_SYS_DCSRBAR + 0xb0108; 841 p = (void __iomem *)CONFIG_SYS_DCSRBAR + 0xb0108;
841 out_be32(p, 0x34); 842 out_be32(p, 0x34);
842 } 843 }
843 #endif 844 #endif
844 845
845 #ifdef CONFIG_SYS_SRIO 846 #ifdef CONFIG_SYS_SRIO
846 srio_init(); 847 srio_init();
847 #ifdef CONFIG_SRIO_PCIE_BOOT_MASTER 848 #ifdef CONFIG_SRIO_PCIE_BOOT_MASTER
848 char *s = env_get("bootmaster"); 849 char *s = env_get("bootmaster");
849 if (s) { 850 if (s) {
850 if (!strcmp(s, "SRIO1")) { 851 if (!strcmp(s, "SRIO1")) {
851 srio_boot_master(1); 852 srio_boot_master(1);
852 srio_boot_master_release_slave(1); 853 srio_boot_master_release_slave(1);
853 } 854 }
854 if (!strcmp(s, "SRIO2")) { 855 if (!strcmp(s, "SRIO2")) {
855 srio_boot_master(2); 856 srio_boot_master(2);
856 srio_boot_master_release_slave(2); 857 srio_boot_master_release_slave(2);
857 } 858 }
858 } 859 }
859 #endif 860 #endif
860 #endif 861 #endif
861 862
862 #if defined(CONFIG_MP) 863 #if defined(CONFIG_MP)
863 setup_mp(); 864 setup_mp();
864 #endif 865 #endif
865 866
866 #ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC13 867 #ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC13
867 { 868 {
868 if (SVR_MAJ(svr) < 3) { 869 if (SVR_MAJ(svr) < 3) {
869 void *p; 870 void *p;
870 p = (void *)CONFIG_SYS_DCSRBAR + 0x20520; 871 p = (void *)CONFIG_SYS_DCSRBAR + 0x20520;
871 setbits_be32(p, 1 << (31 - 14)); 872 setbits_be32(p, 1 << (31 - 14));
872 } 873 }
873 } 874 }
874 #endif 875 #endif
875 876
876 #ifdef CONFIG_SYS_LBC_LCRR 877 #ifdef CONFIG_SYS_LBC_LCRR
877 /* 878 /*
878 * Modify the CLKDIV field of LCRR register to improve the writing 879 * Modify the CLKDIV field of LCRR register to improve the writing
879 * speed for NOR flash. 880 * speed for NOR flash.
880 */ 881 */
881 clrsetbits_be32(&lbc->lcrr, LCRR_CLKDIV, CONFIG_SYS_LBC_LCRR); 882 clrsetbits_be32(&lbc->lcrr, LCRR_CLKDIV, CONFIG_SYS_LBC_LCRR);
882 __raw_readl(&lbc->lcrr); 883 __raw_readl(&lbc->lcrr);
883 isync(); 884 isync();
884 #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_LBC103 885 #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_LBC103
885 udelay(100); 886 udelay(100);
886 #endif 887 #endif
887 #endif 888 #endif
888 889
889 #ifdef CONFIG_SYS_FSL_USB1_PHY_ENABLE 890 #ifdef CONFIG_SYS_FSL_USB1_PHY_ENABLE
890 { 891 {
891 struct ccsr_usb_phy __iomem *usb_phy1 = 892 struct ccsr_usb_phy __iomem *usb_phy1 =
892 (void *)CONFIG_SYS_MPC85xx_USB1_PHY_ADDR; 893 (void *)CONFIG_SYS_MPC85xx_USB1_PHY_ADDR;
893 #ifdef CONFIG_SYS_FSL_ERRATUM_A006261 894 #ifdef CONFIG_SYS_FSL_ERRATUM_A006261
894 if (has_erratum_a006261()) 895 if (has_erratum_a006261())
895 fsl_erratum_a006261_workaround(usb_phy1); 896 fsl_erratum_a006261_workaround(usb_phy1);
896 #endif 897 #endif
897 out_be32(&usb_phy1->usb_enable_override, 898 out_be32(&usb_phy1->usb_enable_override,
898 CONFIG_SYS_FSL_USB_ENABLE_OVERRIDE); 899 CONFIG_SYS_FSL_USB_ENABLE_OVERRIDE);
899 } 900 }
900 #endif 901 #endif
901 #ifdef CONFIG_SYS_FSL_USB2_PHY_ENABLE 902 #ifdef CONFIG_SYS_FSL_USB2_PHY_ENABLE
902 { 903 {
903 struct ccsr_usb_phy __iomem *usb_phy2 = 904 struct ccsr_usb_phy __iomem *usb_phy2 =
904 (void *)CONFIG_SYS_MPC85xx_USB2_PHY_ADDR; 905 (void *)CONFIG_SYS_MPC85xx_USB2_PHY_ADDR;
905 #ifdef CONFIG_SYS_FSL_ERRATUM_A006261 906 #ifdef CONFIG_SYS_FSL_ERRATUM_A006261
906 if (has_erratum_a006261()) 907 if (has_erratum_a006261())
907 fsl_erratum_a006261_workaround(usb_phy2); 908 fsl_erratum_a006261_workaround(usb_phy2);
908 #endif 909 #endif
909 out_be32(&usb_phy2->usb_enable_override, 910 out_be32(&usb_phy2->usb_enable_override,
910 CONFIG_SYS_FSL_USB_ENABLE_OVERRIDE); 911 CONFIG_SYS_FSL_USB_ENABLE_OVERRIDE);
911 } 912 }
912 #endif 913 #endif
913 914
914 #ifdef CONFIG_SYS_FSL_ERRATUM_USB14 915 #ifdef CONFIG_SYS_FSL_ERRATUM_USB14
915 /* On P204x/P304x/P50x0 Rev1.0, USB transmit will result internal 916 /* On P204x/P304x/P50x0 Rev1.0, USB transmit will result internal
916 * multi-bit ECC errors which has impact on performance, so software 917 * multi-bit ECC errors which has impact on performance, so software
917 * should disable all ECC reporting from USB1 and USB2. 918 * should disable all ECC reporting from USB1 and USB2.
918 */ 919 */
919 if (IS_SVR_REV(get_svr(), 1, 0)) { 920 if (IS_SVR_REV(get_svr(), 1, 0)) {
920 struct dcsr_dcfg_regs *dcfg = (struct dcsr_dcfg_regs *) 921 struct dcsr_dcfg_regs *dcfg = (struct dcsr_dcfg_regs *)
921 (CONFIG_SYS_DCSRBAR + CONFIG_SYS_DCSR_DCFG_OFFSET); 922 (CONFIG_SYS_DCSRBAR + CONFIG_SYS_DCSR_DCFG_OFFSET);
922 setbits_be32(&dcfg->ecccr1, 923 setbits_be32(&dcfg->ecccr1,
923 (DCSR_DCFG_ECC_DISABLE_USB1 | 924 (DCSR_DCFG_ECC_DISABLE_USB1 |
924 DCSR_DCFG_ECC_DISABLE_USB2)); 925 DCSR_DCFG_ECC_DISABLE_USB2));
925 } 926 }
926 #endif 927 #endif
927 928
928 #if defined(CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE) 929 #if defined(CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE)
929 struct ccsr_usb_phy __iomem *usb_phy = 930 struct ccsr_usb_phy __iomem *usb_phy =
930 (void *)CONFIG_SYS_MPC85xx_USB1_PHY_ADDR; 931 (void *)CONFIG_SYS_MPC85xx_USB1_PHY_ADDR;
931 setbits_be32(&usb_phy->pllprg[1], 932 setbits_be32(&usb_phy->pllprg[1],
932 CONFIG_SYS_FSL_USB_PLLPRG2_PHY2_CLK_EN | 933 CONFIG_SYS_FSL_USB_PLLPRG2_PHY2_CLK_EN |
933 CONFIG_SYS_FSL_USB_PLLPRG2_PHY1_CLK_EN | 934 CONFIG_SYS_FSL_USB_PLLPRG2_PHY1_CLK_EN |
934 CONFIG_SYS_FSL_USB_PLLPRG2_MFI | 935 CONFIG_SYS_FSL_USB_PLLPRG2_MFI |
935 CONFIG_SYS_FSL_USB_PLLPRG2_PLL_EN); 936 CONFIG_SYS_FSL_USB_PLLPRG2_PLL_EN);
936 #ifdef CONFIG_SYS_FSL_SINGLE_SOURCE_CLK 937 #ifdef CONFIG_SYS_FSL_SINGLE_SOURCE_CLK
937 usb_single_source_clk_configure(usb_phy); 938 usb_single_source_clk_configure(usb_phy);
938 #endif 939 #endif
939 setbits_be32(&usb_phy->port1.ctrl, 940 setbits_be32(&usb_phy->port1.ctrl,
940 CONFIG_SYS_FSL_USB_CTRL_PHY_EN); 941 CONFIG_SYS_FSL_USB_CTRL_PHY_EN);
941 setbits_be32(&usb_phy->port1.drvvbuscfg, 942 setbits_be32(&usb_phy->port1.drvvbuscfg,
942 CONFIG_SYS_FSL_USB_DRVVBUS_CR_EN); 943 CONFIG_SYS_FSL_USB_DRVVBUS_CR_EN);
943 setbits_be32(&usb_phy->port1.pwrfltcfg, 944 setbits_be32(&usb_phy->port1.pwrfltcfg,
944 CONFIG_SYS_FSL_USB_PWRFLT_CR_EN); 945 CONFIG_SYS_FSL_USB_PWRFLT_CR_EN);
945 setbits_be32(&usb_phy->port2.ctrl, 946 setbits_be32(&usb_phy->port2.ctrl,
946 CONFIG_SYS_FSL_USB_CTRL_PHY_EN); 947 CONFIG_SYS_FSL_USB_CTRL_PHY_EN);
947 setbits_be32(&usb_phy->port2.drvvbuscfg, 948 setbits_be32(&usb_phy->port2.drvvbuscfg,
948 CONFIG_SYS_FSL_USB_DRVVBUS_CR_EN); 949 CONFIG_SYS_FSL_USB_DRVVBUS_CR_EN);
949 setbits_be32(&usb_phy->port2.pwrfltcfg, 950 setbits_be32(&usb_phy->port2.pwrfltcfg,
950 CONFIG_SYS_FSL_USB_PWRFLT_CR_EN); 951 CONFIG_SYS_FSL_USB_PWRFLT_CR_EN);
951 952
952 #ifdef CONFIG_SYS_FSL_ERRATUM_A006261 953 #ifdef CONFIG_SYS_FSL_ERRATUM_A006261
953 if (has_erratum_a006261()) 954 if (has_erratum_a006261())
954 fsl_erratum_a006261_workaround(usb_phy); 955 fsl_erratum_a006261_workaround(usb_phy);
955 #endif 956 #endif
956 957
957 #endif /* CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE */ 958 #endif /* CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE */
958 959
959 #ifdef CONFIG_SYS_FSL_ERRATUM_A009942 960 #ifdef CONFIG_SYS_FSL_ERRATUM_A009942
960 erratum_a009942_check_cpo(); 961 erratum_a009942_check_cpo();
961 #endif 962 #endif
962 963
963 #ifdef CONFIG_FMAN_ENET 964 #ifdef CONFIG_FMAN_ENET
964 fman_enet_init(); 965 fman_enet_init();
965 #endif 966 #endif
966 967
967 #if defined(CONFIG_SECURE_BOOT) && defined(CONFIG_FSL_CORENET) 968 #if defined(CONFIG_SECURE_BOOT) && defined(CONFIG_FSL_CORENET)
968 if (pamu_init() < 0) 969 if (pamu_init() < 0)
969 fsl_secboot_handle_error(ERROR_ESBC_PAMU_INIT); 970 fsl_secboot_handle_error(ERROR_ESBC_PAMU_INIT);
970 #endif 971 #endif
971 972
972 #ifdef CONFIG_FSL_CAAM 973 #ifdef CONFIG_FSL_CAAM
973 sec_init(); 974 sec_init();
974 975
975 #if defined(CONFIG_ARCH_C29X) 976 #if defined(CONFIG_ARCH_C29X)
976 if ((SVR_SOC_VER(svr) == SVR_C292) || 977 if ((SVR_SOC_VER(svr) == SVR_C292) ||
977 (SVR_SOC_VER(svr) == SVR_C293)) 978 (SVR_SOC_VER(svr) == SVR_C293))
978 sec_init_idx(1); 979 sec_init_idx(1);
979 980
980 if (SVR_SOC_VER(svr) == SVR_C293) 981 if (SVR_SOC_VER(svr) == SVR_C293)
981 sec_init_idx(2); 982 sec_init_idx(2);
982 #endif 983 #endif
983 #endif 984 #endif
984 985
985 #if defined(CONFIG_FSL_SATA_V2) && defined(CONFIG_SYS_FSL_ERRATUM_SATA_A001) 986 #if defined(CONFIG_FSL_SATA_V2) && defined(CONFIG_SYS_FSL_ERRATUM_SATA_A001)
986 /* 987 /*
987 * For P1022/1013 Rev1.0 silicon, after power on SATA host 988 * For P1022/1013 Rev1.0 silicon, after power on SATA host
988 * controller is configured in legacy mode instead of the 989 * controller is configured in legacy mode instead of the
989 * expected enterprise mode. Software needs to clear bit[28] 990 * expected enterprise mode. Software needs to clear bit[28]
990 * of HControl register to change to enterprise mode from 991 * of HControl register to change to enterprise mode from
991 * legacy mode. We assume that the controller is offline. 992 * legacy mode. We assume that the controller is offline.
992 */ 993 */
993 if (IS_SVR_REV(svr, 1, 0) && 994 if (IS_SVR_REV(svr, 1, 0) &&
994 ((SVR_SOC_VER(svr) == SVR_P1022) || 995 ((SVR_SOC_VER(svr) == SVR_P1022) ||
995 (SVR_SOC_VER(svr) == SVR_P1013))) { 996 (SVR_SOC_VER(svr) == SVR_P1013))) {
996 fsl_sata_reg_t *reg; 997 fsl_sata_reg_t *reg;
997 998
998 /* first SATA controller */ 999 /* first SATA controller */
999 reg = (void *)CONFIG_SYS_MPC85xx_SATA1_ADDR; 1000 reg = (void *)CONFIG_SYS_MPC85xx_SATA1_ADDR;
1000 clrbits_le32(&reg->hcontrol, HCONTROL_ENTERPRISE_EN); 1001 clrbits_le32(&reg->hcontrol, HCONTROL_ENTERPRISE_EN);
1001 1002
1002 /* second SATA controller */ 1003 /* second SATA controller */
1003 reg = (void *)CONFIG_SYS_MPC85xx_SATA2_ADDR; 1004 reg = (void *)CONFIG_SYS_MPC85xx_SATA2_ADDR;
1004 clrbits_le32(&reg->hcontrol, HCONTROL_ENTERPRISE_EN); 1005 clrbits_le32(&reg->hcontrol, HCONTROL_ENTERPRISE_EN);
1005 } 1006 }
1006 #endif 1007 #endif
1007 1008
1008 init_used_tlb_cams(); 1009 init_used_tlb_cams();
1009 1010
1010 return 0; 1011 return 0;
1011 } 1012 }
1012 1013
1013 void arch_preboot_os(void) 1014 void arch_preboot_os(void)
1014 { 1015 {
1015 u32 msr; 1016 u32 msr;
1016 1017
1017 /* 1018 /*
1018 * We are changing interrupt offsets and are about to boot the OS so 1019 * We are changing interrupt offsets and are about to boot the OS so
1019 * we need to make sure we disable all async interrupts. EE is already 1020 * we need to make sure we disable all async interrupts. EE is already
1020 * disabled by the time we get called. 1021 * disabled by the time we get called.
1021 */ 1022 */
1022 msr = mfmsr(); 1023 msr = mfmsr();
1023 msr &= ~(MSR_ME|MSR_CE); 1024 msr &= ~(MSR_ME|MSR_CE);
1024 mtmsr(msr); 1025 mtmsr(msr);
1025 } 1026 }
1026 1027
1027 #if defined(CONFIG_SATA) && defined(CONFIG_FSL_SATA) 1028 #if defined(CONFIG_SATA) && defined(CONFIG_FSL_SATA)
1028 int sata_initialize(void) 1029 int sata_initialize(void)
1029 { 1030 {
1030 if (is_serdes_configured(SATA1) || is_serdes_configured(SATA2)) 1031 if (is_serdes_configured(SATA1) || is_serdes_configured(SATA2))
1031 return __sata_initialize(); 1032 return __sata_initialize();
1032 1033
1033 return 1; 1034 return 1;
1034 } 1035 }
1035 #endif 1036 #endif
1036 1037
1037 void cpu_secondary_init_r(void) 1038 void cpu_secondary_init_r(void)
1038 { 1039 {
1039 #ifdef CONFIG_U_QE 1040 #ifdef CONFIG_U_QE
1040 uint qe_base = CONFIG_SYS_IMMR + 0x00140000; /* QE immr base */ 1041 uint qe_base = CONFIG_SYS_IMMR + 0x00140000; /* QE immr base */
1041 #elif defined CONFIG_QE 1042 #elif defined CONFIG_QE
1042 uint qe_base = CONFIG_SYS_IMMR + 0x00080000; /* QE immr base */ 1043 uint qe_base = CONFIG_SYS_IMMR + 0x00080000; /* QE immr base */
1043 #endif 1044 #endif
1044 1045
1045 #ifdef CONFIG_QE 1046 #ifdef CONFIG_QE
1046 qe_init(qe_base); 1047 qe_init(qe_base);
1047 qe_reset(); 1048 qe_reset();
1048 #endif 1049 #endif
1049 } 1050 }
1050 1051
1051 #ifdef CONFIG_BOARD_LATE_INIT 1052 #ifdef CONFIG_BOARD_LATE_INIT
1052 int board_late_init(void) 1053 int board_late_init(void)
1053 { 1054 {
1054 #ifdef CONFIG_CHAIN_OF_TRUST 1055 #ifdef CONFIG_CHAIN_OF_TRUST
1055 fsl_setenv_chain_of_trust(); 1056 fsl_setenv_chain_of_trust();
1056 #endif 1057 #endif
1057 1058
1058 return 0; 1059 return 0;
1059 } 1060 }
1060 #endif 1061 #endif
1061 1062
arch/powerpc/cpu/mpc85xx/fdt.c
1 /* 1 /*
2 * Copyright 2007-2011 Freescale Semiconductor, Inc. 2 * Copyright 2007-2011 Freescale Semiconductor, Inc.
3 * 3 *
4 * (C) Copyright 2000 4 * (C) Copyright 2000
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 * 6 *
7 * SPDX-License-Identifier: GPL-2.0+ 7 * SPDX-License-Identifier: GPL-2.0+
8 */ 8 */
9 9
10 #include <common.h> 10 #include <common.h>
11 #include <libfdt.h> 11 #include <libfdt.h>
12 #include <fdt_support.h> 12 #include <fdt_support.h>
13 #include <asm/processor.h> 13 #include <asm/processor.h>
14 #include <linux/ctype.h> 14 #include <linux/ctype.h>
15 #include <asm/io.h> 15 #include <asm/io.h>
16 #include <asm/fsl_fdt.h> 16 #include <asm/fsl_fdt.h>
17 #include <asm/fsl_portals.h> 17 #include <asm/fsl_portals.h>
18 #include <fsl_qbman.h>
18 #include <hwconfig.h> 19 #include <hwconfig.h>
19 #ifdef CONFIG_FSL_ESDHC 20 #ifdef CONFIG_FSL_ESDHC
20 #include <fsl_esdhc.h> 21 #include <fsl_esdhc.h>
21 #endif 22 #endif
22 #ifdef CONFIG_SYS_DPAA_FMAN 23 #ifdef CONFIG_SYS_DPAA_FMAN
23 #include <fsl_fman.h> 24 #include <fsl_fman.h>
24 #endif 25 #endif
25 26
26 DECLARE_GLOBAL_DATA_PTR; 27 DECLARE_GLOBAL_DATA_PTR;
27 28
28 extern void ft_qe_setup(void *blob); 29 extern void ft_qe_setup(void *blob);
29 extern void ft_fixup_num_cores(void *blob); 30 extern void ft_fixup_num_cores(void *blob);
30 extern void ft_srio_setup(void *blob); 31 extern void ft_srio_setup(void *blob);
31 32
32 #ifdef CONFIG_MP 33 #ifdef CONFIG_MP
33 #include "mp.h" 34 #include "mp.h"
34 35
35 void ft_fixup_cpu(void *blob, u64 memory_limit) 36 void ft_fixup_cpu(void *blob, u64 memory_limit)
36 { 37 {
37 int off; 38 int off;
38 phys_addr_t spin_tbl_addr = get_spin_phys_addr(); 39 phys_addr_t spin_tbl_addr = get_spin_phys_addr();
39 u32 bootpg = determine_mp_bootpg(NULL); 40 u32 bootpg = determine_mp_bootpg(NULL);
40 u32 id = get_my_id(); 41 u32 id = get_my_id();
41 const char *enable_method; 42 const char *enable_method;
42 #if defined(T1040_TDM_QUIRK_CCSR_BASE) 43 #if defined(T1040_TDM_QUIRK_CCSR_BASE)
43 int ret; 44 int ret;
44 int tdm_hwconfig_enabled = 0; 45 int tdm_hwconfig_enabled = 0;
45 char buffer[HWCONFIG_BUFFER_SIZE] = {0}; 46 char buffer[HWCONFIG_BUFFER_SIZE] = {0};
46 #endif 47 #endif
47 48
48 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); 49 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
49 while (off != -FDT_ERR_NOTFOUND) { 50 while (off != -FDT_ERR_NOTFOUND) {
50 u32 *reg = (u32 *)fdt_getprop(blob, off, "reg", 0); 51 u32 *reg = (u32 *)fdt_getprop(blob, off, "reg", 0);
51 52
52 if (reg) { 53 if (reg) {
53 u32 phys_cpu_id = thread_to_core(*reg); 54 u32 phys_cpu_id = thread_to_core(*reg);
54 u64 val = phys_cpu_id * SIZE_BOOT_ENTRY + spin_tbl_addr; 55 u64 val = phys_cpu_id * SIZE_BOOT_ENTRY + spin_tbl_addr;
55 val = cpu_to_fdt64(val); 56 val = cpu_to_fdt64(val);
56 if (*reg == id) { 57 if (*reg == id) {
57 fdt_setprop_string(blob, off, "status", 58 fdt_setprop_string(blob, off, "status",
58 "okay"); 59 "okay");
59 } else { 60 } else {
60 fdt_setprop_string(blob, off, "status", 61 fdt_setprop_string(blob, off, "status",
61 "disabled"); 62 "disabled");
62 } 63 }
63 64
64 if (hold_cores_in_reset(0)) { 65 if (hold_cores_in_reset(0)) {
65 #ifdef CONFIG_FSL_CORENET 66 #ifdef CONFIG_FSL_CORENET
66 /* Cores held in reset, use BRR to release */ 67 /* Cores held in reset, use BRR to release */
67 enable_method = "fsl,brr-holdoff"; 68 enable_method = "fsl,brr-holdoff";
68 #else 69 #else
69 /* Cores held in reset, use EEBPCR to release */ 70 /* Cores held in reset, use EEBPCR to release */
70 enable_method = "fsl,eebpcr-holdoff"; 71 enable_method = "fsl,eebpcr-holdoff";
71 #endif 72 #endif
72 } else { 73 } else {
73 /* Cores out of reset and in a spin-loop */ 74 /* Cores out of reset and in a spin-loop */
74 enable_method = "spin-table"; 75 enable_method = "spin-table";
75 76
76 fdt_setprop(blob, off, "cpu-release-addr", 77 fdt_setprop(blob, off, "cpu-release-addr",
77 &val, sizeof(val)); 78 &val, sizeof(val));
78 } 79 }
79 80
80 fdt_setprop_string(blob, off, "enable-method", 81 fdt_setprop_string(blob, off, "enable-method",
81 enable_method); 82 enable_method);
82 } else { 83 } else {
83 printf ("cpu NULL\n"); 84 printf ("cpu NULL\n");
84 } 85 }
85 off = fdt_node_offset_by_prop_value(blob, off, 86 off = fdt_node_offset_by_prop_value(blob, off,
86 "device_type", "cpu", 4); 87 "device_type", "cpu", 4);
87 } 88 }
88 89
89 #if defined(T1040_TDM_QUIRK_CCSR_BASE) 90 #if defined(T1040_TDM_QUIRK_CCSR_BASE)
90 #define CONFIG_MEM_HOLE_16M 0x1000000 91 #define CONFIG_MEM_HOLE_16M 0x1000000
91 /* 92 /*
92 * Extract hwconfig from environment. 93 * Extract hwconfig from environment.
93 * Search for tdm entry in hwconfig. 94 * Search for tdm entry in hwconfig.
94 */ 95 */
95 ret = env_get_f("hwconfig", buffer, sizeof(buffer)); 96 ret = env_get_f("hwconfig", buffer, sizeof(buffer));
96 if (ret > 0) 97 if (ret > 0)
97 tdm_hwconfig_enabled = hwconfig_f("tdm", buffer); 98 tdm_hwconfig_enabled = hwconfig_f("tdm", buffer);
98 99
99 /* Reserve the memory hole created by TDM LAW, so OSes dont use it */ 100 /* Reserve the memory hole created by TDM LAW, so OSes dont use it */
100 if (tdm_hwconfig_enabled) { 101 if (tdm_hwconfig_enabled) {
101 off = fdt_add_mem_rsv(blob, T1040_TDM_QUIRK_CCSR_BASE, 102 off = fdt_add_mem_rsv(blob, T1040_TDM_QUIRK_CCSR_BASE,
102 CONFIG_MEM_HOLE_16M); 103 CONFIG_MEM_HOLE_16M);
103 if (off < 0) 104 if (off < 0)
104 printf("Failed to reserve memory for tdm: %s\n", 105 printf("Failed to reserve memory for tdm: %s\n",
105 fdt_strerror(off)); 106 fdt_strerror(off));
106 } 107 }
107 #endif 108 #endif
108 109
109 /* Reserve the boot page so OSes dont use it */ 110 /* Reserve the boot page so OSes dont use it */
110 if ((u64)bootpg < memory_limit) { 111 if ((u64)bootpg < memory_limit) {
111 off = fdt_add_mem_rsv(blob, bootpg, (u64)4096); 112 off = fdt_add_mem_rsv(blob, bootpg, (u64)4096);
112 if (off < 0) 113 if (off < 0)
113 printf("Failed to reserve memory for bootpg: %s\n", 114 printf("Failed to reserve memory for bootpg: %s\n",
114 fdt_strerror(off)); 115 fdt_strerror(off));
115 } 116 }
116 117
117 #ifndef CONFIG_MPC8xxx_DISABLE_BPTR 118 #ifndef CONFIG_MPC8xxx_DISABLE_BPTR
118 /* 119 /*
119 * Reserve the default boot page so OSes dont use it. 120 * Reserve the default boot page so OSes dont use it.
120 * The default boot page is always mapped to bootpg above using 121 * The default boot page is always mapped to bootpg above using
121 * boot page translation. 122 * boot page translation.
122 */ 123 */
123 if (0xfffff000ull < memory_limit) { 124 if (0xfffff000ull < memory_limit) {
124 off = fdt_add_mem_rsv(blob, 0xfffff000ull, (u64)4096); 125 off = fdt_add_mem_rsv(blob, 0xfffff000ull, (u64)4096);
125 if (off < 0) { 126 if (off < 0) {
126 printf("Failed to reserve memory for 0xfffff000: %s\n", 127 printf("Failed to reserve memory for 0xfffff000: %s\n",
127 fdt_strerror(off)); 128 fdt_strerror(off));
128 } 129 }
129 } 130 }
130 #endif 131 #endif
131 132
132 /* Reserve spin table page */ 133 /* Reserve spin table page */
133 if (spin_tbl_addr < memory_limit) { 134 if (spin_tbl_addr < memory_limit) {
134 off = fdt_add_mem_rsv(blob, 135 off = fdt_add_mem_rsv(blob,
135 (spin_tbl_addr & ~0xffful), 4096); 136 (spin_tbl_addr & ~0xffful), 4096);
136 if (off < 0) 137 if (off < 0)
137 printf("Failed to reserve memory for spin table: %s\n", 138 printf("Failed to reserve memory for spin table: %s\n",
138 fdt_strerror(off)); 139 fdt_strerror(off));
139 } 140 }
140 #ifdef CONFIG_DEEP_SLEEP 141 #ifdef CONFIG_DEEP_SLEEP
141 #ifdef CONFIG_SPL_MMC_BOOT 142 #ifdef CONFIG_SPL_MMC_BOOT
142 off = fdt_add_mem_rsv(blob, CONFIG_SYS_MMC_U_BOOT_START, 143 off = fdt_add_mem_rsv(blob, CONFIG_SYS_MMC_U_BOOT_START,
143 CONFIG_SYS_MMC_U_BOOT_SIZE); 144 CONFIG_SYS_MMC_U_BOOT_SIZE);
144 if (off < 0) 145 if (off < 0)
145 printf("Failed to reserve memory for SD deep sleep: %s\n", 146 printf("Failed to reserve memory for SD deep sleep: %s\n",
146 fdt_strerror(off)); 147 fdt_strerror(off));
147 #elif defined(CONFIG_SPL_SPI_BOOT) 148 #elif defined(CONFIG_SPL_SPI_BOOT)
148 off = fdt_add_mem_rsv(blob, CONFIG_SYS_SPI_FLASH_U_BOOT_START, 149 off = fdt_add_mem_rsv(blob, CONFIG_SYS_SPI_FLASH_U_BOOT_START,
149 CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE); 150 CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE);
150 if (off < 0) 151 if (off < 0)
151 printf("Failed to reserve memory for SPI deep sleep: %s\n", 152 printf("Failed to reserve memory for SPI deep sleep: %s\n",
152 fdt_strerror(off)); 153 fdt_strerror(off));
153 #endif 154 #endif
154 #endif 155 #endif
155 } 156 }
156 #endif 157 #endif
157 158
158 #ifdef CONFIG_SYS_FSL_CPC 159 #ifdef CONFIG_SYS_FSL_CPC
159 static inline void ft_fixup_l3cache(void *blob, int off) 160 static inline void ft_fixup_l3cache(void *blob, int off)
160 { 161 {
161 u32 line_size, num_ways, size, num_sets; 162 u32 line_size, num_ways, size, num_sets;
162 cpc_corenet_t *cpc = (void *)CONFIG_SYS_FSL_CPC_ADDR; 163 cpc_corenet_t *cpc = (void *)CONFIG_SYS_FSL_CPC_ADDR;
163 u32 cfg0 = in_be32(&cpc->cpccfg0); 164 u32 cfg0 = in_be32(&cpc->cpccfg0);
164 165
165 size = CPC_CFG0_SZ_K(cfg0) * 1024 * CONFIG_SYS_NUM_CPC; 166 size = CPC_CFG0_SZ_K(cfg0) * 1024 * CONFIG_SYS_NUM_CPC;
166 num_ways = CPC_CFG0_NUM_WAYS(cfg0); 167 num_ways = CPC_CFG0_NUM_WAYS(cfg0);
167 line_size = CPC_CFG0_LINE_SZ(cfg0); 168 line_size = CPC_CFG0_LINE_SZ(cfg0);
168 num_sets = size / (line_size * num_ways); 169 num_sets = size / (line_size * num_ways);
169 170
170 fdt_setprop(blob, off, "cache-unified", NULL, 0); 171 fdt_setprop(blob, off, "cache-unified", NULL, 0);
171 fdt_setprop_cell(blob, off, "cache-block-size", line_size); 172 fdt_setprop_cell(blob, off, "cache-block-size", line_size);
172 fdt_setprop_cell(blob, off, "cache-size", size); 173 fdt_setprop_cell(blob, off, "cache-size", size);
173 fdt_setprop_cell(blob, off, "cache-sets", num_sets); 174 fdt_setprop_cell(blob, off, "cache-sets", num_sets);
174 fdt_setprop_cell(blob, off, "cache-level", 3); 175 fdt_setprop_cell(blob, off, "cache-level", 3);
175 #ifdef CONFIG_SYS_CACHE_STASHING 176 #ifdef CONFIG_SYS_CACHE_STASHING
176 fdt_setprop_cell(blob, off, "cache-stash-id", 1); 177 fdt_setprop_cell(blob, off, "cache-stash-id", 1);
177 #endif 178 #endif
178 } 179 }
179 #else 180 #else
180 #define ft_fixup_l3cache(x, y) 181 #define ft_fixup_l3cache(x, y)
181 #endif 182 #endif
182 183
183 #if defined(CONFIG_L2_CACHE) || \ 184 #if defined(CONFIG_L2_CACHE) || \
184 defined(CONFIG_BACKSIDE_L2_CACHE) || \ 185 defined(CONFIG_BACKSIDE_L2_CACHE) || \
185 defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) 186 defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2)
186 static inline void ft_fixup_l2cache_compatible(void *blob, int off) 187 static inline void ft_fixup_l2cache_compatible(void *blob, int off)
187 { 188 {
188 int len; 189 int len;
189 struct cpu_type *cpu = identify_cpu(SVR_SOC_VER(get_svr())); 190 struct cpu_type *cpu = identify_cpu(SVR_SOC_VER(get_svr()));
190 191
191 if (cpu) { 192 if (cpu) {
192 char buf[40]; 193 char buf[40];
193 194
194 if (isdigit(cpu->name[0])) { 195 if (isdigit(cpu->name[0])) {
195 /* MPCxxxx, where xxxx == 4-digit number */ 196 /* MPCxxxx, where xxxx == 4-digit number */
196 len = sprintf(buf, "fsl,mpc%s-l2-cache-controller", 197 len = sprintf(buf, "fsl,mpc%s-l2-cache-controller",
197 cpu->name) + 1; 198 cpu->name) + 1;
198 } else { 199 } else {
199 /* Pxxxx or Txxxx, where xxxx == 4-digit number */ 200 /* Pxxxx or Txxxx, where xxxx == 4-digit number */
200 len = sprintf(buf, "fsl,%c%s-l2-cache-controller", 201 len = sprintf(buf, "fsl,%c%s-l2-cache-controller",
201 tolower(cpu->name[0]), cpu->name + 1) + 1; 202 tolower(cpu->name[0]), cpu->name + 1) + 1;
202 } 203 }
203 204
204 /* 205 /*
205 * append "cache" after the NULL character that the previous 206 * append "cache" after the NULL character that the previous
206 * sprintf wrote. This is how a device tree stores multiple 207 * sprintf wrote. This is how a device tree stores multiple
207 * strings in a property. 208 * strings in a property.
208 */ 209 */
209 len += sprintf(buf + len, "cache") + 1; 210 len += sprintf(buf + len, "cache") + 1;
210 211
211 fdt_setprop(blob, off, "compatible", buf, len); 212 fdt_setprop(blob, off, "compatible", buf, len);
212 } 213 }
213 } 214 }
214 #endif 215 #endif
215 216
216 #if defined(CONFIG_L2_CACHE) 217 #if defined(CONFIG_L2_CACHE)
217 /* return size in kilobytes */ 218 /* return size in kilobytes */
218 static inline u32 l2cache_size(void) 219 static inline u32 l2cache_size(void)
219 { 220 {
220 volatile ccsr_l2cache_t *l2cache = (void *)CONFIG_SYS_MPC85xx_L2_ADDR; 221 volatile ccsr_l2cache_t *l2cache = (void *)CONFIG_SYS_MPC85xx_L2_ADDR;
221 volatile u32 l2siz_field = (l2cache->l2ctl >> 28) & 0x3; 222 volatile u32 l2siz_field = (l2cache->l2ctl >> 28) & 0x3;
222 u32 ver = SVR_SOC_VER(get_svr()); 223 u32 ver = SVR_SOC_VER(get_svr());
223 224
224 switch (l2siz_field) { 225 switch (l2siz_field) {
225 case 0x0: 226 case 0x0:
226 break; 227 break;
227 case 0x1: 228 case 0x1:
228 if (ver == SVR_8540 || ver == SVR_8560 || 229 if (ver == SVR_8540 || ver == SVR_8560 ||
229 ver == SVR_8541 || ver == SVR_8555) 230 ver == SVR_8541 || ver == SVR_8555)
230 return 128; 231 return 128;
231 else 232 else
232 return 256; 233 return 256;
233 break; 234 break;
234 case 0x2: 235 case 0x2:
235 if (ver == SVR_8540 || ver == SVR_8560 || 236 if (ver == SVR_8540 || ver == SVR_8560 ||
236 ver == SVR_8541 || ver == SVR_8555) 237 ver == SVR_8541 || ver == SVR_8555)
237 return 256; 238 return 256;
238 else 239 else
239 return 512; 240 return 512;
240 break; 241 break;
241 case 0x3: 242 case 0x3:
242 return 1024; 243 return 1024;
243 break; 244 break;
244 } 245 }
245 246
246 return 0; 247 return 0;
247 } 248 }
248 249
249 static inline void ft_fixup_l2cache(void *blob) 250 static inline void ft_fixup_l2cache(void *blob)
250 { 251 {
251 int off; 252 int off;
252 u32 *ph; 253 u32 *ph;
253 254
254 const u32 line_size = 32; 255 const u32 line_size = 32;
255 const u32 num_ways = 8; 256 const u32 num_ways = 8;
256 const u32 size = l2cache_size() * 1024; 257 const u32 size = l2cache_size() * 1024;
257 const u32 num_sets = size / (line_size * num_ways); 258 const u32 num_sets = size / (line_size * num_ways);
258 259
259 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); 260 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
260 if (off < 0) { 261 if (off < 0) {
261 debug("no cpu node fount\n"); 262 debug("no cpu node fount\n");
262 return; 263 return;
263 } 264 }
264 265
265 ph = (u32 *)fdt_getprop(blob, off, "next-level-cache", 0); 266 ph = (u32 *)fdt_getprop(blob, off, "next-level-cache", 0);
266 267
267 if (ph == NULL) { 268 if (ph == NULL) {
268 debug("no next-level-cache property\n"); 269 debug("no next-level-cache property\n");
269 return ; 270 return ;
270 } 271 }
271 272
272 off = fdt_node_offset_by_phandle(blob, *ph); 273 off = fdt_node_offset_by_phandle(blob, *ph);
273 if (off < 0) { 274 if (off < 0) {
274 printf("%s: %s\n", __func__, fdt_strerror(off)); 275 printf("%s: %s\n", __func__, fdt_strerror(off));
275 return ; 276 return ;
276 } 277 }
277 278
278 ft_fixup_l2cache_compatible(blob, off); 279 ft_fixup_l2cache_compatible(blob, off);
279 fdt_setprop(blob, off, "cache-unified", NULL, 0); 280 fdt_setprop(blob, off, "cache-unified", NULL, 0);
280 fdt_setprop_cell(blob, off, "cache-block-size", line_size); 281 fdt_setprop_cell(blob, off, "cache-block-size", line_size);
281 fdt_setprop_cell(blob, off, "cache-size", size); 282 fdt_setprop_cell(blob, off, "cache-size", size);
282 fdt_setprop_cell(blob, off, "cache-sets", num_sets); 283 fdt_setprop_cell(blob, off, "cache-sets", num_sets);
283 fdt_setprop_cell(blob, off, "cache-level", 2); 284 fdt_setprop_cell(blob, off, "cache-level", 2);
284 285
285 /* we dont bother w/L3 since no platform of this type has one */ 286 /* we dont bother w/L3 since no platform of this type has one */
286 } 287 }
287 #elif defined(CONFIG_BACKSIDE_L2_CACHE) || \ 288 #elif defined(CONFIG_BACKSIDE_L2_CACHE) || \
288 defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) 289 defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2)
289 static inline void ft_fixup_l2cache(void *blob) 290 static inline void ft_fixup_l2cache(void *blob)
290 { 291 {
291 int off, l2_off, l3_off = -1; 292 int off, l2_off, l3_off = -1;
292 u32 *ph; 293 u32 *ph;
293 #ifdef CONFIG_BACKSIDE_L2_CACHE 294 #ifdef CONFIG_BACKSIDE_L2_CACHE
294 u32 l2cfg0 = mfspr(SPRN_L2CFG0); 295 u32 l2cfg0 = mfspr(SPRN_L2CFG0);
295 #else 296 #else
296 struct ccsr_cluster_l2 *l2cache = 297 struct ccsr_cluster_l2 *l2cache =
297 (struct ccsr_cluster_l2 __iomem *)(CONFIG_SYS_FSL_CLUSTER_1_L2); 298 (struct ccsr_cluster_l2 __iomem *)(CONFIG_SYS_FSL_CLUSTER_1_L2);
298 u32 l2cfg0 = in_be32(&l2cache->l2cfg0); 299 u32 l2cfg0 = in_be32(&l2cache->l2cfg0);
299 #endif 300 #endif
300 u32 size, line_size, num_ways, num_sets; 301 u32 size, line_size, num_ways, num_sets;
301 int has_l2 = 1; 302 int has_l2 = 1;
302 303
303 /* P2040/P2040E has no L2, so dont set any L2 props */ 304 /* P2040/P2040E has no L2, so dont set any L2 props */
304 if (SVR_SOC_VER(get_svr()) == SVR_P2040) 305 if (SVR_SOC_VER(get_svr()) == SVR_P2040)
305 has_l2 = 0; 306 has_l2 = 0;
306 307
307 size = (l2cfg0 & 0x3fff) * 64 * 1024; 308 size = (l2cfg0 & 0x3fff) * 64 * 1024;
308 num_ways = ((l2cfg0 >> 14) & 0x1f) + 1; 309 num_ways = ((l2cfg0 >> 14) & 0x1f) + 1;
309 line_size = (((l2cfg0 >> 23) & 0x3) + 1) * 32; 310 line_size = (((l2cfg0 >> 23) & 0x3) + 1) * 32;
310 num_sets = size / (line_size * num_ways); 311 num_sets = size / (line_size * num_ways);
311 312
312 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); 313 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
313 314
314 while (off != -FDT_ERR_NOTFOUND) { 315 while (off != -FDT_ERR_NOTFOUND) {
315 ph = (u32 *)fdt_getprop(blob, off, "next-level-cache", 0); 316 ph = (u32 *)fdt_getprop(blob, off, "next-level-cache", 0);
316 317
317 if (ph == NULL) { 318 if (ph == NULL) {
318 debug("no next-level-cache property\n"); 319 debug("no next-level-cache property\n");
319 goto next; 320 goto next;
320 } 321 }
321 322
322 l2_off = fdt_node_offset_by_phandle(blob, *ph); 323 l2_off = fdt_node_offset_by_phandle(blob, *ph);
323 if (l2_off < 0) { 324 if (l2_off < 0) {
324 printf("%s: %s\n", __func__, fdt_strerror(off)); 325 printf("%s: %s\n", __func__, fdt_strerror(off));
325 goto next; 326 goto next;
326 } 327 }
327 328
328 if (has_l2) { 329 if (has_l2) {
329 #ifdef CONFIG_SYS_CACHE_STASHING 330 #ifdef CONFIG_SYS_CACHE_STASHING
330 u32 *reg = (u32 *)fdt_getprop(blob, off, "reg", 0); 331 u32 *reg = (u32 *)fdt_getprop(blob, off, "reg", 0);
331 #if defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && defined(CONFIG_E6500) 332 #if defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && defined(CONFIG_E6500)
332 /* Only initialize every eighth thread */ 333 /* Only initialize every eighth thread */
333 if (reg && !((*reg) % 8)) { 334 if (reg && !((*reg) % 8)) {
334 fdt_setprop_cell(blob, l2_off, "cache-stash-id", 335 fdt_setprop_cell(blob, l2_off, "cache-stash-id",
335 (*reg / 4) + 32 + 1); 336 (*reg / 4) + 32 + 1);
336 } 337 }
337 #else 338 #else
338 if (reg) { 339 if (reg) {
339 fdt_setprop_cell(blob, l2_off, "cache-stash-id", 340 fdt_setprop_cell(blob, l2_off, "cache-stash-id",
340 (*reg * 2) + 32 + 1); 341 (*reg * 2) + 32 + 1);
341 } 342 }
342 #endif 343 #endif
343 #endif 344 #endif
344 345
345 fdt_setprop(blob, l2_off, "cache-unified", NULL, 0); 346 fdt_setprop(blob, l2_off, "cache-unified", NULL, 0);
346 fdt_setprop_cell(blob, l2_off, "cache-block-size", 347 fdt_setprop_cell(blob, l2_off, "cache-block-size",
347 line_size); 348 line_size);
348 fdt_setprop_cell(blob, l2_off, "cache-size", size); 349 fdt_setprop_cell(blob, l2_off, "cache-size", size);
349 fdt_setprop_cell(blob, l2_off, "cache-sets", num_sets); 350 fdt_setprop_cell(blob, l2_off, "cache-sets", num_sets);
350 fdt_setprop_cell(blob, l2_off, "cache-level", 2); 351 fdt_setprop_cell(blob, l2_off, "cache-level", 2);
351 ft_fixup_l2cache_compatible(blob, l2_off); 352 ft_fixup_l2cache_compatible(blob, l2_off);
352 } 353 }
353 354
354 if (l3_off < 0) { 355 if (l3_off < 0) {
355 ph = (u32 *)fdt_getprop(blob, l2_off, "next-level-cache", 0); 356 ph = (u32 *)fdt_getprop(blob, l2_off, "next-level-cache", 0);
356 357
357 if (ph == NULL) { 358 if (ph == NULL) {
358 debug("no next-level-cache property\n"); 359 debug("no next-level-cache property\n");
359 goto next; 360 goto next;
360 } 361 }
361 l3_off = *ph; 362 l3_off = *ph;
362 } 363 }
363 next: 364 next:
364 off = fdt_node_offset_by_prop_value(blob, off, 365 off = fdt_node_offset_by_prop_value(blob, off,
365 "device_type", "cpu", 4); 366 "device_type", "cpu", 4);
366 } 367 }
367 if (l3_off > 0) { 368 if (l3_off > 0) {
368 l3_off = fdt_node_offset_by_phandle(blob, l3_off); 369 l3_off = fdt_node_offset_by_phandle(blob, l3_off);
369 if (l3_off < 0) { 370 if (l3_off < 0) {
370 printf("%s: %s\n", __func__, fdt_strerror(off)); 371 printf("%s: %s\n", __func__, fdt_strerror(off));
371 return ; 372 return ;
372 } 373 }
373 ft_fixup_l3cache(blob, l3_off); 374 ft_fixup_l3cache(blob, l3_off);
374 } 375 }
375 } 376 }
376 #else 377 #else
377 #define ft_fixup_l2cache(x) 378 #define ft_fixup_l2cache(x)
378 #endif 379 #endif
379 380
380 static inline void ft_fixup_cache(void *blob) 381 static inline void ft_fixup_cache(void *blob)
381 { 382 {
382 int off; 383 int off;
383 384
384 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); 385 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
385 386
386 while (off != -FDT_ERR_NOTFOUND) { 387 while (off != -FDT_ERR_NOTFOUND) {
387 u32 l1cfg0 = mfspr(SPRN_L1CFG0); 388 u32 l1cfg0 = mfspr(SPRN_L1CFG0);
388 u32 l1cfg1 = mfspr(SPRN_L1CFG1); 389 u32 l1cfg1 = mfspr(SPRN_L1CFG1);
389 u32 isize, iline_size, inum_sets, inum_ways; 390 u32 isize, iline_size, inum_sets, inum_ways;
390 u32 dsize, dline_size, dnum_sets, dnum_ways; 391 u32 dsize, dline_size, dnum_sets, dnum_ways;
391 392
392 /* d-side config */ 393 /* d-side config */
393 dsize = (l1cfg0 & 0x7ff) * 1024; 394 dsize = (l1cfg0 & 0x7ff) * 1024;
394 dnum_ways = ((l1cfg0 >> 11) & 0xff) + 1; 395 dnum_ways = ((l1cfg0 >> 11) & 0xff) + 1;
395 dline_size = (((l1cfg0 >> 23) & 0x3) + 1) * 32; 396 dline_size = (((l1cfg0 >> 23) & 0x3) + 1) * 32;
396 dnum_sets = dsize / (dline_size * dnum_ways); 397 dnum_sets = dsize / (dline_size * dnum_ways);
397 398
398 fdt_setprop_cell(blob, off, "d-cache-block-size", dline_size); 399 fdt_setprop_cell(blob, off, "d-cache-block-size", dline_size);
399 fdt_setprop_cell(blob, off, "d-cache-size", dsize); 400 fdt_setprop_cell(blob, off, "d-cache-size", dsize);
400 fdt_setprop_cell(blob, off, "d-cache-sets", dnum_sets); 401 fdt_setprop_cell(blob, off, "d-cache-sets", dnum_sets);
401 402
402 #ifdef CONFIG_SYS_CACHE_STASHING 403 #ifdef CONFIG_SYS_CACHE_STASHING
403 { 404 {
404 u32 *reg = (u32 *)fdt_getprop(blob, off, "reg", 0); 405 u32 *reg = (u32 *)fdt_getprop(blob, off, "reg", 0);
405 if (reg) 406 if (reg)
406 fdt_setprop_cell(blob, off, "cache-stash-id", 407 fdt_setprop_cell(blob, off, "cache-stash-id",
407 (*reg * 2) + 32 + 0); 408 (*reg * 2) + 32 + 0);
408 } 409 }
409 #endif 410 #endif
410 411
411 /* i-side config */ 412 /* i-side config */
412 isize = (l1cfg1 & 0x7ff) * 1024; 413 isize = (l1cfg1 & 0x7ff) * 1024;
413 inum_ways = ((l1cfg1 >> 11) & 0xff) + 1; 414 inum_ways = ((l1cfg1 >> 11) & 0xff) + 1;
414 iline_size = (((l1cfg1 >> 23) & 0x3) + 1) * 32; 415 iline_size = (((l1cfg1 >> 23) & 0x3) + 1) * 32;
415 inum_sets = isize / (iline_size * inum_ways); 416 inum_sets = isize / (iline_size * inum_ways);
416 417
417 fdt_setprop_cell(blob, off, "i-cache-block-size", iline_size); 418 fdt_setprop_cell(blob, off, "i-cache-block-size", iline_size);
418 fdt_setprop_cell(blob, off, "i-cache-size", isize); 419 fdt_setprop_cell(blob, off, "i-cache-size", isize);
419 fdt_setprop_cell(blob, off, "i-cache-sets", inum_sets); 420 fdt_setprop_cell(blob, off, "i-cache-sets", inum_sets);
420 421
421 off = fdt_node_offset_by_prop_value(blob, off, 422 off = fdt_node_offset_by_prop_value(blob, off,
422 "device_type", "cpu", 4); 423 "device_type", "cpu", 4);
423 } 424 }
424 425
425 ft_fixup_l2cache(blob); 426 ft_fixup_l2cache(blob);
426 } 427 }
427 428
428 429
429 void fdt_add_enet_stashing(void *fdt) 430 void fdt_add_enet_stashing(void *fdt)
430 { 431 {
431 do_fixup_by_compat(fdt, "gianfar", "bd-stash", NULL, 0, 1); 432 do_fixup_by_compat(fdt, "gianfar", "bd-stash", NULL, 0, 1);
432 433
433 do_fixup_by_compat_u32(fdt, "gianfar", "rx-stash-len", 96, 1); 434 do_fixup_by_compat_u32(fdt, "gianfar", "rx-stash-len", 96, 1);
434 435
435 do_fixup_by_compat_u32(fdt, "gianfar", "rx-stash-idx", 0, 1); 436 do_fixup_by_compat_u32(fdt, "gianfar", "rx-stash-idx", 0, 1);
436 do_fixup_by_compat(fdt, "fsl,etsec2", "bd-stash", NULL, 0, 1); 437 do_fixup_by_compat(fdt, "fsl,etsec2", "bd-stash", NULL, 0, 1);
437 do_fixup_by_compat_u32(fdt, "fsl,etsec2", "rx-stash-len", 96, 1); 438 do_fixup_by_compat_u32(fdt, "fsl,etsec2", "rx-stash-len", 96, 1);
438 do_fixup_by_compat_u32(fdt, "fsl,etsec2", "rx-stash-idx", 0, 1); 439 do_fixup_by_compat_u32(fdt, "fsl,etsec2", "rx-stash-idx", 0, 1);
439 } 440 }
440 441
441 #if defined(CONFIG_SYS_DPAA_FMAN) || defined(CONFIG_SYS_DPAA_PME) 442 #if defined(CONFIG_SYS_DPAA_FMAN) || defined(CONFIG_SYS_DPAA_PME)
442 #ifdef CONFIG_SYS_DPAA_FMAN 443 #ifdef CONFIG_SYS_DPAA_FMAN
443 static void ft_fixup_clks(void *blob, const char *compat, u32 offset, 444 static void ft_fixup_clks(void *blob, const char *compat, u32 offset,
444 unsigned long freq) 445 unsigned long freq)
445 { 446 {
446 phys_addr_t phys = offset + CONFIG_SYS_CCSRBAR_PHYS; 447 phys_addr_t phys = offset + CONFIG_SYS_CCSRBAR_PHYS;
447 int off = fdt_node_offset_by_compat_reg(blob, compat, phys); 448 int off = fdt_node_offset_by_compat_reg(blob, compat, phys);
448 449
449 if (off >= 0) { 450 if (off >= 0) {
450 off = fdt_setprop_cell(blob, off, "clock-frequency", freq); 451 off = fdt_setprop_cell(blob, off, "clock-frequency", freq);
451 if (off > 0) 452 if (off > 0)
452 printf("WARNING enable to set clock-frequency " 453 printf("WARNING enable to set clock-frequency "
453 "for %s: %s\n", compat, fdt_strerror(off)); 454 "for %s: %s\n", compat, fdt_strerror(off));
454 } 455 }
455 } 456 }
456 #endif 457 #endif
457 458
458 static void ft_fixup_dpaa_clks(void *blob) 459 static void ft_fixup_dpaa_clks(void *blob)
459 { 460 {
460 sys_info_t sysinfo; 461 sys_info_t sysinfo;
461 462
462 get_sys_info(&sysinfo); 463 get_sys_info(&sysinfo);
463 #ifdef CONFIG_SYS_DPAA_FMAN 464 #ifdef CONFIG_SYS_DPAA_FMAN
464 ft_fixup_clks(blob, "fsl,fman", CONFIG_SYS_FSL_FM1_OFFSET, 465 ft_fixup_clks(blob, "fsl,fman", CONFIG_SYS_FSL_FM1_OFFSET,
465 sysinfo.freq_fman[0]); 466 sysinfo.freq_fman[0]);
466 467
467 #if (CONFIG_SYS_NUM_FMAN == 2) 468 #if (CONFIG_SYS_NUM_FMAN == 2)
468 ft_fixup_clks(blob, "fsl,fman", CONFIG_SYS_FSL_FM2_OFFSET, 469 ft_fixup_clks(blob, "fsl,fman", CONFIG_SYS_FSL_FM2_OFFSET,
469 sysinfo.freq_fman[1]); 470 sysinfo.freq_fman[1]);
470 #endif 471 #endif
471 #endif 472 #endif
472 473
473 #ifdef CONFIG_SYS_DPAA_QBMAN 474 #ifdef CONFIG_SYS_DPAA_QBMAN
474 do_fixup_by_compat_u32(blob, "fsl,qman", 475 do_fixup_by_compat_u32(blob, "fsl,qman",
475 "clock-frequency", sysinfo.freq_qman, 1); 476 "clock-frequency", sysinfo.freq_qman, 1);
476 #endif 477 #endif
477 478
478 #ifdef CONFIG_SYS_DPAA_PME 479 #ifdef CONFIG_SYS_DPAA_PME
479 do_fixup_by_compat_u32(blob, "fsl,pme", 480 do_fixup_by_compat_u32(blob, "fsl,pme",
480 "clock-frequency", sysinfo.freq_pme, 1); 481 "clock-frequency", sysinfo.freq_pme, 1);
481 #endif 482 #endif
482 } 483 }
483 #else 484 #else
484 #define ft_fixup_dpaa_clks(x) 485 #define ft_fixup_dpaa_clks(x)
485 #endif 486 #endif
486 487
487 #ifdef CONFIG_QE 488 #ifdef CONFIG_QE
488 static void ft_fixup_qe_snum(void *blob) 489 static void ft_fixup_qe_snum(void *blob)
489 { 490 {
490 unsigned int svr; 491 unsigned int svr;
491 492
492 svr = mfspr(SPRN_SVR); 493 svr = mfspr(SPRN_SVR);
493 if (SVR_SOC_VER(svr) == SVR_8569) { 494 if (SVR_SOC_VER(svr) == SVR_8569) {
494 if(IS_SVR_REV(svr, 1, 0)) 495 if(IS_SVR_REV(svr, 1, 0))
495 do_fixup_by_compat_u32(blob, "fsl,qe", 496 do_fixup_by_compat_u32(blob, "fsl,qe",
496 "fsl,qe-num-snums", 46, 1); 497 "fsl,qe-num-snums", 46, 1);
497 else 498 else
498 do_fixup_by_compat_u32(blob, "fsl,qe", 499 do_fixup_by_compat_u32(blob, "fsl,qe",
499 "fsl,qe-num-snums", 76, 1); 500 "fsl,qe-num-snums", 76, 1);
500 } 501 }
501 } 502 }
502 #endif 503 #endif
503 504
504 #if defined(CONFIG_ARCH_P4080) 505 #if defined(CONFIG_ARCH_P4080)
505 static void fdt_fixup_usb(void *fdt) 506 static void fdt_fixup_usb(void *fdt)
506 { 507 {
507 ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); 508 ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
508 u32 rcwsr11 = in_be32(&gur->rcwsr[11]); 509 u32 rcwsr11 = in_be32(&gur->rcwsr[11]);
509 int off; 510 int off;
510 511
511 off = fdt_node_offset_by_compatible(fdt, -1, "fsl,mpc85xx-usb2-mph"); 512 off = fdt_node_offset_by_compatible(fdt, -1, "fsl,mpc85xx-usb2-mph");
512 if ((rcwsr11 & FSL_CORENET_RCWSR11_EC1) != 513 if ((rcwsr11 & FSL_CORENET_RCWSR11_EC1) !=
513 FSL_CORENET_RCWSR11_EC1_FM1_USB1) 514 FSL_CORENET_RCWSR11_EC1_FM1_USB1)
514 fdt_status_disabled(fdt, off); 515 fdt_status_disabled(fdt, off);
515 516
516 off = fdt_node_offset_by_compatible(fdt, -1, "fsl,mpc85xx-usb2-dr"); 517 off = fdt_node_offset_by_compatible(fdt, -1, "fsl,mpc85xx-usb2-dr");
517 if ((rcwsr11 & FSL_CORENET_RCWSR11_EC2) != 518 if ((rcwsr11 & FSL_CORENET_RCWSR11_EC2) !=
518 FSL_CORENET_RCWSR11_EC2_USB2) 519 FSL_CORENET_RCWSR11_EC2_USB2)
519 fdt_status_disabled(fdt, off); 520 fdt_status_disabled(fdt, off);
520 } 521 }
521 #else 522 #else
522 #define fdt_fixup_usb(x) 523 #define fdt_fixup_usb(x)
523 #endif 524 #endif
524 525
525 #if defined(CONFIG_ARCH_T2080) || defined(CONFIG_ARCH_T4240) || \ 526 #if defined(CONFIG_ARCH_T2080) || defined(CONFIG_ARCH_T4240) || \
526 defined(CONFIG_ARCH_T4160) 527 defined(CONFIG_ARCH_T4160)
527 void fdt_fixup_dma3(void *blob) 528 void fdt_fixup_dma3(void *blob)
528 { 529 {
529 /* the 3rd DMA is not functional if SRIO2 is chosen */ 530 /* the 3rd DMA is not functional if SRIO2 is chosen */
530 int nodeoff; 531 int nodeoff;
531 ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); 532 ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
532 533
533 #define CONFIG_SYS_ELO3_DMA3 (0xffe000000 + 0x102300) 534 #define CONFIG_SYS_ELO3_DMA3 (0xffe000000 + 0x102300)
534 #if defined(CONFIG_ARCH_T2080) 535 #if defined(CONFIG_ARCH_T2080)
535 u32 srds_prtcl_s2 = in_be32(&gur->rcwsr[4]) & 536 u32 srds_prtcl_s2 = in_be32(&gur->rcwsr[4]) &
536 FSL_CORENET2_RCWSR4_SRDS2_PRTCL; 537 FSL_CORENET2_RCWSR4_SRDS2_PRTCL;
537 srds_prtcl_s2 >>= FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT; 538 srds_prtcl_s2 >>= FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT;
538 539
539 switch (srds_prtcl_s2) { 540 switch (srds_prtcl_s2) {
540 case 0x29: 541 case 0x29:
541 case 0x2d: 542 case 0x2d:
542 case 0x2e: 543 case 0x2e:
543 #elif defined(CONFIG_ARCH_T4240) || defined(CONFIG_ARCH_T4160) 544 #elif defined(CONFIG_ARCH_T4240) || defined(CONFIG_ARCH_T4160)
544 u32 srds_prtcl_s4 = in_be32(&gur->rcwsr[4]) & 545 u32 srds_prtcl_s4 = in_be32(&gur->rcwsr[4]) &
545 FSL_CORENET2_RCWSR4_SRDS4_PRTCL; 546 FSL_CORENET2_RCWSR4_SRDS4_PRTCL;
546 srds_prtcl_s4 >>= FSL_CORENET2_RCWSR4_SRDS4_PRTCL_SHIFT; 547 srds_prtcl_s4 >>= FSL_CORENET2_RCWSR4_SRDS4_PRTCL_SHIFT;
547 548
548 switch (srds_prtcl_s4) { 549 switch (srds_prtcl_s4) {
549 case 6: 550 case 6:
550 case 8: 551 case 8:
551 case 14: 552 case 14:
552 case 16: 553 case 16:
553 #endif 554 #endif
554 nodeoff = fdt_node_offset_by_compat_reg(blob, "fsl,elo3-dma", 555 nodeoff = fdt_node_offset_by_compat_reg(blob, "fsl,elo3-dma",
555 CONFIG_SYS_ELO3_DMA3); 556 CONFIG_SYS_ELO3_DMA3);
556 if (nodeoff > 0) 557 if (nodeoff > 0)
557 fdt_status_disabled(blob, nodeoff); 558 fdt_status_disabled(blob, nodeoff);
558 else 559 else
559 printf("WARNING: unable to disable dma3\n"); 560 printf("WARNING: unable to disable dma3\n");
560 break; 561 break;
561 default: 562 default:
562 break; 563 break;
563 } 564 }
564 } 565 }
565 #else 566 #else
566 #define fdt_fixup_dma3(x) 567 #define fdt_fixup_dma3(x)
567 #endif 568 #endif
568 569
569 #if defined(CONFIG_ARCH_T1040) 570 #if defined(CONFIG_ARCH_T1040)
570 static void fdt_fixup_l2_switch(void *blob) 571 static void fdt_fixup_l2_switch(void *blob)
571 { 572 {
572 uchar l2swaddr[6]; 573 uchar l2swaddr[6];
573 int node; 574 int node;
574 575
575 /* The l2switch node from device-tree has 576 /* The l2switch node from device-tree has
576 * compatible string "vitesse-9953" */ 577 * compatible string "vitesse-9953" */
577 node = fdt_node_offset_by_compatible(blob, -1, "vitesse-9953"); 578 node = fdt_node_offset_by_compatible(blob, -1, "vitesse-9953");
578 if (node == -FDT_ERR_NOTFOUND) 579 if (node == -FDT_ERR_NOTFOUND)
579 /* no l2switch node has been found */ 580 /* no l2switch node has been found */
580 return; 581 return;
581 582
582 /* Get MAC address for the l2switch from "l2switchaddr"*/ 583 /* Get MAC address for the l2switch from "l2switchaddr"*/
583 if (!eth_env_get_enetaddr("l2switchaddr", l2swaddr)) { 584 if (!eth_env_get_enetaddr("l2switchaddr", l2swaddr)) {
584 printf("Warning: MAC address for l2switch not found\n"); 585 printf("Warning: MAC address for l2switch not found\n");
585 memset(l2swaddr, 0, sizeof(l2swaddr)); 586 memset(l2swaddr, 0, sizeof(l2swaddr));
586 } 587 }
587 588
588 /* Add MAC address to l2switch node */ 589 /* Add MAC address to l2switch node */
589 fdt_setprop(blob, node, "local-mac-address", l2swaddr, 590 fdt_setprop(blob, node, "local-mac-address", l2swaddr,
590 sizeof(l2swaddr)); 591 sizeof(l2swaddr));
591 } 592 }
592 #else 593 #else
593 #define fdt_fixup_l2_switch(x) 594 #define fdt_fixup_l2_switch(x)
594 #endif 595 #endif
595 596
596 void ft_cpu_setup(void *blob, bd_t *bd) 597 void ft_cpu_setup(void *blob, bd_t *bd)
597 { 598 {
598 int off; 599 int off;
599 int val; 600 int val;
600 int len; 601 int len;
601 sys_info_t sysinfo; 602 sys_info_t sysinfo;
602 603
603 /* delete crypto node if not on an E-processor */ 604 /* delete crypto node if not on an E-processor */
604 if (!IS_E_PROCESSOR(get_svr())) 605 if (!IS_E_PROCESSOR(get_svr()))
605 fdt_fixup_crypto_node(blob, 0); 606 fdt_fixup_crypto_node(blob, 0);
606 #if CONFIG_SYS_FSL_SEC_COMPAT >= 4 607 #if CONFIG_SYS_FSL_SEC_COMPAT >= 4
607 else { 608 else {
608 ccsr_sec_t __iomem *sec; 609 ccsr_sec_t __iomem *sec;
609 610
610 sec = (void __iomem *)CONFIG_SYS_FSL_SEC_ADDR; 611 sec = (void __iomem *)CONFIG_SYS_FSL_SEC_ADDR;
611 fdt_fixup_crypto_node(blob, sec_in32(&sec->secvid_ms)); 612 fdt_fixup_crypto_node(blob, sec_in32(&sec->secvid_ms));
612 } 613 }
613 #endif 614 #endif
614 615
615 fdt_add_enet_stashing(blob); 616 fdt_add_enet_stashing(blob);
616 617
617 #ifndef CONFIG_FSL_TBCLK_EXTRA_DIV 618 #ifndef CONFIG_FSL_TBCLK_EXTRA_DIV
618 #define CONFIG_FSL_TBCLK_EXTRA_DIV 1 619 #define CONFIG_FSL_TBCLK_EXTRA_DIV 1
619 #endif 620 #endif
620 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, 621 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
621 "timebase-frequency", get_tbclk() / CONFIG_FSL_TBCLK_EXTRA_DIV, 622 "timebase-frequency", get_tbclk() / CONFIG_FSL_TBCLK_EXTRA_DIV,
622 1); 623 1);
623 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, 624 do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
624 "bus-frequency", bd->bi_busfreq, 1); 625 "bus-frequency", bd->bi_busfreq, 1);
625 get_sys_info(&sysinfo); 626 get_sys_info(&sysinfo);
626 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4); 627 off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
627 while (off != -FDT_ERR_NOTFOUND) { 628 while (off != -FDT_ERR_NOTFOUND) {
628 u32 *reg = (u32 *)fdt_getprop(blob, off, "reg", &len); 629 u32 *reg = (u32 *)fdt_getprop(blob, off, "reg", &len);
629 val = cpu_to_fdt32(sysinfo.freq_processor[(*reg) / (len / 4)]); 630 val = cpu_to_fdt32(sysinfo.freq_processor[(*reg) / (len / 4)]);
630 fdt_setprop(blob, off, "clock-frequency", &val, 4); 631 fdt_setprop(blob, off, "clock-frequency", &val, 4);
631 off = fdt_node_offset_by_prop_value(blob, off, "device_type", 632 off = fdt_node_offset_by_prop_value(blob, off, "device_type",
632 "cpu", 4); 633 "cpu", 4);
633 } 634 }
634 do_fixup_by_prop_u32(blob, "device_type", "soc", 4, 635 do_fixup_by_prop_u32(blob, "device_type", "soc", 4,
635 "bus-frequency", bd->bi_busfreq, 1); 636 "bus-frequency", bd->bi_busfreq, 1);
636 637
637 #ifdef CONFIG_QE 638 #ifdef CONFIG_QE
638 ft_qe_setup(blob); 639 ft_qe_setup(blob);
639 ft_fixup_qe_snum(blob); 640 ft_fixup_qe_snum(blob);
640 #endif 641 #endif
641 642
642 #ifdef CONFIG_SYS_DPAA_FMAN 643 #ifdef CONFIG_SYS_DPAA_FMAN
643 fdt_fixup_fman_firmware(blob); 644 fdt_fixup_fman_firmware(blob);
644 #endif 645 #endif
645 646
646 #ifdef CONFIG_SYS_NS16550 647 #ifdef CONFIG_SYS_NS16550
647 do_fixup_by_compat_u32(blob, "ns16550", 648 do_fixup_by_compat_u32(blob, "ns16550",
648 "clock-frequency", CONFIG_SYS_NS16550_CLK, 1); 649 "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);
649 #endif 650 #endif
650 651
651 #ifdef CONFIG_CPM2 652 #ifdef CONFIG_CPM2
652 do_fixup_by_compat_u32(blob, "fsl,cpm2-scc-uart", 653 do_fixup_by_compat_u32(blob, "fsl,cpm2-scc-uart",
653 "current-speed", gd->baudrate, 1); 654 "current-speed", gd->baudrate, 1);
654 655
655 do_fixup_by_compat_u32(blob, "fsl,cpm2-brg", 656 do_fixup_by_compat_u32(blob, "fsl,cpm2-brg",
656 "clock-frequency", bd->bi_brgfreq, 1); 657 "clock-frequency", bd->bi_brgfreq, 1);
657 #endif 658 #endif
658 659
659 #ifdef CONFIG_FSL_CORENET 660 #ifdef CONFIG_FSL_CORENET
660 do_fixup_by_compat_u32(blob, "fsl,qoriq-clockgen-1.0", 661 do_fixup_by_compat_u32(blob, "fsl,qoriq-clockgen-1.0",
661 "clock-frequency", CONFIG_SYS_CLK_FREQ, 1); 662 "clock-frequency", CONFIG_SYS_CLK_FREQ, 1);
662 do_fixup_by_compat_u32(blob, "fsl,qoriq-clockgen-2.0", 663 do_fixup_by_compat_u32(blob, "fsl,qoriq-clockgen-2.0",
663 "clock-frequency", CONFIG_SYS_CLK_FREQ, 1); 664 "clock-frequency", CONFIG_SYS_CLK_FREQ, 1);
664 do_fixup_by_compat_u32(blob, "fsl,mpic", 665 do_fixup_by_compat_u32(blob, "fsl,mpic",
665 "clock-frequency", get_bus_freq(0)/2, 1); 666 "clock-frequency", get_bus_freq(0)/2, 1);
666 #else 667 #else
667 do_fixup_by_compat_u32(blob, "fsl,mpic", 668 do_fixup_by_compat_u32(blob, "fsl,mpic",
668 "clock-frequency", get_bus_freq(0), 1); 669 "clock-frequency", get_bus_freq(0), 1);
669 #endif 670 #endif
670 671
671 fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); 672 fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
672 673
673 #ifdef CONFIG_MP 674 #ifdef CONFIG_MP
674 ft_fixup_cpu(blob, (u64)bd->bi_memstart + (u64)bd->bi_memsize); 675 ft_fixup_cpu(blob, (u64)bd->bi_memstart + (u64)bd->bi_memsize);
675 ft_fixup_num_cores(blob); 676 ft_fixup_num_cores(blob);
676 #endif 677 #endif
677 678
678 ft_fixup_cache(blob); 679 ft_fixup_cache(blob);
679 680
680 #if defined(CONFIG_FSL_ESDHC) 681 #if defined(CONFIG_FSL_ESDHC)
681 fdt_fixup_esdhc(blob, bd); 682 fdt_fixup_esdhc(blob, bd);
682 #endif 683 #endif
683 684
684 ft_fixup_dpaa_clks(blob); 685 ft_fixup_dpaa_clks(blob);
685 686
686 #if defined(CONFIG_SYS_BMAN_MEM_PHYS) 687 #if defined(CONFIG_SYS_BMAN_MEM_PHYS)
687 fdt_portal(blob, "fsl,bman-portal", "bman-portals", 688 fdt_portal(blob, "fsl,bman-portal", "bman-portals",
688 (u64)CONFIG_SYS_BMAN_MEM_PHYS, 689 (u64)CONFIG_SYS_BMAN_MEM_PHYS,
689 CONFIG_SYS_BMAN_MEM_SIZE); 690 CONFIG_SYS_BMAN_MEM_SIZE);
690 fdt_fixup_bportals(blob); 691 fdt_fixup_bportals(blob);
691 #endif 692 #endif
692 693
693 #if defined(CONFIG_SYS_QMAN_MEM_PHYS) 694 #if defined(CONFIG_SYS_QMAN_MEM_PHYS)
694 fdt_portal(blob, "fsl,qman-portal", "qman-portals", 695 fdt_portal(blob, "fsl,qman-portal", "qman-portals",
695 (u64)CONFIG_SYS_QMAN_MEM_PHYS, 696 (u64)CONFIG_SYS_QMAN_MEM_PHYS,
696 CONFIG_SYS_QMAN_MEM_SIZE); 697 CONFIG_SYS_QMAN_MEM_SIZE);
697 698
698 fdt_fixup_qportals(blob); 699 fdt_fixup_qportals(blob);
699 #endif 700 #endif
700 701
701 #ifdef CONFIG_SYS_SRIO 702 #ifdef CONFIG_SYS_SRIO
702 ft_srio_setup(blob); 703 ft_srio_setup(blob);
703 #endif 704 #endif
704 705
705 /* 706 /*
706 * system-clock = CCB clock/2 707 * system-clock = CCB clock/2
707 * Here gd->bus_clk = CCB clock 708 * Here gd->bus_clk = CCB clock
708 * We are using the system clock as 1588 Timer reference 709 * We are using the system clock as 1588 Timer reference
709 * clock source select 710 * clock source select
710 */ 711 */
711 do_fixup_by_compat_u32(blob, "fsl,gianfar-ptp-timer", 712 do_fixup_by_compat_u32(blob, "fsl,gianfar-ptp-timer",
712 "timer-frequency", gd->bus_clk/2, 1); 713 "timer-frequency", gd->bus_clk/2, 1);
713 714
714 /* 715 /*
715 * clock-freq should change to clock-frequency and 716 * clock-freq should change to clock-frequency and
716 * flexcan-v1.0 should change to p1010-flexcan respectively 717 * flexcan-v1.0 should change to p1010-flexcan respectively
717 * in the future. 718 * in the future.
718 */ 719 */
719 do_fixup_by_compat_u32(blob, "fsl,flexcan-v1.0", 720 do_fixup_by_compat_u32(blob, "fsl,flexcan-v1.0",
720 "clock_freq", gd->bus_clk/2, 1); 721 "clock_freq", gd->bus_clk/2, 1);
721 722
722 do_fixup_by_compat_u32(blob, "fsl,flexcan-v1.0", 723 do_fixup_by_compat_u32(blob, "fsl,flexcan-v1.0",
723 "clock-frequency", gd->bus_clk/2, 1); 724 "clock-frequency", gd->bus_clk/2, 1);
724 725
725 do_fixup_by_compat_u32(blob, "fsl,p1010-flexcan", 726 do_fixup_by_compat_u32(blob, "fsl,p1010-flexcan",
726 "clock-frequency", gd->bus_clk/2, 1); 727 "clock-frequency", gd->bus_clk/2, 1);
727 728
728 fdt_fixup_usb(blob); 729 fdt_fixup_usb(blob);
729 730
730 fdt_fixup_l2_switch(blob); 731 fdt_fixup_l2_switch(blob);
731 732
732 fdt_fixup_dma3(blob); 733 fdt_fixup_dma3(blob);
733 } 734 }
734 735
735 /* 736 /*
736 * For some CCSR devices, we only have the virtual address, not the physical 737 * For some CCSR devices, we only have the virtual address, not the physical
737 * address. This is because we map CCSR as a whole, so we typically don't need 738 * address. This is because we map CCSR as a whole, so we typically don't need
738 * a macro for the physical address of any device within CCSR. In this case, 739 * a macro for the physical address of any device within CCSR. In this case,
739 * we calculate the physical address of that device using it's the difference 740 * we calculate the physical address of that device using it's the difference
740 * between the virtual address of the device and the virtual address of the 741 * between the virtual address of the device and the virtual address of the
741 * beginning of CCSR. 742 * beginning of CCSR.
742 */ 743 */
743 #define CCSR_VIRT_TO_PHYS(x) \ 744 #define CCSR_VIRT_TO_PHYS(x) \
744 (CONFIG_SYS_CCSRBAR_PHYS + ((x) - CONFIG_SYS_CCSRBAR)) 745 (CONFIG_SYS_CCSRBAR_PHYS + ((x) - CONFIG_SYS_CCSRBAR))
745 746
746 static void msg(const char *name, uint64_t uaddr, uint64_t daddr) 747 static void msg(const char *name, uint64_t uaddr, uint64_t daddr)
747 { 748 {
748 printf("Warning: U-Boot configured %s at address %llx,\n" 749 printf("Warning: U-Boot configured %s at address %llx,\n"
749 "but the device tree has it at %llx\n", name, uaddr, daddr); 750 "but the device tree has it at %llx\n", name, uaddr, daddr);
750 } 751 }
751 752
752 /* 753 /*
753 * Verify the device tree 754 * Verify the device tree
754 * 755 *
755 * This function compares several CONFIG_xxx macros that contain physical 756 * This function compares several CONFIG_xxx macros that contain physical
756 * addresses with the corresponding nodes in the device tree, to see if 757 * addresses with the corresponding nodes in the device tree, to see if
757 * the physical addresses are all correct. For example, if 758 * the physical addresses are all correct. For example, if
758 * CONFIG_SYS_NS16550_COM1 is defined, then it contains the virtual address 759 * CONFIG_SYS_NS16550_COM1 is defined, then it contains the virtual address
759 * of the first UART. We convert this to a physical address and compare 760 * of the first UART. We convert this to a physical address and compare
760 * that with the physical address of the first ns16550-compatible node 761 * that with the physical address of the first ns16550-compatible node
761 * in the device tree. If they don't match, then we display a warning. 762 * in the device tree. If they don't match, then we display a warning.
762 * 763 *
763 * Returns 1 on success, 0 on failure 764 * Returns 1 on success, 0 on failure
764 */ 765 */
765 int ft_verify_fdt(void *fdt) 766 int ft_verify_fdt(void *fdt)
766 { 767 {
767 uint64_t addr = 0; 768 uint64_t addr = 0;
768 int aliases; 769 int aliases;
769 int off; 770 int off;
770 771
771 /* First check the CCSR base address */ 772 /* First check the CCSR base address */
772 off = fdt_node_offset_by_prop_value(fdt, -1, "device_type", "soc", 4); 773 off = fdt_node_offset_by_prop_value(fdt, -1, "device_type", "soc", 4);
773 if (off > 0) { 774 if (off > 0) {
774 int size; 775 int size;
775 u32 naddr; 776 u32 naddr;
776 const fdt32_t *prop; 777 const fdt32_t *prop;
777 778
778 naddr = fdt_address_cells(fdt, off); 779 naddr = fdt_address_cells(fdt, off);
779 prop = fdt_getprop(fdt, off, "ranges", &size); 780 prop = fdt_getprop(fdt, off, "ranges", &size);
780 addr = fdt_translate_address(fdt, off, prop + naddr); 781 addr = fdt_translate_address(fdt, off, prop + naddr);
781 } 782 }
782 783
783 if (!addr) { 784 if (!addr) {
784 printf("Warning: could not determine base CCSR address in " 785 printf("Warning: could not determine base CCSR address in "
785 "device tree\n"); 786 "device tree\n");
786 /* No point in checking anything else */ 787 /* No point in checking anything else */
787 return 0; 788 return 0;
788 } 789 }
789 790
790 if (addr != CONFIG_SYS_CCSRBAR_PHYS) { 791 if (addr != CONFIG_SYS_CCSRBAR_PHYS) {
791 msg("CCSR", CONFIG_SYS_CCSRBAR_PHYS, addr); 792 msg("CCSR", CONFIG_SYS_CCSRBAR_PHYS, addr);
792 /* No point in checking anything else */ 793 /* No point in checking anything else */
793 return 0; 794 return 0;
794 } 795 }
795 796
796 /* 797 /*
797 * Check some nodes via aliases. We assume that U-Boot and the device 798 * Check some nodes via aliases. We assume that U-Boot and the device
798 * tree enumerate the devices equally. E.g. the first serial port in 799 * tree enumerate the devices equally. E.g. the first serial port in
799 * U-Boot is the same as "serial0" in the device tree. 800 * U-Boot is the same as "serial0" in the device tree.
800 */ 801 */
801 aliases = fdt_path_offset(fdt, "/aliases"); 802 aliases = fdt_path_offset(fdt, "/aliases");
802 if (aliases > 0) { 803 if (aliases > 0) {
803 #ifdef CONFIG_SYS_NS16550_COM1 804 #ifdef CONFIG_SYS_NS16550_COM1
804 if (!fdt_verify_alias_address(fdt, aliases, "serial0", 805 if (!fdt_verify_alias_address(fdt, aliases, "serial0",
805 CCSR_VIRT_TO_PHYS(CONFIG_SYS_NS16550_COM1))) 806 CCSR_VIRT_TO_PHYS(CONFIG_SYS_NS16550_COM1)))
806 return 0; 807 return 0;
807 #endif 808 #endif
808 809
809 #ifdef CONFIG_SYS_NS16550_COM2 810 #ifdef CONFIG_SYS_NS16550_COM2
810 if (!fdt_verify_alias_address(fdt, aliases, "serial1", 811 if (!fdt_verify_alias_address(fdt, aliases, "serial1",
811 CCSR_VIRT_TO_PHYS(CONFIG_SYS_NS16550_COM2))) 812 CCSR_VIRT_TO_PHYS(CONFIG_SYS_NS16550_COM2)))
812 return 0; 813 return 0;
813 #endif 814 #endif
814 } 815 }
815 816
816 /* 817 /*
817 * The localbus node is typically a root node, even though the lbc 818 * The localbus node is typically a root node, even though the lbc
818 * controller is part of CCSR. If we were to put the lbc node under 819 * controller is part of CCSR. If we were to put the lbc node under
819 * the SOC node, then the 'ranges' property in the lbc node would 820 * the SOC node, then the 'ranges' property in the lbc node would
820 * translate through the 'ranges' property of the parent SOC node, and 821 * translate through the 'ranges' property of the parent SOC node, and
821 * we don't want that. Since it's a separate node, it's possible for 822 * we don't want that. Since it's a separate node, it's possible for
822 * the 'reg' property to be wrong, so check it here. For now, we 823 * the 'reg' property to be wrong, so check it here. For now, we
823 * only check for "fsl,elbc" nodes. 824 * only check for "fsl,elbc" nodes.
824 */ 825 */
825 #ifdef CONFIG_SYS_LBC_ADDR 826 #ifdef CONFIG_SYS_LBC_ADDR
826 off = fdt_node_offset_by_compatible(fdt, -1, "fsl,elbc"); 827 off = fdt_node_offset_by_compatible(fdt, -1, "fsl,elbc");
827 if (off > 0) { 828 if (off > 0) {
828 const fdt32_t *reg = fdt_getprop(fdt, off, "reg", NULL); 829 const fdt32_t *reg = fdt_getprop(fdt, off, "reg", NULL);
829 if (reg) { 830 if (reg) {
830 uint64_t uaddr = CCSR_VIRT_TO_PHYS(CONFIG_SYS_LBC_ADDR); 831 uint64_t uaddr = CCSR_VIRT_TO_PHYS(CONFIG_SYS_LBC_ADDR);
831 832
832 addr = fdt_translate_address(fdt, off, reg); 833 addr = fdt_translate_address(fdt, off, reg);
833 if (uaddr != addr) { 834 if (uaddr != addr) {
834 msg("the localbus", uaddr, addr); 835 msg("the localbus", uaddr, addr);
835 return 0; 836 return 0;
836 } 837 }
837 } 838 }
838 } 839 }
839 #endif 840 #endif
840 841
841 return 1; 842 return 1;
842 } 843 }
843 844
844 void fdt_del_diu(void *blob) 845 void fdt_del_diu(void *blob)
845 { 846 {
846 int nodeoff = 0; 847 int nodeoff = 0;
847 848
848 while ((nodeoff = fdt_node_offset_by_compatible(blob, 0, 849 while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
849 "fsl,diu")) >= 0) { 850 "fsl,diu")) >= 0) {
850 fdt_del_node(blob, nodeoff); 851 fdt_del_node(blob, nodeoff);
851 } 852 }
852 } 853 }
853 854
arch/powerpc/cpu/mpc85xx/portals.c
1 /* 1 /*
2 * Copyright 2008-2011 Freescale Semiconductor, Inc. 2 * Copyright 2008-2011 Freescale Semiconductor, Inc.
3 * 3 *
4 * SPDX-License-Identifier: GPL-2.0+ 4 * SPDX-License-Identifier: GPL-2.0+
5 */ 5 */
6 6
7 #include <common.h> 7 #include <common.h>
8 #include <libfdt.h> 8 #include <libfdt.h>
9 #include <fdt_support.h> 9 #include <fdt_support.h>
10 10
11 #include <asm/processor.h> 11 #include <asm/processor.h>
12 #include <asm/io.h> 12 #include <asm/io.h>
13 13
14 #include <asm/fsl_portals.h> 14 #include <asm/fsl_portals.h>
15 #include <asm/fsl_liodn.h> 15 #include <asm/fsl_liodn.h>
16 16
17 #define MAX_BPORTALS (CONFIG_SYS_BMAN_CINH_SIZE / CONFIG_SYS_BMAN_SP_CINH_SIZE)
18 #define MAX_QPORTALS (CONFIG_SYS_QMAN_CINH_SIZE / CONFIG_SYS_QMAN_SP_CINH_SIZE)
19 static void inhibit_portals(void __iomem *addr, int max_portals,
20 int arch_max_portals, int portal_cinh_size)
21 {
22 uint32_t val;
23 int i;
24
25 /* arch_max_portals is the maximum based on memory size. This includes
26 * the reserved memory in the SoC. max_portals the number of physical
27 * portals in the SoC */
28 if (max_portals > arch_max_portals) {
29 printf("ERROR: portal config error\n");
30 max_portals = arch_max_portals;
31 }
32
33 for (i = 0; i < max_portals; i++) {
34 out_be32(addr, -1);
35 val = in_be32(addr);
36 if (!val) {
37 printf("ERROR: Stopped after %d portals\n", i);
38 goto done;
39 }
40 addr += portal_cinh_size;
41 }
42 #ifdef DEBUG
43 printf("Cleared %d portals\n", i);
44 #endif
45 done:
46
47 return;
48 }
49
50 void setup_portals(void)
51 {
52 ccsr_qman_t *qman = (void *)CONFIG_SYS_FSL_QMAN_ADDR;
53 void __iomem *bpaddr = (void *)CONFIG_SYS_BMAN_CINH_BASE +
54 CONFIG_SYS_BMAN_SWP_ISDR_REG;
55 void __iomem *qpaddr = (void *)CONFIG_SYS_QMAN_CINH_BASE +
56 CONFIG_SYS_QMAN_SWP_ISDR_REG;
57 #ifdef CONFIG_FSL_CORENET
58 int i;
59
60 for (i = 0; i < CONFIG_SYS_QMAN_NUM_PORTALS; i++) {
61 u8 sdest = qp_info[i].sdest;
62 u16 fliodn = qp_info[i].fliodn;
63 u16 dliodn = qp_info[i].dliodn;
64 u16 liodn_off = qp_info[i].liodn_offset;
65
66 out_be32(&qman->qcsp[i].qcsp_lio_cfg, (liodn_off << 16) |
67 dliodn);
68 /* set frame liodn */
69 out_be32(&qman->qcsp[i].qcsp_io_cfg, (sdest << 16) | fliodn);
70 }
71 #endif
72
73 /* Set the Qman initiator BAR to match the LAW (for DQRR stashing) */
74 #ifdef CONFIG_PHYS_64BIT
75 out_be32(&qman->qcsp_bare, (u32)(CONFIG_SYS_QMAN_MEM_PHYS >> 32));
76 #endif
77 out_be32(&qman->qcsp_bar, (u32)CONFIG_SYS_QMAN_MEM_PHYS);
78
79 /* Change default state of BMan ISDR portals to all 1s */
80 inhibit_portals(bpaddr, CONFIG_SYS_BMAN_NUM_PORTALS, MAX_BPORTALS,
81 CONFIG_SYS_BMAN_SP_CINH_SIZE);
82 inhibit_portals(qpaddr, CONFIG_SYS_QMAN_NUM_PORTALS, MAX_QPORTALS,
83 CONFIG_SYS_QMAN_SP_CINH_SIZE);
84 }
85
86 /* Update portal containter to match LAW setup of portal in phy map */ 17 /* Update portal containter to match LAW setup of portal in phy map */
87 void fdt_portal(void *blob, const char *compat, const char *container, 18 void fdt_portal(void *blob, const char *compat, const char *container,
88 u64 addr, u32 size) 19 u64 addr, u32 size)
89 { 20 {
90 int off; 21 int off;
91 22
92 off = fdt_node_offset_by_compatible(blob, -1, compat); 23 off = fdt_node_offset_by_compatible(blob, -1, compat);
93 if (off < 0) 24 if (off < 0)
94 return ; 25 return ;
95 26
96 off = fdt_parent_offset(blob, off); 27 off = fdt_parent_offset(blob, off);
97 /* if non-zero assume we have a container */ 28 /* if non-zero assume we have a container */
98 if (off > 0) { 29 if (off > 0) {
99 char buf[60]; 30 char buf[60];
100 const char *p, *name; 31 const char *p, *name;
101 u32 *range; 32 u32 *range;
102 int len; 33 int len;
103 34
104 /* fixup ranges */ 35 /* fixup ranges */
105 range = fdt_getprop_w(blob, off, "ranges", &len); 36 range = fdt_getprop_w(blob, off, "ranges", &len);
106 if (range == NULL) { 37 if (range == NULL) {
107 printf("ERROR: container for %s has no ranges", compat); 38 printf("ERROR: container for %s has no ranges", compat);
108 return ; 39 return ;
109 } 40 }
110 41
111 range[0] = 0; 42 range[0] = 0;
112 if (len == 16) { 43 if (len == 16) {
113 range[1] = addr >> 32; 44 range[1] = addr >> 32;
114 range[2] = addr & 0xffffffff; 45 range[2] = addr & 0xffffffff;
115 range[3] = size; 46 range[3] = size;
116 } else { 47 } else {
117 range[1] = addr & 0xffffffff; 48 range[1] = addr & 0xffffffff;
118 range[2] = size; 49 range[2] = size;
119 } 50 }
120 fdt_setprop_inplace(blob, off, "ranges", range, len); 51 fdt_setprop_inplace(blob, off, "ranges", range, len);
121 52
122 /* fixup the name */ 53 /* fixup the name */
123 name = fdt_get_name(blob, off, &len); 54 name = fdt_get_name(blob, off, &len);
124 p = memchr(name, '@', len); 55 p = memchr(name, '@', len);
125 56
126 if (p) 57 if (p)
127 len = p - name; 58 len = p - name;
128 59
129 /* if we are given a container name check it 60 /* if we are given a container name check it
130 * against what we found, if it doesnt match exit out */ 61 * against what we found, if it doesnt match exit out */
131 if (container && (memcmp(container, name, len))) { 62 if (container && (memcmp(container, name, len))) {
132 printf("WARNING: container names didn't match %s %s\n", 63 printf("WARNING: container names didn't match %s %s\n",
133 container, name); 64 container, name);
134 return ; 65 return ;
135 } 66 }
136 67
137 memcpy(&buf, name, len); 68 memcpy(&buf, name, len);
138 len += sprintf(&buf[len], "@%llx", addr); 69 len += sprintf(&buf[len], "@%llx", addr);
139 fdt_set_name(blob, off, buf); 70 fdt_set_name(blob, off, buf);
140 return ; 71 return ;
141 } 72 }
142 73
143 printf("ERROR: %s isn't in a container. Not supported\n", compat); 74 printf("ERROR: %s isn't in a container. Not supported\n", compat);
144 }
145
146 static int fdt_qportal(void *blob, int off, int id, char *name,
147 enum fsl_dpaa_dev dev, int create)
148 {
149 int childoff, dev_off, ret = 0;
150 uint32_t dev_handle;
151 #ifdef CONFIG_FSL_CORENET
152 int num;
153 u32 liodns[2];
154 #endif
155
156 childoff = fdt_subnode_offset(blob, off, name);
157 if (create) {
158 char handle[64], *p;
159
160 strncpy(handle, name, sizeof(handle));
161 p = strchr(handle, '@');
162 if (!strncmp(name, "fman", 4)) {
163 *p = *(p + 1);
164 p++;
165 }
166 *p = '\0';
167
168 dev_off = fdt_path_offset(blob, handle);
169 /* skip this node if alias is not found */
170 if (dev_off == -FDT_ERR_BADPATH)
171 return 0;
172 if (dev_off < 0)
173 return dev_off;
174
175 if (childoff <= 0)
176 childoff = fdt_add_subnode(blob, off, name);
177
178 /* need to update the dev_off after adding a subnode */
179 dev_off = fdt_path_offset(blob, handle);
180 if (dev_off < 0)
181 return dev_off;
182
183 if (childoff > 0) {
184 dev_handle = fdt_get_phandle(blob, dev_off);
185 if (dev_handle <= 0) {
186 dev_handle = fdt_alloc_phandle(blob);
187 ret = fdt_set_phandle(blob, dev_off,
188 dev_handle);
189 if (ret < 0)
190 return ret;
191 }
192
193 ret = fdt_setprop(blob, childoff, "dev-handle",
194 &dev_handle, sizeof(dev_handle));
195 if (ret < 0)
196 return ret;
197
198 #ifdef CONFIG_FSL_CORENET
199 num = get_dpaa_liodn(dev, &liodns[0], id);
200 ret = fdt_setprop(blob, childoff, "fsl,liodn",
201 &liodns[0], sizeof(u32) * num);
202 if (!strncmp(name, "pme", 3)) {
203 u32 pme_rev1, pme_rev2;
204 ccsr_pme_t *pme_regs =
205 (void *)CONFIG_SYS_FSL_CORENET_PME_ADDR;
206
207 pme_rev1 = in_be32(&pme_regs->pm_ip_rev_1);
208 pme_rev2 = in_be32(&pme_regs->pm_ip_rev_2);
209 ret = fdt_setprop(blob, childoff,
210 "fsl,pme-rev1", &pme_rev1, sizeof(u32));
211 if (ret < 0)
212 return ret;
213 ret = fdt_setprop(blob, childoff,
214 "fsl,pme-rev2", &pme_rev2, sizeof(u32));
215 }
216 #endif
217 } else {
218 return childoff;
219 }
220 } else {
221 if (childoff > 0)
222 ret = fdt_del_node(blob, childoff);
223 }
224
225 return ret;
226 }
227
228 void fdt_fixup_qportals(void *blob)
229 {
230 int off, err;
231 unsigned int maj, min;
232 unsigned int ip_cfg;
233 ccsr_qman_t *qman = (void *)CONFIG_SYS_FSL_QMAN_ADDR;
234 u32 rev_1 = in_be32(&qman->ip_rev_1);
235 u32 rev_2 = in_be32(&qman->ip_rev_2);
236 char compat[64];
237 int compat_len;
238
239 maj = (rev_1 >> 8) & 0xff;
240 min = rev_1 & 0xff;
241 ip_cfg = rev_2 & 0xff;
242
243 compat_len = sprintf(compat, "fsl,qman-portal-%u.%u.%u",
244 maj, min, ip_cfg) + 1;
245 compat_len += sprintf(compat + compat_len, "fsl,qman-portal") + 1;
246
247 off = fdt_node_offset_by_compatible(blob, -1, "fsl,qman-portal");
248 while (off != -FDT_ERR_NOTFOUND) {
249 #ifdef CONFIG_FSL_CORENET
250 u32 liodns[2];
251 #endif
252 const int *ci = fdt_getprop(blob, off, "cell-index", &err);
253 int i;
254
255 if (!ci)
256 goto err;
257
258 i = *ci;
259 #ifdef CONFIG_SYS_DPAA_FMAN
260 int j;
261 #endif
262
263 err = fdt_setprop(blob, off, "compatible", compat, compat_len);
264 if (err < 0)
265 goto err;
266
267 #ifdef CONFIG_FSL_CORENET
268 liodns[0] = qp_info[i].dliodn;
269 liodns[1] = qp_info[i].fliodn;
270
271 err = fdt_setprop(blob, off, "fsl,liodn",
272 &liodns, sizeof(u32) * 2);
273 if (err < 0)
274 goto err;
275 #endif
276
277 i++;
278
279 err = fdt_qportal(blob, off, i, "crypto@0", FSL_HW_PORTAL_SEC,
280 IS_E_PROCESSOR(get_svr()));
281 if (err < 0)
282 goto err;
283
284 #ifdef CONFIG_FSL_CORENET
285 #ifdef CONFIG_SYS_DPAA_PME
286 err = fdt_qportal(blob, off, i, "pme@0", FSL_HW_PORTAL_PME, 1);
287 if (err < 0)
288 goto err;
289 #else
290 fdt_qportal(blob, off, i, "pme@0", FSL_HW_PORTAL_PME, 0);
291 #endif
292 #endif
293
294 #ifdef CONFIG_SYS_DPAA_FMAN
295 for (j = 0; j < CONFIG_SYS_NUM_FMAN; j++) {
296 char name[] = "fman@0";
297
298 name[sizeof(name) - 2] = '0' + j;
299 err = fdt_qportal(blob, off, i, name,
300 FSL_HW_PORTAL_FMAN1 + j, 1);
301 if (err < 0)
302 goto err;
303 }
304 #endif
305 #ifdef CONFIG_SYS_DPAA_RMAN
306 err = fdt_qportal(blob, off, i, "rman@0",
307 FSL_HW_PORTAL_RMAN, 1);
308 if (err < 0)
309 goto err;
310 #endif
311
312 err:
313 if (err < 0) {
314 printf("ERROR: unable to create props for %s: %s\n",
315 fdt_get_name(blob, off, NULL), fdt_strerror(err));
316 return;
317 }
318
319 off = fdt_node_offset_by_compatible(blob, off, "fsl,qman-portal");
320 }
321 }
322
323 void fdt_fixup_bportals(void *blob)
324 {
325 int off, err;
326 unsigned int maj, min;
327 unsigned int ip_cfg;
328 ccsr_bman_t *bman = (void *)CONFIG_SYS_FSL_BMAN_ADDR;
329 u32 rev_1 = in_be32(&bman->ip_rev_1);
330 u32 rev_2 = in_be32(&bman->ip_rev_2);
331 char compat[64];
332 int compat_len;
333
334 maj = (rev_1 >> 8) & 0xff;
335 min = rev_1 & 0xff;
336
337 ip_cfg = rev_2 & 0xff;
338
339 compat_len = sprintf(compat, "fsl,bman-portal-%u.%u.%u",
340 maj, min, ip_cfg) + 1;
341 compat_len += sprintf(compat + compat_len, "fsl,bman-portal") + 1;
342
343 off = fdt_node_offset_by_compatible(blob, -1, "fsl,bman-portal");
344 while (off != -FDT_ERR_NOTFOUND) {
345 err = fdt_setprop(blob, off, "compatible", compat, compat_len);
346 if (err < 0) {
347 printf("ERROR: unable to create props for %s: %s\n",
348 fdt_get_name(blob, off, NULL),
349 fdt_strerror(err));
350 return;
351 }
352
353 off = fdt_node_offset_by_compatible(blob, off, "fsl,bman-portal");
354 }
355
356 } 75 }
357 76
arch/powerpc/include/asm/fsl_liodn.h
1 /* 1 /*
2 * Copyright 2009-2011 Freescale Semiconductor, Inc. 2 * Copyright 2009-2011 Freescale Semiconductor, Inc.
3 * 3 *
4 * SPDX-License-Identifier: GPL-2.0+ 4 * SPDX-License-Identifier: GPL-2.0+
5 */ 5 */
6 6
7 #ifndef _FSL_LIODN_H_ 7 #ifndef _FSL_LIODN_H_
8 #define _FSL_LIODN_H_ 8 #define _FSL_LIODN_H_
9 9
10 #include <asm/types.h> 10 #include <asm/types.h>
11 #include <fsl_qbman.h>
11 12
12 struct srio_liodn_id_table { 13 struct srio_liodn_id_table {
13 u32 id[2]; 14 u32 id[2];
14 unsigned long reg_offset[2]; 15 unsigned long reg_offset[2];
15 u8 num_ids; 16 u8 num_ids;
16 u8 portid; 17 u8 portid;
17 }; 18 };
18 #define SET_SRIO_LIODN_1(port, idA) \ 19 #define SET_SRIO_LIODN_1(port, idA) \
19 { .id = { idA }, .num_ids = 1, .portid = port, \ 20 { .id = { idA }, .num_ids = 1, .portid = port, \
20 .reg_offset[0] = offsetof(ccsr_gur_t, rio##port##liodnr) \ 21 .reg_offset[0] = offsetof(ccsr_gur_t, rio##port##liodnr) \
21 + CONFIG_SYS_MPC85xx_GUTS_OFFSET + CONFIG_SYS_CCSRBAR, \ 22 + CONFIG_SYS_MPC85xx_GUTS_OFFSET + CONFIG_SYS_CCSRBAR, \
22 } 23 }
23 24
24 #define SET_SRIO_LIODN_2(port, idA, idB) \ 25 #define SET_SRIO_LIODN_2(port, idA, idB) \
25 { .id = { idA, idB }, .num_ids = 2, .portid = port, \ 26 { .id = { idA, idB }, .num_ids = 2, .portid = port, \
26 .reg_offset[0] = offsetof(ccsr_gur_t, rio##port##liodnr) \ 27 .reg_offset[0] = offsetof(ccsr_gur_t, rio##port##liodnr) \
27 + CONFIG_SYS_MPC85xx_GUTS_OFFSET + CONFIG_SYS_CCSRBAR, \ 28 + CONFIG_SYS_MPC85xx_GUTS_OFFSET + CONFIG_SYS_CCSRBAR, \
28 .reg_offset[1] = offsetof(ccsr_gur_t, rio##port##maintliodnr) \ 29 .reg_offset[1] = offsetof(ccsr_gur_t, rio##port##maintliodnr) \
29 + CONFIG_SYS_MPC85xx_GUTS_OFFSET + CONFIG_SYS_CCSRBAR, \ 30 + CONFIG_SYS_MPC85xx_GUTS_OFFSET + CONFIG_SYS_CCSRBAR, \
30 } 31 }
31 32
32 #define SET_SRIO_LIODN_BASE(port, id_a) \ 33 #define SET_SRIO_LIODN_BASE(port, id_a) \
33 { .id = { id_a }, .num_ids = 1, .portid = port, \ 34 { .id = { id_a }, .num_ids = 1, .portid = port, \
34 .reg_offset[0] = offsetof(struct ccsr_rio, liodn) \ 35 .reg_offset[0] = offsetof(struct ccsr_rio, liodn) \
35 + (port - 1) * 0x200 \ 36 + (port - 1) * 0x200 \
36 + CONFIG_SYS_FSL_SRIO_ADDR, \ 37 + CONFIG_SYS_FSL_SRIO_ADDR, \
37 } 38 }
38 39
39 struct liodn_id_table { 40 struct liodn_id_table {
40 const char * compat; 41 const char * compat;
41 u32 id[2]; 42 u32 id[2];
42 u8 num_ids; 43 u8 num_ids;
43 phys_addr_t compat_offset; 44 phys_addr_t compat_offset;
44 unsigned long reg_offset; 45 unsigned long reg_offset;
45 }; 46 };
46 47
47 struct fman_liodn_id_table { 48 struct fman_liodn_id_table {
48 /* Freescale FMan Device Tree binding was updated for FMan. 49 /* Freescale FMan Device Tree binding was updated for FMan.
49 * We need to support both new and old compatibles in order not to 50 * We need to support both new and old compatibles in order not to
50 * break backward compatibility. 51 * break backward compatibility.
51 */ 52 */
52 const char *compat[2]; 53 const char *compat[2];
53 u32 id[2]; 54 u32 id[2];
54 u8 num_ids; 55 u8 num_ids;
55 phys_addr_t compat_offset; 56 phys_addr_t compat_offset;
56 unsigned long reg_offset; 57 unsigned long reg_offset;
57 }; 58 };
58 59
59 extern u32 get_ppid_liodn(int ppid_tbl_idx, int ppid); 60 extern u32 get_ppid_liodn(int ppid_tbl_idx, int ppid);
60 extern void set_liodns(void); 61 extern void set_liodns(void);
61 extern void fdt_fixup_liodn(void *blob); 62 extern void fdt_fixup_liodn(void *blob);
62 63
63 #define SET_LIODN_BASE_1(idA) \ 64 #define SET_LIODN_BASE_1(idA) \
64 { .id = { idA }, .num_ids = 1, } 65 { .id = { idA }, .num_ids = 1, }
65 66
66 #define SET_LIODN_BASE_2(idA, idB) \ 67 #define SET_LIODN_BASE_2(idA, idB) \
67 { .id = { idA, idB }, .num_ids = 2 } 68 { .id = { idA, idB }, .num_ids = 2 }
68 69
69 #define SET_FMAN_LIODN_ENTRY(name1, name2, idA, off, compatoff)\ 70 #define SET_FMAN_LIODN_ENTRY(name1, name2, idA, off, compatoff)\
70 { .compat[0] = name1, \ 71 { .compat[0] = name1, \
71 .compat[1] = name2, \ 72 .compat[1] = name2, \
72 .id = { idA }, .num_ids = 1, \ 73 .id = { idA }, .num_ids = 1, \
73 .reg_offset = off + CONFIG_SYS_CCSRBAR, \ 74 .reg_offset = off + CONFIG_SYS_CCSRBAR, \
74 .compat_offset = compatoff + CONFIG_SYS_CCSRBAR_PHYS, \ 75 .compat_offset = compatoff + CONFIG_SYS_CCSRBAR_PHYS, \
75 } 76 }
76 77
77 #define SET_LIODN_ENTRY_1(name, idA, off, compatoff) \ 78 #define SET_LIODN_ENTRY_1(name, idA, off, compatoff) \
78 { .compat = name, \ 79 { .compat = name, \
79 .id = { idA }, .num_ids = 1, \ 80 .id = { idA }, .num_ids = 1, \
80 .reg_offset = off + CONFIG_SYS_CCSRBAR, \ 81 .reg_offset = off + CONFIG_SYS_CCSRBAR, \
81 .compat_offset = compatoff + CONFIG_SYS_CCSRBAR_PHYS, \ 82 .compat_offset = compatoff + CONFIG_SYS_CCSRBAR_PHYS, \
82 } 83 }
83 84
84 #define SET_LIODN_ENTRY_2(name, idA, idB, off, compatoff) \ 85 #define SET_LIODN_ENTRY_2(name, idA, idB, off, compatoff) \
85 { .compat = name, \ 86 { .compat = name, \
86 .id = { idA, idB }, .num_ids = 2, \ 87 .id = { idA, idB }, .num_ids = 2, \
87 .reg_offset = off + CONFIG_SYS_CCSRBAR, \ 88 .reg_offset = off + CONFIG_SYS_CCSRBAR, \
88 .compat_offset = compatoff + CONFIG_SYS_CCSRBAR_PHYS, \ 89 .compat_offset = compatoff + CONFIG_SYS_CCSRBAR_PHYS, \
89 } 90 }
90 91
91 #define SET_GUTS_LIODN(compat, liodn, name, compatoff) \ 92 #define SET_GUTS_LIODN(compat, liodn, name, compatoff) \
92 SET_LIODN_ENTRY_1(compat, liodn, \ 93 SET_LIODN_ENTRY_1(compat, liodn, \
93 offsetof(ccsr_gur_t, name) + CONFIG_SYS_MPC85xx_GUTS_OFFSET, \ 94 offsetof(ccsr_gur_t, name) + CONFIG_SYS_MPC85xx_GUTS_OFFSET, \
94 compatoff) 95 compatoff)
95 96
96 #define SET_USB_LIODN(usbNum, compat, liodn) \ 97 #define SET_USB_LIODN(usbNum, compat, liodn) \
97 SET_GUTS_LIODN(compat, liodn, usb##usbNum##liodnr,\ 98 SET_GUTS_LIODN(compat, liodn, usb##usbNum##liodnr,\
98 CONFIG_SYS_MPC85xx_USB##usbNum##_OFFSET) 99 CONFIG_SYS_MPC85xx_USB##usbNum##_OFFSET)
99 100
100 #define SET_SATA_LIODN(sataNum, liodn) \ 101 #define SET_SATA_LIODN(sataNum, liodn) \
101 SET_GUTS_LIODN("fsl,pq-sata-v2", liodn, sata##sataNum##liodnr,\ 102 SET_GUTS_LIODN("fsl,pq-sata-v2", liodn, sata##sataNum##liodnr,\
102 CONFIG_SYS_MPC85xx_SATA##sataNum##_OFFSET) 103 CONFIG_SYS_MPC85xx_SATA##sataNum##_OFFSET)
103 104
104 #define SET_PCI_LIODN(compat, pciNum, liodn) \ 105 #define SET_PCI_LIODN(compat, pciNum, liodn) \
105 SET_GUTS_LIODN(compat, liodn, pex##pciNum##liodnr,\ 106 SET_GUTS_LIODN(compat, liodn, pex##pciNum##liodnr,\
106 CONFIG_SYS_MPC85xx_PCIE##pciNum##_OFFSET) 107 CONFIG_SYS_MPC85xx_PCIE##pciNum##_OFFSET)
107 108
108 #define SET_PCI_LIODN_BASE(compat, pciNum, liodn) \ 109 #define SET_PCI_LIODN_BASE(compat, pciNum, liodn) \
109 SET_LIODN_ENTRY_1(compat, liodn,\ 110 SET_LIODN_ENTRY_1(compat, liodn,\
110 offsetof(ccsr_pcix_t, liodn_base) + CONFIG_SYS_MPC85xx_PCIE##pciNum##_OFFSET,\ 111 offsetof(ccsr_pcix_t, liodn_base) + CONFIG_SYS_MPC85xx_PCIE##pciNum##_OFFSET,\
111 CONFIG_SYS_MPC85xx_PCIE##pciNum##_OFFSET) 112 CONFIG_SYS_MPC85xx_PCIE##pciNum##_OFFSET)
112 113
113 /* reg nodes for DMA start @ 0x300 */ 114 /* reg nodes for DMA start @ 0x300 */
114 #define SET_DMA_LIODN(dmaNum, compat, liodn) \ 115 #define SET_DMA_LIODN(dmaNum, compat, liodn) \
115 SET_GUTS_LIODN(compat, liodn, dma##dmaNum##liodnr,\ 116 SET_GUTS_LIODN(compat, liodn, dma##dmaNum##liodnr,\
116 CONFIG_SYS_MPC85xx_DMA##dmaNum##_OFFSET + 0x300) 117 CONFIG_SYS_MPC85xx_DMA##dmaNum##_OFFSET + 0x300)
117 118
118 #define SET_SDHC_LIODN(sdhcNum, liodn) \ 119 #define SET_SDHC_LIODN(sdhcNum, liodn) \
119 SET_GUTS_LIODN("fsl,esdhc", liodn, sdmmc##sdhcNum##liodnr,\ 120 SET_GUTS_LIODN("fsl,esdhc", liodn, sdmmc##sdhcNum##liodnr,\
120 CONFIG_SYS_MPC85xx_ESDHC_OFFSET) 121 CONFIG_SYS_MPC85xx_ESDHC_OFFSET)
121 122
122 #define SET_QE_LIODN(liodn) \ 123 #define SET_QE_LIODN(liodn) \
123 SET_GUTS_LIODN("fsl,qe", liodn, qeliodnr,\ 124 SET_GUTS_LIODN("fsl,qe", liodn, qeliodnr,\
124 CONFIG_SYS_MPC85xx_QE_OFFSET) 125 CONFIG_SYS_MPC85xx_QE_OFFSET)
125 126
126 #define SET_TDM_LIODN(liodn) \ 127 #define SET_TDM_LIODN(liodn) \
127 SET_GUTS_LIODN("fsl,tdm1.0", liodn, tdmliodnr,\ 128 SET_GUTS_LIODN("fsl,tdm1.0", liodn, tdmliodnr,\
128 CONFIG_SYS_MPC85xx_TDM_OFFSET) 129 CONFIG_SYS_MPC85xx_TDM_OFFSET)
129 130
130 #define SET_QMAN_LIODN(liodn) \ 131 #define SET_QMAN_LIODN(liodn) \
131 SET_LIODN_ENTRY_1("fsl,qman", liodn, offsetof(ccsr_qman_t, liodnr) + \ 132 SET_LIODN_ENTRY_1("fsl,qman", liodn, \
133 offsetof(struct ccsr_qman, liodnr) + \
132 CONFIG_SYS_FSL_QMAN_OFFSET, \ 134 CONFIG_SYS_FSL_QMAN_OFFSET, \
133 CONFIG_SYS_FSL_QMAN_OFFSET) 135 CONFIG_SYS_FSL_QMAN_OFFSET)
134 136
135 #define SET_BMAN_LIODN(liodn) \ 137 #define SET_BMAN_LIODN(liodn) \
136 SET_LIODN_ENTRY_1("fsl,bman", liodn, offsetof(ccsr_bman_t, liodnr) + \ 138 SET_LIODN_ENTRY_1("fsl,bman", liodn, \
139 offsetof(struct ccsr_bman, liodnr) + \
137 CONFIG_SYS_FSL_BMAN_OFFSET, \ 140 CONFIG_SYS_FSL_BMAN_OFFSET, \
138 CONFIG_SYS_FSL_BMAN_OFFSET) 141 CONFIG_SYS_FSL_BMAN_OFFSET)
139 142
140 #define SET_PME_LIODN(liodn) \ 143 #define SET_PME_LIODN(liodn) \
141 SET_LIODN_ENTRY_1("fsl,pme", liodn, offsetof(ccsr_pme_t, liodnr) + \ 144 SET_LIODN_ENTRY_1("fsl,pme", liodn, offsetof(ccsr_pme_t, liodnr) + \
142 CONFIG_SYS_FSL_CORENET_PME_OFFSET, \ 145 CONFIG_SYS_FSL_CORENET_PME_OFFSET, \
143 CONFIG_SYS_FSL_CORENET_PME_OFFSET) 146 CONFIG_SYS_FSL_CORENET_PME_OFFSET)
144 147
145 #define SET_PMAN_LIODN(num, liodn) \ 148 #define SET_PMAN_LIODN(num, liodn) \
146 SET_LIODN_ENTRY_2("fsl,pman", liodn, 0, \ 149 SET_LIODN_ENTRY_2("fsl,pman", liodn, 0, \
147 offsetof(struct ccsr_pman, ppa1) + \ 150 offsetof(struct ccsr_pman, ppa1) + \
148 CONFIG_SYS_FSL_CORENET_PMAN##num##_OFFSET, \ 151 CONFIG_SYS_FSL_CORENET_PMAN##num##_OFFSET, \
149 CONFIG_SYS_FSL_CORENET_PMAN##num##_OFFSET) 152 CONFIG_SYS_FSL_CORENET_PMAN##num##_OFFSET)
150 153
151 /* -1 from portID due to how immap has the registers */ 154 /* -1 from portID due to how immap has the registers */
152 #define FM_PPID_RX_PORT_OFFSET(fmNum, portID) \ 155 #define FM_PPID_RX_PORT_OFFSET(fmNum, portID) \
153 CONFIG_SYS_FSL_FM##fmNum##_OFFSET + \ 156 CONFIG_SYS_FSL_FM##fmNum##_OFFSET + \
154 offsetof(struct ccsr_fman, fm_bmi_common.fmbm_ppid[portID - 1]) 157 offsetof(struct ccsr_fman, fm_bmi_common.fmbm_ppid[portID - 1])
155 158
156 #ifdef CONFIG_SYS_FMAN_V3 159 #ifdef CONFIG_SYS_FMAN_V3
157 /* enetNum is 0, 1, 2... so we + 8 for 1g to get to HW Port ID */ 160 /* enetNum is 0, 1, 2... so we + 8 for 1g to get to HW Port ID */
158 #define SET_FMAN_RX_1G_LIODN(fmNum, enetNum, liodn) \ 161 #define SET_FMAN_RX_1G_LIODN(fmNum, enetNum, liodn) \
159 SET_FMAN_LIODN_ENTRY("fsl,fman-v3-port-rx", "fsl,fman-port-1g-rx", \ 162 SET_FMAN_LIODN_ENTRY("fsl,fman-v3-port-rx", "fsl,fman-port-1g-rx", \
160 liodn, FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 8), \ 163 liodn, FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 8), \
161 CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_1G_OFFSET) 164 CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_1G_OFFSET)
162 165
163 /* enetNum is 0, 1, 2... so we + 16 for 10g to get to HW Port ID */ 166 /* enetNum is 0, 1, 2... so we + 16 for 10g to get to HW Port ID */
164 #define SET_FMAN_RX_10G_LIODN(fmNum, enetNum, liodn) \ 167 #define SET_FMAN_RX_10G_LIODN(fmNum, enetNum, liodn) \
165 SET_FMAN_LIODN_ENTRY("fsl,fman-v3-port-rx", "fsl,fman-port-10g-rx", \ 168 SET_FMAN_LIODN_ENTRY("fsl,fman-v3-port-rx", "fsl,fman-port-10g-rx", \
166 liodn, FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 16), \ 169 liodn, FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 16), \
167 CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_10G_OFFSET) 170 CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_10G_OFFSET)
168 171
169 /* enetNum is 0, 1, 2... so we + 8 for type-2 10g to get to HW Port ID */ 172 /* enetNum is 0, 1, 2... so we + 8 for type-2 10g to get to HW Port ID */
170 #define SET_FMAN_RX_10G_TYPE2_LIODN(fmNum, enetNum, liodn) \ 173 #define SET_FMAN_RX_10G_TYPE2_LIODN(fmNum, enetNum, liodn) \
171 SET_FMAN_LIODN_ENTRY("fsl,fman-v3-port-rx", "fsl,fman-port-10g-rx", \ 174 SET_FMAN_LIODN_ENTRY("fsl,fman-v3-port-rx", "fsl,fman-port-10g-rx", \
172 liodn, FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 8), \ 175 liodn, FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 8), \
173 CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_1G_OFFSET) 176 CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_1G_OFFSET)
174 #else 177 #else
175 /* enetNum is 0, 1, 2... so we + 8 for 1g to get to HW Port ID */ 178 /* enetNum is 0, 1, 2... so we + 8 for 1g to get to HW Port ID */
176 #define SET_FMAN_RX_1G_LIODN(fmNum, enetNum, liodn) \ 179 #define SET_FMAN_RX_1G_LIODN(fmNum, enetNum, liodn) \
177 SET_FMAN_LIODN_ENTRY("fsl,fman-v2-port-rx", "fsl,fman-port-1g-rx", \ 180 SET_FMAN_LIODN_ENTRY("fsl,fman-v2-port-rx", "fsl,fman-port-1g-rx", \
178 liodn, FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 8), \ 181 liodn, FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 8), \
179 CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_1G_OFFSET) 182 CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_1G_OFFSET)
180 183
181 /* enetNum is 0, 1, 2... so we + 16 for 10g to get to HW Port ID */ 184 /* enetNum is 0, 1, 2... so we + 16 for 10g to get to HW Port ID */
182 #define SET_FMAN_RX_10G_LIODN(fmNum, enetNum, liodn) \ 185 #define SET_FMAN_RX_10G_LIODN(fmNum, enetNum, liodn) \
183 SET_FMAN_LIODN_ENTRY("fsl,fman-v2-port-rx", "fsl,fman-port-10g-rx", \ 186 SET_FMAN_LIODN_ENTRY("fsl,fman-v2-port-rx", "fsl,fman-port-10g-rx", \
184 liodn, FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 16), \ 187 liodn, FM_PPID_RX_PORT_OFFSET(fmNum, enetNum + 16), \
185 CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_10G_OFFSET) 188 CONFIG_SYS_FSL_FM##fmNum##_RX##enetNum##_10G_OFFSET)
186 #endif 189 #endif
187 /* 190 /*
188 * handle both old and new versioned SEC properties: 191 * handle both old and new versioned SEC properties:
189 * "fsl,secX.Y" became "fsl,sec-vX.Y" during development 192 * "fsl,secX.Y" became "fsl,sec-vX.Y" during development
190 */ 193 */
191 #define SET_SEC_JR_LIODN_ENTRY(jrNum, liodnA, liodnB) \ 194 #define SET_SEC_JR_LIODN_ENTRY(jrNum, liodnA, liodnB) \
192 SET_LIODN_ENTRY_2("fsl,sec4.0-job-ring", liodnA, liodnB,\ 195 SET_LIODN_ENTRY_2("fsl,sec4.0-job-ring", liodnA, liodnB,\
193 offsetof(ccsr_sec_t, jrliodnr[jrNum].ls) + \ 196 offsetof(ccsr_sec_t, jrliodnr[jrNum].ls) + \
194 CONFIG_SYS_FSL_SEC_OFFSET, \ 197 CONFIG_SYS_FSL_SEC_OFFSET, \
195 CONFIG_SYS_FSL_SEC_OFFSET + 0x1000 + 0x1000 * jrNum), \ 198 CONFIG_SYS_FSL_SEC_OFFSET + 0x1000 + 0x1000 * jrNum), \
196 SET_LIODN_ENTRY_2("fsl,sec-v4.0-job-ring", liodnA, liodnB,\ 199 SET_LIODN_ENTRY_2("fsl,sec-v4.0-job-ring", liodnA, liodnB,\
197 offsetof(ccsr_sec_t, jrliodnr[jrNum].ls) + \ 200 offsetof(ccsr_sec_t, jrliodnr[jrNum].ls) + \
198 CONFIG_SYS_FSL_SEC_OFFSET, \ 201 CONFIG_SYS_FSL_SEC_OFFSET, \
199 CONFIG_SYS_FSL_SEC_OFFSET + 0x1000 + 0x1000 * jrNum) 202 CONFIG_SYS_FSL_SEC_OFFSET + 0x1000 + 0x1000 * jrNum)
200 203
201 /* This is a bit evil since we treat rtic param as both a string & hex value */ 204 /* This is a bit evil since we treat rtic param as both a string & hex value */
202 #define SET_SEC_RTIC_LIODN_ENTRY(rtic, liodnA) \ 205 #define SET_SEC_RTIC_LIODN_ENTRY(rtic, liodnA) \
203 SET_LIODN_ENTRY_1("fsl,sec4.0-rtic-memory", \ 206 SET_LIODN_ENTRY_1("fsl,sec4.0-rtic-memory", \
204 liodnA, \ 207 liodnA, \
205 offsetof(ccsr_sec_t, rticliodnr[0x##rtic-0xa].ls) + \ 208 offsetof(ccsr_sec_t, rticliodnr[0x##rtic-0xa].ls) + \
206 CONFIG_SYS_FSL_SEC_OFFSET, \ 209 CONFIG_SYS_FSL_SEC_OFFSET, \
207 CONFIG_SYS_FSL_SEC_OFFSET + 0x6100 + 0x20 * (0x##rtic-0xa)), \ 210 CONFIG_SYS_FSL_SEC_OFFSET + 0x6100 + 0x20 * (0x##rtic-0xa)), \
208 SET_LIODN_ENTRY_1("fsl,sec-v4.0-rtic-memory", \ 211 SET_LIODN_ENTRY_1("fsl,sec-v4.0-rtic-memory", \
209 liodnA, \ 212 liodnA, \
210 offsetof(ccsr_sec_t, rticliodnr[0x##rtic-0xa].ls) + \ 213 offsetof(ccsr_sec_t, rticliodnr[0x##rtic-0xa].ls) + \
211 CONFIG_SYS_FSL_SEC_OFFSET, \ 214 CONFIG_SYS_FSL_SEC_OFFSET, \
212 CONFIG_SYS_FSL_SEC_OFFSET + 0x6100 + 0x20 * (0x##rtic-0xa)) 215 CONFIG_SYS_FSL_SEC_OFFSET + 0x6100 + 0x20 * (0x##rtic-0xa))
213 216
214 #define SET_SEC_DECO_LIODN_ENTRY(num, liodnA, liodnB) \ 217 #define SET_SEC_DECO_LIODN_ENTRY(num, liodnA, liodnB) \
215 SET_LIODN_ENTRY_2(NULL, liodnA, liodnB, \ 218 SET_LIODN_ENTRY_2(NULL, liodnA, liodnB, \
216 offsetof(ccsr_sec_t, decoliodnr[num].ls) + \ 219 offsetof(ccsr_sec_t, decoliodnr[num].ls) + \
217 CONFIG_SYS_FSL_SEC_OFFSET, 0) 220 CONFIG_SYS_FSL_SEC_OFFSET, 0)
218 221
219 #define SET_RAID_ENGINE_JQ_LIODN_ENTRY(jqNum, rNum, liodnA) \ 222 #define SET_RAID_ENGINE_JQ_LIODN_ENTRY(jqNum, rNum, liodnA) \
220 SET_LIODN_ENTRY_1("fsl,raideng-v1.0-job-ring", \ 223 SET_LIODN_ENTRY_1("fsl,raideng-v1.0-job-ring", \
221 liodnA, \ 224 liodnA, \
222 offsetof(struct ccsr_raide, jq[jqNum].ring[rNum].cfg1) + \ 225 offsetof(struct ccsr_raide, jq[jqNum].ring[rNum].cfg1) + \
223 CONFIG_SYS_FSL_RAID_ENGINE_OFFSET, \ 226 CONFIG_SYS_FSL_RAID_ENGINE_OFFSET, \
224 offsetof(struct ccsr_raide, jq[jqNum].ring[rNum].cfg0) + \ 227 offsetof(struct ccsr_raide, jq[jqNum].ring[rNum].cfg0) + \
225 CONFIG_SYS_FSL_RAID_ENGINE_OFFSET) 228 CONFIG_SYS_FSL_RAID_ENGINE_OFFSET)
226 229
227 #define SET_RMAN_LIODN(ibNum, liodn) \ 230 #define SET_RMAN_LIODN(ibNum, liodn) \
228 SET_LIODN_ENTRY_1("fsl,rman-inbound-block", liodn, \ 231 SET_LIODN_ENTRY_1("fsl,rman-inbound-block", liodn, \
229 offsetof(struct ccsr_rman, mmitdr) + \ 232 offsetof(struct ccsr_rman, mmitdr) + \
230 CONFIG_SYS_FSL_CORENET_RMAN_OFFSET, \ 233 CONFIG_SYS_FSL_CORENET_RMAN_OFFSET, \
231 CONFIG_SYS_FSL_CORENET_RMAN_OFFSET + ibNum * 0x1000) 234 CONFIG_SYS_FSL_CORENET_RMAN_OFFSET + ibNum * 0x1000)
232 235
233 extern struct liodn_id_table liodn_tbl[], liodn_bases[], sec_liodn_tbl[]; 236 extern struct liodn_id_table liodn_tbl[], liodn_bases[], sec_liodn_tbl[];
234 extern struct liodn_id_table raide_liodn_tbl[]; 237 extern struct liodn_id_table raide_liodn_tbl[];
235 extern struct fman_liodn_id_table fman1_liodn_tbl[], fman2_liodn_tbl[]; 238 extern struct fman_liodn_id_table fman1_liodn_tbl[], fman2_liodn_tbl[];
236 #ifdef CONFIG_SYS_SRIO 239 #ifdef CONFIG_SYS_SRIO
237 extern struct srio_liodn_id_table srio_liodn_tbl[]; 240 extern struct srio_liodn_id_table srio_liodn_tbl[];
238 extern int srio_liodn_tbl_sz; 241 extern int srio_liodn_tbl_sz;
239 #endif 242 #endif
240 extern struct liodn_id_table rman_liodn_tbl[]; 243 extern struct liodn_id_table rman_liodn_tbl[];
241 extern int liodn_tbl_sz, sec_liodn_tbl_sz, raide_liodn_tbl_sz; 244 extern int liodn_tbl_sz, sec_liodn_tbl_sz, raide_liodn_tbl_sz;
242 extern int fman1_liodn_tbl_sz, fman2_liodn_tbl_sz; 245 extern int fman1_liodn_tbl_sz, fman2_liodn_tbl_sz;
243 extern int rman_liodn_tbl_sz; 246 extern int rman_liodn_tbl_sz;
244 247
245 #endif 248 #endif
246 249
arch/powerpc/include/asm/fsl_portals.h
1 /* 1 /*
2 * Copyright 2009-2011 Freescale Semiconductor, Inc. 2 * Copyright 2009-2011 Freescale Semiconductor, Inc.
3 * 3 *
4 * SPDX-License-Identifier: GPL-2.0+ 4 * SPDX-License-Identifier: GPL-2.0+
5 */ 5 */
6 6
7 #ifndef _FSL_PORTALS_H_ 7 #ifndef _FSL_PORTALS_H_
8 #define _FSL_PORTALS_H_ 8 #define _FSL_PORTALS_H_
9 9
10 /* entries must be in order and contiguous */ 10 /* entries must be in order and contiguous */
11 enum fsl_dpaa_dev { 11 enum fsl_dpaa_dev {
12 FSL_HW_PORTAL_SEC, 12 FSL_HW_PORTAL_SEC,
13 #ifdef CONFIG_SYS_DPAA_FMAN 13 #ifdef CONFIG_SYS_DPAA_FMAN
14 FSL_HW_PORTAL_FMAN1, 14 FSL_HW_PORTAL_FMAN1,
15 #if (CONFIG_SYS_NUM_FMAN == 2) 15 #if (CONFIG_SYS_NUM_FMAN == 2)
16 FSL_HW_PORTAL_FMAN2, 16 FSL_HW_PORTAL_FMAN2,
17 #endif 17 #endif
18 #endif 18 #endif
19 FSL_HW_PORTAL_PME, 19 FSL_HW_PORTAL_PME,
20 #ifdef CONFIG_SYS_FSL_RAID_ENGINE 20 #ifdef CONFIG_SYS_FSL_RAID_ENGINE
21 FSL_HW_PORTAL_RAID_ENGINE, 21 FSL_HW_PORTAL_RAID_ENGINE,
22 #endif 22 #endif
23 #ifdef CONFIG_SYS_DPAA_RMAN 23 #ifdef CONFIG_SYS_DPAA_RMAN
24 FSL_HW_PORTAL_RMAN, 24 FSL_HW_PORTAL_RMAN,
25 #endif 25 #endif
26 #ifdef CONFIG_SYS_DPAA_DCE 26 #ifdef CONFIG_SYS_DPAA_DCE
27 FSL_HW_PORTAL_DCE, 27 FSL_HW_PORTAL_DCE,
28 #endif 28 #endif
29 29
30 }; 30 };
31 31
32 struct qportal_info { 32 struct qportal_info {
33 u16 dliodn; /* DQRR LIODN */ 33 u16 dliodn; /* DQRR LIODN */
34 u16 fliodn; /* frame data LIODN */ 34 u16 fliodn; /* frame data LIODN */
35 u16 liodn_offset; 35 u16 liodn_offset;
36 u8 sdest; 36 u8 sdest;
37 }; 37 };
38 38
39 #define SET_QP_INFO(dqrr, fdata, off, dest) \ 39 #define SET_QP_INFO(dqrr, fdata, off, dest) \
40 { .dliodn = dqrr, .fliodn = fdata, .liodn_offset = off, .sdest = dest } 40 { .dliodn = dqrr, .fliodn = fdata, .liodn_offset = off, .sdest = dest }
41 41
42 extern int get_dpaa_liodn(enum fsl_dpaa_dev dpaa_dev, 42 extern int get_dpaa_liodn(enum fsl_dpaa_dev dpaa_dev,
43 u32 *liodns, int liodn_offset); 43 u32 *liodns, int liodn_offset);
44 extern void setup_portals(void);
45 extern void fdt_fixup_qportals(void *blob);
46 extern void fdt_fixup_bportals(void *blob);
47
48 extern struct qportal_info qp_info[]; 44 extern struct qportal_info qp_info[];
49 extern void fdt_portal(void *blob, const char *compat, const char *container, 45 extern void fdt_portal(void *blob, const char *compat, const char *container,
50 u64 addr, u32 size); 46 u64 addr, u32 size);
51 47
52 #endif 48 #endif
53 49
arch/powerpc/include/asm/immap_85xx.h
1 /* 1 /*
2 * MPC85xx Internal Memory Map 2 * MPC85xx Internal Memory Map
3 * 3 *
4 * Copyright 2007-2012 Freescale Semiconductor, Inc. 4 * Copyright 2007-2012 Freescale Semiconductor, Inc.
5 * 5 *
6 * Copyright(c) 2002,2003 Motorola Inc. 6 * Copyright(c) 2002,2003 Motorola Inc.
7 * Xianghua Xiao (x.xiao@motorola.com) 7 * Xianghua Xiao (x.xiao@motorola.com)
8 * 8 *
9 * SPDX-License-Identifier: GPL-2.0+ 9 * SPDX-License-Identifier: GPL-2.0+
10 */ 10 */
11 11
12 #ifndef __IMMAP_85xx__ 12 #ifndef __IMMAP_85xx__
13 #define __IMMAP_85xx__ 13 #define __IMMAP_85xx__
14 14
15 #include <asm/types.h> 15 #include <asm/types.h>
16 #include <asm/fsl_dma.h> 16 #include <asm/fsl_dma.h>
17 #include <asm/fsl_i2c.h> 17 #include <asm/fsl_i2c.h>
18 #include <fsl_ifc.h> 18 #include <fsl_ifc.h>
19 #include <fsl_sec.h> 19 #include <fsl_sec.h>
20 #include <fsl_sfp.h> 20 #include <fsl_sfp.h>
21 #include <asm/fsl_lbc.h> 21 #include <asm/fsl_lbc.h>
22 #include <fsl_fman.h> 22 #include <fsl_fman.h>
23 #include <fsl_immap.h> 23 #include <fsl_immap.h>
24 24
25 typedef struct ccsr_local { 25 typedef struct ccsr_local {
26 u32 ccsrbarh; /* CCSR Base Addr High */ 26 u32 ccsrbarh; /* CCSR Base Addr High */
27 u32 ccsrbarl; /* CCSR Base Addr Low */ 27 u32 ccsrbarl; /* CCSR Base Addr Low */
28 u32 ccsrar; /* CCSR Attr */ 28 u32 ccsrar; /* CCSR Attr */
29 #define CCSRAR_C 0x80000000 /* Commit */ 29 #define CCSRAR_C 0x80000000 /* Commit */
30 u8 res1[4]; 30 u8 res1[4];
31 u32 altcbarh; /* Alternate Configuration Base Addr High */ 31 u32 altcbarh; /* Alternate Configuration Base Addr High */
32 u32 altcbarl; /* Alternate Configuration Base Addr Low */ 32 u32 altcbarl; /* Alternate Configuration Base Addr Low */
33 u32 altcar; /* Alternate Configuration Attr */ 33 u32 altcar; /* Alternate Configuration Attr */
34 u8 res2[4]; 34 u8 res2[4];
35 u32 bstrh; /* Boot space translation high */ 35 u32 bstrh; /* Boot space translation high */
36 u32 bstrl; /* Boot space translation Low */ 36 u32 bstrl; /* Boot space translation Low */
37 u32 bstrar; /* Boot space translation attributes */ 37 u32 bstrar; /* Boot space translation attributes */
38 u8 res3[0xbd4]; 38 u8 res3[0xbd4];
39 struct { 39 struct {
40 u32 lawbarh; /* LAWn base addr high */ 40 u32 lawbarh; /* LAWn base addr high */
41 u32 lawbarl; /* LAWn base addr low */ 41 u32 lawbarl; /* LAWn base addr low */
42 u32 lawar; /* LAWn attributes */ 42 u32 lawar; /* LAWn attributes */
43 u8 res4[4]; 43 u8 res4[4];
44 } law[32]; 44 } law[32];
45 u8 res35[0x204]; 45 u8 res35[0x204];
46 } ccsr_local_t; 46 } ccsr_local_t;
47 47
48 /* Local-Access Registers & ECM Registers */ 48 /* Local-Access Registers & ECM Registers */
49 typedef struct ccsr_local_ecm { 49 typedef struct ccsr_local_ecm {
50 u32 ccsrbar; /* CCSR Base Addr */ 50 u32 ccsrbar; /* CCSR Base Addr */
51 u8 res1[4]; 51 u8 res1[4];
52 u32 altcbar; /* Alternate Configuration Base Addr */ 52 u32 altcbar; /* Alternate Configuration Base Addr */
53 u8 res2[4]; 53 u8 res2[4];
54 u32 altcar; /* Alternate Configuration Attr */ 54 u32 altcar; /* Alternate Configuration Attr */
55 u8 res3[12]; 55 u8 res3[12];
56 u32 bptr; /* Boot Page Translation */ 56 u32 bptr; /* Boot Page Translation */
57 u8 res4[3044]; 57 u8 res4[3044];
58 u32 lawbar0; /* Local Access Window 0 Base Addr */ 58 u32 lawbar0; /* Local Access Window 0 Base Addr */
59 u8 res5[4]; 59 u8 res5[4];
60 u32 lawar0; /* Local Access Window 0 Attrs */ 60 u32 lawar0; /* Local Access Window 0 Attrs */
61 u8 res6[20]; 61 u8 res6[20];
62 u32 lawbar1; /* Local Access Window 1 Base Addr */ 62 u32 lawbar1; /* Local Access Window 1 Base Addr */
63 u8 res7[4]; 63 u8 res7[4];
64 u32 lawar1; /* Local Access Window 1 Attrs */ 64 u32 lawar1; /* Local Access Window 1 Attrs */
65 u8 res8[20]; 65 u8 res8[20];
66 u32 lawbar2; /* Local Access Window 2 Base Addr */ 66 u32 lawbar2; /* Local Access Window 2 Base Addr */
67 u8 res9[4]; 67 u8 res9[4];
68 u32 lawar2; /* Local Access Window 2 Attrs */ 68 u32 lawar2; /* Local Access Window 2 Attrs */
69 u8 res10[20]; 69 u8 res10[20];
70 u32 lawbar3; /* Local Access Window 3 Base Addr */ 70 u32 lawbar3; /* Local Access Window 3 Base Addr */
71 u8 res11[4]; 71 u8 res11[4];
72 u32 lawar3; /* Local Access Window 3 Attrs */ 72 u32 lawar3; /* Local Access Window 3 Attrs */
73 u8 res12[20]; 73 u8 res12[20];
74 u32 lawbar4; /* Local Access Window 4 Base Addr */ 74 u32 lawbar4; /* Local Access Window 4 Base Addr */
75 u8 res13[4]; 75 u8 res13[4];
76 u32 lawar4; /* Local Access Window 4 Attrs */ 76 u32 lawar4; /* Local Access Window 4 Attrs */
77 u8 res14[20]; 77 u8 res14[20];
78 u32 lawbar5; /* Local Access Window 5 Base Addr */ 78 u32 lawbar5; /* Local Access Window 5 Base Addr */
79 u8 res15[4]; 79 u8 res15[4];
80 u32 lawar5; /* Local Access Window 5 Attrs */ 80 u32 lawar5; /* Local Access Window 5 Attrs */
81 u8 res16[20]; 81 u8 res16[20];
82 u32 lawbar6; /* Local Access Window 6 Base Addr */ 82 u32 lawbar6; /* Local Access Window 6 Base Addr */
83 u8 res17[4]; 83 u8 res17[4];
84 u32 lawar6; /* Local Access Window 6 Attrs */ 84 u32 lawar6; /* Local Access Window 6 Attrs */
85 u8 res18[20]; 85 u8 res18[20];
86 u32 lawbar7; /* Local Access Window 7 Base Addr */ 86 u32 lawbar7; /* Local Access Window 7 Base Addr */
87 u8 res19[4]; 87 u8 res19[4];
88 u32 lawar7; /* Local Access Window 7 Attrs */ 88 u32 lawar7; /* Local Access Window 7 Attrs */
89 u8 res19_8a[20]; 89 u8 res19_8a[20];
90 u32 lawbar8; /* Local Access Window 8 Base Addr */ 90 u32 lawbar8; /* Local Access Window 8 Base Addr */
91 u8 res19_8b[4]; 91 u8 res19_8b[4];
92 u32 lawar8; /* Local Access Window 8 Attrs */ 92 u32 lawar8; /* Local Access Window 8 Attrs */
93 u8 res19_9a[20]; 93 u8 res19_9a[20];
94 u32 lawbar9; /* Local Access Window 9 Base Addr */ 94 u32 lawbar9; /* Local Access Window 9 Base Addr */
95 u8 res19_9b[4]; 95 u8 res19_9b[4];
96 u32 lawar9; /* Local Access Window 9 Attrs */ 96 u32 lawar9; /* Local Access Window 9 Attrs */
97 u8 res19_10a[20]; 97 u8 res19_10a[20];
98 u32 lawbar10; /* Local Access Window 10 Base Addr */ 98 u32 lawbar10; /* Local Access Window 10 Base Addr */
99 u8 res19_10b[4]; 99 u8 res19_10b[4];
100 u32 lawar10; /* Local Access Window 10 Attrs */ 100 u32 lawar10; /* Local Access Window 10 Attrs */
101 u8 res19_11a[20]; 101 u8 res19_11a[20];
102 u32 lawbar11; /* Local Access Window 11 Base Addr */ 102 u32 lawbar11; /* Local Access Window 11 Base Addr */
103 u8 res19_11b[4]; 103 u8 res19_11b[4];
104 u32 lawar11; /* Local Access Window 11 Attrs */ 104 u32 lawar11; /* Local Access Window 11 Attrs */
105 u8 res20[652]; 105 u8 res20[652];
106 u32 eebacr; /* ECM CCB Addr Configuration */ 106 u32 eebacr; /* ECM CCB Addr Configuration */
107 u8 res21[12]; 107 u8 res21[12];
108 u32 eebpcr; /* ECM CCB Port Configuration */ 108 u32 eebpcr; /* ECM CCB Port Configuration */
109 u8 res22[3564]; 109 u8 res22[3564];
110 u32 eedr; /* ECM Error Detect */ 110 u32 eedr; /* ECM Error Detect */
111 u8 res23[4]; 111 u8 res23[4];
112 u32 eeer; /* ECM Error Enable */ 112 u32 eeer; /* ECM Error Enable */
113 u32 eeatr; /* ECM Error Attrs Capture */ 113 u32 eeatr; /* ECM Error Attrs Capture */
114 u32 eeadr; /* ECM Error Addr Capture */ 114 u32 eeadr; /* ECM Error Addr Capture */
115 u8 res24[492]; 115 u8 res24[492];
116 } ccsr_local_ecm_t; 116 } ccsr_local_ecm_t;
117 117
118 #define DDR_EOR_RD_BDW_OPT_DIS 0x80000000 /* Read BDW Opt. disable */ 118 #define DDR_EOR_RD_BDW_OPT_DIS 0x80000000 /* Read BDW Opt. disable */
119 #define DDR_EOR_ADDR_HASH_EN 0x40000000 /* Address hash enabled */ 119 #define DDR_EOR_ADDR_HASH_EN 0x40000000 /* Address hash enabled */
120 120
121 /* I2C Registers */ 121 /* I2C Registers */
122 typedef struct ccsr_i2c { 122 typedef struct ccsr_i2c {
123 struct fsl_i2c_base i2c[1]; 123 struct fsl_i2c_base i2c[1];
124 u8 res[4096 - 1 * sizeof(struct fsl_i2c_base)]; 124 u8 res[4096 - 1 * sizeof(struct fsl_i2c_base)];
125 } ccsr_i2c_t; 125 } ccsr_i2c_t;
126 126
127 #if defined(CONFIG_ARCH_MPC8540) || \ 127 #if defined(CONFIG_ARCH_MPC8540) || \
128 defined(CONFIG_ARCH_MPC8541) || \ 128 defined(CONFIG_ARCH_MPC8541) || \
129 defined(CONFIG_ARCH_MPC8548) || \ 129 defined(CONFIG_ARCH_MPC8548) || \
130 defined(CONFIG_ARCH_MPC8555) 130 defined(CONFIG_ARCH_MPC8555)
131 /* DUART Registers */ 131 /* DUART Registers */
132 typedef struct ccsr_duart { 132 typedef struct ccsr_duart {
133 u8 res1[1280]; 133 u8 res1[1280];
134 /* URBR1, UTHR1, UDLB1 with the same addr */ 134 /* URBR1, UTHR1, UDLB1 with the same addr */
135 u8 urbr1_uthr1_udlb1; 135 u8 urbr1_uthr1_udlb1;
136 /* UIER1, UDMB1 with the same addr01 */ 136 /* UIER1, UDMB1 with the same addr01 */
137 u8 uier1_udmb1; 137 u8 uier1_udmb1;
138 /* UIIR1, UFCR1, UAFR1 with the same addr */ 138 /* UIIR1, UFCR1, UAFR1 with the same addr */
139 u8 uiir1_ufcr1_uafr1; 139 u8 uiir1_ufcr1_uafr1;
140 u8 ulcr1; /* UART1 Line Control */ 140 u8 ulcr1; /* UART1 Line Control */
141 u8 umcr1; /* UART1 Modem Control */ 141 u8 umcr1; /* UART1 Modem Control */
142 u8 ulsr1; /* UART1 Line Status */ 142 u8 ulsr1; /* UART1 Line Status */
143 u8 umsr1; /* UART1 Modem Status */ 143 u8 umsr1; /* UART1 Modem Status */
144 u8 uscr1; /* UART1 Scratch */ 144 u8 uscr1; /* UART1 Scratch */
145 u8 res2[8]; 145 u8 res2[8];
146 u8 udsr1; /* UART1 DMA Status */ 146 u8 udsr1; /* UART1 DMA Status */
147 u8 res3[239]; 147 u8 res3[239];
148 /* URBR2, UTHR2, UDLB2 with the same addr */ 148 /* URBR2, UTHR2, UDLB2 with the same addr */
149 u8 urbr2_uthr2_udlb2; 149 u8 urbr2_uthr2_udlb2;
150 /* UIER2, UDMB2 with the same addr */ 150 /* UIER2, UDMB2 with the same addr */
151 u8 uier2_udmb2; 151 u8 uier2_udmb2;
152 /* UIIR2, UFCR2, UAFR2 with the same addr */ 152 /* UIIR2, UFCR2, UAFR2 with the same addr */
153 u8 uiir2_ufcr2_uafr2; 153 u8 uiir2_ufcr2_uafr2;
154 u8 ulcr2; /* UART2 Line Control */ 154 u8 ulcr2; /* UART2 Line Control */
155 u8 umcr2; /* UART2 Modem Control */ 155 u8 umcr2; /* UART2 Modem Control */
156 u8 ulsr2; /* UART2 Line Status */ 156 u8 ulsr2; /* UART2 Line Status */
157 u8 umsr2; /* UART2 Modem Status */ 157 u8 umsr2; /* UART2 Modem Status */
158 u8 uscr2; /* UART2 Scratch */ 158 u8 uscr2; /* UART2 Scratch */
159 u8 res4[8]; 159 u8 res4[8];
160 u8 udsr2; /* UART2 DMA Status */ 160 u8 udsr2; /* UART2 DMA Status */
161 u8 res5[2543]; 161 u8 res5[2543];
162 } ccsr_duart_t; 162 } ccsr_duart_t;
163 #else /* MPC8560 uses UART on its CPM */ 163 #else /* MPC8560 uses UART on its CPM */
164 typedef struct ccsr_duart { 164 typedef struct ccsr_duart {
165 u8 res[4096]; 165 u8 res[4096];
166 } ccsr_duart_t; 166 } ccsr_duart_t;
167 #endif 167 #endif
168 168
169 /* eSPI Registers */ 169 /* eSPI Registers */
170 typedef struct ccsr_espi { 170 typedef struct ccsr_espi {
171 u32 mode; /* eSPI mode */ 171 u32 mode; /* eSPI mode */
172 u32 event; /* eSPI event */ 172 u32 event; /* eSPI event */
173 u32 mask; /* eSPI mask */ 173 u32 mask; /* eSPI mask */
174 u32 com; /* eSPI command */ 174 u32 com; /* eSPI command */
175 u32 tx; /* eSPI transmit FIFO access */ 175 u32 tx; /* eSPI transmit FIFO access */
176 u32 rx; /* eSPI receive FIFO access */ 176 u32 rx; /* eSPI receive FIFO access */
177 u8 res1[8]; /* reserved */ 177 u8 res1[8]; /* reserved */
178 u32 csmode[4]; /* 0x2c: sSPI CS0/1/2/3 mode */ 178 u32 csmode[4]; /* 0x2c: sSPI CS0/1/2/3 mode */
179 u8 res2[4048]; /* fill up to 0x1000 */ 179 u8 res2[4048]; /* fill up to 0x1000 */
180 } ccsr_espi_t; 180 } ccsr_espi_t;
181 181
182 /* PCI Registers */ 182 /* PCI Registers */
183 typedef struct ccsr_pcix { 183 typedef struct ccsr_pcix {
184 u32 cfg_addr; /* PCIX Configuration Addr */ 184 u32 cfg_addr; /* PCIX Configuration Addr */
185 u32 cfg_data; /* PCIX Configuration Data */ 185 u32 cfg_data; /* PCIX Configuration Data */
186 u32 int_ack; /* PCIX IRQ Acknowledge */ 186 u32 int_ack; /* PCIX IRQ Acknowledge */
187 u8 res000c[52]; 187 u8 res000c[52];
188 u32 liodn_base; /* PCIX LIODN base register */ 188 u32 liodn_base; /* PCIX LIODN base register */
189 u8 res0044[2996]; 189 u8 res0044[2996];
190 u32 ipver1; /* PCIX IP block revision register 1 */ 190 u32 ipver1; /* PCIX IP block revision register 1 */
191 u32 ipver2; /* PCIX IP block revision register 2 */ 191 u32 ipver2; /* PCIX IP block revision register 2 */
192 u32 potar0; /* PCIX Outbound Transaction Addr 0 */ 192 u32 potar0; /* PCIX Outbound Transaction Addr 0 */
193 u32 potear0; /* PCIX Outbound Translation Extended Addr 0 */ 193 u32 potear0; /* PCIX Outbound Translation Extended Addr 0 */
194 u32 powbar0; /* PCIX Outbound Window Base Addr 0 */ 194 u32 powbar0; /* PCIX Outbound Window Base Addr 0 */
195 u32 powbear0; /* PCIX Outbound Window Base Extended Addr 0 */ 195 u32 powbear0; /* PCIX Outbound Window Base Extended Addr 0 */
196 u32 powar0; /* PCIX Outbound Window Attrs 0 */ 196 u32 powar0; /* PCIX Outbound Window Attrs 0 */
197 u8 res2[12]; 197 u8 res2[12];
198 u32 potar1; /* PCIX Outbound Transaction Addr 1 */ 198 u32 potar1; /* PCIX Outbound Transaction Addr 1 */
199 u32 potear1; /* PCIX Outbound Translation Extended Addr 1 */ 199 u32 potear1; /* PCIX Outbound Translation Extended Addr 1 */
200 u32 powbar1; /* PCIX Outbound Window Base Addr 1 */ 200 u32 powbar1; /* PCIX Outbound Window Base Addr 1 */
201 u32 powbear1; /* PCIX Outbound Window Base Extended Addr 1 */ 201 u32 powbear1; /* PCIX Outbound Window Base Extended Addr 1 */
202 u32 powar1; /* PCIX Outbound Window Attrs 1 */ 202 u32 powar1; /* PCIX Outbound Window Attrs 1 */
203 u8 res3[12]; 203 u8 res3[12];
204 u32 potar2; /* PCIX Outbound Transaction Addr 2 */ 204 u32 potar2; /* PCIX Outbound Transaction Addr 2 */
205 u32 potear2; /* PCIX Outbound Translation Extended Addr 2 */ 205 u32 potear2; /* PCIX Outbound Translation Extended Addr 2 */
206 u32 powbar2; /* PCIX Outbound Window Base Addr 2 */ 206 u32 powbar2; /* PCIX Outbound Window Base Addr 2 */
207 u32 powbear2; /* PCIX Outbound Window Base Extended Addr 2 */ 207 u32 powbear2; /* PCIX Outbound Window Base Extended Addr 2 */
208 u32 powar2; /* PCIX Outbound Window Attrs 2 */ 208 u32 powar2; /* PCIX Outbound Window Attrs 2 */
209 u8 res4[12]; 209 u8 res4[12];
210 u32 potar3; /* PCIX Outbound Transaction Addr 3 */ 210 u32 potar3; /* PCIX Outbound Transaction Addr 3 */
211 u32 potear3; /* PCIX Outbound Translation Extended Addr 3 */ 211 u32 potear3; /* PCIX Outbound Translation Extended Addr 3 */
212 u32 powbar3; /* PCIX Outbound Window Base Addr 3 */ 212 u32 powbar3; /* PCIX Outbound Window Base Addr 3 */
213 u32 powbear3; /* PCIX Outbound Window Base Extended Addr 3 */ 213 u32 powbear3; /* PCIX Outbound Window Base Extended Addr 3 */
214 u32 powar3; /* PCIX Outbound Window Attrs 3 */ 214 u32 powar3; /* PCIX Outbound Window Attrs 3 */
215 u8 res5[12]; 215 u8 res5[12];
216 u32 potar4; /* PCIX Outbound Transaction Addr 4 */ 216 u32 potar4; /* PCIX Outbound Transaction Addr 4 */
217 u32 potear4; /* PCIX Outbound Translation Extended Addr 4 */ 217 u32 potear4; /* PCIX Outbound Translation Extended Addr 4 */
218 u32 powbar4; /* PCIX Outbound Window Base Addr 4 */ 218 u32 powbar4; /* PCIX Outbound Window Base Addr 4 */
219 u32 powbear4; /* PCIX Outbound Window Base Extended Addr 4 */ 219 u32 powbear4; /* PCIX Outbound Window Base Extended Addr 4 */
220 u32 powar4; /* PCIX Outbound Window Attrs 4 */ 220 u32 powar4; /* PCIX Outbound Window Attrs 4 */
221 u8 res6[268]; 221 u8 res6[268];
222 u32 pitar3; /* PCIX Inbound Translation Addr 3 */ 222 u32 pitar3; /* PCIX Inbound Translation Addr 3 */
223 u32 pitear3; /* PCIX Inbound Translation Extended Addr 3 */ 223 u32 pitear3; /* PCIX Inbound Translation Extended Addr 3 */
224 u32 piwbar3; /* PCIX Inbound Window Base Addr 3 */ 224 u32 piwbar3; /* PCIX Inbound Window Base Addr 3 */
225 u32 piwbear3; /* PCIX Inbound Window Base Extended Addr 3 */ 225 u32 piwbear3; /* PCIX Inbound Window Base Extended Addr 3 */
226 u32 piwar3; /* PCIX Inbound Window Attrs 3 */ 226 u32 piwar3; /* PCIX Inbound Window Attrs 3 */
227 u8 res7[12]; 227 u8 res7[12];
228 u32 pitar2; /* PCIX Inbound Translation Addr 2 */ 228 u32 pitar2; /* PCIX Inbound Translation Addr 2 */
229 u32 pitear2; /* PCIX Inbound Translation Extended Addr 2 */ 229 u32 pitear2; /* PCIX Inbound Translation Extended Addr 2 */
230 u32 piwbar2; /* PCIX Inbound Window Base Addr 2 */ 230 u32 piwbar2; /* PCIX Inbound Window Base Addr 2 */
231 u32 piwbear2; /* PCIX Inbound Window Base Extended Addr 2 */ 231 u32 piwbear2; /* PCIX Inbound Window Base Extended Addr 2 */
232 u32 piwar2; /* PCIX Inbound Window Attrs 2 */ 232 u32 piwar2; /* PCIX Inbound Window Attrs 2 */
233 u8 res8[12]; 233 u8 res8[12];
234 u32 pitar1; /* PCIX Inbound Translation Addr 1 */ 234 u32 pitar1; /* PCIX Inbound Translation Addr 1 */
235 u32 pitear1; /* PCIX Inbound Translation Extended Addr 1 */ 235 u32 pitear1; /* PCIX Inbound Translation Extended Addr 1 */
236 u32 piwbar1; /* PCIX Inbound Window Base Addr 1 */ 236 u32 piwbar1; /* PCIX Inbound Window Base Addr 1 */
237 u8 res9[4]; 237 u8 res9[4];
238 u32 piwar1; /* PCIX Inbound Window Attrs 1 */ 238 u32 piwar1; /* PCIX Inbound Window Attrs 1 */
239 u8 res10[12]; 239 u8 res10[12];
240 u32 pedr; /* PCIX Error Detect */ 240 u32 pedr; /* PCIX Error Detect */
241 u32 pecdr; /* PCIX Error Capture Disable */ 241 u32 pecdr; /* PCIX Error Capture Disable */
242 u32 peer; /* PCIX Error Enable */ 242 u32 peer; /* PCIX Error Enable */
243 u32 peattrcr; /* PCIX Error Attrs Capture */ 243 u32 peattrcr; /* PCIX Error Attrs Capture */
244 u32 peaddrcr; /* PCIX Error Addr Capture */ 244 u32 peaddrcr; /* PCIX Error Addr Capture */
245 u32 peextaddrcr; /* PCIX Error Extended Addr Capture */ 245 u32 peextaddrcr; /* PCIX Error Extended Addr Capture */
246 u32 pedlcr; /* PCIX Error Data Low Capture */ 246 u32 pedlcr; /* PCIX Error Data Low Capture */
247 u32 pedhcr; /* PCIX Error Error Data High Capture */ 247 u32 pedhcr; /* PCIX Error Error Data High Capture */
248 u32 gas_timr; /* PCIX Gasket Timer */ 248 u32 gas_timr; /* PCIX Gasket Timer */
249 u8 res11[476]; 249 u8 res11[476];
250 } ccsr_pcix_t; 250 } ccsr_pcix_t;
251 251
252 #define PCIX_COMMAND 0x62 252 #define PCIX_COMMAND 0x62
253 #define POWAR_EN 0x80000000 253 #define POWAR_EN 0x80000000
254 #define POWAR_IO_READ 0x00080000 254 #define POWAR_IO_READ 0x00080000
255 #define POWAR_MEM_READ 0x00040000 255 #define POWAR_MEM_READ 0x00040000
256 #define POWAR_IO_WRITE 0x00008000 256 #define POWAR_IO_WRITE 0x00008000
257 #define POWAR_MEM_WRITE 0x00004000 257 #define POWAR_MEM_WRITE 0x00004000
258 #define POWAR_MEM_512M 0x0000001c 258 #define POWAR_MEM_512M 0x0000001c
259 #define POWAR_IO_1M 0x00000013 259 #define POWAR_IO_1M 0x00000013
260 260
261 #define PIWAR_EN 0x80000000 261 #define PIWAR_EN 0x80000000
262 #define PIWAR_PF 0x20000000 262 #define PIWAR_PF 0x20000000
263 #define PIWAR_LOCAL 0x00f00000 263 #define PIWAR_LOCAL 0x00f00000
264 #define PIWAR_READ_SNOOP 0x00050000 264 #define PIWAR_READ_SNOOP 0x00050000
265 #define PIWAR_WRITE_SNOOP 0x00005000 265 #define PIWAR_WRITE_SNOOP 0x00005000
266 #define PIWAR_MEM_2G 0x0000001e 266 #define PIWAR_MEM_2G 0x0000001e
267 267
268 #ifndef CONFIG_MPC85XX_GPIO 268 #ifndef CONFIG_MPC85XX_GPIO
269 typedef struct ccsr_gpio { 269 typedef struct ccsr_gpio {
270 u32 gpdir; 270 u32 gpdir;
271 u32 gpodr; 271 u32 gpodr;
272 u32 gpdat; 272 u32 gpdat;
273 u32 gpier; 273 u32 gpier;
274 u32 gpimr; 274 u32 gpimr;
275 u32 gpicr; 275 u32 gpicr;
276 } ccsr_gpio_t; 276 } ccsr_gpio_t;
277 #endif 277 #endif
278 278
279 /* L2 Cache Registers */ 279 /* L2 Cache Registers */
280 typedef struct ccsr_l2cache { 280 typedef struct ccsr_l2cache {
281 u32 l2ctl; /* L2 configuration 0 */ 281 u32 l2ctl; /* L2 configuration 0 */
282 u8 res1[12]; 282 u8 res1[12];
283 u32 l2cewar0; /* L2 cache external write addr 0 */ 283 u32 l2cewar0; /* L2 cache external write addr 0 */
284 u8 res2[4]; 284 u8 res2[4];
285 u32 l2cewcr0; /* L2 cache external write control 0 */ 285 u32 l2cewcr0; /* L2 cache external write control 0 */
286 u8 res3[4]; 286 u8 res3[4];
287 u32 l2cewar1; /* L2 cache external write addr 1 */ 287 u32 l2cewar1; /* L2 cache external write addr 1 */
288 u8 res4[4]; 288 u8 res4[4];
289 u32 l2cewcr1; /* L2 cache external write control 1 */ 289 u32 l2cewcr1; /* L2 cache external write control 1 */
290 u8 res5[4]; 290 u8 res5[4];
291 u32 l2cewar2; /* L2 cache external write addr 2 */ 291 u32 l2cewar2; /* L2 cache external write addr 2 */
292 u8 res6[4]; 292 u8 res6[4];
293 u32 l2cewcr2; /* L2 cache external write control 2 */ 293 u32 l2cewcr2; /* L2 cache external write control 2 */
294 u8 res7[4]; 294 u8 res7[4];
295 u32 l2cewar3; /* L2 cache external write addr 3 */ 295 u32 l2cewar3; /* L2 cache external write addr 3 */
296 u8 res8[4]; 296 u8 res8[4];
297 u32 l2cewcr3; /* L2 cache external write control 3 */ 297 u32 l2cewcr3; /* L2 cache external write control 3 */
298 u8 res9[180]; 298 u8 res9[180];
299 u32 l2srbar0; /* L2 memory-mapped SRAM base addr 0 */ 299 u32 l2srbar0; /* L2 memory-mapped SRAM base addr 0 */
300 u8 res10[4]; 300 u8 res10[4];
301 u32 l2srbar1; /* L2 memory-mapped SRAM base addr 1 */ 301 u32 l2srbar1; /* L2 memory-mapped SRAM base addr 1 */
302 u8 res11[3316]; 302 u8 res11[3316];
303 u32 l2errinjhi; /* L2 error injection mask high */ 303 u32 l2errinjhi; /* L2 error injection mask high */
304 u32 l2errinjlo; /* L2 error injection mask low */ 304 u32 l2errinjlo; /* L2 error injection mask low */
305 u32 l2errinjctl; /* L2 error injection tag/ECC control */ 305 u32 l2errinjctl; /* L2 error injection tag/ECC control */
306 u8 res12[20]; 306 u8 res12[20];
307 u32 l2captdatahi; /* L2 error data high capture */ 307 u32 l2captdatahi; /* L2 error data high capture */
308 u32 l2captdatalo; /* L2 error data low capture */ 308 u32 l2captdatalo; /* L2 error data low capture */
309 u32 l2captecc; /* L2 error ECC capture */ 309 u32 l2captecc; /* L2 error ECC capture */
310 u8 res13[20]; 310 u8 res13[20];
311 u32 l2errdet; /* L2 error detect */ 311 u32 l2errdet; /* L2 error detect */
312 u32 l2errdis; /* L2 error disable */ 312 u32 l2errdis; /* L2 error disable */
313 u32 l2errinten; /* L2 error interrupt enable */ 313 u32 l2errinten; /* L2 error interrupt enable */
314 u32 l2errattr; /* L2 error attributes capture */ 314 u32 l2errattr; /* L2 error attributes capture */
315 u32 l2erraddr; /* L2 error addr capture */ 315 u32 l2erraddr; /* L2 error addr capture */
316 u8 res14[4]; 316 u8 res14[4];
317 u32 l2errctl; /* L2 error control */ 317 u32 l2errctl; /* L2 error control */
318 u8 res15[420]; 318 u8 res15[420];
319 } ccsr_l2cache_t; 319 } ccsr_l2cache_t;
320 320
321 #define MPC85xx_L2CTL_L2E 0x80000000 321 #define MPC85xx_L2CTL_L2E 0x80000000
322 #define MPC85xx_L2CTL_L2SRAM_ENTIRE 0x00010000 322 #define MPC85xx_L2CTL_L2SRAM_ENTIRE 0x00010000
323 #define MPC85xx_L2ERRDIS_MBECC 0x00000008 323 #define MPC85xx_L2ERRDIS_MBECC 0x00000008
324 #define MPC85xx_L2ERRDIS_SBECC 0x00000004 324 #define MPC85xx_L2ERRDIS_SBECC 0x00000004
325 325
326 /* DMA Registers */ 326 /* DMA Registers */
327 typedef struct ccsr_dma { 327 typedef struct ccsr_dma {
328 u8 res1[256]; 328 u8 res1[256];
329 struct fsl_dma dma[4]; 329 struct fsl_dma dma[4];
330 u32 dgsr; /* DMA General Status */ 330 u32 dgsr; /* DMA General Status */
331 u8 res2[11516]; 331 u8 res2[11516];
332 } ccsr_dma_t; 332 } ccsr_dma_t;
333 333
334 /* tsec */ 334 /* tsec */
335 typedef struct ccsr_tsec { 335 typedef struct ccsr_tsec {
336 u8 res1[16]; 336 u8 res1[16];
337 u32 ievent; /* IRQ Event */ 337 u32 ievent; /* IRQ Event */
338 u32 imask; /* IRQ Mask */ 338 u32 imask; /* IRQ Mask */
339 u32 edis; /* Error Disabled */ 339 u32 edis; /* Error Disabled */
340 u8 res2[4]; 340 u8 res2[4];
341 u32 ecntrl; /* Ethernet Control */ 341 u32 ecntrl; /* Ethernet Control */
342 u32 minflr; /* Minimum Frame Len */ 342 u32 minflr; /* Minimum Frame Len */
343 u32 ptv; /* Pause Time Value */ 343 u32 ptv; /* Pause Time Value */
344 u32 dmactrl; /* DMA Control */ 344 u32 dmactrl; /* DMA Control */
345 u32 tbipa; /* TBI PHY Addr */ 345 u32 tbipa; /* TBI PHY Addr */
346 u8 res3[88]; 346 u8 res3[88];
347 u32 fifo_tx_thr; /* FIFO transmit threshold */ 347 u32 fifo_tx_thr; /* FIFO transmit threshold */
348 u8 res4[8]; 348 u8 res4[8];
349 u32 fifo_tx_starve; /* FIFO transmit starve */ 349 u32 fifo_tx_starve; /* FIFO transmit starve */
350 u32 fifo_tx_starve_shutoff; /* FIFO transmit starve shutoff */ 350 u32 fifo_tx_starve_shutoff; /* FIFO transmit starve shutoff */
351 u8 res5[96]; 351 u8 res5[96];
352 u32 tctrl; /* TX Control */ 352 u32 tctrl; /* TX Control */
353 u32 tstat; /* TX Status */ 353 u32 tstat; /* TX Status */
354 u8 res6[4]; 354 u8 res6[4];
355 u32 tbdlen; /* TX Buffer Desc Data Len */ 355 u32 tbdlen; /* TX Buffer Desc Data Len */
356 u8 res7[16]; 356 u8 res7[16];
357 u32 ctbptrh; /* Current TX Buffer Desc Ptr High */ 357 u32 ctbptrh; /* Current TX Buffer Desc Ptr High */
358 u32 ctbptr; /* Current TX Buffer Desc Ptr */ 358 u32 ctbptr; /* Current TX Buffer Desc Ptr */
359 u8 res8[88]; 359 u8 res8[88];
360 u32 tbptrh; /* TX Buffer Desc Ptr High */ 360 u32 tbptrh; /* TX Buffer Desc Ptr High */
361 u32 tbptr; /* TX Buffer Desc Ptr Low */ 361 u32 tbptr; /* TX Buffer Desc Ptr Low */
362 u8 res9[120]; 362 u8 res9[120];
363 u32 tbaseh; /* TX Desc Base Addr High */ 363 u32 tbaseh; /* TX Desc Base Addr High */
364 u32 tbase; /* TX Desc Base Addr */ 364 u32 tbase; /* TX Desc Base Addr */
365 u8 res10[168]; 365 u8 res10[168];
366 u32 ostbd; /* Out-of-Sequence(OOS) TX Buffer Desc */ 366 u32 ostbd; /* Out-of-Sequence(OOS) TX Buffer Desc */
367 u32 ostbdp; /* OOS TX Data Buffer Ptr */ 367 u32 ostbdp; /* OOS TX Data Buffer Ptr */
368 u32 os32tbdp; /* OOS 32 Bytes TX Data Buffer Ptr Low */ 368 u32 os32tbdp; /* OOS 32 Bytes TX Data Buffer Ptr Low */
369 u32 os32iptrh; /* OOS 32 Bytes TX Insert Ptr High */ 369 u32 os32iptrh; /* OOS 32 Bytes TX Insert Ptr High */
370 u32 os32iptrl; /* OOS 32 Bytes TX Insert Ptr Low */ 370 u32 os32iptrl; /* OOS 32 Bytes TX Insert Ptr Low */
371 u32 os32tbdr; /* OOS 32 Bytes TX Reserved */ 371 u32 os32tbdr; /* OOS 32 Bytes TX Reserved */
372 u32 os32iil; /* OOS 32 Bytes TX Insert Idx/Len */ 372 u32 os32iil; /* OOS 32 Bytes TX Insert Idx/Len */
373 u8 res11[52]; 373 u8 res11[52];
374 u32 rctrl; /* RX Control */ 374 u32 rctrl; /* RX Control */
375 u32 rstat; /* RX Status */ 375 u32 rstat; /* RX Status */
376 u8 res12[4]; 376 u8 res12[4];
377 u32 rbdlen; /* RxBD Data Len */ 377 u32 rbdlen; /* RxBD Data Len */
378 u8 res13[16]; 378 u8 res13[16];
379 u32 crbptrh; /* Current RX Buffer Desc Ptr High */ 379 u32 crbptrh; /* Current RX Buffer Desc Ptr High */
380 u32 crbptr; /* Current RX Buffer Desc Ptr */ 380 u32 crbptr; /* Current RX Buffer Desc Ptr */
381 u8 res14[24]; 381 u8 res14[24];
382 u32 mrblr; /* Maximum RX Buffer Len */ 382 u32 mrblr; /* Maximum RX Buffer Len */
383 u32 mrblr2r3; /* Maximum RX Buffer Len R2R3 */ 383 u32 mrblr2r3; /* Maximum RX Buffer Len R2R3 */
384 u8 res15[56]; 384 u8 res15[56];
385 u32 rbptrh; /* RX Buffer Desc Ptr High 0 */ 385 u32 rbptrh; /* RX Buffer Desc Ptr High 0 */
386 u32 rbptr; /* RX Buffer Desc Ptr */ 386 u32 rbptr; /* RX Buffer Desc Ptr */
387 u32 rbptrh1; /* RX Buffer Desc Ptr High 1 */ 387 u32 rbptrh1; /* RX Buffer Desc Ptr High 1 */
388 u32 rbptrl1; /* RX Buffer Desc Ptr Low 1 */ 388 u32 rbptrl1; /* RX Buffer Desc Ptr Low 1 */
389 u32 rbptrh2; /* RX Buffer Desc Ptr High 2 */ 389 u32 rbptrh2; /* RX Buffer Desc Ptr High 2 */
390 u32 rbptrl2; /* RX Buffer Desc Ptr Low 2 */ 390 u32 rbptrl2; /* RX Buffer Desc Ptr Low 2 */
391 u32 rbptrh3; /* RX Buffer Desc Ptr High 3 */ 391 u32 rbptrh3; /* RX Buffer Desc Ptr High 3 */
392 u32 rbptrl3; /* RX Buffer Desc Ptr Low 3 */ 392 u32 rbptrl3; /* RX Buffer Desc Ptr Low 3 */
393 u8 res16[96]; 393 u8 res16[96];
394 u32 rbaseh; /* RX Desc Base Addr High 0 */ 394 u32 rbaseh; /* RX Desc Base Addr High 0 */
395 u32 rbase; /* RX Desc Base Addr */ 395 u32 rbase; /* RX Desc Base Addr */
396 u32 rbaseh1; /* RX Desc Base Addr High 1 */ 396 u32 rbaseh1; /* RX Desc Base Addr High 1 */
397 u32 rbasel1; /* RX Desc Base Addr Low 1 */ 397 u32 rbasel1; /* RX Desc Base Addr Low 1 */
398 u32 rbaseh2; /* RX Desc Base Addr High 2 */ 398 u32 rbaseh2; /* RX Desc Base Addr High 2 */
399 u32 rbasel2; /* RX Desc Base Addr Low 2 */ 399 u32 rbasel2; /* RX Desc Base Addr Low 2 */
400 u32 rbaseh3; /* RX Desc Base Addr High 3 */ 400 u32 rbaseh3; /* RX Desc Base Addr High 3 */
401 u32 rbasel3; /* RX Desc Base Addr Low 3 */ 401 u32 rbasel3; /* RX Desc Base Addr Low 3 */
402 u8 res17[224]; 402 u8 res17[224];
403 u32 maccfg1; /* MAC Configuration 1 */ 403 u32 maccfg1; /* MAC Configuration 1 */
404 u32 maccfg2; /* MAC Configuration 2 */ 404 u32 maccfg2; /* MAC Configuration 2 */
405 u32 ipgifg; /* Inter Packet Gap/Inter Frame Gap */ 405 u32 ipgifg; /* Inter Packet Gap/Inter Frame Gap */
406 u32 hafdup; /* Half Duplex */ 406 u32 hafdup; /* Half Duplex */
407 u32 maxfrm; /* Maximum Frame Len */ 407 u32 maxfrm; /* Maximum Frame Len */
408 u8 res18[12]; 408 u8 res18[12];
409 u32 miimcfg; /* MII Management Configuration */ 409 u32 miimcfg; /* MII Management Configuration */
410 u32 miimcom; /* MII Management Cmd */ 410 u32 miimcom; /* MII Management Cmd */
411 u32 miimadd; /* MII Management Addr */ 411 u32 miimadd; /* MII Management Addr */
412 u32 miimcon; /* MII Management Control */ 412 u32 miimcon; /* MII Management Control */
413 u32 miimstat; /* MII Management Status */ 413 u32 miimstat; /* MII Management Status */
414 u32 miimind; /* MII Management Indicator */ 414 u32 miimind; /* MII Management Indicator */
415 u8 res19[4]; 415 u8 res19[4];
416 u32 ifstat; /* Interface Status */ 416 u32 ifstat; /* Interface Status */
417 u32 macstnaddr1; /* Station Addr Part 1 */ 417 u32 macstnaddr1; /* Station Addr Part 1 */
418 u32 macstnaddr2; /* Station Addr Part 2 */ 418 u32 macstnaddr2; /* Station Addr Part 2 */
419 u8 res20[312]; 419 u8 res20[312];
420 u32 tr64; /* TX & RX 64-byte Frame Counter */ 420 u32 tr64; /* TX & RX 64-byte Frame Counter */
421 u32 tr127; /* TX & RX 65-127 byte Frame Counter */ 421 u32 tr127; /* TX & RX 65-127 byte Frame Counter */
422 u32 tr255; /* TX & RX 128-255 byte Frame Counter */ 422 u32 tr255; /* TX & RX 128-255 byte Frame Counter */
423 u32 tr511; /* TX & RX 256-511 byte Frame Counter */ 423 u32 tr511; /* TX & RX 256-511 byte Frame Counter */
424 u32 tr1k; /* TX & RX 512-1023 byte Frame Counter */ 424 u32 tr1k; /* TX & RX 512-1023 byte Frame Counter */
425 u32 trmax; /* TX & RX 1024-1518 byte Frame Counter */ 425 u32 trmax; /* TX & RX 1024-1518 byte Frame Counter */
426 u32 trmgv; /* TX & RX 1519-1522 byte Good VLAN Frame */ 426 u32 trmgv; /* TX & RX 1519-1522 byte Good VLAN Frame */
427 u32 rbyt; /* RX Byte Counter */ 427 u32 rbyt; /* RX Byte Counter */
428 u32 rpkt; /* RX Packet Counter */ 428 u32 rpkt; /* RX Packet Counter */
429 u32 rfcs; /* RX FCS Error Counter */ 429 u32 rfcs; /* RX FCS Error Counter */
430 u32 rmca; /* RX Multicast Packet Counter */ 430 u32 rmca; /* RX Multicast Packet Counter */
431 u32 rbca; /* RX Broadcast Packet Counter */ 431 u32 rbca; /* RX Broadcast Packet Counter */
432 u32 rxcf; /* RX Control Frame Packet Counter */ 432 u32 rxcf; /* RX Control Frame Packet Counter */
433 u32 rxpf; /* RX Pause Frame Packet Counter */ 433 u32 rxpf; /* RX Pause Frame Packet Counter */
434 u32 rxuo; /* RX Unknown OP Code Counter */ 434 u32 rxuo; /* RX Unknown OP Code Counter */
435 u32 raln; /* RX Alignment Error Counter */ 435 u32 raln; /* RX Alignment Error Counter */
436 u32 rflr; /* RX Frame Len Error Counter */ 436 u32 rflr; /* RX Frame Len Error Counter */
437 u32 rcde; /* RX Code Error Counter */ 437 u32 rcde; /* RX Code Error Counter */
438 u32 rcse; /* RX Carrier Sense Error Counter */ 438 u32 rcse; /* RX Carrier Sense Error Counter */
439 u32 rund; /* RX Undersize Packet Counter */ 439 u32 rund; /* RX Undersize Packet Counter */
440 u32 rovr; /* RX Oversize Packet Counter */ 440 u32 rovr; /* RX Oversize Packet Counter */
441 u32 rfrg; /* RX Fragments Counter */ 441 u32 rfrg; /* RX Fragments Counter */
442 u32 rjbr; /* RX Jabber Counter */ 442 u32 rjbr; /* RX Jabber Counter */
443 u32 rdrp; /* RX Drop Counter */ 443 u32 rdrp; /* RX Drop Counter */
444 u32 tbyt; /* TX Byte Counter Counter */ 444 u32 tbyt; /* TX Byte Counter Counter */
445 u32 tpkt; /* TX Packet Counter */ 445 u32 tpkt; /* TX Packet Counter */
446 u32 tmca; /* TX Multicast Packet Counter */ 446 u32 tmca; /* TX Multicast Packet Counter */
447 u32 tbca; /* TX Broadcast Packet Counter */ 447 u32 tbca; /* TX Broadcast Packet Counter */
448 u32 txpf; /* TX Pause Control Frame Counter */ 448 u32 txpf; /* TX Pause Control Frame Counter */
449 u32 tdfr; /* TX Deferral Packet Counter */ 449 u32 tdfr; /* TX Deferral Packet Counter */
450 u32 tedf; /* TX Excessive Deferral Packet Counter */ 450 u32 tedf; /* TX Excessive Deferral Packet Counter */
451 u32 tscl; /* TX Single Collision Packet Counter */ 451 u32 tscl; /* TX Single Collision Packet Counter */
452 u32 tmcl; /* TX Multiple Collision Packet Counter */ 452 u32 tmcl; /* TX Multiple Collision Packet Counter */
453 u32 tlcl; /* TX Late Collision Packet Counter */ 453 u32 tlcl; /* TX Late Collision Packet Counter */
454 u32 txcl; /* TX Excessive Collision Packet Counter */ 454 u32 txcl; /* TX Excessive Collision Packet Counter */
455 u32 tncl; /* TX Total Collision Counter */ 455 u32 tncl; /* TX Total Collision Counter */
456 u8 res21[4]; 456 u8 res21[4];
457 u32 tdrp; /* TX Drop Frame Counter */ 457 u32 tdrp; /* TX Drop Frame Counter */
458 u32 tjbr; /* TX Jabber Frame Counter */ 458 u32 tjbr; /* TX Jabber Frame Counter */
459 u32 tfcs; /* TX FCS Error Counter */ 459 u32 tfcs; /* TX FCS Error Counter */
460 u32 txcf; /* TX Control Frame Counter */ 460 u32 txcf; /* TX Control Frame Counter */
461 u32 tovr; /* TX Oversize Frame Counter */ 461 u32 tovr; /* TX Oversize Frame Counter */
462 u32 tund; /* TX Undersize Frame Counter */ 462 u32 tund; /* TX Undersize Frame Counter */
463 u32 tfrg; /* TX Fragments Frame Counter */ 463 u32 tfrg; /* TX Fragments Frame Counter */
464 u32 car1; /* Carry One */ 464 u32 car1; /* Carry One */
465 u32 car2; /* Carry Two */ 465 u32 car2; /* Carry Two */
466 u32 cam1; /* Carry Mask One */ 466 u32 cam1; /* Carry Mask One */
467 u32 cam2; /* Carry Mask Two */ 467 u32 cam2; /* Carry Mask Two */
468 u8 res22[192]; 468 u8 res22[192];
469 u32 iaddr0; /* Indivdual addr 0 */ 469 u32 iaddr0; /* Indivdual addr 0 */
470 u32 iaddr1; /* Indivdual addr 1 */ 470 u32 iaddr1; /* Indivdual addr 1 */
471 u32 iaddr2; /* Indivdual addr 2 */ 471 u32 iaddr2; /* Indivdual addr 2 */
472 u32 iaddr3; /* Indivdual addr 3 */ 472 u32 iaddr3; /* Indivdual addr 3 */
473 u32 iaddr4; /* Indivdual addr 4 */ 473 u32 iaddr4; /* Indivdual addr 4 */
474 u32 iaddr5; /* Indivdual addr 5 */ 474 u32 iaddr5; /* Indivdual addr 5 */
475 u32 iaddr6; /* Indivdual addr 6 */ 475 u32 iaddr6; /* Indivdual addr 6 */
476 u32 iaddr7; /* Indivdual addr 7 */ 476 u32 iaddr7; /* Indivdual addr 7 */
477 u8 res23[96]; 477 u8 res23[96];
478 u32 gaddr0; /* Global addr 0 */ 478 u32 gaddr0; /* Global addr 0 */
479 u32 gaddr1; /* Global addr 1 */ 479 u32 gaddr1; /* Global addr 1 */
480 u32 gaddr2; /* Global addr 2 */ 480 u32 gaddr2; /* Global addr 2 */
481 u32 gaddr3; /* Global addr 3 */ 481 u32 gaddr3; /* Global addr 3 */
482 u32 gaddr4; /* Global addr 4 */ 482 u32 gaddr4; /* Global addr 4 */
483 u32 gaddr5; /* Global addr 5 */ 483 u32 gaddr5; /* Global addr 5 */
484 u32 gaddr6; /* Global addr 6 */ 484 u32 gaddr6; /* Global addr 6 */
485 u32 gaddr7; /* Global addr 7 */ 485 u32 gaddr7; /* Global addr 7 */
486 u8 res24[96]; 486 u8 res24[96];
487 u32 pmd0; /* Pattern Match Data */ 487 u32 pmd0; /* Pattern Match Data */
488 u8 res25[4]; 488 u8 res25[4];
489 u32 pmask0; /* Pattern Mask */ 489 u32 pmask0; /* Pattern Mask */
490 u8 res26[4]; 490 u8 res26[4];
491 u32 pcntrl0; /* Pattern Match Control */ 491 u32 pcntrl0; /* Pattern Match Control */
492 u8 res27[4]; 492 u8 res27[4];
493 u32 pattrb0; /* Pattern Match Attrs */ 493 u32 pattrb0; /* Pattern Match Attrs */
494 u32 pattrbeli0; /* Pattern Match Attrs Extract Len & Idx */ 494 u32 pattrbeli0; /* Pattern Match Attrs Extract Len & Idx */
495 u32 pmd1; /* Pattern Match Data */ 495 u32 pmd1; /* Pattern Match Data */
496 u8 res28[4]; 496 u8 res28[4];
497 u32 pmask1; /* Pattern Mask */ 497 u32 pmask1; /* Pattern Mask */
498 u8 res29[4]; 498 u8 res29[4];
499 u32 pcntrl1; /* Pattern Match Control */ 499 u32 pcntrl1; /* Pattern Match Control */
500 u8 res30[4]; 500 u8 res30[4];
501 u32 pattrb1; /* Pattern Match Attrs */ 501 u32 pattrb1; /* Pattern Match Attrs */
502 u32 pattrbeli1; /* Pattern Match Attrs Extract Len & Idx */ 502 u32 pattrbeli1; /* Pattern Match Attrs Extract Len & Idx */
503 u32 pmd2; /* Pattern Match Data */ 503 u32 pmd2; /* Pattern Match Data */
504 u8 res31[4]; 504 u8 res31[4];
505 u32 pmask2; /* Pattern Mask */ 505 u32 pmask2; /* Pattern Mask */
506 u8 res32[4]; 506 u8 res32[4];
507 u32 pcntrl2; /* Pattern Match Control */ 507 u32 pcntrl2; /* Pattern Match Control */
508 u8 res33[4]; 508 u8 res33[4];
509 u32 pattrb2; /* Pattern Match Attrs */ 509 u32 pattrb2; /* Pattern Match Attrs */
510 u32 pattrbeli2; /* Pattern Match Attrs Extract Len & Idx */ 510 u32 pattrbeli2; /* Pattern Match Attrs Extract Len & Idx */
511 u32 pmd3; /* Pattern Match Data */ 511 u32 pmd3; /* Pattern Match Data */
512 u8 res34[4]; 512 u8 res34[4];
513 u32 pmask3; /* Pattern Mask */ 513 u32 pmask3; /* Pattern Mask */
514 u8 res35[4]; 514 u8 res35[4];
515 u32 pcntrl3; /* Pattern Match Control */ 515 u32 pcntrl3; /* Pattern Match Control */
516 u8 res36[4]; 516 u8 res36[4];
517 u32 pattrb3; /* Pattern Match Attrs */ 517 u32 pattrb3; /* Pattern Match Attrs */
518 u32 pattrbeli3; /* Pattern Match Attrs Extract Len & Idx */ 518 u32 pattrbeli3; /* Pattern Match Attrs Extract Len & Idx */
519 u32 pmd4; /* Pattern Match Data */ 519 u32 pmd4; /* Pattern Match Data */
520 u8 res37[4]; 520 u8 res37[4];
521 u32 pmask4; /* Pattern Mask */ 521 u32 pmask4; /* Pattern Mask */
522 u8 res38[4]; 522 u8 res38[4];
523 u32 pcntrl4; /* Pattern Match Control */ 523 u32 pcntrl4; /* Pattern Match Control */
524 u8 res39[4]; 524 u8 res39[4];
525 u32 pattrb4; /* Pattern Match Attrs */ 525 u32 pattrb4; /* Pattern Match Attrs */
526 u32 pattrbeli4; /* Pattern Match Attrs Extract Len & Idx */ 526 u32 pattrbeli4; /* Pattern Match Attrs Extract Len & Idx */
527 u32 pmd5; /* Pattern Match Data */ 527 u32 pmd5; /* Pattern Match Data */
528 u8 res40[4]; 528 u8 res40[4];
529 u32 pmask5; /* Pattern Mask */ 529 u32 pmask5; /* Pattern Mask */
530 u8 res41[4]; 530 u8 res41[4];
531 u32 pcntrl5; /* Pattern Match Control */ 531 u32 pcntrl5; /* Pattern Match Control */
532 u8 res42[4]; 532 u8 res42[4];
533 u32 pattrb5; /* Pattern Match Attrs */ 533 u32 pattrb5; /* Pattern Match Attrs */
534 u32 pattrbeli5; /* Pattern Match Attrs Extract Len & Idx */ 534 u32 pattrbeli5; /* Pattern Match Attrs Extract Len & Idx */
535 u32 pmd6; /* Pattern Match Data */ 535 u32 pmd6; /* Pattern Match Data */
536 u8 res43[4]; 536 u8 res43[4];
537 u32 pmask6; /* Pattern Mask */ 537 u32 pmask6; /* Pattern Mask */
538 u8 res44[4]; 538 u8 res44[4];
539 u32 pcntrl6; /* Pattern Match Control */ 539 u32 pcntrl6; /* Pattern Match Control */
540 u8 res45[4]; 540 u8 res45[4];
541 u32 pattrb6; /* Pattern Match Attrs */ 541 u32 pattrb6; /* Pattern Match Attrs */
542 u32 pattrbeli6; /* Pattern Match Attrs Extract Len & Idx */ 542 u32 pattrbeli6; /* Pattern Match Attrs Extract Len & Idx */
543 u32 pmd7; /* Pattern Match Data */ 543 u32 pmd7; /* Pattern Match Data */
544 u8 res46[4]; 544 u8 res46[4];
545 u32 pmask7; /* Pattern Mask */ 545 u32 pmask7; /* Pattern Mask */
546 u8 res47[4]; 546 u8 res47[4];
547 u32 pcntrl7; /* Pattern Match Control */ 547 u32 pcntrl7; /* Pattern Match Control */
548 u8 res48[4]; 548 u8 res48[4];
549 u32 pattrb7; /* Pattern Match Attrs */ 549 u32 pattrb7; /* Pattern Match Attrs */
550 u32 pattrbeli7; /* Pattern Match Attrs Extract Len & Idx */ 550 u32 pattrbeli7; /* Pattern Match Attrs Extract Len & Idx */
551 u32 pmd8; /* Pattern Match Data */ 551 u32 pmd8; /* Pattern Match Data */
552 u8 res49[4]; 552 u8 res49[4];
553 u32 pmask8; /* Pattern Mask */ 553 u32 pmask8; /* Pattern Mask */
554 u8 res50[4]; 554 u8 res50[4];
555 u32 pcntrl8; /* Pattern Match Control */ 555 u32 pcntrl8; /* Pattern Match Control */
556 u8 res51[4]; 556 u8 res51[4];
557 u32 pattrb8; /* Pattern Match Attrs */ 557 u32 pattrb8; /* Pattern Match Attrs */
558 u32 pattrbeli8; /* Pattern Match Attrs Extract Len & Idx */ 558 u32 pattrbeli8; /* Pattern Match Attrs Extract Len & Idx */
559 u32 pmd9; /* Pattern Match Data */ 559 u32 pmd9; /* Pattern Match Data */
560 u8 res52[4]; 560 u8 res52[4];
561 u32 pmask9; /* Pattern Mask */ 561 u32 pmask9; /* Pattern Mask */
562 u8 res53[4]; 562 u8 res53[4];
563 u32 pcntrl9; /* Pattern Match Control */ 563 u32 pcntrl9; /* Pattern Match Control */
564 u8 res54[4]; 564 u8 res54[4];
565 u32 pattrb9; /* Pattern Match Attrs */ 565 u32 pattrb9; /* Pattern Match Attrs */
566 u32 pattrbeli9; /* Pattern Match Attrs Extract Len & Idx */ 566 u32 pattrbeli9; /* Pattern Match Attrs Extract Len & Idx */
567 u32 pmd10; /* Pattern Match Data */ 567 u32 pmd10; /* Pattern Match Data */
568 u8 res55[4]; 568 u8 res55[4];
569 u32 pmask10; /* Pattern Mask */ 569 u32 pmask10; /* Pattern Mask */
570 u8 res56[4]; 570 u8 res56[4];
571 u32 pcntrl10; /* Pattern Match Control */ 571 u32 pcntrl10; /* Pattern Match Control */
572 u8 res57[4]; 572 u8 res57[4];
573 u32 pattrb10; /* Pattern Match Attrs */ 573 u32 pattrb10; /* Pattern Match Attrs */
574 u32 pattrbeli10; /* Pattern Match Attrs Extract Len & Idx */ 574 u32 pattrbeli10; /* Pattern Match Attrs Extract Len & Idx */
575 u32 pmd11; /* Pattern Match Data */ 575 u32 pmd11; /* Pattern Match Data */
576 u8 res58[4]; 576 u8 res58[4];
577 u32 pmask11; /* Pattern Mask */ 577 u32 pmask11; /* Pattern Mask */
578 u8 res59[4]; 578 u8 res59[4];
579 u32 pcntrl11; /* Pattern Match Control */ 579 u32 pcntrl11; /* Pattern Match Control */
580 u8 res60[4]; 580 u8 res60[4];
581 u32 pattrb11; /* Pattern Match Attrs */ 581 u32 pattrb11; /* Pattern Match Attrs */
582 u32 pattrbeli11; /* Pattern Match Attrs Extract Len & Idx */ 582 u32 pattrbeli11; /* Pattern Match Attrs Extract Len & Idx */
583 u32 pmd12; /* Pattern Match Data */ 583 u32 pmd12; /* Pattern Match Data */
584 u8 res61[4]; 584 u8 res61[4];
585 u32 pmask12; /* Pattern Mask */ 585 u32 pmask12; /* Pattern Mask */
586 u8 res62[4]; 586 u8 res62[4];
587 u32 pcntrl12; /* Pattern Match Control */ 587 u32 pcntrl12; /* Pattern Match Control */
588 u8 res63[4]; 588 u8 res63[4];
589 u32 pattrb12; /* Pattern Match Attrs */ 589 u32 pattrb12; /* Pattern Match Attrs */
590 u32 pattrbeli12; /* Pattern Match Attrs Extract Len & Idx */ 590 u32 pattrbeli12; /* Pattern Match Attrs Extract Len & Idx */
591 u32 pmd13; /* Pattern Match Data */ 591 u32 pmd13; /* Pattern Match Data */
592 u8 res64[4]; 592 u8 res64[4];
593 u32 pmask13; /* Pattern Mask */ 593 u32 pmask13; /* Pattern Mask */
594 u8 res65[4]; 594 u8 res65[4];
595 u32 pcntrl13; /* Pattern Match Control */ 595 u32 pcntrl13; /* Pattern Match Control */
596 u8 res66[4]; 596 u8 res66[4];
597 u32 pattrb13; /* Pattern Match Attrs */ 597 u32 pattrb13; /* Pattern Match Attrs */
598 u32 pattrbeli13; /* Pattern Match Attrs Extract Len & Idx */ 598 u32 pattrbeli13; /* Pattern Match Attrs Extract Len & Idx */
599 u32 pmd14; /* Pattern Match Data */ 599 u32 pmd14; /* Pattern Match Data */
600 u8 res67[4]; 600 u8 res67[4];
601 u32 pmask14; /* Pattern Mask */ 601 u32 pmask14; /* Pattern Mask */
602 u8 res68[4]; 602 u8 res68[4];
603 u32 pcntrl14; /* Pattern Match Control */ 603 u32 pcntrl14; /* Pattern Match Control */
604 u8 res69[4]; 604 u8 res69[4];
605 u32 pattrb14; /* Pattern Match Attrs */ 605 u32 pattrb14; /* Pattern Match Attrs */
606 u32 pattrbeli14; /* Pattern Match Attrs Extract Len & Idx */ 606 u32 pattrbeli14; /* Pattern Match Attrs Extract Len & Idx */
607 u32 pmd15; /* Pattern Match Data */ 607 u32 pmd15; /* Pattern Match Data */
608 u8 res70[4]; 608 u8 res70[4];
609 u32 pmask15; /* Pattern Mask */ 609 u32 pmask15; /* Pattern Mask */
610 u8 res71[4]; 610 u8 res71[4];
611 u32 pcntrl15; /* Pattern Match Control */ 611 u32 pcntrl15; /* Pattern Match Control */
612 u8 res72[4]; 612 u8 res72[4];
613 u32 pattrb15; /* Pattern Match Attrs */ 613 u32 pattrb15; /* Pattern Match Attrs */
614 u32 pattrbeli15; /* Pattern Match Attrs Extract Len & Idx */ 614 u32 pattrbeli15; /* Pattern Match Attrs Extract Len & Idx */
615 u8 res73[248]; 615 u8 res73[248];
616 u32 attr; /* Attrs */ 616 u32 attr; /* Attrs */
617 u32 attreli; /* Attrs Extract Len & Idx */ 617 u32 attreli; /* Attrs Extract Len & Idx */
618 u8 res74[1024]; 618 u8 res74[1024];
619 } ccsr_tsec_t; 619 } ccsr_tsec_t;
620 620
621 /* PIC Registers */ 621 /* PIC Registers */
622 typedef struct ccsr_pic { 622 typedef struct ccsr_pic {
623 u8 res1[64]; 623 u8 res1[64];
624 u32 ipidr0; /* Interprocessor IRQ Dispatch 0 */ 624 u32 ipidr0; /* Interprocessor IRQ Dispatch 0 */
625 u8 res2[12]; 625 u8 res2[12];
626 u32 ipidr1; /* Interprocessor IRQ Dispatch 1 */ 626 u32 ipidr1; /* Interprocessor IRQ Dispatch 1 */
627 u8 res3[12]; 627 u8 res3[12];
628 u32 ipidr2; /* Interprocessor IRQ Dispatch 2 */ 628 u32 ipidr2; /* Interprocessor IRQ Dispatch 2 */
629 u8 res4[12]; 629 u8 res4[12];
630 u32 ipidr3; /* Interprocessor IRQ Dispatch 3 */ 630 u32 ipidr3; /* Interprocessor IRQ Dispatch 3 */
631 u8 res5[12]; 631 u8 res5[12];
632 u32 ctpr; /* Current Task Priority */ 632 u32 ctpr; /* Current Task Priority */
633 u8 res6[12]; 633 u8 res6[12];
634 u32 whoami; /* Who Am I */ 634 u32 whoami; /* Who Am I */
635 u8 res7[12]; 635 u8 res7[12];
636 u32 iack; /* IRQ Acknowledge */ 636 u32 iack; /* IRQ Acknowledge */
637 u8 res8[12]; 637 u8 res8[12];
638 u32 eoi; /* End Of IRQ */ 638 u32 eoi; /* End Of IRQ */
639 u8 res9[3916]; 639 u8 res9[3916];
640 u32 frr; /* Feature Reporting */ 640 u32 frr; /* Feature Reporting */
641 u8 res10[28]; 641 u8 res10[28];
642 u32 gcr; /* Global Configuration */ 642 u32 gcr; /* Global Configuration */
643 #define MPC85xx_PICGCR_RST 0x80000000 643 #define MPC85xx_PICGCR_RST 0x80000000
644 #define MPC85xx_PICGCR_M 0x20000000 644 #define MPC85xx_PICGCR_M 0x20000000
645 u8 res11[92]; 645 u8 res11[92];
646 u32 vir; /* Vendor Identification */ 646 u32 vir; /* Vendor Identification */
647 u8 res12[12]; 647 u8 res12[12];
648 u32 pir; /* Processor Initialization */ 648 u32 pir; /* Processor Initialization */
649 u8 res13[12]; 649 u8 res13[12];
650 u32 ipivpr0; /* IPI Vector/Priority 0 */ 650 u32 ipivpr0; /* IPI Vector/Priority 0 */
651 u8 res14[12]; 651 u8 res14[12];
652 u32 ipivpr1; /* IPI Vector/Priority 1 */ 652 u32 ipivpr1; /* IPI Vector/Priority 1 */
653 u8 res15[12]; 653 u8 res15[12];
654 u32 ipivpr2; /* IPI Vector/Priority 2 */ 654 u32 ipivpr2; /* IPI Vector/Priority 2 */
655 u8 res16[12]; 655 u8 res16[12];
656 u32 ipivpr3; /* IPI Vector/Priority 3 */ 656 u32 ipivpr3; /* IPI Vector/Priority 3 */
657 u8 res17[12]; 657 u8 res17[12];
658 u32 svr; /* Spurious Vector */ 658 u32 svr; /* Spurious Vector */
659 u8 res18[12]; 659 u8 res18[12];
660 u32 tfrr; /* Timer Frequency Reporting */ 660 u32 tfrr; /* Timer Frequency Reporting */
661 u8 res19[12]; 661 u8 res19[12];
662 u32 gtccr0; /* Global Timer Current Count 0 */ 662 u32 gtccr0; /* Global Timer Current Count 0 */
663 u8 res20[12]; 663 u8 res20[12];
664 u32 gtbcr0; /* Global Timer Base Count 0 */ 664 u32 gtbcr0; /* Global Timer Base Count 0 */
665 u8 res21[12]; 665 u8 res21[12];
666 u32 gtvpr0; /* Global Timer Vector/Priority 0 */ 666 u32 gtvpr0; /* Global Timer Vector/Priority 0 */
667 u8 res22[12]; 667 u8 res22[12];
668 u32 gtdr0; /* Global Timer Destination 0 */ 668 u32 gtdr0; /* Global Timer Destination 0 */
669 u8 res23[12]; 669 u8 res23[12];
670 u32 gtccr1; /* Global Timer Current Count 1 */ 670 u32 gtccr1; /* Global Timer Current Count 1 */
671 u8 res24[12]; 671 u8 res24[12];
672 u32 gtbcr1; /* Global Timer Base Count 1 */ 672 u32 gtbcr1; /* Global Timer Base Count 1 */
673 u8 res25[12]; 673 u8 res25[12];
674 u32 gtvpr1; /* Global Timer Vector/Priority 1 */ 674 u32 gtvpr1; /* Global Timer Vector/Priority 1 */
675 u8 res26[12]; 675 u8 res26[12];
676 u32 gtdr1; /* Global Timer Destination 1 */ 676 u32 gtdr1; /* Global Timer Destination 1 */
677 u8 res27[12]; 677 u8 res27[12];
678 u32 gtccr2; /* Global Timer Current Count 2 */ 678 u32 gtccr2; /* Global Timer Current Count 2 */
679 u8 res28[12]; 679 u8 res28[12];
680 u32 gtbcr2; /* Global Timer Base Count 2 */ 680 u32 gtbcr2; /* Global Timer Base Count 2 */
681 u8 res29[12]; 681 u8 res29[12];
682 u32 gtvpr2; /* Global Timer Vector/Priority 2 */ 682 u32 gtvpr2; /* Global Timer Vector/Priority 2 */
683 u8 res30[12]; 683 u8 res30[12];
684 u32 gtdr2; /* Global Timer Destination 2 */ 684 u32 gtdr2; /* Global Timer Destination 2 */
685 u8 res31[12]; 685 u8 res31[12];
686 u32 gtccr3; /* Global Timer Current Count 3 */ 686 u32 gtccr3; /* Global Timer Current Count 3 */
687 u8 res32[12]; 687 u8 res32[12];
688 u32 gtbcr3; /* Global Timer Base Count 3 */ 688 u32 gtbcr3; /* Global Timer Base Count 3 */
689 u8 res33[12]; 689 u8 res33[12];
690 u32 gtvpr3; /* Global Timer Vector/Priority 3 */ 690 u32 gtvpr3; /* Global Timer Vector/Priority 3 */
691 u8 res34[12]; 691 u8 res34[12];
692 u32 gtdr3; /* Global Timer Destination 3 */ 692 u32 gtdr3; /* Global Timer Destination 3 */
693 u8 res35[268]; 693 u8 res35[268];
694 u32 tcr; /* Timer Control */ 694 u32 tcr; /* Timer Control */
695 u8 res36[12]; 695 u8 res36[12];
696 u32 irqsr0; /* IRQ_OUT Summary 0 */ 696 u32 irqsr0; /* IRQ_OUT Summary 0 */
697 u8 res37[12]; 697 u8 res37[12];
698 u32 irqsr1; /* IRQ_OUT Summary 1 */ 698 u32 irqsr1; /* IRQ_OUT Summary 1 */
699 u8 res38[12]; 699 u8 res38[12];
700 u32 cisr0; /* Critical IRQ Summary 0 */ 700 u32 cisr0; /* Critical IRQ Summary 0 */
701 u8 res39[12]; 701 u8 res39[12];
702 u32 cisr1; /* Critical IRQ Summary 1 */ 702 u32 cisr1; /* Critical IRQ Summary 1 */
703 u8 res40[188]; 703 u8 res40[188];
704 u32 msgr0; /* Message 0 */ 704 u32 msgr0; /* Message 0 */
705 u8 res41[12]; 705 u8 res41[12];
706 u32 msgr1; /* Message 1 */ 706 u32 msgr1; /* Message 1 */
707 u8 res42[12]; 707 u8 res42[12];
708 u32 msgr2; /* Message 2 */ 708 u32 msgr2; /* Message 2 */
709 u8 res43[12]; 709 u8 res43[12];
710 u32 msgr3; /* Message 3 */ 710 u32 msgr3; /* Message 3 */
711 u8 res44[204]; 711 u8 res44[204];
712 u32 mer; /* Message Enable */ 712 u32 mer; /* Message Enable */
713 u8 res45[12]; 713 u8 res45[12];
714 u32 msr; /* Message Status */ 714 u32 msr; /* Message Status */
715 u8 res46[60140]; 715 u8 res46[60140];
716 u32 eivpr0; /* External IRQ Vector/Priority 0 */ 716 u32 eivpr0; /* External IRQ Vector/Priority 0 */
717 u8 res47[12]; 717 u8 res47[12];
718 u32 eidr0; /* External IRQ Destination 0 */ 718 u32 eidr0; /* External IRQ Destination 0 */
719 u8 res48[12]; 719 u8 res48[12];
720 u32 eivpr1; /* External IRQ Vector/Priority 1 */ 720 u32 eivpr1; /* External IRQ Vector/Priority 1 */
721 u8 res49[12]; 721 u8 res49[12];
722 u32 eidr1; /* External IRQ Destination 1 */ 722 u32 eidr1; /* External IRQ Destination 1 */
723 u8 res50[12]; 723 u8 res50[12];
724 u32 eivpr2; /* External IRQ Vector/Priority 2 */ 724 u32 eivpr2; /* External IRQ Vector/Priority 2 */
725 u8 res51[12]; 725 u8 res51[12];
726 u32 eidr2; /* External IRQ Destination 2 */ 726 u32 eidr2; /* External IRQ Destination 2 */
727 u8 res52[12]; 727 u8 res52[12];
728 u32 eivpr3; /* External IRQ Vector/Priority 3 */ 728 u32 eivpr3; /* External IRQ Vector/Priority 3 */
729 u8 res53[12]; 729 u8 res53[12];
730 u32 eidr3; /* External IRQ Destination 3 */ 730 u32 eidr3; /* External IRQ Destination 3 */
731 u8 res54[12]; 731 u8 res54[12];
732 u32 eivpr4; /* External IRQ Vector/Priority 4 */ 732 u32 eivpr4; /* External IRQ Vector/Priority 4 */
733 u8 res55[12]; 733 u8 res55[12];
734 u32 eidr4; /* External IRQ Destination 4 */ 734 u32 eidr4; /* External IRQ Destination 4 */
735 u8 res56[12]; 735 u8 res56[12];
736 u32 eivpr5; /* External IRQ Vector/Priority 5 */ 736 u32 eivpr5; /* External IRQ Vector/Priority 5 */
737 u8 res57[12]; 737 u8 res57[12];
738 u32 eidr5; /* External IRQ Destination 5 */ 738 u32 eidr5; /* External IRQ Destination 5 */
739 u8 res58[12]; 739 u8 res58[12];
740 u32 eivpr6; /* External IRQ Vector/Priority 6 */ 740 u32 eivpr6; /* External IRQ Vector/Priority 6 */
741 u8 res59[12]; 741 u8 res59[12];
742 u32 eidr6; /* External IRQ Destination 6 */ 742 u32 eidr6; /* External IRQ Destination 6 */
743 u8 res60[12]; 743 u8 res60[12];
744 u32 eivpr7; /* External IRQ Vector/Priority 7 */ 744 u32 eivpr7; /* External IRQ Vector/Priority 7 */
745 u8 res61[12]; 745 u8 res61[12];
746 u32 eidr7; /* External IRQ Destination 7 */ 746 u32 eidr7; /* External IRQ Destination 7 */
747 u8 res62[12]; 747 u8 res62[12];
748 u32 eivpr8; /* External IRQ Vector/Priority 8 */ 748 u32 eivpr8; /* External IRQ Vector/Priority 8 */
749 u8 res63[12]; 749 u8 res63[12];
750 u32 eidr8; /* External IRQ Destination 8 */ 750 u32 eidr8; /* External IRQ Destination 8 */
751 u8 res64[12]; 751 u8 res64[12];
752 u32 eivpr9; /* External IRQ Vector/Priority 9 */ 752 u32 eivpr9; /* External IRQ Vector/Priority 9 */
753 u8 res65[12]; 753 u8 res65[12];
754 u32 eidr9; /* External IRQ Destination 9 */ 754 u32 eidr9; /* External IRQ Destination 9 */
755 u8 res66[12]; 755 u8 res66[12];
756 u32 eivpr10; /* External IRQ Vector/Priority 10 */ 756 u32 eivpr10; /* External IRQ Vector/Priority 10 */
757 u8 res67[12]; 757 u8 res67[12];
758 u32 eidr10; /* External IRQ Destination 10 */ 758 u32 eidr10; /* External IRQ Destination 10 */
759 u8 res68[12]; 759 u8 res68[12];
760 u32 eivpr11; /* External IRQ Vector/Priority 11 */ 760 u32 eivpr11; /* External IRQ Vector/Priority 11 */
761 u8 res69[12]; 761 u8 res69[12];
762 u32 eidr11; /* External IRQ Destination 11 */ 762 u32 eidr11; /* External IRQ Destination 11 */
763 u8 res70[140]; 763 u8 res70[140];
764 u32 iivpr0; /* Internal IRQ Vector/Priority 0 */ 764 u32 iivpr0; /* Internal IRQ Vector/Priority 0 */
765 u8 res71[12]; 765 u8 res71[12];
766 u32 iidr0; /* Internal IRQ Destination 0 */ 766 u32 iidr0; /* Internal IRQ Destination 0 */
767 u8 res72[12]; 767 u8 res72[12];
768 u32 iivpr1; /* Internal IRQ Vector/Priority 1 */ 768 u32 iivpr1; /* Internal IRQ Vector/Priority 1 */
769 u8 res73[12]; 769 u8 res73[12];
770 u32 iidr1; /* Internal IRQ Destination 1 */ 770 u32 iidr1; /* Internal IRQ Destination 1 */
771 u8 res74[12]; 771 u8 res74[12];
772 u32 iivpr2; /* Internal IRQ Vector/Priority 2 */ 772 u32 iivpr2; /* Internal IRQ Vector/Priority 2 */
773 u8 res75[12]; 773 u8 res75[12];
774 u32 iidr2; /* Internal IRQ Destination 2 */ 774 u32 iidr2; /* Internal IRQ Destination 2 */
775 u8 res76[12]; 775 u8 res76[12];
776 u32 iivpr3; /* Internal IRQ Vector/Priority 3 */ 776 u32 iivpr3; /* Internal IRQ Vector/Priority 3 */
777 u8 res77[12]; 777 u8 res77[12];
778 u32 iidr3; /* Internal IRQ Destination 3 */ 778 u32 iidr3; /* Internal IRQ Destination 3 */
779 u8 res78[12]; 779 u8 res78[12];
780 u32 iivpr4; /* Internal IRQ Vector/Priority 4 */ 780 u32 iivpr4; /* Internal IRQ Vector/Priority 4 */
781 u8 res79[12]; 781 u8 res79[12];
782 u32 iidr4; /* Internal IRQ Destination 4 */ 782 u32 iidr4; /* Internal IRQ Destination 4 */
783 u8 res80[12]; 783 u8 res80[12];
784 u32 iivpr5; /* Internal IRQ Vector/Priority 5 */ 784 u32 iivpr5; /* Internal IRQ Vector/Priority 5 */
785 u8 res81[12]; 785 u8 res81[12];
786 u32 iidr5; /* Internal IRQ Destination 5 */ 786 u32 iidr5; /* Internal IRQ Destination 5 */
787 u8 res82[12]; 787 u8 res82[12];
788 u32 iivpr6; /* Internal IRQ Vector/Priority 6 */ 788 u32 iivpr6; /* Internal IRQ Vector/Priority 6 */
789 u8 res83[12]; 789 u8 res83[12];
790 u32 iidr6; /* Internal IRQ Destination 6 */ 790 u32 iidr6; /* Internal IRQ Destination 6 */
791 u8 res84[12]; 791 u8 res84[12];
792 u32 iivpr7; /* Internal IRQ Vector/Priority 7 */ 792 u32 iivpr7; /* Internal IRQ Vector/Priority 7 */
793 u8 res85[12]; 793 u8 res85[12];
794 u32 iidr7; /* Internal IRQ Destination 7 */ 794 u32 iidr7; /* Internal IRQ Destination 7 */
795 u8 res86[12]; 795 u8 res86[12];
796 u32 iivpr8; /* Internal IRQ Vector/Priority 8 */ 796 u32 iivpr8; /* Internal IRQ Vector/Priority 8 */
797 u8 res87[12]; 797 u8 res87[12];
798 u32 iidr8; /* Internal IRQ Destination 8 */ 798 u32 iidr8; /* Internal IRQ Destination 8 */
799 u8 res88[12]; 799 u8 res88[12];
800 u32 iivpr9; /* Internal IRQ Vector/Priority 9 */ 800 u32 iivpr9; /* Internal IRQ Vector/Priority 9 */
801 u8 res89[12]; 801 u8 res89[12];
802 u32 iidr9; /* Internal IRQ Destination 9 */ 802 u32 iidr9; /* Internal IRQ Destination 9 */
803 u8 res90[12]; 803 u8 res90[12];
804 u32 iivpr10; /* Internal IRQ Vector/Priority 10 */ 804 u32 iivpr10; /* Internal IRQ Vector/Priority 10 */
805 u8 res91[12]; 805 u8 res91[12];
806 u32 iidr10; /* Internal IRQ Destination 10 */ 806 u32 iidr10; /* Internal IRQ Destination 10 */
807 u8 res92[12]; 807 u8 res92[12];
808 u32 iivpr11; /* Internal IRQ Vector/Priority 11 */ 808 u32 iivpr11; /* Internal IRQ Vector/Priority 11 */
809 u8 res93[12]; 809 u8 res93[12];
810 u32 iidr11; /* Internal IRQ Destination 11 */ 810 u32 iidr11; /* Internal IRQ Destination 11 */
811 u8 res94[12]; 811 u8 res94[12];
812 u32 iivpr12; /* Internal IRQ Vector/Priority 12 */ 812 u32 iivpr12; /* Internal IRQ Vector/Priority 12 */
813 u8 res95[12]; 813 u8 res95[12];
814 u32 iidr12; /* Internal IRQ Destination 12 */ 814 u32 iidr12; /* Internal IRQ Destination 12 */
815 u8 res96[12]; 815 u8 res96[12];
816 u32 iivpr13; /* Internal IRQ Vector/Priority 13 */ 816 u32 iivpr13; /* Internal IRQ Vector/Priority 13 */
817 u8 res97[12]; 817 u8 res97[12];
818 u32 iidr13; /* Internal IRQ Destination 13 */ 818 u32 iidr13; /* Internal IRQ Destination 13 */
819 u8 res98[12]; 819 u8 res98[12];
820 u32 iivpr14; /* Internal IRQ Vector/Priority 14 */ 820 u32 iivpr14; /* Internal IRQ Vector/Priority 14 */
821 u8 res99[12]; 821 u8 res99[12];
822 u32 iidr14; /* Internal IRQ Destination 14 */ 822 u32 iidr14; /* Internal IRQ Destination 14 */
823 u8 res100[12]; 823 u8 res100[12];
824 u32 iivpr15; /* Internal IRQ Vector/Priority 15 */ 824 u32 iivpr15; /* Internal IRQ Vector/Priority 15 */
825 u8 res101[12]; 825 u8 res101[12];
826 u32 iidr15; /* Internal IRQ Destination 15 */ 826 u32 iidr15; /* Internal IRQ Destination 15 */
827 u8 res102[12]; 827 u8 res102[12];
828 u32 iivpr16; /* Internal IRQ Vector/Priority 16 */ 828 u32 iivpr16; /* Internal IRQ Vector/Priority 16 */
829 u8 res103[12]; 829 u8 res103[12];
830 u32 iidr16; /* Internal IRQ Destination 16 */ 830 u32 iidr16; /* Internal IRQ Destination 16 */
831 u8 res104[12]; 831 u8 res104[12];
832 u32 iivpr17; /* Internal IRQ Vector/Priority 17 */ 832 u32 iivpr17; /* Internal IRQ Vector/Priority 17 */
833 u8 res105[12]; 833 u8 res105[12];
834 u32 iidr17; /* Internal IRQ Destination 17 */ 834 u32 iidr17; /* Internal IRQ Destination 17 */
835 u8 res106[12]; 835 u8 res106[12];
836 u32 iivpr18; /* Internal IRQ Vector/Priority 18 */ 836 u32 iivpr18; /* Internal IRQ Vector/Priority 18 */
837 u8 res107[12]; 837 u8 res107[12];
838 u32 iidr18; /* Internal IRQ Destination 18 */ 838 u32 iidr18; /* Internal IRQ Destination 18 */
839 u8 res108[12]; 839 u8 res108[12];
840 u32 iivpr19; /* Internal IRQ Vector/Priority 19 */ 840 u32 iivpr19; /* Internal IRQ Vector/Priority 19 */
841 u8 res109[12]; 841 u8 res109[12];
842 u32 iidr19; /* Internal IRQ Destination 19 */ 842 u32 iidr19; /* Internal IRQ Destination 19 */
843 u8 res110[12]; 843 u8 res110[12];
844 u32 iivpr20; /* Internal IRQ Vector/Priority 20 */ 844 u32 iivpr20; /* Internal IRQ Vector/Priority 20 */
845 u8 res111[12]; 845 u8 res111[12];
846 u32 iidr20; /* Internal IRQ Destination 20 */ 846 u32 iidr20; /* Internal IRQ Destination 20 */
847 u8 res112[12]; 847 u8 res112[12];
848 u32 iivpr21; /* Internal IRQ Vector/Priority 21 */ 848 u32 iivpr21; /* Internal IRQ Vector/Priority 21 */
849 u8 res113[12]; 849 u8 res113[12];
850 u32 iidr21; /* Internal IRQ Destination 21 */ 850 u32 iidr21; /* Internal IRQ Destination 21 */
851 u8 res114[12]; 851 u8 res114[12];
852 u32 iivpr22; /* Internal IRQ Vector/Priority 22 */ 852 u32 iivpr22; /* Internal IRQ Vector/Priority 22 */
853 u8 res115[12]; 853 u8 res115[12];
854 u32 iidr22; /* Internal IRQ Destination 22 */ 854 u32 iidr22; /* Internal IRQ Destination 22 */
855 u8 res116[12]; 855 u8 res116[12];
856 u32 iivpr23; /* Internal IRQ Vector/Priority 23 */ 856 u32 iivpr23; /* Internal IRQ Vector/Priority 23 */
857 u8 res117[12]; 857 u8 res117[12];
858 u32 iidr23; /* Internal IRQ Destination 23 */ 858 u32 iidr23; /* Internal IRQ Destination 23 */
859 u8 res118[12]; 859 u8 res118[12];
860 u32 iivpr24; /* Internal IRQ Vector/Priority 24 */ 860 u32 iivpr24; /* Internal IRQ Vector/Priority 24 */
861 u8 res119[12]; 861 u8 res119[12];
862 u32 iidr24; /* Internal IRQ Destination 24 */ 862 u32 iidr24; /* Internal IRQ Destination 24 */
863 u8 res120[12]; 863 u8 res120[12];
864 u32 iivpr25; /* Internal IRQ Vector/Priority 25 */ 864 u32 iivpr25; /* Internal IRQ Vector/Priority 25 */
865 u8 res121[12]; 865 u8 res121[12];
866 u32 iidr25; /* Internal IRQ Destination 25 */ 866 u32 iidr25; /* Internal IRQ Destination 25 */
867 u8 res122[12]; 867 u8 res122[12];
868 u32 iivpr26; /* Internal IRQ Vector/Priority 26 */ 868 u32 iivpr26; /* Internal IRQ Vector/Priority 26 */
869 u8 res123[12]; 869 u8 res123[12];
870 u32 iidr26; /* Internal IRQ Destination 26 */ 870 u32 iidr26; /* Internal IRQ Destination 26 */
871 u8 res124[12]; 871 u8 res124[12];
872 u32 iivpr27; /* Internal IRQ Vector/Priority 27 */ 872 u32 iivpr27; /* Internal IRQ Vector/Priority 27 */
873 u8 res125[12]; 873 u8 res125[12];
874 u32 iidr27; /* Internal IRQ Destination 27 */ 874 u32 iidr27; /* Internal IRQ Destination 27 */
875 u8 res126[12]; 875 u8 res126[12];
876 u32 iivpr28; /* Internal IRQ Vector/Priority 28 */ 876 u32 iivpr28; /* Internal IRQ Vector/Priority 28 */
877 u8 res127[12]; 877 u8 res127[12];
878 u32 iidr28; /* Internal IRQ Destination 28 */ 878 u32 iidr28; /* Internal IRQ Destination 28 */
879 u8 res128[12]; 879 u8 res128[12];
880 u32 iivpr29; /* Internal IRQ Vector/Priority 29 */ 880 u32 iivpr29; /* Internal IRQ Vector/Priority 29 */
881 u8 res129[12]; 881 u8 res129[12];
882 u32 iidr29; /* Internal IRQ Destination 29 */ 882 u32 iidr29; /* Internal IRQ Destination 29 */
883 u8 res130[12]; 883 u8 res130[12];
884 u32 iivpr30; /* Internal IRQ Vector/Priority 30 */ 884 u32 iivpr30; /* Internal IRQ Vector/Priority 30 */
885 u8 res131[12]; 885 u8 res131[12];
886 u32 iidr30; /* Internal IRQ Destination 30 */ 886 u32 iidr30; /* Internal IRQ Destination 30 */
887 u8 res132[12]; 887 u8 res132[12];
888 u32 iivpr31; /* Internal IRQ Vector/Priority 31 */ 888 u32 iivpr31; /* Internal IRQ Vector/Priority 31 */
889 u8 res133[12]; 889 u8 res133[12];
890 u32 iidr31; /* Internal IRQ Destination 31 */ 890 u32 iidr31; /* Internal IRQ Destination 31 */
891 u8 res134[4108]; 891 u8 res134[4108];
892 u32 mivpr0; /* Messaging IRQ Vector/Priority 0 */ 892 u32 mivpr0; /* Messaging IRQ Vector/Priority 0 */
893 u8 res135[12]; 893 u8 res135[12];
894 u32 midr0; /* Messaging IRQ Destination 0 */ 894 u32 midr0; /* Messaging IRQ Destination 0 */
895 u8 res136[12]; 895 u8 res136[12];
896 u32 mivpr1; /* Messaging IRQ Vector/Priority 1 */ 896 u32 mivpr1; /* Messaging IRQ Vector/Priority 1 */
897 u8 res137[12]; 897 u8 res137[12];
898 u32 midr1; /* Messaging IRQ Destination 1 */ 898 u32 midr1; /* Messaging IRQ Destination 1 */
899 u8 res138[12]; 899 u8 res138[12];
900 u32 mivpr2; /* Messaging IRQ Vector/Priority 2 */ 900 u32 mivpr2; /* Messaging IRQ Vector/Priority 2 */
901 u8 res139[12]; 901 u8 res139[12];
902 u32 midr2; /* Messaging IRQ Destination 2 */ 902 u32 midr2; /* Messaging IRQ Destination 2 */
903 u8 res140[12]; 903 u8 res140[12];
904 u32 mivpr3; /* Messaging IRQ Vector/Priority 3 */ 904 u32 mivpr3; /* Messaging IRQ Vector/Priority 3 */
905 u8 res141[12]; 905 u8 res141[12];
906 u32 midr3; /* Messaging IRQ Destination 3 */ 906 u32 midr3; /* Messaging IRQ Destination 3 */
907 u8 res142[59852]; 907 u8 res142[59852];
908 u32 ipi0dr0; /* Processor 0 Interprocessor IRQ Dispatch 0 */ 908 u32 ipi0dr0; /* Processor 0 Interprocessor IRQ Dispatch 0 */
909 u8 res143[12]; 909 u8 res143[12];
910 u32 ipi0dr1; /* Processor 0 Interprocessor IRQ Dispatch 1 */ 910 u32 ipi0dr1; /* Processor 0 Interprocessor IRQ Dispatch 1 */
911 u8 res144[12]; 911 u8 res144[12];
912 u32 ipi0dr2; /* Processor 0 Interprocessor IRQ Dispatch 2 */ 912 u32 ipi0dr2; /* Processor 0 Interprocessor IRQ Dispatch 2 */
913 u8 res145[12]; 913 u8 res145[12];
914 u32 ipi0dr3; /* Processor 0 Interprocessor IRQ Dispatch 3 */ 914 u32 ipi0dr3; /* Processor 0 Interprocessor IRQ Dispatch 3 */
915 u8 res146[12]; 915 u8 res146[12];
916 u32 ctpr0; /* Current Task Priority for Processor 0 */ 916 u32 ctpr0; /* Current Task Priority for Processor 0 */
917 u8 res147[12]; 917 u8 res147[12];
918 u32 whoami0; /* Who Am I for Processor 0 */ 918 u32 whoami0; /* Who Am I for Processor 0 */
919 u8 res148[12]; 919 u8 res148[12];
920 u32 iack0; /* IRQ Acknowledge for Processor 0 */ 920 u32 iack0; /* IRQ Acknowledge for Processor 0 */
921 u8 res149[12]; 921 u8 res149[12];
922 u32 eoi0; /* End Of IRQ for Processor 0 */ 922 u32 eoi0; /* End Of IRQ for Processor 0 */
923 u8 res150[130892]; 923 u8 res150[130892];
924 } ccsr_pic_t; 924 } ccsr_pic_t;
925 925
926 /* CPM Block */ 926 /* CPM Block */
927 #ifndef CONFIG_CPM2 927 #ifndef CONFIG_CPM2
928 typedef struct ccsr_cpm { 928 typedef struct ccsr_cpm {
929 u8 res[262144]; 929 u8 res[262144];
930 } ccsr_cpm_t; 930 } ccsr_cpm_t;
931 #else 931 #else
932 /* 932 /*
933 * DPARM 933 * DPARM
934 * General SIU 934 * General SIU
935 */ 935 */
936 typedef struct ccsr_cpm_siu { 936 typedef struct ccsr_cpm_siu {
937 u8 res1[80]; 937 u8 res1[80];
938 u32 smaer; 938 u32 smaer;
939 u32 smser; 939 u32 smser;
940 u32 smevr; 940 u32 smevr;
941 u8 res2[4]; 941 u8 res2[4];
942 u32 lmaer; 942 u32 lmaer;
943 u32 lmser; 943 u32 lmser;
944 u32 lmevr; 944 u32 lmevr;
945 u8 res3[2964]; 945 u8 res3[2964];
946 } ccsr_cpm_siu_t; 946 } ccsr_cpm_siu_t;
947 947
948 /* IRQ Controller */ 948 /* IRQ Controller */
949 typedef struct ccsr_cpm_intctl { 949 typedef struct ccsr_cpm_intctl {
950 u16 sicr; 950 u16 sicr;
951 u8 res1[2]; 951 u8 res1[2];
952 u32 sivec; 952 u32 sivec;
953 u32 sipnrh; 953 u32 sipnrh;
954 u32 sipnrl; 954 u32 sipnrl;
955 u32 siprr; 955 u32 siprr;
956 u32 scprrh; 956 u32 scprrh;
957 u32 scprrl; 957 u32 scprrl;
958 u32 simrh; 958 u32 simrh;
959 u32 simrl; 959 u32 simrl;
960 u32 siexr; 960 u32 siexr;
961 u8 res2[88]; 961 u8 res2[88];
962 u32 sccr; 962 u32 sccr;
963 u8 res3[124]; 963 u8 res3[124];
964 } ccsr_cpm_intctl_t; 964 } ccsr_cpm_intctl_t;
965 965
966 /* input/output port */ 966 /* input/output port */
967 typedef struct ccsr_cpm_iop { 967 typedef struct ccsr_cpm_iop {
968 u32 pdira; 968 u32 pdira;
969 u32 ppara; 969 u32 ppara;
970 u32 psora; 970 u32 psora;
971 u32 podra; 971 u32 podra;
972 u32 pdata; 972 u32 pdata;
973 u8 res1[12]; 973 u8 res1[12];
974 u32 pdirb; 974 u32 pdirb;
975 u32 pparb; 975 u32 pparb;
976 u32 psorb; 976 u32 psorb;
977 u32 podrb; 977 u32 podrb;
978 u32 pdatb; 978 u32 pdatb;
979 u8 res2[12]; 979 u8 res2[12];
980 u32 pdirc; 980 u32 pdirc;
981 u32 pparc; 981 u32 pparc;
982 u32 psorc; 982 u32 psorc;
983 u32 podrc; 983 u32 podrc;
984 u32 pdatc; 984 u32 pdatc;
985 u8 res3[12]; 985 u8 res3[12];
986 u32 pdird; 986 u32 pdird;
987 u32 ppard; 987 u32 ppard;
988 u32 psord; 988 u32 psord;
989 u32 podrd; 989 u32 podrd;
990 u32 pdatd; 990 u32 pdatd;
991 u8 res4[12]; 991 u8 res4[12];
992 } ccsr_cpm_iop_t; 992 } ccsr_cpm_iop_t;
993 993
994 /* CPM timers */ 994 /* CPM timers */
995 typedef struct ccsr_cpm_timer { 995 typedef struct ccsr_cpm_timer {
996 u8 tgcr1; 996 u8 tgcr1;
997 u8 res1[3]; 997 u8 res1[3];
998 u8 tgcr2; 998 u8 tgcr2;
999 u8 res2[11]; 999 u8 res2[11];
1000 u16 tmr1; 1000 u16 tmr1;
1001 u16 tmr2; 1001 u16 tmr2;
1002 u16 trr1; 1002 u16 trr1;
1003 u16 trr2; 1003 u16 trr2;
1004 u16 tcr1; 1004 u16 tcr1;
1005 u16 tcr2; 1005 u16 tcr2;
1006 u16 tcn1; 1006 u16 tcn1;
1007 u16 tcn2; 1007 u16 tcn2;
1008 u16 tmr3; 1008 u16 tmr3;
1009 u16 tmr4; 1009 u16 tmr4;
1010 u16 trr3; 1010 u16 trr3;
1011 u16 trr4; 1011 u16 trr4;
1012 u16 tcr3; 1012 u16 tcr3;
1013 u16 tcr4; 1013 u16 tcr4;
1014 u16 tcn3; 1014 u16 tcn3;
1015 u16 tcn4; 1015 u16 tcn4;
1016 u16 ter1; 1016 u16 ter1;
1017 u16 ter2; 1017 u16 ter2;
1018 u16 ter3; 1018 u16 ter3;
1019 u16 ter4; 1019 u16 ter4;
1020 u8 res3[608]; 1020 u8 res3[608];
1021 } ccsr_cpm_timer_t; 1021 } ccsr_cpm_timer_t;
1022 1022
1023 /* SDMA */ 1023 /* SDMA */
1024 typedef struct ccsr_cpm_sdma { 1024 typedef struct ccsr_cpm_sdma {
1025 u8 sdsr; 1025 u8 sdsr;
1026 u8 res1[3]; 1026 u8 res1[3];
1027 u8 sdmr; 1027 u8 sdmr;
1028 u8 res2[739]; 1028 u8 res2[739];
1029 } ccsr_cpm_sdma_t; 1029 } ccsr_cpm_sdma_t;
1030 1030
1031 /* FCC1 */ 1031 /* FCC1 */
1032 typedef struct ccsr_cpm_fcc1 { 1032 typedef struct ccsr_cpm_fcc1 {
1033 u32 gfmr; 1033 u32 gfmr;
1034 u32 fpsmr; 1034 u32 fpsmr;
1035 u16 ftodr; 1035 u16 ftodr;
1036 u8 res1[2]; 1036 u8 res1[2];
1037 u16 fdsr; 1037 u16 fdsr;
1038 u8 res2[2]; 1038 u8 res2[2];
1039 u16 fcce; 1039 u16 fcce;
1040 u8 res3[2]; 1040 u8 res3[2];
1041 u16 fccm; 1041 u16 fccm;
1042 u8 res4[2]; 1042 u8 res4[2];
1043 u8 fccs; 1043 u8 fccs;
1044 u8 res5[3]; 1044 u8 res5[3];
1045 u8 ftirr_phy[4]; 1045 u8 ftirr_phy[4];
1046 } ccsr_cpm_fcc1_t; 1046 } ccsr_cpm_fcc1_t;
1047 1047
1048 /* FCC2 */ 1048 /* FCC2 */
1049 typedef struct ccsr_cpm_fcc2 { 1049 typedef struct ccsr_cpm_fcc2 {
1050 u32 gfmr; 1050 u32 gfmr;
1051 u32 fpsmr; 1051 u32 fpsmr;
1052 u16 ftodr; 1052 u16 ftodr;
1053 u8 res1[2]; 1053 u8 res1[2];
1054 u16 fdsr; 1054 u16 fdsr;
1055 u8 res2[2]; 1055 u8 res2[2];
1056 u16 fcce; 1056 u16 fcce;
1057 u8 res3[2]; 1057 u8 res3[2];
1058 u16 fccm; 1058 u16 fccm;
1059 u8 res4[2]; 1059 u8 res4[2];
1060 u8 fccs; 1060 u8 fccs;
1061 u8 res5[3]; 1061 u8 res5[3];
1062 u8 ftirr_phy[4]; 1062 u8 ftirr_phy[4];
1063 } ccsr_cpm_fcc2_t; 1063 } ccsr_cpm_fcc2_t;
1064 1064
1065 /* FCC3 */ 1065 /* FCC3 */
1066 typedef struct ccsr_cpm_fcc3 { 1066 typedef struct ccsr_cpm_fcc3 {
1067 u32 gfmr; 1067 u32 gfmr;
1068 u32 fpsmr; 1068 u32 fpsmr;
1069 u16 ftodr; 1069 u16 ftodr;
1070 u8 res1[2]; 1070 u8 res1[2];
1071 u16 fdsr; 1071 u16 fdsr;
1072 u8 res2[2]; 1072 u8 res2[2];
1073 u16 fcce; 1073 u16 fcce;
1074 u8 res3[2]; 1074 u8 res3[2];
1075 u16 fccm; 1075 u16 fccm;
1076 u8 res4[2]; 1076 u8 res4[2];
1077 u8 fccs; 1077 u8 fccs;
1078 u8 res5[3]; 1078 u8 res5[3];
1079 u8 res[36]; 1079 u8 res[36];
1080 } ccsr_cpm_fcc3_t; 1080 } ccsr_cpm_fcc3_t;
1081 1081
1082 /* FCC1 extended */ 1082 /* FCC1 extended */
1083 typedef struct ccsr_cpm_fcc1_ext { 1083 typedef struct ccsr_cpm_fcc1_ext {
1084 u32 firper; 1084 u32 firper;
1085 u32 firer; 1085 u32 firer;
1086 u32 firsr_h; 1086 u32 firsr_h;
1087 u32 firsr_l; 1087 u32 firsr_l;
1088 u8 gfemr; 1088 u8 gfemr;
1089 u8 res[15]; 1089 u8 res[15];
1090 1090
1091 } ccsr_cpm_fcc1_ext_t; 1091 } ccsr_cpm_fcc1_ext_t;
1092 1092
1093 /* FCC2 extended */ 1093 /* FCC2 extended */
1094 typedef struct ccsr_cpm_fcc2_ext { 1094 typedef struct ccsr_cpm_fcc2_ext {
1095 u32 firper; 1095 u32 firper;
1096 u32 firer; 1096 u32 firer;
1097 u32 firsr_h; 1097 u32 firsr_h;
1098 u32 firsr_l; 1098 u32 firsr_l;
1099 u8 gfemr; 1099 u8 gfemr;
1100 u8 res[31]; 1100 u8 res[31];
1101 } ccsr_cpm_fcc2_ext_t; 1101 } ccsr_cpm_fcc2_ext_t;
1102 1102
1103 /* FCC3 extended */ 1103 /* FCC3 extended */
1104 typedef struct ccsr_cpm_fcc3_ext { 1104 typedef struct ccsr_cpm_fcc3_ext {
1105 u8 gfemr; 1105 u8 gfemr;
1106 u8 res[47]; 1106 u8 res[47];
1107 } ccsr_cpm_fcc3_ext_t; 1107 } ccsr_cpm_fcc3_ext_t;
1108 1108
1109 /* TC layers */ 1109 /* TC layers */
1110 typedef struct ccsr_cpm_tmp1 { 1110 typedef struct ccsr_cpm_tmp1 {
1111 u8 res[496]; 1111 u8 res[496];
1112 } ccsr_cpm_tmp1_t; 1112 } ccsr_cpm_tmp1_t;
1113 1113
1114 /* BRGs:5,6,7,8 */ 1114 /* BRGs:5,6,7,8 */
1115 typedef struct ccsr_cpm_brg2 { 1115 typedef struct ccsr_cpm_brg2 {
1116 u32 brgc5; 1116 u32 brgc5;
1117 u32 brgc6; 1117 u32 brgc6;
1118 u32 brgc7; 1118 u32 brgc7;
1119 u32 brgc8; 1119 u32 brgc8;
1120 u8 res[608]; 1120 u8 res[608];
1121 } ccsr_cpm_brg2_t; 1121 } ccsr_cpm_brg2_t;
1122 1122
1123 /* I2C */ 1123 /* I2C */
1124 typedef struct ccsr_cpm_i2c { 1124 typedef struct ccsr_cpm_i2c {
1125 u8 i2mod; 1125 u8 i2mod;
1126 u8 res1[3]; 1126 u8 res1[3];
1127 u8 i2add; 1127 u8 i2add;
1128 u8 res2[3]; 1128 u8 res2[3];
1129 u8 i2brg; 1129 u8 i2brg;
1130 u8 res3[3]; 1130 u8 res3[3];
1131 u8 i2com; 1131 u8 i2com;
1132 u8 res4[3]; 1132 u8 res4[3];
1133 u8 i2cer; 1133 u8 i2cer;
1134 u8 res5[3]; 1134 u8 res5[3];
1135 u8 i2cmr; 1135 u8 i2cmr;
1136 u8 res6[331]; 1136 u8 res6[331];
1137 } ccsr_cpm_i2c_t; 1137 } ccsr_cpm_i2c_t;
1138 1138
1139 /* CPM core */ 1139 /* CPM core */
1140 typedef struct ccsr_cpm_cp { 1140 typedef struct ccsr_cpm_cp {
1141 u32 cpcr; 1141 u32 cpcr;
1142 u32 rccr; 1142 u32 rccr;
1143 u8 res1[14]; 1143 u8 res1[14];
1144 u16 rter; 1144 u16 rter;
1145 u8 res2[2]; 1145 u8 res2[2];
1146 u16 rtmr; 1146 u16 rtmr;
1147 u16 rtscr; 1147 u16 rtscr;
1148 u8 res3[2]; 1148 u8 res3[2];
1149 u32 rtsr; 1149 u32 rtsr;
1150 u8 res4[12]; 1150 u8 res4[12];
1151 } ccsr_cpm_cp_t; 1151 } ccsr_cpm_cp_t;
1152 1152
1153 /* BRGs:1,2,3,4 */ 1153 /* BRGs:1,2,3,4 */
1154 typedef struct ccsr_cpm_brg1 { 1154 typedef struct ccsr_cpm_brg1 {
1155 u32 brgc1; 1155 u32 brgc1;
1156 u32 brgc2; 1156 u32 brgc2;
1157 u32 brgc3; 1157 u32 brgc3;
1158 u32 brgc4; 1158 u32 brgc4;
1159 } ccsr_cpm_brg1_t; 1159 } ccsr_cpm_brg1_t;
1160 1160
1161 /* SCC1-SCC4 */ 1161 /* SCC1-SCC4 */
1162 typedef struct ccsr_cpm_scc { 1162 typedef struct ccsr_cpm_scc {
1163 u32 gsmrl; 1163 u32 gsmrl;
1164 u32 gsmrh; 1164 u32 gsmrh;
1165 u16 psmr; 1165 u16 psmr;
1166 u8 res1[2]; 1166 u8 res1[2];
1167 u16 todr; 1167 u16 todr;
1168 u16 dsr; 1168 u16 dsr;
1169 u16 scce; 1169 u16 scce;
1170 u8 res2[2]; 1170 u8 res2[2];
1171 u16 sccm; 1171 u16 sccm;
1172 u8 res3; 1172 u8 res3;
1173 u8 sccs; 1173 u8 sccs;
1174 u8 res4[8]; 1174 u8 res4[8];
1175 } ccsr_cpm_scc_t; 1175 } ccsr_cpm_scc_t;
1176 1176
1177 typedef struct ccsr_cpm_tmp2 { 1177 typedef struct ccsr_cpm_tmp2 {
1178 u8 res[32]; 1178 u8 res[32];
1179 } ccsr_cpm_tmp2_t; 1179 } ccsr_cpm_tmp2_t;
1180 1180
1181 /* SPI */ 1181 /* SPI */
1182 typedef struct ccsr_cpm_spi { 1182 typedef struct ccsr_cpm_spi {
1183 u16 spmode; 1183 u16 spmode;
1184 u8 res1[4]; 1184 u8 res1[4];
1185 u8 spie; 1185 u8 spie;
1186 u8 res2[3]; 1186 u8 res2[3];
1187 u8 spim; 1187 u8 spim;
1188 u8 res3[2]; 1188 u8 res3[2];
1189 u8 spcom; 1189 u8 spcom;
1190 u8 res4[82]; 1190 u8 res4[82];
1191 } ccsr_cpm_spi_t; 1191 } ccsr_cpm_spi_t;
1192 1192
1193 /* CPM MUX */ 1193 /* CPM MUX */
1194 typedef struct ccsr_cpm_mux { 1194 typedef struct ccsr_cpm_mux {
1195 u8 cmxsi1cr; 1195 u8 cmxsi1cr;
1196 u8 res1; 1196 u8 res1;
1197 u8 cmxsi2cr; 1197 u8 cmxsi2cr;
1198 u8 res2; 1198 u8 res2;
1199 u32 cmxfcr; 1199 u32 cmxfcr;
1200 u32 cmxscr; 1200 u32 cmxscr;
1201 u8 res3[2]; 1201 u8 res3[2];
1202 u16 cmxuar; 1202 u16 cmxuar;
1203 u8 res4[16]; 1203 u8 res4[16];
1204 } ccsr_cpm_mux_t; 1204 } ccsr_cpm_mux_t;
1205 1205
1206 /* SI,MCC,etc */ 1206 /* SI,MCC,etc */
1207 typedef struct ccsr_cpm_tmp3 { 1207 typedef struct ccsr_cpm_tmp3 {
1208 u8 res[58592]; 1208 u8 res[58592];
1209 } ccsr_cpm_tmp3_t; 1209 } ccsr_cpm_tmp3_t;
1210 1210
1211 typedef struct ccsr_cpm_iram { 1211 typedef struct ccsr_cpm_iram {
1212 u32 iram[8192]; 1212 u32 iram[8192];
1213 u8 res[98304]; 1213 u8 res[98304];
1214 } ccsr_cpm_iram_t; 1214 } ccsr_cpm_iram_t;
1215 1215
1216 typedef struct ccsr_cpm { 1216 typedef struct ccsr_cpm {
1217 /* Some references are into the unique & known dpram spaces, 1217 /* Some references are into the unique & known dpram spaces,
1218 * others are from the generic base. 1218 * others are from the generic base.
1219 */ 1219 */
1220 #define im_dprambase im_dpram1 1220 #define im_dprambase im_dpram1
1221 u8 im_dpram1[16*1024]; 1221 u8 im_dpram1[16*1024];
1222 u8 res1[16*1024]; 1222 u8 res1[16*1024];
1223 u8 im_dpram2[16*1024]; 1223 u8 im_dpram2[16*1024];
1224 u8 res2[16*1024]; 1224 u8 res2[16*1024];
1225 ccsr_cpm_siu_t im_cpm_siu; /* SIU Configuration */ 1225 ccsr_cpm_siu_t im_cpm_siu; /* SIU Configuration */
1226 ccsr_cpm_intctl_t im_cpm_intctl; /* IRQ Controller */ 1226 ccsr_cpm_intctl_t im_cpm_intctl; /* IRQ Controller */
1227 ccsr_cpm_iop_t im_cpm_iop; /* IO Port control/status */ 1227 ccsr_cpm_iop_t im_cpm_iop; /* IO Port control/status */
1228 ccsr_cpm_timer_t im_cpm_timer; /* CPM timers */ 1228 ccsr_cpm_timer_t im_cpm_timer; /* CPM timers */
1229 ccsr_cpm_sdma_t im_cpm_sdma; /* SDMA control/status */ 1229 ccsr_cpm_sdma_t im_cpm_sdma; /* SDMA control/status */
1230 ccsr_cpm_fcc1_t im_cpm_fcc1; 1230 ccsr_cpm_fcc1_t im_cpm_fcc1;
1231 ccsr_cpm_fcc2_t im_cpm_fcc2; 1231 ccsr_cpm_fcc2_t im_cpm_fcc2;
1232 ccsr_cpm_fcc3_t im_cpm_fcc3; 1232 ccsr_cpm_fcc3_t im_cpm_fcc3;
1233 ccsr_cpm_fcc1_ext_t im_cpm_fcc1_ext; 1233 ccsr_cpm_fcc1_ext_t im_cpm_fcc1_ext;
1234 ccsr_cpm_fcc2_ext_t im_cpm_fcc2_ext; 1234 ccsr_cpm_fcc2_ext_t im_cpm_fcc2_ext;
1235 ccsr_cpm_fcc3_ext_t im_cpm_fcc3_ext; 1235 ccsr_cpm_fcc3_ext_t im_cpm_fcc3_ext;
1236 ccsr_cpm_tmp1_t im_cpm_tmp1; 1236 ccsr_cpm_tmp1_t im_cpm_tmp1;
1237 ccsr_cpm_brg2_t im_cpm_brg2; 1237 ccsr_cpm_brg2_t im_cpm_brg2;
1238 ccsr_cpm_i2c_t im_cpm_i2c; 1238 ccsr_cpm_i2c_t im_cpm_i2c;
1239 ccsr_cpm_cp_t im_cpm_cp; 1239 ccsr_cpm_cp_t im_cpm_cp;
1240 ccsr_cpm_brg1_t im_cpm_brg1; 1240 ccsr_cpm_brg1_t im_cpm_brg1;
1241 ccsr_cpm_scc_t im_cpm_scc[4]; 1241 ccsr_cpm_scc_t im_cpm_scc[4];
1242 ccsr_cpm_tmp2_t im_cpm_tmp2; 1242 ccsr_cpm_tmp2_t im_cpm_tmp2;
1243 ccsr_cpm_spi_t im_cpm_spi; 1243 ccsr_cpm_spi_t im_cpm_spi;
1244 ccsr_cpm_mux_t im_cpm_mux; 1244 ccsr_cpm_mux_t im_cpm_mux;
1245 ccsr_cpm_tmp3_t im_cpm_tmp3; 1245 ccsr_cpm_tmp3_t im_cpm_tmp3;
1246 ccsr_cpm_iram_t im_cpm_iram; 1246 ccsr_cpm_iram_t im_cpm_iram;
1247 } ccsr_cpm_t; 1247 } ccsr_cpm_t;
1248 #endif 1248 #endif
1249 1249
1250 #ifdef CONFIG_SYS_SRIO 1250 #ifdef CONFIG_SYS_SRIO
1251 /* Architectural regsiters */ 1251 /* Architectural regsiters */
1252 struct rio_arch { 1252 struct rio_arch {
1253 u32 didcar; /* Device Identity CAR */ 1253 u32 didcar; /* Device Identity CAR */
1254 u32 dicar; /* Device Information CAR */ 1254 u32 dicar; /* Device Information CAR */
1255 u32 aidcar; /* Assembly Identity CAR */ 1255 u32 aidcar; /* Assembly Identity CAR */
1256 u32 aicar; /* Assembly Information CAR */ 1256 u32 aicar; /* Assembly Information CAR */
1257 u32 pefcar; /* Processing Element Features CAR */ 1257 u32 pefcar; /* Processing Element Features CAR */
1258 u8 res0[4]; 1258 u8 res0[4];
1259 u32 socar; /* Source Operations CAR */ 1259 u32 socar; /* Source Operations CAR */
1260 u32 docar; /* Destination Operations CAR */ 1260 u32 docar; /* Destination Operations CAR */
1261 u8 res1[32]; 1261 u8 res1[32];
1262 u32 mcsr; /* Mailbox CSR */ 1262 u32 mcsr; /* Mailbox CSR */
1263 u32 pwdcsr; /* Port-Write and Doorbell CSR */ 1263 u32 pwdcsr; /* Port-Write and Doorbell CSR */
1264 u8 res2[4]; 1264 u8 res2[4];
1265 u32 pellccsr; /* Processing Element Logic Layer CCSR */ 1265 u32 pellccsr; /* Processing Element Logic Layer CCSR */
1266 u8 res3[12]; 1266 u8 res3[12];
1267 u32 lcsbacsr; /* Local Configuration Space BACSR */ 1267 u32 lcsbacsr; /* Local Configuration Space BACSR */
1268 u32 bdidcsr; /* Base Device ID CSR */ 1268 u32 bdidcsr; /* Base Device ID CSR */
1269 u8 res4[4]; 1269 u8 res4[4];
1270 u32 hbdidlcsr; /* Host Base Device ID Lock CSR */ 1270 u32 hbdidlcsr; /* Host Base Device ID Lock CSR */
1271 u32 ctcsr; /* Component Tag CSR */ 1271 u32 ctcsr; /* Component Tag CSR */
1272 }; 1272 };
1273 1273
1274 /* Extended Features Space: 1x/4x LP-Serial Port registers */ 1274 /* Extended Features Space: 1x/4x LP-Serial Port registers */
1275 struct rio_lp_serial_port { 1275 struct rio_lp_serial_port {
1276 u32 plmreqcsr; /* Port Link Maintenance Request CSR */ 1276 u32 plmreqcsr; /* Port Link Maintenance Request CSR */
1277 u32 plmrespcsr; /* Port Link Maintenance Response CS */ 1277 u32 plmrespcsr; /* Port Link Maintenance Response CS */
1278 u32 plascsr; /* Port Local Ackid Status CSR */ 1278 u32 plascsr; /* Port Local Ackid Status CSR */
1279 u8 res0[12]; 1279 u8 res0[12];
1280 u32 pescsr; /* Port Error and Status CSR */ 1280 u32 pescsr; /* Port Error and Status CSR */
1281 u32 pccsr; /* Port Control CSR */ 1281 u32 pccsr; /* Port Control CSR */
1282 }; 1282 };
1283 1283
1284 /* Extended Features Space: 1x/4x LP-Serial registers */ 1284 /* Extended Features Space: 1x/4x LP-Serial registers */
1285 struct rio_lp_serial { 1285 struct rio_lp_serial {
1286 u32 pmbh0csr; /* Port Maintenance Block Header 0 CSR */ 1286 u32 pmbh0csr; /* Port Maintenance Block Header 0 CSR */
1287 u8 res0[28]; 1287 u8 res0[28];
1288 u32 pltoccsr; /* Port Link Time-out CCSR */ 1288 u32 pltoccsr; /* Port Link Time-out CCSR */
1289 u32 prtoccsr; /* Port Response Time-out CCSR */ 1289 u32 prtoccsr; /* Port Response Time-out CCSR */
1290 u8 res1[20]; 1290 u8 res1[20];
1291 u32 pgccsr; /* Port General CSR */ 1291 u32 pgccsr; /* Port General CSR */
1292 struct rio_lp_serial_port port[CONFIG_SYS_FSL_SRIO_MAX_PORTS]; 1292 struct rio_lp_serial_port port[CONFIG_SYS_FSL_SRIO_MAX_PORTS];
1293 }; 1293 };
1294 1294
1295 /* Logical error reporting registers */ 1295 /* Logical error reporting registers */
1296 struct rio_logical_err { 1296 struct rio_logical_err {
1297 u32 erbh; /* Error Reporting Block Header Register */ 1297 u32 erbh; /* Error Reporting Block Header Register */
1298 u8 res0[4]; 1298 u8 res0[4];
1299 u32 ltledcsr; /* Logical/Transport layer error DCSR */ 1299 u32 ltledcsr; /* Logical/Transport layer error DCSR */
1300 u32 ltleecsr; /* Logical/Transport layer error ECSR */ 1300 u32 ltleecsr; /* Logical/Transport layer error ECSR */
1301 u8 res1[4]; 1301 u8 res1[4];
1302 u32 ltlaccsr; /* Logical/Transport layer ACCSR */ 1302 u32 ltlaccsr; /* Logical/Transport layer ACCSR */
1303 u32 ltldidccsr; /* Logical/Transport layer DID CCSR */ 1303 u32 ltldidccsr; /* Logical/Transport layer DID CCSR */
1304 u32 ltlcccsr; /* Logical/Transport layer control CCSR */ 1304 u32 ltlcccsr; /* Logical/Transport layer control CCSR */
1305 }; 1305 };
1306 1306
1307 /* Physical error reporting port registers */ 1307 /* Physical error reporting port registers */
1308 struct rio_phys_err_port { 1308 struct rio_phys_err_port {
1309 u32 edcsr; /* Port error detect CSR */ 1309 u32 edcsr; /* Port error detect CSR */
1310 u32 erecsr; /* Port error rate enable CSR */ 1310 u32 erecsr; /* Port error rate enable CSR */
1311 u32 ecacsr; /* Port error capture attributes CSR */ 1311 u32 ecacsr; /* Port error capture attributes CSR */
1312 u32 pcseccsr0; /* Port packet/control symbol ECCSR 0 */ 1312 u32 pcseccsr0; /* Port packet/control symbol ECCSR 0 */
1313 u32 peccsr[3]; /* Port error capture CSR */ 1313 u32 peccsr[3]; /* Port error capture CSR */
1314 u8 res0[12]; 1314 u8 res0[12];
1315 u32 ercsr; /* Port error rate CSR */ 1315 u32 ercsr; /* Port error rate CSR */
1316 u32 ertcsr; /* Port error rate threshold CSR */ 1316 u32 ertcsr; /* Port error rate threshold CSR */
1317 u8 res1[16]; 1317 u8 res1[16];
1318 }; 1318 };
1319 1319
1320 /* Physical error reporting registers */ 1320 /* Physical error reporting registers */
1321 struct rio_phys_err { 1321 struct rio_phys_err {
1322 struct rio_phys_err_port port[CONFIG_SYS_FSL_SRIO_MAX_PORTS]; 1322 struct rio_phys_err_port port[CONFIG_SYS_FSL_SRIO_MAX_PORTS];
1323 }; 1323 };
1324 1324
1325 /* Implementation Space: General Port-Common */ 1325 /* Implementation Space: General Port-Common */
1326 struct rio_impl_common { 1326 struct rio_impl_common {
1327 u8 res0[4]; 1327 u8 res0[4];
1328 u32 llcr; /* Logical Layer Configuration Register */ 1328 u32 llcr; /* Logical Layer Configuration Register */
1329 u8 res1[8]; 1329 u8 res1[8];
1330 u32 epwisr; /* Error / Port-Write Interrupt SR */ 1330 u32 epwisr; /* Error / Port-Write Interrupt SR */
1331 u8 res2[12]; 1331 u8 res2[12];
1332 u32 lretcr; /* Logical Retry Error Threshold CR */ 1332 u32 lretcr; /* Logical Retry Error Threshold CR */
1333 u8 res3[92]; 1333 u8 res3[92];
1334 u32 pretcr; /* Physical Retry Erorr Threshold CR */ 1334 u32 pretcr; /* Physical Retry Erorr Threshold CR */
1335 u8 res4[124]; 1335 u8 res4[124];
1336 }; 1336 };
1337 1337
1338 /* Implementation Space: Port Specific */ 1338 /* Implementation Space: Port Specific */
1339 struct rio_impl_port_spec { 1339 struct rio_impl_port_spec {
1340 u32 adidcsr; /* Port Alt. Device ID CSR */ 1340 u32 adidcsr; /* Port Alt. Device ID CSR */
1341 u8 res0[28]; 1341 u8 res0[28];
1342 u32 ptaacr; /* Port Pass-Through/Accept-All CR */ 1342 u32 ptaacr; /* Port Pass-Through/Accept-All CR */
1343 u32 lopttlcr; 1343 u32 lopttlcr;
1344 u8 res1[8]; 1344 u8 res1[8];
1345 u32 iecsr; /* Port Implementation Error CSR */ 1345 u32 iecsr; /* Port Implementation Error CSR */
1346 u8 res2[12]; 1346 u8 res2[12];
1347 u32 pcr; /* Port Phsyical Configuration Register */ 1347 u32 pcr; /* Port Phsyical Configuration Register */
1348 u8 res3[20]; 1348 u8 res3[20];
1349 u32 slcsr; /* Port Serial Link CSR */ 1349 u32 slcsr; /* Port Serial Link CSR */
1350 u8 res4[4]; 1350 u8 res4[4];
1351 u32 sleicr; /* Port Serial Link Error Injection */ 1351 u32 sleicr; /* Port Serial Link Error Injection */
1352 u32 a0txcr; /* Port Arbitration 0 Tx CR */ 1352 u32 a0txcr; /* Port Arbitration 0 Tx CR */
1353 u32 a1txcr; /* Port Arbitration 1 Tx CR */ 1353 u32 a1txcr; /* Port Arbitration 1 Tx CR */
1354 u32 a2txcr; /* Port Arbitration 2 Tx CR */ 1354 u32 a2txcr; /* Port Arbitration 2 Tx CR */
1355 u32 mreqtxbacr[3]; /* Port Request Tx Buffer ACR */ 1355 u32 mreqtxbacr[3]; /* Port Request Tx Buffer ACR */
1356 u32 mrspfctxbacr; /* Port Response/Flow Control Tx Buffer ACR */ 1356 u32 mrspfctxbacr; /* Port Response/Flow Control Tx Buffer ACR */
1357 }; 1357 };
1358 1358
1359 /* Implementation Space: register */ 1359 /* Implementation Space: register */
1360 struct rio_implement { 1360 struct rio_implement {
1361 struct rio_impl_common com; 1361 struct rio_impl_common com;
1362 struct rio_impl_port_spec port[CONFIG_SYS_FSL_SRIO_MAX_PORTS]; 1362 struct rio_impl_port_spec port[CONFIG_SYS_FSL_SRIO_MAX_PORTS];
1363 }; 1363 };
1364 1364
1365 /* Revision Control Register */ 1365 /* Revision Control Register */
1366 struct rio_rev_ctrl { 1366 struct rio_rev_ctrl {
1367 u32 ipbrr[2]; /* IP Block Revision Register */ 1367 u32 ipbrr[2]; /* IP Block Revision Register */
1368 }; 1368 };
1369 1369
1370 struct rio_atmu_row { 1370 struct rio_atmu_row {
1371 u32 rowtar; /* RapidIO Outbound Window TAR */ 1371 u32 rowtar; /* RapidIO Outbound Window TAR */
1372 u32 rowtear; /* RapidIO Outbound Window TEAR */ 1372 u32 rowtear; /* RapidIO Outbound Window TEAR */
1373 u32 rowbar; 1373 u32 rowbar;
1374 u8 res0[4]; 1374 u8 res0[4];
1375 u32 rowar; /* RapidIO Outbound Attributes Register */ 1375 u32 rowar; /* RapidIO Outbound Attributes Register */
1376 u32 rowsr[3]; /* Port RapidIO outbound window segment register */ 1376 u32 rowsr[3]; /* Port RapidIO outbound window segment register */
1377 }; 1377 };
1378 1378
1379 struct rio_atmu_riw { 1379 struct rio_atmu_riw {
1380 u32 riwtar; /* RapidIO Inbound Window Translation AR */ 1380 u32 riwtar; /* RapidIO Inbound Window Translation AR */
1381 u8 res0[4]; 1381 u8 res0[4];
1382 u32 riwbar; /* RapidIO Inbound Window Base AR */ 1382 u32 riwbar; /* RapidIO Inbound Window Base AR */
1383 u8 res1[4]; 1383 u8 res1[4];
1384 u32 riwar; /* RapidIO Inbound Attributes Register */ 1384 u32 riwar; /* RapidIO Inbound Attributes Register */
1385 u8 res2[12]; 1385 u8 res2[12];
1386 }; 1386 };
1387 1387
1388 /* ATMU window registers */ 1388 /* ATMU window registers */
1389 struct rio_atmu_win { 1389 struct rio_atmu_win {
1390 struct rio_atmu_row outbw[CONFIG_SYS_FSL_SRIO_OB_WIN_NUM]; 1390 struct rio_atmu_row outbw[CONFIG_SYS_FSL_SRIO_OB_WIN_NUM];
1391 u8 res0[64]; 1391 u8 res0[64];
1392 struct rio_atmu_riw inbw[CONFIG_SYS_FSL_SRIO_IB_WIN_NUM]; 1392 struct rio_atmu_riw inbw[CONFIG_SYS_FSL_SRIO_IB_WIN_NUM];
1393 }; 1393 };
1394 1394
1395 struct rio_atmu { 1395 struct rio_atmu {
1396 struct rio_atmu_win port[CONFIG_SYS_FSL_SRIO_MAX_PORTS]; 1396 struct rio_atmu_win port[CONFIG_SYS_FSL_SRIO_MAX_PORTS];
1397 }; 1397 };
1398 1398
1399 #ifdef CONFIG_SYS_FSL_RMU 1399 #ifdef CONFIG_SYS_FSL_RMU
1400 struct rio_msg { 1400 struct rio_msg {
1401 u32 omr; /* Outbound Mode Register */ 1401 u32 omr; /* Outbound Mode Register */
1402 u32 osr; /* Outbound Status Register */ 1402 u32 osr; /* Outbound Status Register */
1403 u32 eodqdpar; /* Extended Outbound DQ DPAR */ 1403 u32 eodqdpar; /* Extended Outbound DQ DPAR */
1404 u32 odqdpar; /* Outbound Descriptor Queue DPAR */ 1404 u32 odqdpar; /* Outbound Descriptor Queue DPAR */
1405 u32 eosar; /* Extended Outbound Unit Source AR */ 1405 u32 eosar; /* Extended Outbound Unit Source AR */
1406 u32 osar; /* Outbound Unit Source AR */ 1406 u32 osar; /* Outbound Unit Source AR */
1407 u32 odpr; /* Outbound Destination Port Register */ 1407 u32 odpr; /* Outbound Destination Port Register */
1408 u32 odatr; /* Outbound Destination Attributes Register */ 1408 u32 odatr; /* Outbound Destination Attributes Register */
1409 u32 odcr; /* Outbound Doubleword Count Register */ 1409 u32 odcr; /* Outbound Doubleword Count Register */
1410 u32 eodqepar; /* Extended Outbound DQ EPAR */ 1410 u32 eodqepar; /* Extended Outbound DQ EPAR */
1411 u32 odqepar; /* Outbound Descriptor Queue EPAR */ 1411 u32 odqepar; /* Outbound Descriptor Queue EPAR */
1412 u32 oretr; /* Outbound Retry Error Threshold Register */ 1412 u32 oretr; /* Outbound Retry Error Threshold Register */
1413 u32 omgr; /* Outbound Multicast Group Register */ 1413 u32 omgr; /* Outbound Multicast Group Register */
1414 u32 omlr; /* Outbound Multicast List Register */ 1414 u32 omlr; /* Outbound Multicast List Register */
1415 u8 res0[40]; 1415 u8 res0[40];
1416 u32 imr; /* Outbound Mode Register */ 1416 u32 imr; /* Outbound Mode Register */
1417 u32 isr; /* Inbound Status Register */ 1417 u32 isr; /* Inbound Status Register */
1418 u32 eidqdpar; /* Extended Inbound Descriptor Queue DPAR */ 1418 u32 eidqdpar; /* Extended Inbound Descriptor Queue DPAR */
1419 u32 idqdpar; /* Inbound Descriptor Queue DPAR */ 1419 u32 idqdpar; /* Inbound Descriptor Queue DPAR */
1420 u32 eifqepar; /* Extended Inbound Frame Queue EPAR */ 1420 u32 eifqepar; /* Extended Inbound Frame Queue EPAR */
1421 u32 ifqepar; /* Inbound Frame Queue EPAR */ 1421 u32 ifqepar; /* Inbound Frame Queue EPAR */
1422 u32 imirir; /* Inbound Maximum Interrutp RIR */ 1422 u32 imirir; /* Inbound Maximum Interrutp RIR */
1423 u8 res1[4]; 1423 u8 res1[4];
1424 u32 eihqepar; /* Extended inbound message header queue EPAR */ 1424 u32 eihqepar; /* Extended inbound message header queue EPAR */
1425 u32 ihqepar; /* Inbound message header queue EPAR */ 1425 u32 ihqepar; /* Inbound message header queue EPAR */
1426 u8 res2[120]; 1426 u8 res2[120];
1427 }; 1427 };
1428 1428
1429 struct rio_dbell { 1429 struct rio_dbell {
1430 u32 odmr; /* Outbound Doorbell Mode Register */ 1430 u32 odmr; /* Outbound Doorbell Mode Register */
1431 u32 odsr; /* Outbound Doorbell Status Register */ 1431 u32 odsr; /* Outbound Doorbell Status Register */
1432 u8 res0[16]; 1432 u8 res0[16];
1433 u32 oddpr; /* Outbound Doorbell Destination Port */ 1433 u32 oddpr; /* Outbound Doorbell Destination Port */
1434 u32 oddatr; /* Outbound Doorbell Destination AR */ 1434 u32 oddatr; /* Outbound Doorbell Destination AR */
1435 u8 res1[12]; 1435 u8 res1[12];
1436 u32 oddretr; /* Outbound Doorbell Retry Threshold CR */ 1436 u32 oddretr; /* Outbound Doorbell Retry Threshold CR */
1437 u8 res2[48]; 1437 u8 res2[48];
1438 u32 idmr; /* Inbound Doorbell Mode Register */ 1438 u32 idmr; /* Inbound Doorbell Mode Register */
1439 u32 idsr; /* Inbound Doorbell Status Register */ 1439 u32 idsr; /* Inbound Doorbell Status Register */
1440 u32 iedqdpar; /* Extended Inbound Doorbell Queue DPAR */ 1440 u32 iedqdpar; /* Extended Inbound Doorbell Queue DPAR */
1441 u32 iqdpar; /* Inbound Doorbell Queue DPAR */ 1441 u32 iqdpar; /* Inbound Doorbell Queue DPAR */
1442 u32 iedqepar; /* Extended Inbound Doorbell Queue EPAR */ 1442 u32 iedqepar; /* Extended Inbound Doorbell Queue EPAR */
1443 u32 idqepar; /* Inbound Doorbell Queue EPAR */ 1443 u32 idqepar; /* Inbound Doorbell Queue EPAR */
1444 u32 idmirir; /* Inbound Doorbell Max Interrupt RIR */ 1444 u32 idmirir; /* Inbound Doorbell Max Interrupt RIR */
1445 }; 1445 };
1446 1446
1447 struct rio_pw { 1447 struct rio_pw {
1448 u32 pwmr; /* Port-Write Mode Register */ 1448 u32 pwmr; /* Port-Write Mode Register */
1449 u32 pwsr; /* Port-Write Status Register */ 1449 u32 pwsr; /* Port-Write Status Register */
1450 u32 epwqbar; /* Extended Port-Write Queue BAR */ 1450 u32 epwqbar; /* Extended Port-Write Queue BAR */
1451 u32 pwqbar; /* Port-Write Queue Base Address Register */ 1451 u32 pwqbar; /* Port-Write Queue Base Address Register */
1452 }; 1452 };
1453 #endif 1453 #endif
1454 1454
1455 #ifdef CONFIG_SYS_FSL_SRIO_LIODN 1455 #ifdef CONFIG_SYS_FSL_SRIO_LIODN
1456 struct rio_liodn { 1456 struct rio_liodn {
1457 u32 plbr; 1457 u32 plbr;
1458 u8 res0[28]; 1458 u8 res0[28];
1459 u32 plaor; 1459 u32 plaor;
1460 u8 res1[12]; 1460 u8 res1[12];
1461 u32 pludr; 1461 u32 pludr;
1462 u32 plldr; 1462 u32 plldr;
1463 u8 res2[456]; 1463 u8 res2[456];
1464 }; 1464 };
1465 #endif 1465 #endif
1466 1466
1467 /* RapidIO Registers */ 1467 /* RapidIO Registers */
1468 struct ccsr_rio { 1468 struct ccsr_rio {
1469 struct rio_arch arch; 1469 struct rio_arch arch;
1470 u8 res0[144]; 1470 u8 res0[144];
1471 struct rio_lp_serial lp_serial; 1471 struct rio_lp_serial lp_serial;
1472 u8 res1[1152]; 1472 u8 res1[1152];
1473 struct rio_logical_err logical_err; 1473 struct rio_logical_err logical_err;
1474 u8 res2[32]; 1474 u8 res2[32];
1475 struct rio_phys_err phys_err; 1475 struct rio_phys_err phys_err;
1476 u8 res3[63808]; 1476 u8 res3[63808];
1477 struct rio_implement impl; 1477 struct rio_implement impl;
1478 u8 res4[2552]; 1478 u8 res4[2552];
1479 struct rio_rev_ctrl rev; 1479 struct rio_rev_ctrl rev;
1480 struct rio_atmu atmu; 1480 struct rio_atmu atmu;
1481 #ifdef CONFIG_SYS_FSL_RMU 1481 #ifdef CONFIG_SYS_FSL_RMU
1482 u8 res5[8192]; 1482 u8 res5[8192];
1483 struct rio_msg msg[CONFIG_SYS_FSL_SRIO_MSG_UNIT_NUM]; 1483 struct rio_msg msg[CONFIG_SYS_FSL_SRIO_MSG_UNIT_NUM];
1484 u8 res6[512]; 1484 u8 res6[512];
1485 struct rio_dbell dbell; 1485 struct rio_dbell dbell;
1486 u8 res7[100]; 1486 u8 res7[100];
1487 struct rio_pw pw; 1487 struct rio_pw pw;
1488 #endif 1488 #endif
1489 #ifdef CONFIG_SYS_FSL_SRIO_LIODN 1489 #ifdef CONFIG_SYS_FSL_SRIO_LIODN
1490 u8 res5[8192]; 1490 u8 res5[8192];
1491 struct rio_liodn liodn[CONFIG_SYS_FSL_SRIO_MAX_PORTS]; 1491 struct rio_liodn liodn[CONFIG_SYS_FSL_SRIO_MAX_PORTS];
1492 #endif 1492 #endif
1493 }; 1493 };
1494 #endif 1494 #endif
1495 1495
1496 /* Quick Engine Block Pin Muxing Registers */ 1496 /* Quick Engine Block Pin Muxing Registers */
1497 typedef struct par_io { 1497 typedef struct par_io {
1498 u32 cpodr; 1498 u32 cpodr;
1499 u32 cpdat; 1499 u32 cpdat;
1500 u32 cpdir1; 1500 u32 cpdir1;
1501 u32 cpdir2; 1501 u32 cpdir2;
1502 u32 cppar1; 1502 u32 cppar1;
1503 u32 cppar2; 1503 u32 cppar2;
1504 u8 res[8]; 1504 u8 res[8];
1505 } par_io_t; 1505 } par_io_t;
1506 1506
1507 #ifdef CONFIG_SYS_FSL_CPC 1507 #ifdef CONFIG_SYS_FSL_CPC
1508 /* 1508 /*
1509 * Define a single offset that is the start of all the CPC register 1509 * Define a single offset that is the start of all the CPC register
1510 * blocks - if there is more than one CPC, we expect these to be 1510 * blocks - if there is more than one CPC, we expect these to be
1511 * contiguous 4k regions 1511 * contiguous 4k regions
1512 */ 1512 */
1513 1513
1514 typedef struct cpc_corenet { 1514 typedef struct cpc_corenet {
1515 u32 cpccsr0; /* Config/status reg */ 1515 u32 cpccsr0; /* Config/status reg */
1516 u32 res1; 1516 u32 res1;
1517 u32 cpccfg0; /* Configuration register */ 1517 u32 cpccfg0; /* Configuration register */
1518 u32 res2; 1518 u32 res2;
1519 u32 cpcewcr0; /* External Write reg 0 */ 1519 u32 cpcewcr0; /* External Write reg 0 */
1520 u32 cpcewabr0; /* External write base reg 0 */ 1520 u32 cpcewabr0; /* External write base reg 0 */
1521 u32 res3[2]; 1521 u32 res3[2];
1522 u32 cpcewcr1; /* External Write reg 1 */ 1522 u32 cpcewcr1; /* External Write reg 1 */
1523 u32 cpcewabr1; /* External write base reg 1 */ 1523 u32 cpcewabr1; /* External write base reg 1 */
1524 u32 res4[54]; 1524 u32 res4[54];
1525 u32 cpcsrcr1; /* SRAM control reg 1 */ 1525 u32 cpcsrcr1; /* SRAM control reg 1 */
1526 u32 cpcsrcr0; /* SRAM control reg 0 */ 1526 u32 cpcsrcr0; /* SRAM control reg 0 */
1527 u32 res5[62]; 1527 u32 res5[62];
1528 struct { 1528 struct {
1529 u32 id; /* partition ID */ 1529 u32 id; /* partition ID */
1530 u32 res; 1530 u32 res;
1531 u32 alloc; /* partition allocation */ 1531 u32 alloc; /* partition allocation */
1532 u32 way; /* partition way */ 1532 u32 way; /* partition way */
1533 } partition_regs[16]; 1533 } partition_regs[16];
1534 u32 res6[704]; 1534 u32 res6[704];
1535 u32 cpcerrinjhi; /* Error injection high */ 1535 u32 cpcerrinjhi; /* Error injection high */
1536 u32 cpcerrinjlo; /* Error injection lo */ 1536 u32 cpcerrinjlo; /* Error injection lo */
1537 u32 cpcerrinjctl; /* Error injection control */ 1537 u32 cpcerrinjctl; /* Error injection control */
1538 u32 res7[5]; 1538 u32 res7[5];
1539 u32 cpccaptdatahi; /* capture data high */ 1539 u32 cpccaptdatahi; /* capture data high */
1540 u32 cpccaptdatalo; /* capture data low */ 1540 u32 cpccaptdatalo; /* capture data low */
1541 u32 cpcaptecc; /* capture ECC */ 1541 u32 cpcaptecc; /* capture ECC */
1542 u32 res8[5]; 1542 u32 res8[5];
1543 u32 cpcerrdet; /* error detect */ 1543 u32 cpcerrdet; /* error detect */
1544 u32 cpcerrdis; /* error disable */ 1544 u32 cpcerrdis; /* error disable */
1545 u32 cpcerrinten; /* errir interrupt enable */ 1545 u32 cpcerrinten; /* errir interrupt enable */
1546 u32 cpcerrattr; /* error attribute */ 1546 u32 cpcerrattr; /* error attribute */
1547 u32 cpcerreaddr; /* error extended address */ 1547 u32 cpcerreaddr; /* error extended address */
1548 u32 cpcerraddr; /* error address */ 1548 u32 cpcerraddr; /* error address */
1549 u32 cpcerrctl; /* error control */ 1549 u32 cpcerrctl; /* error control */
1550 u32 res9[41]; /* pad out to 4k */ 1550 u32 res9[41]; /* pad out to 4k */
1551 u32 cpchdbcr0; /* hardware debug control register 0 */ 1551 u32 cpchdbcr0; /* hardware debug control register 0 */
1552 u32 res10[63]; /* pad out to 4k */ 1552 u32 res10[63]; /* pad out to 4k */
1553 } cpc_corenet_t; 1553 } cpc_corenet_t;
1554 1554
1555 #define CPC_CSR0_CE 0x80000000 /* Cache Enable */ 1555 #define CPC_CSR0_CE 0x80000000 /* Cache Enable */
1556 #define CPC_CSR0_PE 0x40000000 /* Enable ECC */ 1556 #define CPC_CSR0_PE 0x40000000 /* Enable ECC */
1557 #define CPC_CSR0_FI 0x00200000 /* Cache Flash Invalidate */ 1557 #define CPC_CSR0_FI 0x00200000 /* Cache Flash Invalidate */
1558 #define CPC_CSR0_WT 0x00080000 /* Write-through mode */ 1558 #define CPC_CSR0_WT 0x00080000 /* Write-through mode */
1559 #define CPC_CSR0_FL 0x00000800 /* Hardware cache flush */ 1559 #define CPC_CSR0_FL 0x00000800 /* Hardware cache flush */
1560 #define CPC_CSR0_LFC 0x00000400 /* Cache Lock Flash Clear */ 1560 #define CPC_CSR0_LFC 0x00000400 /* Cache Lock Flash Clear */
1561 #define CPC_CFG0_SZ_MASK 0x00003fff 1561 #define CPC_CFG0_SZ_MASK 0x00003fff
1562 #define CPC_CFG0_SZ_K(x) ((x & CPC_CFG0_SZ_MASK) << 6) 1562 #define CPC_CFG0_SZ_K(x) ((x & CPC_CFG0_SZ_MASK) << 6)
1563 #define CPC_CFG0_NUM_WAYS(x) (((x >> 14) & 0x1f) + 1) 1563 #define CPC_CFG0_NUM_WAYS(x) (((x >> 14) & 0x1f) + 1)
1564 #define CPC_CFG0_LINE_SZ(x) ((((x >> 23) & 0x3) + 1) * 32) 1564 #define CPC_CFG0_LINE_SZ(x) ((((x >> 23) & 0x3) + 1) * 32)
1565 #define CPC_SRCR1_SRBARU_MASK 0x0000ffff 1565 #define CPC_SRCR1_SRBARU_MASK 0x0000ffff
1566 #define CPC_SRCR1_SRBARU(x) (((unsigned long long)x >> 32) \ 1566 #define CPC_SRCR1_SRBARU(x) (((unsigned long long)x >> 32) \
1567 & CPC_SRCR1_SRBARU_MASK) 1567 & CPC_SRCR1_SRBARU_MASK)
1568 #define CPC_SRCR0_SRBARL_MASK 0xffff8000 1568 #define CPC_SRCR0_SRBARL_MASK 0xffff8000
1569 #define CPC_SRCR0_SRBARL(x) (x & CPC_SRCR0_SRBARL_MASK) 1569 #define CPC_SRCR0_SRBARL(x) (x & CPC_SRCR0_SRBARL_MASK)
1570 #define CPC_SRCR0_INTLVEN 0x00000100 1570 #define CPC_SRCR0_INTLVEN 0x00000100
1571 #define CPC_SRCR0_SRAMSZ_1_WAY 0x00000000 1571 #define CPC_SRCR0_SRAMSZ_1_WAY 0x00000000
1572 #define CPC_SRCR0_SRAMSZ_2_WAY 0x00000002 1572 #define CPC_SRCR0_SRAMSZ_2_WAY 0x00000002
1573 #define CPC_SRCR0_SRAMSZ_4_WAY 0x00000004 1573 #define CPC_SRCR0_SRAMSZ_4_WAY 0x00000004
1574 #define CPC_SRCR0_SRAMSZ_8_WAY 0x00000006 1574 #define CPC_SRCR0_SRAMSZ_8_WAY 0x00000006
1575 #define CPC_SRCR0_SRAMSZ_16_WAY 0x00000008 1575 #define CPC_SRCR0_SRAMSZ_16_WAY 0x00000008
1576 #define CPC_SRCR0_SRAMSZ_32_WAY 0x0000000a 1576 #define CPC_SRCR0_SRAMSZ_32_WAY 0x0000000a
1577 #define CPC_SRCR0_SRAMEN 0x00000001 1577 #define CPC_SRCR0_SRAMEN 0x00000001
1578 #define CPC_ERRDIS_TMHITDIS 0x00000080 /* multi-way hit disable */ 1578 #define CPC_ERRDIS_TMHITDIS 0x00000080 /* multi-way hit disable */
1579 #define CPC_HDBCR0_CDQ_SPEC_DIS 0x08000000 1579 #define CPC_HDBCR0_CDQ_SPEC_DIS 0x08000000
1580 #define CPC_HDBCR0_TAG_ECC_SCRUB_DIS 0x01000000 1580 #define CPC_HDBCR0_TAG_ECC_SCRUB_DIS 0x01000000
1581 #define CPC_HDBCR0_DATA_ECC_SCRUB_DIS 0x00400000 1581 #define CPC_HDBCR0_DATA_ECC_SCRUB_DIS 0x00400000
1582 #define CPC_HDBCR0_SPLRU_LEVEL_EN 0x001e0000 1582 #define CPC_HDBCR0_SPLRU_LEVEL_EN 0x001e0000
1583 #endif /* CONFIG_SYS_FSL_CPC */ 1583 #endif /* CONFIG_SYS_FSL_CPC */
1584 1584
1585 /* Global Utilities Block */ 1585 /* Global Utilities Block */
1586 #ifdef CONFIG_FSL_CORENET 1586 #ifdef CONFIG_FSL_CORENET
1587 typedef struct ccsr_gur { 1587 typedef struct ccsr_gur {
1588 u32 porsr1; /* POR status 1 */ 1588 u32 porsr1; /* POR status 1 */
1589 u32 porsr2; /* POR status 2 */ 1589 u32 porsr2; /* POR status 2 */
1590 #ifdef CONFIG_SYS_FSL_SINGLE_SOURCE_CLK 1590 #ifdef CONFIG_SYS_FSL_SINGLE_SOURCE_CLK
1591 #define FSL_DCFG_PORSR1_SYSCLK_SHIFT 15 1591 #define FSL_DCFG_PORSR1_SYSCLK_SHIFT 15
1592 #define FSL_DCFG_PORSR1_SYSCLK_MASK 0x1 1592 #define FSL_DCFG_PORSR1_SYSCLK_MASK 0x1
1593 #define FSL_DCFG_PORSR1_SYSCLK_SINGLE_ENDED 0x1 1593 #define FSL_DCFG_PORSR1_SYSCLK_SINGLE_ENDED 0x1
1594 #define FSL_DCFG_PORSR1_SYSCLK_DIFF 0x0 1594 #define FSL_DCFG_PORSR1_SYSCLK_DIFF 0x0
1595 #endif 1595 #endif
1596 u8 res_008[0x20-0x8]; 1596 u8 res_008[0x20-0x8];
1597 u32 gpporcr1; /* General-purpose POR configuration */ 1597 u32 gpporcr1; /* General-purpose POR configuration */
1598 u32 gpporcr2; /* General-purpose POR configuration 2 */ 1598 u32 gpporcr2; /* General-purpose POR configuration 2 */
1599 u32 dcfg_fusesr; /* Fuse status register */ 1599 u32 dcfg_fusesr; /* Fuse status register */
1600 #define FSL_CORENET_DCFG_FUSESR_VID_SHIFT 25 1600 #define FSL_CORENET_DCFG_FUSESR_VID_SHIFT 25
1601 #define FSL_CORENET_DCFG_FUSESR_VID_MASK 0x1F 1601 #define FSL_CORENET_DCFG_FUSESR_VID_MASK 0x1F
1602 #define FSL_CORENET_DCFG_FUSESR_ALTVID_SHIFT 20 1602 #define FSL_CORENET_DCFG_FUSESR_ALTVID_SHIFT 20
1603 #define FSL_CORENET_DCFG_FUSESR_ALTVID_MASK 0x1F 1603 #define FSL_CORENET_DCFG_FUSESR_ALTVID_MASK 0x1F
1604 u8 res_02c[0x70-0x2c]; 1604 u8 res_02c[0x70-0x2c];
1605 u32 devdisr; /* Device disable control */ 1605 u32 devdisr; /* Device disable control */
1606 u32 devdisr2; /* Device disable control 2 */ 1606 u32 devdisr2; /* Device disable control 2 */
1607 u32 devdisr3; /* Device disable control 3 */ 1607 u32 devdisr3; /* Device disable control 3 */
1608 u32 devdisr4; /* Device disable control 4 */ 1608 u32 devdisr4; /* Device disable control 4 */
1609 #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2 1609 #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2
1610 u32 devdisr5; /* Device disable control 5 */ 1610 u32 devdisr5; /* Device disable control 5 */
1611 #define FSL_CORENET_DEVDISR_PBL 0x80000000 1611 #define FSL_CORENET_DEVDISR_PBL 0x80000000
1612 #define FSL_CORENET_DEVDISR_PMAN 0x40000000 1612 #define FSL_CORENET_DEVDISR_PMAN 0x40000000
1613 #define FSL_CORENET_DEVDISR_ESDHC 0x20000000 1613 #define FSL_CORENET_DEVDISR_ESDHC 0x20000000
1614 #define FSL_CORENET_DEVDISR_DMA1 0x00800000 1614 #define FSL_CORENET_DEVDISR_DMA1 0x00800000
1615 #define FSL_CORENET_DEVDISR_DMA2 0x00400000 1615 #define FSL_CORENET_DEVDISR_DMA2 0x00400000
1616 #define FSL_CORENET_DEVDISR_USB1 0x00080000 1616 #define FSL_CORENET_DEVDISR_USB1 0x00080000
1617 #define FSL_CORENET_DEVDISR_USB2 0x00040000 1617 #define FSL_CORENET_DEVDISR_USB2 0x00040000
1618 #define FSL_CORENET_DEVDISR_SATA1 0x00008000 1618 #define FSL_CORENET_DEVDISR_SATA1 0x00008000
1619 #define FSL_CORENET_DEVDISR_SATA2 0x00004000 1619 #define FSL_CORENET_DEVDISR_SATA2 0x00004000
1620 #define FSL_CORENET_DEVDISR_PME 0x00000800 1620 #define FSL_CORENET_DEVDISR_PME 0x00000800
1621 #define FSL_CORENET_DEVDISR_SEC 0x00000200 1621 #define FSL_CORENET_DEVDISR_SEC 0x00000200
1622 #define FSL_CORENET_DEVDISR_RMU 0x00000080 1622 #define FSL_CORENET_DEVDISR_RMU 0x00000080
1623 #define FSL_CORENET_DEVDISR_DCE 0x00000040 1623 #define FSL_CORENET_DEVDISR_DCE 0x00000040
1624 #define FSL_CORENET_DEVDISR2_DTSEC1_1 0x80000000 1624 #define FSL_CORENET_DEVDISR2_DTSEC1_1 0x80000000
1625 #define FSL_CORENET_DEVDISR2_DTSEC1_2 0x40000000 1625 #define FSL_CORENET_DEVDISR2_DTSEC1_2 0x40000000
1626 #define FSL_CORENET_DEVDISR2_DTSEC1_3 0x20000000 1626 #define FSL_CORENET_DEVDISR2_DTSEC1_3 0x20000000
1627 #define FSL_CORENET_DEVDISR2_DTSEC1_4 0x10000000 1627 #define FSL_CORENET_DEVDISR2_DTSEC1_4 0x10000000
1628 #define FSL_CORENET_DEVDISR2_DTSEC1_5 0x08000000 1628 #define FSL_CORENET_DEVDISR2_DTSEC1_5 0x08000000
1629 #define FSL_CORENET_DEVDISR2_DTSEC1_6 0x04000000 1629 #define FSL_CORENET_DEVDISR2_DTSEC1_6 0x04000000
1630 #define FSL_CORENET_DEVDISR2_DTSEC1_9 0x00800000 1630 #define FSL_CORENET_DEVDISR2_DTSEC1_9 0x00800000
1631 #define FSL_CORENET_DEVDISR2_DTSEC1_10 0x00400000 1631 #define FSL_CORENET_DEVDISR2_DTSEC1_10 0x00400000
1632 #ifdef CONFIG_FSL_FM_10GEC_REGULAR_NOTATION 1632 #ifdef CONFIG_FSL_FM_10GEC_REGULAR_NOTATION
1633 #define FSL_CORENET_DEVDISR2_10GEC1_1 0x80000000 1633 #define FSL_CORENET_DEVDISR2_10GEC1_1 0x80000000
1634 #define FSL_CORENET_DEVDISR2_10GEC1_2 0x40000000 1634 #define FSL_CORENET_DEVDISR2_10GEC1_2 0x40000000
1635 #else 1635 #else
1636 #define FSL_CORENET_DEVDISR2_10GEC1_1 0x00800000 1636 #define FSL_CORENET_DEVDISR2_10GEC1_1 0x00800000
1637 #define FSL_CORENET_DEVDISR2_10GEC1_2 0x00400000 1637 #define FSL_CORENET_DEVDISR2_10GEC1_2 0x00400000
1638 #define FSL_CORENET_DEVDISR2_10GEC1_3 0x80000000 1638 #define FSL_CORENET_DEVDISR2_10GEC1_3 0x80000000
1639 #define FSL_CORENET_DEVDISR2_10GEC1_4 0x40000000 1639 #define FSL_CORENET_DEVDISR2_10GEC1_4 0x40000000
1640 #endif 1640 #endif
1641 #define FSL_CORENET_DEVDISR2_DTSEC2_1 0x00080000 1641 #define FSL_CORENET_DEVDISR2_DTSEC2_1 0x00080000
1642 #define FSL_CORENET_DEVDISR2_DTSEC2_2 0x00040000 1642 #define FSL_CORENET_DEVDISR2_DTSEC2_2 0x00040000
1643 #define FSL_CORENET_DEVDISR2_DTSEC2_3 0x00020000 1643 #define FSL_CORENET_DEVDISR2_DTSEC2_3 0x00020000
1644 #define FSL_CORENET_DEVDISR2_DTSEC2_4 0x00010000 1644 #define FSL_CORENET_DEVDISR2_DTSEC2_4 0x00010000
1645 #define FSL_CORENET_DEVDISR2_DTSEC2_5 0x00008000 1645 #define FSL_CORENET_DEVDISR2_DTSEC2_5 0x00008000
1646 #define FSL_CORENET_DEVDISR2_DTSEC2_6 0x00004000 1646 #define FSL_CORENET_DEVDISR2_DTSEC2_6 0x00004000
1647 #define FSL_CORENET_DEVDISR2_DTSEC2_9 0x00000800 1647 #define FSL_CORENET_DEVDISR2_DTSEC2_9 0x00000800
1648 #define FSL_CORENET_DEVDISR2_DTSEC2_10 0x00000400 1648 #define FSL_CORENET_DEVDISR2_DTSEC2_10 0x00000400
1649 #define FSL_CORENET_DEVDISR2_10GEC2_1 0x00000800 1649 #define FSL_CORENET_DEVDISR2_10GEC2_1 0x00000800
1650 #define FSL_CORENET_DEVDISR2_10GEC2_2 0x00000400 1650 #define FSL_CORENET_DEVDISR2_10GEC2_2 0x00000400
1651 #define FSL_CORENET_DEVDISR2_FM1 0x00000080 1651 #define FSL_CORENET_DEVDISR2_FM1 0x00000080
1652 #define FSL_CORENET_DEVDISR2_FM2 0x00000040 1652 #define FSL_CORENET_DEVDISR2_FM2 0x00000040
1653 #define FSL_CORENET_DEVDISR2_CPRI 0x00000008 1653 #define FSL_CORENET_DEVDISR2_CPRI 0x00000008
1654 #define FSL_CORENET_DEVDISR3_PCIE1 0x80000000 1654 #define FSL_CORENET_DEVDISR3_PCIE1 0x80000000
1655 #define FSL_CORENET_DEVDISR3_PCIE2 0x40000000 1655 #define FSL_CORENET_DEVDISR3_PCIE2 0x40000000
1656 #define FSL_CORENET_DEVDISR3_PCIE3 0x20000000 1656 #define FSL_CORENET_DEVDISR3_PCIE3 0x20000000
1657 #define FSL_CORENET_DEVDISR3_PCIE4 0x10000000 1657 #define FSL_CORENET_DEVDISR3_PCIE4 0x10000000
1658 #define FSL_CORENET_DEVDISR3_SRIO1 0x08000000 1658 #define FSL_CORENET_DEVDISR3_SRIO1 0x08000000
1659 #define FSL_CORENET_DEVDISR3_SRIO2 0x04000000 1659 #define FSL_CORENET_DEVDISR3_SRIO2 0x04000000
1660 #define FSL_CORENET_DEVDISR3_QMAN 0x00080000 1660 #define FSL_CORENET_DEVDISR3_QMAN 0x00080000
1661 #define FSL_CORENET_DEVDISR3_BMAN 0x00040000 1661 #define FSL_CORENET_DEVDISR3_BMAN 0x00040000
1662 #define FSL_CORENET_DEVDISR3_LA1 0x00008000 1662 #define FSL_CORENET_DEVDISR3_LA1 0x00008000
1663 #define FSL_CORENET_DEVDISR3_MAPLE1 0x00000800 1663 #define FSL_CORENET_DEVDISR3_MAPLE1 0x00000800
1664 #define FSL_CORENET_DEVDISR3_MAPLE2 0x00000400 1664 #define FSL_CORENET_DEVDISR3_MAPLE2 0x00000400
1665 #define FSL_CORENET_DEVDISR3_MAPLE3 0x00000200 1665 #define FSL_CORENET_DEVDISR3_MAPLE3 0x00000200
1666 #define FSL_CORENET_DEVDISR4_I2C1 0x80000000 1666 #define FSL_CORENET_DEVDISR4_I2C1 0x80000000
1667 #define FSL_CORENET_DEVDISR4_I2C2 0x40000000 1667 #define FSL_CORENET_DEVDISR4_I2C2 0x40000000
1668 #define FSL_CORENET_DEVDISR4_DUART1 0x20000000 1668 #define FSL_CORENET_DEVDISR4_DUART1 0x20000000
1669 #define FSL_CORENET_DEVDISR4_DUART2 0x10000000 1669 #define FSL_CORENET_DEVDISR4_DUART2 0x10000000
1670 #define FSL_CORENET_DEVDISR4_ESPI 0x08000000 1670 #define FSL_CORENET_DEVDISR4_ESPI 0x08000000
1671 #define FSL_CORENET_DEVDISR5_DDR1 0x80000000 1671 #define FSL_CORENET_DEVDISR5_DDR1 0x80000000
1672 #define FSL_CORENET_DEVDISR5_DDR2 0x40000000 1672 #define FSL_CORENET_DEVDISR5_DDR2 0x40000000
1673 #define FSL_CORENET_DEVDISR5_DDR3 0x20000000 1673 #define FSL_CORENET_DEVDISR5_DDR3 0x20000000
1674 #define FSL_CORENET_DEVDISR5_CPC1 0x08000000 1674 #define FSL_CORENET_DEVDISR5_CPC1 0x08000000
1675 #define FSL_CORENET_DEVDISR5_CPC2 0x04000000 1675 #define FSL_CORENET_DEVDISR5_CPC2 0x04000000
1676 #define FSL_CORENET_DEVDISR5_CPC3 0x02000000 1676 #define FSL_CORENET_DEVDISR5_CPC3 0x02000000
1677 #define FSL_CORENET_DEVDISR5_IFC 0x00800000 1677 #define FSL_CORENET_DEVDISR5_IFC 0x00800000
1678 #define FSL_CORENET_DEVDISR5_GPIO 0x00400000 1678 #define FSL_CORENET_DEVDISR5_GPIO 0x00400000
1679 #define FSL_CORENET_DEVDISR5_DBG 0x00200000 1679 #define FSL_CORENET_DEVDISR5_DBG 0x00200000
1680 #define FSL_CORENET_DEVDISR5_NAL 0x00100000 1680 #define FSL_CORENET_DEVDISR5_NAL 0x00100000
1681 #define FSL_CORENET_DEVDISR5_TIMERS 0x00020000 1681 #define FSL_CORENET_DEVDISR5_TIMERS 0x00020000
1682 #define FSL_CORENET_NUM_DEVDISR 5 1682 #define FSL_CORENET_NUM_DEVDISR 5
1683 #else 1683 #else
1684 #define FSL_CORENET_DEVDISR_PCIE1 0x80000000 1684 #define FSL_CORENET_DEVDISR_PCIE1 0x80000000
1685 #define FSL_CORENET_DEVDISR_PCIE2 0x40000000 1685 #define FSL_CORENET_DEVDISR_PCIE2 0x40000000
1686 #define FSL_CORENET_DEVDISR_PCIE3 0x20000000 1686 #define FSL_CORENET_DEVDISR_PCIE3 0x20000000
1687 #define FSL_CORENET_DEVDISR_PCIE4 0x10000000 1687 #define FSL_CORENET_DEVDISR_PCIE4 0x10000000
1688 #define FSL_CORENET_DEVDISR_RMU 0x08000000 1688 #define FSL_CORENET_DEVDISR_RMU 0x08000000
1689 #define FSL_CORENET_DEVDISR_SRIO1 0x04000000 1689 #define FSL_CORENET_DEVDISR_SRIO1 0x04000000
1690 #define FSL_CORENET_DEVDISR_SRIO2 0x02000000 1690 #define FSL_CORENET_DEVDISR_SRIO2 0x02000000
1691 #define FSL_CORENET_DEVDISR_DMA1 0x00400000 1691 #define FSL_CORENET_DEVDISR_DMA1 0x00400000
1692 #define FSL_CORENET_DEVDISR_DMA2 0x00200000 1692 #define FSL_CORENET_DEVDISR_DMA2 0x00200000
1693 #define FSL_CORENET_DEVDISR_DDR1 0x00100000 1693 #define FSL_CORENET_DEVDISR_DDR1 0x00100000
1694 #define FSL_CORENET_DEVDISR_DDR2 0x00080000 1694 #define FSL_CORENET_DEVDISR_DDR2 0x00080000
1695 #define FSL_CORENET_DEVDISR_DBG 0x00010000 1695 #define FSL_CORENET_DEVDISR_DBG 0x00010000
1696 #define FSL_CORENET_DEVDISR_NAL 0x00008000 1696 #define FSL_CORENET_DEVDISR_NAL 0x00008000
1697 #define FSL_CORENET_DEVDISR_SATA1 0x00004000 1697 #define FSL_CORENET_DEVDISR_SATA1 0x00004000
1698 #define FSL_CORENET_DEVDISR_SATA2 0x00002000 1698 #define FSL_CORENET_DEVDISR_SATA2 0x00002000
1699 #define FSL_CORENET_DEVDISR_ELBC 0x00001000 1699 #define FSL_CORENET_DEVDISR_ELBC 0x00001000
1700 #define FSL_CORENET_DEVDISR_USB1 0x00000800 1700 #define FSL_CORENET_DEVDISR_USB1 0x00000800
1701 #define FSL_CORENET_DEVDISR_USB2 0x00000400 1701 #define FSL_CORENET_DEVDISR_USB2 0x00000400
1702 #define FSL_CORENET_DEVDISR_ESDHC 0x00000100 1702 #define FSL_CORENET_DEVDISR_ESDHC 0x00000100
1703 #define FSL_CORENET_DEVDISR_GPIO 0x00000080 1703 #define FSL_CORENET_DEVDISR_GPIO 0x00000080
1704 #define FSL_CORENET_DEVDISR_ESPI 0x00000040 1704 #define FSL_CORENET_DEVDISR_ESPI 0x00000040
1705 #define FSL_CORENET_DEVDISR_I2C1 0x00000020 1705 #define FSL_CORENET_DEVDISR_I2C1 0x00000020
1706 #define FSL_CORENET_DEVDISR_I2C2 0x00000010 1706 #define FSL_CORENET_DEVDISR_I2C2 0x00000010
1707 #define FSL_CORENET_DEVDISR_DUART1 0x00000002 1707 #define FSL_CORENET_DEVDISR_DUART1 0x00000002
1708 #define FSL_CORENET_DEVDISR_DUART2 0x00000001 1708 #define FSL_CORENET_DEVDISR_DUART2 0x00000001
1709 #define FSL_CORENET_DEVDISR2_PME 0x80000000 1709 #define FSL_CORENET_DEVDISR2_PME 0x80000000
1710 #define FSL_CORENET_DEVDISR2_SEC 0x40000000 1710 #define FSL_CORENET_DEVDISR2_SEC 0x40000000
1711 #define FSL_CORENET_DEVDISR2_QMBM 0x08000000 1711 #define FSL_CORENET_DEVDISR2_QMBM 0x08000000
1712 #define FSL_CORENET_DEVDISR2_FM1 0x02000000 1712 #define FSL_CORENET_DEVDISR2_FM1 0x02000000
1713 #define FSL_CORENET_DEVDISR2_10GEC1 0x01000000 1713 #define FSL_CORENET_DEVDISR2_10GEC1 0x01000000
1714 #define FSL_CORENET_DEVDISR2_DTSEC1_1 0x00800000 1714 #define FSL_CORENET_DEVDISR2_DTSEC1_1 0x00800000
1715 #define FSL_CORENET_DEVDISR2_DTSEC1_2 0x00400000 1715 #define FSL_CORENET_DEVDISR2_DTSEC1_2 0x00400000
1716 #define FSL_CORENET_DEVDISR2_DTSEC1_3 0x00200000 1716 #define FSL_CORENET_DEVDISR2_DTSEC1_3 0x00200000
1717 #define FSL_CORENET_DEVDISR2_DTSEC1_4 0x00100000 1717 #define FSL_CORENET_DEVDISR2_DTSEC1_4 0x00100000
1718 #define FSL_CORENET_DEVDISR2_DTSEC1_5 0x00080000 1718 #define FSL_CORENET_DEVDISR2_DTSEC1_5 0x00080000
1719 #define FSL_CORENET_DEVDISR2_FM2 0x00020000 1719 #define FSL_CORENET_DEVDISR2_FM2 0x00020000
1720 #define FSL_CORENET_DEVDISR2_10GEC2 0x00010000 1720 #define FSL_CORENET_DEVDISR2_10GEC2 0x00010000
1721 #define FSL_CORENET_DEVDISR2_DTSEC2_1 0x00008000 1721 #define FSL_CORENET_DEVDISR2_DTSEC2_1 0x00008000
1722 #define FSL_CORENET_DEVDISR2_DTSEC2_2 0x00004000 1722 #define FSL_CORENET_DEVDISR2_DTSEC2_2 0x00004000
1723 #define FSL_CORENET_DEVDISR2_DTSEC2_3 0x00002000 1723 #define FSL_CORENET_DEVDISR2_DTSEC2_3 0x00002000
1724 #define FSL_CORENET_DEVDISR2_DTSEC2_4 0x00001000 1724 #define FSL_CORENET_DEVDISR2_DTSEC2_4 0x00001000
1725 #define FSL_CORENET_DEVDISR2_DTSEC2_5 0x00000800 1725 #define FSL_CORENET_DEVDISR2_DTSEC2_5 0x00000800
1726 #define FSL_CORENET_NUM_DEVDISR 2 1726 #define FSL_CORENET_NUM_DEVDISR 2
1727 u32 powmgtcsr; /* Power management status & control */ 1727 u32 powmgtcsr; /* Power management status & control */
1728 #endif 1728 #endif
1729 u8 res8[12]; 1729 u8 res8[12];
1730 u32 coredisru; /* uppper portion for support of 64 cores */ 1730 u32 coredisru; /* uppper portion for support of 64 cores */
1731 u32 coredisrl; /* lower portion for support of 64 cores */ 1731 u32 coredisrl; /* lower portion for support of 64 cores */
1732 u8 res9[8]; 1732 u8 res9[8];
1733 u32 pvr; /* Processor version */ 1733 u32 pvr; /* Processor version */
1734 u32 svr; /* System version */ 1734 u32 svr; /* System version */
1735 u8 res10[8]; 1735 u8 res10[8];
1736 u32 rstcr; /* Reset control */ 1736 u32 rstcr; /* Reset control */
1737 u32 rstrqpblsr; /* Reset request preboot loader status */ 1737 u32 rstrqpblsr; /* Reset request preboot loader status */
1738 u8 res11[8]; 1738 u8 res11[8];
1739 u32 rstrqmr1; /* Reset request mask */ 1739 u32 rstrqmr1; /* Reset request mask */
1740 #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2 1740 #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2
1741 #define FSL_CORENET_RSTRQMR1_SRDS_RST_MSK 0x00000800 1741 #define FSL_CORENET_RSTRQMR1_SRDS_RST_MSK 0x00000800
1742 #endif 1742 #endif
1743 u8 res12[4]; 1743 u8 res12[4];
1744 u32 rstrqsr1; /* Reset request status */ 1744 u32 rstrqsr1; /* Reset request status */
1745 u8 res13[4]; 1745 u8 res13[4];
1746 u8 res14[4]; 1746 u8 res14[4];
1747 u32 rstrqwdtmrl; /* Reset request WDT mask */ 1747 u32 rstrqwdtmrl; /* Reset request WDT mask */
1748 u8 res15[4]; 1748 u8 res15[4];
1749 u32 rstrqwdtsrl; /* Reset request WDT status */ 1749 u32 rstrqwdtsrl; /* Reset request WDT status */
1750 u8 res16[4]; 1750 u8 res16[4];
1751 u32 brrl; /* Boot release */ 1751 u32 brrl; /* Boot release */
1752 u8 res17[24]; 1752 u8 res17[24];
1753 u32 rcwsr[16]; /* Reset control word status */ 1753 u32 rcwsr[16]; /* Reset control word status */
1754 #define RCW_SB_EN_REG_INDEX 7 1754 #define RCW_SB_EN_REG_INDEX 7
1755 #define RCW_SB_EN_MASK 0x00200000 1755 #define RCW_SB_EN_MASK 0x00200000
1756 1756
1757 #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2 1757 #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2
1758 #define FSL_CORENET_RCWSR0_MEM_PLL_RAT_SHIFT 16 1758 #define FSL_CORENET_RCWSR0_MEM_PLL_RAT_SHIFT 16
1759 /* use reserved bits 18~23 as scratch space to host DDR PLL ratio */ 1759 /* use reserved bits 18~23 as scratch space to host DDR PLL ratio */
1760 #define FSL_CORENET_RCWSR0_MEM_PLL_RAT_RESV_SHIFT 8 1760 #define FSL_CORENET_RCWSR0_MEM_PLL_RAT_RESV_SHIFT 8
1761 #define FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK 0x3f 1761 #define FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK 0x3f
1762 #if defined(CONFIG_ARCH_T4240) || defined(CONFIG_ARCH_T4160) 1762 #if defined(CONFIG_ARCH_T4240) || defined(CONFIG_ARCH_T4160)
1763 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL 0xfc000000 1763 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL 0xfc000000
1764 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT 26 1764 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT 26
1765 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL 0x00fe0000 1765 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL 0x00fe0000
1766 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT 17 1766 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT 17
1767 #define FSL_CORENET2_RCWSR4_SRDS3_PRTCL 0x0000f800 1767 #define FSL_CORENET2_RCWSR4_SRDS3_PRTCL 0x0000f800
1768 #define FSL_CORENET2_RCWSR4_SRDS3_PRTCL_SHIFT 11 1768 #define FSL_CORENET2_RCWSR4_SRDS3_PRTCL_SHIFT 11
1769 #define FSL_CORENET2_RCWSR4_SRDS4_PRTCL 0x000000f8 1769 #define FSL_CORENET2_RCWSR4_SRDS4_PRTCL 0x000000f8
1770 #define FSL_CORENET2_RCWSR4_SRDS4_PRTCL_SHIFT 3 1770 #define FSL_CORENET2_RCWSR4_SRDS4_PRTCL_SHIFT 3
1771 #define FSL_CORENET_RCWSR6_BOOT_LOC 0x0f800000 1771 #define FSL_CORENET_RCWSR6_BOOT_LOC 0x0f800000
1772 #elif defined(CONFIG_ARCH_B4860) || defined(CONFIG_ARCH_B4420) 1772 #elif defined(CONFIG_ARCH_B4860) || defined(CONFIG_ARCH_B4420)
1773 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL 0xfe000000 1773 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL 0xfe000000
1774 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT 25 1774 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT 25
1775 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL 0x00ff0000 1775 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL 0x00ff0000
1776 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT 16 1776 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT 16
1777 #define FSL_CORENET_RCWSR6_BOOT_LOC 0x0f800000 1777 #define FSL_CORENET_RCWSR6_BOOT_LOC 0x0f800000
1778 #elif defined(CONFIG_ARCH_T1040) || defined(CONFIG_ARCH_T1042) 1778 #elif defined(CONFIG_ARCH_T1040) || defined(CONFIG_ARCH_T1042)
1779 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL 0xff000000 1779 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL 0xff000000
1780 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT 24 1780 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT 24
1781 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL 0x00fe0000 1781 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL 0x00fe0000
1782 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT 17 1782 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT 17
1783 #define FSL_CORENET_RCWSR13_EC1 0x30000000 /* bits 418..419 */ 1783 #define FSL_CORENET_RCWSR13_EC1 0x30000000 /* bits 418..419 */
1784 #define FSL_CORENET_RCWSR13_EC1_FM1_DTSEC4_RGMII 0x00000000 1784 #define FSL_CORENET_RCWSR13_EC1_FM1_DTSEC4_RGMII 0x00000000
1785 #define FSL_CORENET_RCWSR13_EC1_FM1_GPIO 0x10000000 1785 #define FSL_CORENET_RCWSR13_EC1_FM1_GPIO 0x10000000
1786 #define FSL_CORENET_RCWSR13_EC1_FM1_DTSEC4_MII 0x20000000 1786 #define FSL_CORENET_RCWSR13_EC1_FM1_DTSEC4_MII 0x20000000
1787 #define FSL_CORENET_RCWSR13_EC2 0x0c000000 /* bits 420..421 */ 1787 #define FSL_CORENET_RCWSR13_EC2 0x0c000000 /* bits 420..421 */
1788 #define FSL_CORENET_RCWSR13_EC2_FM1_DTSEC5_RGMII 0x00000000 1788 #define FSL_CORENET_RCWSR13_EC2_FM1_DTSEC5_RGMII 0x00000000
1789 #define FSL_CORENET_RCWSR13_EC2_FM1_GPIO 0x10000000 1789 #define FSL_CORENET_RCWSR13_EC2_FM1_GPIO 0x10000000
1790 #define FSL_CORENET_RCWSR13_EC2_FM1_DTSEC5_MII 0x20000000 1790 #define FSL_CORENET_RCWSR13_EC2_FM1_DTSEC5_MII 0x20000000
1791 #define FSL_CORENET_RCWSR13_MAC2_GMII_SEL 0x00000080 1791 #define FSL_CORENET_RCWSR13_MAC2_GMII_SEL 0x00000080
1792 #define FSL_CORENET_RCWSR13_MAC2_GMII_SEL_L2_SWITCH 0x00000000 1792 #define FSL_CORENET_RCWSR13_MAC2_GMII_SEL_L2_SWITCH 0x00000000
1793 #define FSL_CORENET_RCWSR13_MAC2_GMII_SEL_ENET_PORT 0x80000000 1793 #define FSL_CORENET_RCWSR13_MAC2_GMII_SEL_ENET_PORT 0x80000000
1794 #define CONFIG_SYS_FSL_SCFG_PIXCLKCR_OFFSET 0x28 1794 #define CONFIG_SYS_FSL_SCFG_PIXCLKCR_OFFSET 0x28
1795 #define PXCKEN_MASK 0x80000000 1795 #define PXCKEN_MASK 0x80000000
1796 #define PXCK_MASK 0x00FF0000 1796 #define PXCK_MASK 0x00FF0000
1797 #define PXCK_BITS_START 16 1797 #define PXCK_BITS_START 16
1798 #elif defined(CONFIG_ARCH_T1024) || defined(CONFIG_ARCH_T1023) 1798 #elif defined(CONFIG_ARCH_T1024) || defined(CONFIG_ARCH_T1023)
1799 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL 0xff800000 1799 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL 0xff800000
1800 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT 23 1800 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT 23
1801 #define FSL_CORENET_RCWSR6_BOOT_LOC 0x0f800000 1801 #define FSL_CORENET_RCWSR6_BOOT_LOC 0x0f800000
1802 #define FSL_CORENET_RCWSR13_EC1 0x30000000 /* bits 418..419 */ 1802 #define FSL_CORENET_RCWSR13_EC1 0x30000000 /* bits 418..419 */
1803 #define FSL_CORENET_RCWSR13_EC1_RGMII 0x00000000 1803 #define FSL_CORENET_RCWSR13_EC1_RGMII 0x00000000
1804 #define FSL_CORENET_RCWSR13_EC1_GPIO 0x10000000 1804 #define FSL_CORENET_RCWSR13_EC1_GPIO 0x10000000
1805 #define FSL_CORENET_RCWSR13_EC2 0x0c000000 1805 #define FSL_CORENET_RCWSR13_EC2 0x0c000000
1806 #define FSL_CORENET_RCWSR13_EC2_RGMII 0x08000000 1806 #define FSL_CORENET_RCWSR13_EC2_RGMII 0x08000000
1807 #define CONFIG_SYS_FSL_SCFG_PIXCLKCR_OFFSET 0x28 1807 #define CONFIG_SYS_FSL_SCFG_PIXCLKCR_OFFSET 0x28
1808 #define CONFIG_SYS_FSL_SCFG_IODSECR1_OFFSET 0xd00 1808 #define CONFIG_SYS_FSL_SCFG_IODSECR1_OFFSET 0xd00
1809 #define PXCKEN_MASK 0x80000000 1809 #define PXCKEN_MASK 0x80000000
1810 #define PXCK_MASK 0x00FF0000 1810 #define PXCK_MASK 0x00FF0000
1811 #define PXCK_BITS_START 16 1811 #define PXCK_BITS_START 16
1812 #elif defined(CONFIG_ARCH_T2080) || defined(CONFIG_ARCH_T2081) 1812 #elif defined(CONFIG_ARCH_T2080) || defined(CONFIG_ARCH_T2081)
1813 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL 0xff000000 1813 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL 0xff000000
1814 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT 24 1814 #define FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT 24
1815 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL 0x00ff0000 1815 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL 0x00ff0000
1816 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT 16 1816 #define FSL_CORENET2_RCWSR4_SRDS2_PRTCL_SHIFT 16
1817 #define FSL_CORENET_RCWSR6_BOOT_LOC 0x0f800000 1817 #define FSL_CORENET_RCWSR6_BOOT_LOC 0x0f800000
1818 #endif 1818 #endif
1819 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S1_PLL1 0x00800000 1819 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S1_PLL1 0x00800000
1820 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S1_PLL2 0x00400000 1820 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S1_PLL2 0x00400000
1821 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S2_PLL1 0x00200000 1821 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S2_PLL1 0x00200000
1822 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S2_PLL2 0x00100000 1822 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S2_PLL2 0x00100000
1823 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S3_PLL1 0x00080000 1823 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S3_PLL1 0x00080000
1824 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S3_PLL2 0x00040000 1824 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S3_PLL2 0x00040000
1825 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S4_PLL1 0x00020000 1825 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S4_PLL1 0x00020000
1826 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S4_PLL2 0x00010000 1826 #define FSL_CORENET2_RCWSR5_SRDS_PLL_PD_S4_PLL2 0x00010000
1827 #define FSL_CORENET2_RCWSR5_DDR_REFCLK_SEL_SHIFT 4 1827 #define FSL_CORENET2_RCWSR5_DDR_REFCLK_SEL_SHIFT 4
1828 #define FSL_CORENET2_RCWSR5_DDR_REFCLK_SEL_MASK 0x00000011 1828 #define FSL_CORENET2_RCWSR5_DDR_REFCLK_SEL_MASK 0x00000011
1829 #define FSL_CORENET2_RCWSR5_DDR_REFCLK_SINGLE_CLK 1 1829 #define FSL_CORENET2_RCWSR5_DDR_REFCLK_SINGLE_CLK 1
1830 1830
1831 #else /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */ 1831 #else /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */
1832 #define FSL_CORENET_RCWSR0_MEM_PLL_RAT_SHIFT 17 1832 #define FSL_CORENET_RCWSR0_MEM_PLL_RAT_SHIFT 17
1833 #define FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK 0x1f 1833 #define FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK 0x1f
1834 #define FSL_CORENET_RCWSR4_SRDS_PRTCL 0xfc000000 1834 #define FSL_CORENET_RCWSR4_SRDS_PRTCL 0xfc000000
1835 #define FSL_CORENET_RCWSR5_DDR_SYNC 0x00000080 1835 #define FSL_CORENET_RCWSR5_DDR_SYNC 0x00000080
1836 #define FSL_CORENET_RCWSR5_DDR_SYNC_SHIFT 7 1836 #define FSL_CORENET_RCWSR5_DDR_SYNC_SHIFT 7
1837 #define FSL_CORENET_RCWSR5_SRDS_EN 0x00002000 1837 #define FSL_CORENET_RCWSR5_SRDS_EN 0x00002000
1838 #define FSL_CORENET_RCWSR5_SRDS2_EN 0x00001000 1838 #define FSL_CORENET_RCWSR5_SRDS2_EN 0x00001000
1839 #define FSL_CORENET_RCWSR6_BOOT_LOC 0x0f800000 1839 #define FSL_CORENET_RCWSR6_BOOT_LOC 0x0f800000
1840 #define FSL_CORENET_RCWSRn_SRDS_LPD_B2 0x3c000000 /* bits 162..165 */ 1840 #define FSL_CORENET_RCWSRn_SRDS_LPD_B2 0x3c000000 /* bits 162..165 */
1841 #define FSL_CORENET_RCWSRn_SRDS_LPD_B3 0x003c0000 /* bits 170..173 */ 1841 #define FSL_CORENET_RCWSRn_SRDS_LPD_B3 0x003c0000 /* bits 170..173 */
1842 #endif /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */ 1842 #endif /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */
1843 1843
1844 #define FSL_CORENET_RCWSR7_MCK_TO_PLAT_RAT 0x00400000 1844 #define FSL_CORENET_RCWSR7_MCK_TO_PLAT_RAT 0x00400000
1845 #define FSL_CORENET_RCWSR8_HOST_AGT_B1 0x00e00000 1845 #define FSL_CORENET_RCWSR8_HOST_AGT_B1 0x00e00000
1846 #define FSL_CORENET_RCWSR8_HOST_AGT_B2 0x00100000 1846 #define FSL_CORENET_RCWSR8_HOST_AGT_B2 0x00100000
1847 #define FSL_CORENET_RCWSR11_EC1 0x00c00000 /* bits 360..361 */ 1847 #define FSL_CORENET_RCWSR11_EC1 0x00c00000 /* bits 360..361 */
1848 #ifdef CONFIG_ARCH_P4080 1848 #ifdef CONFIG_ARCH_P4080
1849 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC1 0x00000000 1849 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC1 0x00000000
1850 #define FSL_CORENET_RCWSR11_EC1_FM1_USB1 0x00800000 1850 #define FSL_CORENET_RCWSR11_EC1_FM1_USB1 0x00800000
1851 #define FSL_CORENET_RCWSR11_EC2 0x001c0000 /* bits 363..365 */ 1851 #define FSL_CORENET_RCWSR11_EC2 0x001c0000 /* bits 363..365 */
1852 #define FSL_CORENET_RCWSR11_EC2_FM2_DTSEC1 0x00000000 1852 #define FSL_CORENET_RCWSR11_EC2_FM2_DTSEC1 0x00000000
1853 #define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC2 0x00080000 1853 #define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC2 0x00080000
1854 #define FSL_CORENET_RCWSR11_EC2_USB2 0x00100000 1854 #define FSL_CORENET_RCWSR11_EC2_USB2 0x00100000
1855 #endif 1855 #endif
1856 #if defined(CONFIG_ARCH_P2041) || \ 1856 #if defined(CONFIG_ARCH_P2041) || \
1857 defined(CONFIG_ARCH_P3041) || defined(CONFIG_ARCH_P5020) 1857 defined(CONFIG_ARCH_P3041) || defined(CONFIG_ARCH_P5020)
1858 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC4_RGMII 0x00000000 1858 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC4_RGMII 0x00000000
1859 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC4_MII 0x00800000 1859 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC4_MII 0x00800000
1860 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC4_NONE 0x00c00000 1860 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC4_NONE 0x00c00000
1861 #define FSL_CORENET_RCWSR11_EC2 0x00180000 /* bits 363..364 */ 1861 #define FSL_CORENET_RCWSR11_EC2 0x00180000 /* bits 363..364 */
1862 #define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC5_RGMII 0x00000000 1862 #define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC5_RGMII 0x00000000
1863 #define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC5_MII 0x00100000 1863 #define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC5_MII 0x00100000
1864 #define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC5_NONE 0x00180000 1864 #define FSL_CORENET_RCWSR11_EC2_FM1_DTSEC5_NONE 0x00180000
1865 #endif 1865 #endif
1866 #if defined(CONFIG_ARCH_P5040) 1866 #if defined(CONFIG_ARCH_P5040)
1867 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC5_RGMII 0x00000000 1867 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC5_RGMII 0x00000000
1868 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC5_MII 0x00800000 1868 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC5_MII 0x00800000
1869 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC5_NONE 0x00c00000 1869 #define FSL_CORENET_RCWSR11_EC1_FM1_DTSEC5_NONE 0x00c00000
1870 #define FSL_CORENET_RCWSR11_EC2 0x00180000 /* bits 363..364 */ 1870 #define FSL_CORENET_RCWSR11_EC2 0x00180000 /* bits 363..364 */
1871 #define FSL_CORENET_RCWSR11_EC2_FM2_DTSEC5_RGMII 0x00000000 1871 #define FSL_CORENET_RCWSR11_EC2_FM2_DTSEC5_RGMII 0x00000000
1872 #define FSL_CORENET_RCWSR11_EC2_FM2_DTSEC5_MII 0x00100000 1872 #define FSL_CORENET_RCWSR11_EC2_FM2_DTSEC5_MII 0x00100000
1873 #define FSL_CORENET_RCWSR11_EC2_FM2_DTSEC5_NONE 0x00180000 1873 #define FSL_CORENET_RCWSR11_EC2_FM2_DTSEC5_NONE 0x00180000
1874 #endif 1874 #endif
1875 #if defined(CONFIG_ARCH_T4240) || defined(CONFIG_ARCH_T4160) 1875 #if defined(CONFIG_ARCH_T4240) || defined(CONFIG_ARCH_T4160)
1876 #define FSL_CORENET_RCWSR13_EC1 0x60000000 /* bits 417..418 */ 1876 #define FSL_CORENET_RCWSR13_EC1 0x60000000 /* bits 417..418 */
1877 #define FSL_CORENET_RCWSR13_EC1_FM2_DTSEC5_RGMII 0x00000000 1877 #define FSL_CORENET_RCWSR13_EC1_FM2_DTSEC5_RGMII 0x00000000
1878 #define FSL_CORENET_RCWSR13_EC1_FM2_GPIO 0x40000000 1878 #define FSL_CORENET_RCWSR13_EC1_FM2_GPIO 0x40000000
1879 #define FSL_CORENET_RCWSR13_EC2 0x18000000 /* bits 419..420 */ 1879 #define FSL_CORENET_RCWSR13_EC2 0x18000000 /* bits 419..420 */
1880 #define FSL_CORENET_RCWSR13_EC2_FM1_DTSEC5_RGMII 0x00000000 1880 #define FSL_CORENET_RCWSR13_EC2_FM1_DTSEC5_RGMII 0x00000000
1881 #define FSL_CORENET_RCWSR13_EC2_FM1_DTSEC6_RGMII 0x08000000 1881 #define FSL_CORENET_RCWSR13_EC2_FM1_DTSEC6_RGMII 0x08000000
1882 #define FSL_CORENET_RCWSR13_EC2_FM1_GPIO 0x10000000 1882 #define FSL_CORENET_RCWSR13_EC2_FM1_GPIO 0x10000000
1883 #endif 1883 #endif
1884 #if defined(CONFIG_ARCH_T2080) || defined(CONFIG_ARCH_T2081) 1884 #if defined(CONFIG_ARCH_T2080) || defined(CONFIG_ARCH_T2081)
1885 #define FSL_CORENET_RCWSR13_EC1 0x60000000 /* bits 417..418 */ 1885 #define FSL_CORENET_RCWSR13_EC1 0x60000000 /* bits 417..418 */
1886 #define FSL_CORENET_RCWSR13_EC1_DTSEC3_RGMII 0x00000000 1886 #define FSL_CORENET_RCWSR13_EC1_DTSEC3_RGMII 0x00000000
1887 #define FSL_CORENET_RCWSR13_EC1_GPIO 0x40000000 1887 #define FSL_CORENET_RCWSR13_EC1_GPIO 0x40000000
1888 #define FSL_CORENET_RCWSR13_EC2 0x18000000 /* bits 419..420 */ 1888 #define FSL_CORENET_RCWSR13_EC2 0x18000000 /* bits 419..420 */
1889 #define FSL_CORENET_RCWSR13_EC2_DTSEC4_RGMII 0x00000000 1889 #define FSL_CORENET_RCWSR13_EC2_DTSEC4_RGMII 0x00000000
1890 #define FSL_CORENET_RCWSR13_EC2_DTSEC10_RGMII 0x08000000 1890 #define FSL_CORENET_RCWSR13_EC2_DTSEC10_RGMII 0x08000000
1891 #define FSL_CORENET_RCWSR13_EC2_GPIO 0x10000000 1891 #define FSL_CORENET_RCWSR13_EC2_GPIO 0x10000000
1892 #endif 1892 #endif
1893 u8 res18[192]; 1893 u8 res18[192];
1894 u32 scratchrw[4]; /* Scratch Read/Write */ 1894 u32 scratchrw[4]; /* Scratch Read/Write */
1895 u8 res19[240]; 1895 u8 res19[240];
1896 u32 scratchw1r[4]; /* Scratch Read (Write once) */ 1896 u32 scratchw1r[4]; /* Scratch Read (Write once) */
1897 u8 res20[240]; 1897 u8 res20[240];
1898 u32 scrtsr[8]; /* Core reset status */ 1898 u32 scrtsr[8]; /* Core reset status */
1899 u8 res21[224]; 1899 u8 res21[224];
1900 u32 pex1liodnr; /* PCI Express 1 LIODN */ 1900 u32 pex1liodnr; /* PCI Express 1 LIODN */
1901 u32 pex2liodnr; /* PCI Express 2 LIODN */ 1901 u32 pex2liodnr; /* PCI Express 2 LIODN */
1902 u32 pex3liodnr; /* PCI Express 3 LIODN */ 1902 u32 pex3liodnr; /* PCI Express 3 LIODN */
1903 u32 pex4liodnr; /* PCI Express 4 LIODN */ 1903 u32 pex4liodnr; /* PCI Express 4 LIODN */
1904 u32 rio1liodnr; /* RIO 1 LIODN */ 1904 u32 rio1liodnr; /* RIO 1 LIODN */
1905 u32 rio2liodnr; /* RIO 2 LIODN */ 1905 u32 rio2liodnr; /* RIO 2 LIODN */
1906 u32 rio3liodnr; /* RIO 3 LIODN */ 1906 u32 rio3liodnr; /* RIO 3 LIODN */
1907 u32 rio4liodnr; /* RIO 4 LIODN */ 1907 u32 rio4liodnr; /* RIO 4 LIODN */
1908 u32 usb1liodnr; /* USB 1 LIODN */ 1908 u32 usb1liodnr; /* USB 1 LIODN */
1909 u32 usb2liodnr; /* USB 2 LIODN */ 1909 u32 usb2liodnr; /* USB 2 LIODN */
1910 u32 usb3liodnr; /* USB 3 LIODN */ 1910 u32 usb3liodnr; /* USB 3 LIODN */
1911 u32 usb4liodnr; /* USB 4 LIODN */ 1911 u32 usb4liodnr; /* USB 4 LIODN */
1912 u32 sdmmc1liodnr; /* SD/MMC 1 LIODN */ 1912 u32 sdmmc1liodnr; /* SD/MMC 1 LIODN */
1913 u32 sdmmc2liodnr; /* SD/MMC 2 LIODN */ 1913 u32 sdmmc2liodnr; /* SD/MMC 2 LIODN */
1914 u32 sdmmc3liodnr; /* SD/MMC 3 LIODN */ 1914 u32 sdmmc3liodnr; /* SD/MMC 3 LIODN */
1915 u32 sdmmc4liodnr; /* SD/MMC 4 LIODN */ 1915 u32 sdmmc4liodnr; /* SD/MMC 4 LIODN */
1916 u32 rio1maintliodnr;/* RIO 1 Maintenance LIODN */ 1916 u32 rio1maintliodnr;/* RIO 1 Maintenance LIODN */
1917 u32 rio2maintliodnr;/* RIO 2 Maintenance LIODN */ 1917 u32 rio2maintliodnr;/* RIO 2 Maintenance LIODN */
1918 u32 rio3maintliodnr;/* RIO 3 Maintenance LIODN */ 1918 u32 rio3maintliodnr;/* RIO 3 Maintenance LIODN */
1919 u32 rio4maintliodnr;/* RIO 4 Maintenance LIODN */ 1919 u32 rio4maintliodnr;/* RIO 4 Maintenance LIODN */
1920 u32 sata1liodnr; /* SATA 1 LIODN */ 1920 u32 sata1liodnr; /* SATA 1 LIODN */
1921 u32 sata2liodnr; /* SATA 2 LIODN */ 1921 u32 sata2liodnr; /* SATA 2 LIODN */
1922 u32 sata3liodnr; /* SATA 3 LIODN */ 1922 u32 sata3liodnr; /* SATA 3 LIODN */
1923 u32 sata4liodnr; /* SATA 4 LIODN */ 1923 u32 sata4liodnr; /* SATA 4 LIODN */
1924 u8 res22[20]; 1924 u8 res22[20];
1925 u32 tdmliodnr; /* TDM LIODN */ 1925 u32 tdmliodnr; /* TDM LIODN */
1926 u32 qeliodnr; /* QE LIODN */ 1926 u32 qeliodnr; /* QE LIODN */
1927 u8 res_57c[4]; 1927 u8 res_57c[4];
1928 u32 dma1liodnr; /* DMA 1 LIODN */ 1928 u32 dma1liodnr; /* DMA 1 LIODN */
1929 u32 dma2liodnr; /* DMA 2 LIODN */ 1929 u32 dma2liodnr; /* DMA 2 LIODN */
1930 u32 dma3liodnr; /* DMA 3 LIODN */ 1930 u32 dma3liodnr; /* DMA 3 LIODN */
1931 u32 dma4liodnr; /* DMA 4 LIODN */ 1931 u32 dma4liodnr; /* DMA 4 LIODN */
1932 u8 res23[48]; 1932 u8 res23[48];
1933 u8 res24[64]; 1933 u8 res24[64];
1934 u32 pblsr; /* Preboot loader status */ 1934 u32 pblsr; /* Preboot loader status */
1935 u32 pamubypenr; /* PAMU bypass enable */ 1935 u32 pamubypenr; /* PAMU bypass enable */
1936 u32 dmacr1; /* DMA control */ 1936 u32 dmacr1; /* DMA control */
1937 u8 res25[4]; 1937 u8 res25[4];
1938 u32 gensr1; /* General status */ 1938 u32 gensr1; /* General status */
1939 u8 res26[12]; 1939 u8 res26[12];
1940 u32 gencr1; /* General control */ 1940 u32 gencr1; /* General control */
1941 u8 res27[12]; 1941 u8 res27[12];
1942 u8 res28[4]; 1942 u8 res28[4];
1943 u32 cgensrl; /* Core general status */ 1943 u32 cgensrl; /* Core general status */
1944 u8 res29[8]; 1944 u8 res29[8];
1945 u8 res30[4]; 1945 u8 res30[4];
1946 u32 cgencrl; /* Core general control */ 1946 u32 cgencrl; /* Core general control */
1947 u8 res31[184]; 1947 u8 res31[184];
1948 u32 sriopstecr; /* SRIO prescaler timer enable control */ 1948 u32 sriopstecr; /* SRIO prescaler timer enable control */
1949 u32 dcsrcr; /* DCSR Control register */ 1949 u32 dcsrcr; /* DCSR Control register */
1950 u8 res31a[56]; 1950 u8 res31a[56];
1951 u32 tp_ityp[64]; /* Topology Initiator Type Register */ 1951 u32 tp_ityp[64]; /* Topology Initiator Type Register */
1952 struct { 1952 struct {
1953 u32 upper; 1953 u32 upper;
1954 u32 lower; 1954 u32 lower;
1955 } tp_cluster[16]; /* Core Cluster n Topology Register */ 1955 } tp_cluster[16]; /* Core Cluster n Topology Register */
1956 u8 res32[1344]; 1956 u8 res32[1344];
1957 u32 pmuxcr; /* Pin multiplexing control */ 1957 u32 pmuxcr; /* Pin multiplexing control */
1958 u8 res33[60]; 1958 u8 res33[60];
1959 u32 iovselsr; /* I/O voltage selection status */ 1959 u32 iovselsr; /* I/O voltage selection status */
1960 u8 res34[28]; 1960 u8 res34[28];
1961 u32 ddrclkdr; /* DDR clock disable */ 1961 u32 ddrclkdr; /* DDR clock disable */
1962 u8 res35; 1962 u8 res35;
1963 u32 elbcclkdr; /* eLBC clock disable */ 1963 u32 elbcclkdr; /* eLBC clock disable */
1964 u8 res36[20]; 1964 u8 res36[20];
1965 u32 sdhcpcr; /* eSDHC polarity configuration */ 1965 u32 sdhcpcr; /* eSDHC polarity configuration */
1966 u8 res37[380]; 1966 u8 res37[380];
1967 } ccsr_gur_t; 1967 } ccsr_gur_t;
1968 1968
1969 #define TP_ITYP_AV 0x00000001 /* Initiator available */ 1969 #define TP_ITYP_AV 0x00000001 /* Initiator available */
1970 #define TP_ITYP_TYPE(x) (((x) & 0x6) >> 1) /* Initiator Type */ 1970 #define TP_ITYP_TYPE(x) (((x) & 0x6) >> 1) /* Initiator Type */
1971 #define TP_ITYP_TYPE_OTHER 0x0 1971 #define TP_ITYP_TYPE_OTHER 0x0
1972 #define TP_ITYP_TYPE_PPC 0x1 /* PowerPC */ 1972 #define TP_ITYP_TYPE_PPC 0x1 /* PowerPC */
1973 #define TP_ITYP_TYPE_SC 0x2 /* StarCore DSP */ 1973 #define TP_ITYP_TYPE_SC 0x2 /* StarCore DSP */
1974 #define TP_ITYP_TYPE_HA 0x3 /* HW Accelerator */ 1974 #define TP_ITYP_TYPE_HA 0x3 /* HW Accelerator */
1975 #define TP_ITYP_THDS(x) (((x) & 0x18) >> 3) /* # threads */ 1975 #define TP_ITYP_THDS(x) (((x) & 0x18) >> 3) /* # threads */
1976 #define TP_ITYP_VER(x) (((x) & 0xe0) >> 5) /* Initiator Version */ 1976 #define TP_ITYP_VER(x) (((x) & 0xe0) >> 5) /* Initiator Version */
1977 1977
1978 #define TP_CLUSTER_EOC 0x80000000 /* end of clusters */ 1978 #define TP_CLUSTER_EOC 0x80000000 /* end of clusters */
1979 #define TP_CLUSTER_INIT_MASK 0x0000003f /* initiator mask */ 1979 #define TP_CLUSTER_INIT_MASK 0x0000003f /* initiator mask */
1980 #define TP_INIT_PER_CLUSTER 4 1980 #define TP_INIT_PER_CLUSTER 4
1981 1981
1982 #define FSL_CORENET_DCSR_SZ_MASK 0x00000003 1982 #define FSL_CORENET_DCSR_SZ_MASK 0x00000003
1983 #define FSL_CORENET_DCSR_SZ_4M 0x0 1983 #define FSL_CORENET_DCSR_SZ_4M 0x0
1984 #define FSL_CORENET_DCSR_SZ_1G 0x3 1984 #define FSL_CORENET_DCSR_SZ_1G 0x3
1985 1985
1986 /* 1986 /*
1987 * On p4080 we have an LIODN for msg unit (rmu) but not maintenance 1987 * On p4080 we have an LIODN for msg unit (rmu) but not maintenance
1988 * everything after has RMan thus msg unit LIODN is used for maintenance 1988 * everything after has RMan thus msg unit LIODN is used for maintenance
1989 */ 1989 */
1990 #define rmuliodnr rio1maintliodnr 1990 #define rmuliodnr rio1maintliodnr
1991 1991
1992 typedef struct ccsr_clk { 1992 typedef struct ccsr_clk {
1993 struct { 1993 struct {
1994 u32 clkcncsr; /* core cluster n clock control status */ 1994 u32 clkcncsr; /* core cluster n clock control status */
1995 u8 res_004[0x0c]; 1995 u8 res_004[0x0c];
1996 u32 clkcgnhwacsr;/* clock generator n hardware accelerator */ 1996 u32 clkcgnhwacsr;/* clock generator n hardware accelerator */
1997 u8 res_014[0x0c]; 1997 u8 res_014[0x0c];
1998 } clkcsr[12]; 1998 } clkcsr[12];
1999 u8 res_100[0x680]; /* 0x100 */ 1999 u8 res_100[0x680]; /* 0x100 */
2000 struct { 2000 struct {
2001 u32 pllcngsr; 2001 u32 pllcngsr;
2002 u8 res10[0x1c]; 2002 u8 res10[0x1c];
2003 } pllcgsr[12]; 2003 } pllcgsr[12];
2004 u8 res21[0x280]; 2004 u8 res21[0x280];
2005 u32 pllpgsr; /* 0xc00 Platform PLL General Status */ 2005 u32 pllpgsr; /* 0xc00 Platform PLL General Status */
2006 u8 res16[0x1c]; 2006 u8 res16[0x1c];
2007 u32 plldgsr; /* 0xc20 DDR PLL General Status */ 2007 u32 plldgsr; /* 0xc20 DDR PLL General Status */
2008 u8 res17[0x3dc]; 2008 u8 res17[0x3dc];
2009 } ccsr_clk_t; 2009 } ccsr_clk_t;
2010 2010
2011 #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2 2011 #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2
2012 typedef struct ccsr_rcpm { 2012 typedef struct ccsr_rcpm {
2013 u8 res_00[12]; 2013 u8 res_00[12];
2014 u32 tph10sr0; /* Thread PH10 Status Register */ 2014 u32 tph10sr0; /* Thread PH10 Status Register */
2015 u8 res_10[12]; 2015 u8 res_10[12];
2016 u32 tph10setr0; /* Thread PH10 Set Control Register */ 2016 u32 tph10setr0; /* Thread PH10 Set Control Register */
2017 u8 res_20[12]; 2017 u8 res_20[12];
2018 u32 tph10clrr0; /* Thread PH10 Clear Control Register */ 2018 u32 tph10clrr0; /* Thread PH10 Clear Control Register */
2019 u8 res_30[12]; 2019 u8 res_30[12];
2020 u32 tph10psr0; /* Thread PH10 Previous Status Register */ 2020 u32 tph10psr0; /* Thread PH10 Previous Status Register */
2021 u8 res_40[12]; 2021 u8 res_40[12];
2022 u32 twaitsr0; /* Thread Wait Status Register */ 2022 u32 twaitsr0; /* Thread Wait Status Register */
2023 u8 res_50[96]; 2023 u8 res_50[96];
2024 u32 pcph15sr; /* Physical Core PH15 Status Register */ 2024 u32 pcph15sr; /* Physical Core PH15 Status Register */
2025 u32 pcph15setr; /* Physical Core PH15 Set Control Register */ 2025 u32 pcph15setr; /* Physical Core PH15 Set Control Register */
2026 u32 pcph15clrr; /* Physical Core PH15 Clear Control Register */ 2026 u32 pcph15clrr; /* Physical Core PH15 Clear Control Register */
2027 u32 pcph15psr; /* Physical Core PH15 Prev Status Register */ 2027 u32 pcph15psr; /* Physical Core PH15 Prev Status Register */
2028 u8 res_c0[16]; 2028 u8 res_c0[16];
2029 u32 pcph20sr; /* Physical Core PH20 Status Register */ 2029 u32 pcph20sr; /* Physical Core PH20 Status Register */
2030 u32 pcph20setr; /* Physical Core PH20 Set Control Register */ 2030 u32 pcph20setr; /* Physical Core PH20 Set Control Register */
2031 u32 pcph20clrr; /* Physical Core PH20 Clear Control Register */ 2031 u32 pcph20clrr; /* Physical Core PH20 Clear Control Register */
2032 u32 pcph20psr; /* Physical Core PH20 Prev Status Register */ 2032 u32 pcph20psr; /* Physical Core PH20 Prev Status Register */
2033 u32 pcpw20sr; /* Physical Core PW20 Status Register */ 2033 u32 pcpw20sr; /* Physical Core PW20 Status Register */
2034 u8 res_e0[12]; 2034 u8 res_e0[12];
2035 u32 pcph30sr; /* Physical Core PH30 Status Register */ 2035 u32 pcph30sr; /* Physical Core PH30 Status Register */
2036 u32 pcph30setr; /* Physical Core PH30 Set Control Register */ 2036 u32 pcph30setr; /* Physical Core PH30 Set Control Register */
2037 u32 pcph30clrr; /* Physical Core PH30 Clear Control Register */ 2037 u32 pcph30clrr; /* Physical Core PH30 Clear Control Register */
2038 u32 pcph30psr; /* Physical Core PH30 Prev Status Register */ 2038 u32 pcph30psr; /* Physical Core PH30 Prev Status Register */
2039 u8 res_100[32]; 2039 u8 res_100[32];
2040 u32 ippwrgatecr; /* IP Power Gating Control Register */ 2040 u32 ippwrgatecr; /* IP Power Gating Control Register */
2041 u8 res_124[12]; 2041 u8 res_124[12];
2042 u32 powmgtcsr; /* Power Management Control & Status Reg */ 2042 u32 powmgtcsr; /* Power Management Control & Status Reg */
2043 u8 res_134[12]; 2043 u8 res_134[12];
2044 u32 ippdexpcr[4]; /* IP Powerdown Exception Control Reg */ 2044 u32 ippdexpcr[4]; /* IP Powerdown Exception Control Reg */
2045 u8 res_150[12]; 2045 u8 res_150[12];
2046 u32 tpmimr0; /* Thread PM Interrupt Mask Reg */ 2046 u32 tpmimr0; /* Thread PM Interrupt Mask Reg */
2047 u8 res_160[12]; 2047 u8 res_160[12];
2048 u32 tpmcimr0; /* Thread PM Crit Interrupt Mask Reg */ 2048 u32 tpmcimr0; /* Thread PM Crit Interrupt Mask Reg */
2049 u8 res_170[12]; 2049 u8 res_170[12];
2050 u32 tpmmcmr0; /* Thread PM Machine Check Interrupt Mask Reg */ 2050 u32 tpmmcmr0; /* Thread PM Machine Check Interrupt Mask Reg */
2051 u8 res_180[12]; 2051 u8 res_180[12];
2052 u32 tpmnmimr0; /* Thread PM NMI Mask Reg */ 2052 u32 tpmnmimr0; /* Thread PM NMI Mask Reg */
2053 u8 res_190[12]; 2053 u8 res_190[12];
2054 u32 tmcpmaskcr0; /* Thread Machine Check Mask Control Reg */ 2054 u32 tmcpmaskcr0; /* Thread Machine Check Mask Control Reg */
2055 u32 pctbenr; /* Physical Core Time Base Enable Reg */ 2055 u32 pctbenr; /* Physical Core Time Base Enable Reg */
2056 u32 pctbclkselr; /* Physical Core Time Base Clock Select */ 2056 u32 pctbclkselr; /* Physical Core Time Base Clock Select */
2057 u32 tbclkdivr; /* Time Base Clock Divider Register */ 2057 u32 tbclkdivr; /* Time Base Clock Divider Register */
2058 u8 res_1ac[4]; 2058 u8 res_1ac[4];
2059 u32 ttbhltcr[4]; /* Thread Time Base Halt Control Register */ 2059 u32 ttbhltcr[4]; /* Thread Time Base Halt Control Register */
2060 u32 clpcl10sr; /* Cluster PCL10 Status Register */ 2060 u32 clpcl10sr; /* Cluster PCL10 Status Register */
2061 u32 clpcl10setr; /* Cluster PCL30 Set Control Register */ 2061 u32 clpcl10setr; /* Cluster PCL30 Set Control Register */
2062 u32 clpcl10clrr; /* Cluster PCL30 Clear Control Register */ 2062 u32 clpcl10clrr; /* Cluster PCL30 Clear Control Register */
2063 u32 clpcl10psr; /* Cluster PCL30 Prev Status Register */ 2063 u32 clpcl10psr; /* Cluster PCL30 Prev Status Register */
2064 u32 cddslpsetr; /* Core Domain Deep Sleep Set Register */ 2064 u32 cddslpsetr; /* Core Domain Deep Sleep Set Register */
2065 u32 cddslpclrr; /* Core Domain Deep Sleep Clear Register */ 2065 u32 cddslpclrr; /* Core Domain Deep Sleep Clear Register */
2066 u32 cdpwroksetr; /* Core Domain Power OK Set Register */ 2066 u32 cdpwroksetr; /* Core Domain Power OK Set Register */
2067 u32 cdpwrokclrr; /* Core Domain Power OK Clear Register */ 2067 u32 cdpwrokclrr; /* Core Domain Power OK Clear Register */
2068 u32 cdpwrensr; /* Core Domain Power Enable Status Register */ 2068 u32 cdpwrensr; /* Core Domain Power Enable Status Register */
2069 u32 cddslsr; /* Core Domain Deep Sleep Status Register */ 2069 u32 cddslsr; /* Core Domain Deep Sleep Status Register */
2070 u8 res_1e8[8]; 2070 u8 res_1e8[8];
2071 u32 dslpcntcr[8]; /* Deep Sleep Counter Cfg Register */ 2071 u32 dslpcntcr[8]; /* Deep Sleep Counter Cfg Register */
2072 u8 res_300[3568]; 2072 u8 res_300[3568];
2073 } ccsr_rcpm_t; 2073 } ccsr_rcpm_t;
2074 2074
2075 #define ctbenrl pctbenr 2075 #define ctbenrl pctbenr
2076 2076
2077 #else 2077 #else
2078 typedef struct ccsr_rcpm { 2078 typedef struct ccsr_rcpm {
2079 u8 res1[4]; 2079 u8 res1[4];
2080 u32 cdozsrl; /* Core Doze Status */ 2080 u32 cdozsrl; /* Core Doze Status */
2081 u8 res2[4]; 2081 u8 res2[4];
2082 u32 cdozcrl; /* Core Doze Control */ 2082 u32 cdozcrl; /* Core Doze Control */
2083 u8 res3[4]; 2083 u8 res3[4];
2084 u32 cnapsrl; /* Core Nap Status */ 2084 u32 cnapsrl; /* Core Nap Status */
2085 u8 res4[4]; 2085 u8 res4[4];
2086 u32 cnapcrl; /* Core Nap Control */ 2086 u32 cnapcrl; /* Core Nap Control */
2087 u8 res5[4]; 2087 u8 res5[4];
2088 u32 cdozpsrl; /* Core Doze Previous Status */ 2088 u32 cdozpsrl; /* Core Doze Previous Status */
2089 u8 res6[4]; 2089 u8 res6[4];
2090 u32 cdozpcrl; /* Core Doze Previous Control */ 2090 u32 cdozpcrl; /* Core Doze Previous Control */
2091 u8 res7[4]; 2091 u8 res7[4];
2092 u32 cwaitsrl; /* Core Wait Status */ 2092 u32 cwaitsrl; /* Core Wait Status */
2093 u8 res8[8]; 2093 u8 res8[8];
2094 u32 powmgtcsr; /* Power Mangement Control & Status */ 2094 u32 powmgtcsr; /* Power Mangement Control & Status */
2095 u8 res9[12]; 2095 u8 res9[12];
2096 u32 ippdexpcr0; /* IP Powerdown Exception Control 0 */ 2096 u32 ippdexpcr0; /* IP Powerdown Exception Control 0 */
2097 u8 res10[12]; 2097 u8 res10[12];
2098 u8 res11[4]; 2098 u8 res11[4];
2099 u32 cpmimrl; /* Core PM IRQ Masking */ 2099 u32 cpmimrl; /* Core PM IRQ Masking */
2100 u8 res12[4]; 2100 u8 res12[4];
2101 u32 cpmcimrl; /* Core PM Critical IRQ Masking */ 2101 u32 cpmcimrl; /* Core PM Critical IRQ Masking */
2102 u8 res13[4]; 2102 u8 res13[4];
2103 u32 cpmmcimrl; /* Core PM Machine Check IRQ Masking */ 2103 u32 cpmmcimrl; /* Core PM Machine Check IRQ Masking */
2104 u8 res14[4]; 2104 u8 res14[4];
2105 u32 cpmnmimrl; /* Core PM NMI Masking */ 2105 u32 cpmnmimrl; /* Core PM NMI Masking */
2106 u8 res15[4]; 2106 u8 res15[4];
2107 u32 ctbenrl; /* Core Time Base Enable */ 2107 u32 ctbenrl; /* Core Time Base Enable */
2108 u8 res16[4]; 2108 u8 res16[4];
2109 u32 ctbclkselrl; /* Core Time Base Clock Select */ 2109 u32 ctbclkselrl; /* Core Time Base Clock Select */
2110 u8 res17[4]; 2110 u8 res17[4];
2111 u32 ctbhltcrl; /* Core Time Base Halt Control */ 2111 u32 ctbhltcrl; /* Core Time Base Halt Control */
2112 u8 res18[0xf68]; 2112 u8 res18[0xf68];
2113 } ccsr_rcpm_t; 2113 } ccsr_rcpm_t;
2114 #endif /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */ 2114 #endif /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */
2115 2115
2116 #else 2116 #else
2117 typedef struct ccsr_gur { 2117 typedef struct ccsr_gur {
2118 u32 porpllsr; /* POR PLL ratio status */ 2118 u32 porpllsr; /* POR PLL ratio status */
2119 #ifdef CONFIG_ARCH_MPC8536 2119 #ifdef CONFIG_ARCH_MPC8536
2120 #define MPC85xx_PORPLLSR_DDR_RATIO 0x3e000000 2120 #define MPC85xx_PORPLLSR_DDR_RATIO 0x3e000000
2121 #define MPC85xx_PORPLLSR_DDR_RATIO_SHIFT 25 2121 #define MPC85xx_PORPLLSR_DDR_RATIO_SHIFT 25
2122 #elif defined(CONFIG_ARCH_C29X) 2122 #elif defined(CONFIG_ARCH_C29X)
2123 #define MPC85xx_PORPLLSR_DDR_RATIO 0x00003f00 2123 #define MPC85xx_PORPLLSR_DDR_RATIO 0x00003f00
2124 #define MPC85xx_PORPLLSR_DDR_RATIO_SHIFT (9 - ((gur->pordevsr2 \ 2124 #define MPC85xx_PORPLLSR_DDR_RATIO_SHIFT (9 - ((gur->pordevsr2 \
2125 & MPC85xx_PORDEVSR2_DDR_SPD_0) \ 2125 & MPC85xx_PORDEVSR2_DDR_SPD_0) \
2126 >> MPC85xx_PORDEVSR2_DDR_SPD_0_SHIFT)) 2126 >> MPC85xx_PORDEVSR2_DDR_SPD_0_SHIFT))
2127 #else 2127 #else
2128 #if defined(CONFIG_ARCH_BSC9131) || defined(CONFIG_ARCH_BSC9132) 2128 #if defined(CONFIG_ARCH_BSC9131) || defined(CONFIG_ARCH_BSC9132)
2129 #define MPC85xx_PORPLLSR_DDR_RATIO 0x00003f00 2129 #define MPC85xx_PORPLLSR_DDR_RATIO 0x00003f00
2130 #else 2130 #else
2131 #define MPC85xx_PORPLLSR_DDR_RATIO 0x00003e00 2131 #define MPC85xx_PORPLLSR_DDR_RATIO 0x00003e00
2132 #endif 2132 #endif
2133 #define MPC85xx_PORPLLSR_DDR_RATIO_SHIFT 9 2133 #define MPC85xx_PORPLLSR_DDR_RATIO_SHIFT 9
2134 #endif 2134 #endif
2135 #define MPC85xx_PORPLLSR_QE_RATIO 0x3e000000 2135 #define MPC85xx_PORPLLSR_QE_RATIO 0x3e000000
2136 #define MPC85xx_PORPLLSR_QE_RATIO_SHIFT 25 2136 #define MPC85xx_PORPLLSR_QE_RATIO_SHIFT 25
2137 #define MPC85xx_PORPLLSR_PLAT_RATIO 0x0000003e 2137 #define MPC85xx_PORPLLSR_PLAT_RATIO 0x0000003e
2138 #define MPC85xx_PORPLLSR_PLAT_RATIO_SHIFT 1 2138 #define MPC85xx_PORPLLSR_PLAT_RATIO_SHIFT 1
2139 u32 porbmsr; /* POR boot mode status */ 2139 u32 porbmsr; /* POR boot mode status */
2140 #define MPC85xx_PORBMSR_HA 0x00070000 2140 #define MPC85xx_PORBMSR_HA 0x00070000
2141 #define MPC85xx_PORBMSR_HA_SHIFT 16 2141 #define MPC85xx_PORBMSR_HA_SHIFT 16
2142 #define MPC85xx_PORBMSR_ROMLOC_SHIFT 24 2142 #define MPC85xx_PORBMSR_ROMLOC_SHIFT 24
2143 #define PORBMSR_ROMLOC_SPI 0x6 2143 #define PORBMSR_ROMLOC_SPI 0x6
2144 #define PORBMSR_ROMLOC_SDHC 0x7 2144 #define PORBMSR_ROMLOC_SDHC 0x7
2145 #define PORBMSR_ROMLOC_NAND_2K 0x9 2145 #define PORBMSR_ROMLOC_NAND_2K 0x9
2146 #define PORBMSR_ROMLOC_NOR 0xf 2146 #define PORBMSR_ROMLOC_NOR 0xf
2147 u32 porimpscr; /* POR I/O impedance status & control */ 2147 u32 porimpscr; /* POR I/O impedance status & control */
2148 u32 pordevsr; /* POR I/O device status regsiter */ 2148 u32 pordevsr; /* POR I/O device status regsiter */
2149 #if defined(CONFIG_ARCH_P1023) 2149 #if defined(CONFIG_ARCH_P1023)
2150 #define MPC85xx_PORDEVSR_SGMII1_DIS 0x10000000 2150 #define MPC85xx_PORDEVSR_SGMII1_DIS 0x10000000
2151 #define MPC85xx_PORDEVSR_SGMII2_DIS 0x08000000 2151 #define MPC85xx_PORDEVSR_SGMII2_DIS 0x08000000
2152 #define MPC85xx_PORDEVSR_TSEC1_PRTC 0x02000000 2152 #define MPC85xx_PORDEVSR_TSEC1_PRTC 0x02000000
2153 #else 2153 #else
2154 #define MPC85xx_PORDEVSR_SGMII1_DIS 0x20000000 2154 #define MPC85xx_PORDEVSR_SGMII1_DIS 0x20000000
2155 #define MPC85xx_PORDEVSR_SGMII2_DIS 0x10000000 2155 #define MPC85xx_PORDEVSR_SGMII2_DIS 0x10000000
2156 #endif 2156 #endif
2157 #define MPC85xx_PORDEVSR_SGMII3_DIS 0x08000000 2157 #define MPC85xx_PORDEVSR_SGMII3_DIS 0x08000000
2158 #define MPC85xx_PORDEVSR_SGMII4_DIS 0x04000000 2158 #define MPC85xx_PORDEVSR_SGMII4_DIS 0x04000000
2159 #define MPC85xx_PORDEVSR_SRDS2_IO_SEL 0x38000000 2159 #define MPC85xx_PORDEVSR_SRDS2_IO_SEL 0x38000000
2160 #define MPC85xx_PORDEVSR_PCI1 0x00800000 2160 #define MPC85xx_PORDEVSR_PCI1 0x00800000
2161 #if defined(CONFIG_ARCH_P1022) 2161 #if defined(CONFIG_ARCH_P1022)
2162 #define MPC85xx_PORDEVSR_IO_SEL 0x007c0000 2162 #define MPC85xx_PORDEVSR_IO_SEL 0x007c0000
2163 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT 18 2163 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT 18
2164 #elif defined(CONFIG_ARCH_P1023) 2164 #elif defined(CONFIG_ARCH_P1023)
2165 #define MPC85xx_PORDEVSR_IO_SEL 0x00600000 2165 #define MPC85xx_PORDEVSR_IO_SEL 0x00600000
2166 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT 21 2166 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT 21
2167 #else 2167 #else
2168 #if defined(CONFIG_ARCH_P1010) 2168 #if defined(CONFIG_ARCH_P1010)
2169 #define MPC85xx_PORDEVSR_IO_SEL 0x00600000 2169 #define MPC85xx_PORDEVSR_IO_SEL 0x00600000
2170 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT 21 2170 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT 21
2171 #elif defined(CONFIG_ARCH_BSC9132) 2171 #elif defined(CONFIG_ARCH_BSC9132)
2172 #define MPC85xx_PORDEVSR_IO_SEL 0x00FE0000 2172 #define MPC85xx_PORDEVSR_IO_SEL 0x00FE0000
2173 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT 17 2173 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT 17
2174 #elif defined(CONFIG_ARCH_C29X) 2174 #elif defined(CONFIG_ARCH_C29X)
2175 #define MPC85xx_PORDEVSR_IO_SEL 0x00e00000 2175 #define MPC85xx_PORDEVSR_IO_SEL 0x00e00000
2176 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT 21 2176 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT 21
2177 #else 2177 #else
2178 #define MPC85xx_PORDEVSR_IO_SEL 0x00780000 2178 #define MPC85xx_PORDEVSR_IO_SEL 0x00780000
2179 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT 19 2179 #define MPC85xx_PORDEVSR_IO_SEL_SHIFT 19
2180 #endif /* if defined(CONFIG_ARCH_P1010) */ 2180 #endif /* if defined(CONFIG_ARCH_P1010) */
2181 #endif 2181 #endif
2182 #define MPC85xx_PORDEVSR_PCI2_ARB 0x00040000 2182 #define MPC85xx_PORDEVSR_PCI2_ARB 0x00040000
2183 #define MPC85xx_PORDEVSR_PCI1_ARB 0x00020000 2183 #define MPC85xx_PORDEVSR_PCI1_ARB 0x00020000
2184 #define MPC85xx_PORDEVSR_PCI1_PCI32 0x00010000 2184 #define MPC85xx_PORDEVSR_PCI1_PCI32 0x00010000
2185 #define MPC85xx_PORDEVSR_PCI1_SPD 0x00008000 2185 #define MPC85xx_PORDEVSR_PCI1_SPD 0x00008000
2186 #define MPC85xx_PORDEVSR_PCI2_SPD 0x00004000 2186 #define MPC85xx_PORDEVSR_PCI2_SPD 0x00004000
2187 #define MPC85xx_PORDEVSR_DRAM_RTYPE 0x00000060 2187 #define MPC85xx_PORDEVSR_DRAM_RTYPE 0x00000060
2188 #define MPC85xx_PORDEVSR_RIO_CTLS 0x00000008 2188 #define MPC85xx_PORDEVSR_RIO_CTLS 0x00000008
2189 #define MPC85xx_PORDEVSR_RIO_DEV_ID 0x00000007 2189 #define MPC85xx_PORDEVSR_RIO_DEV_ID 0x00000007
2190 u32 pordbgmsr; /* POR debug mode status */ 2190 u32 pordbgmsr; /* POR debug mode status */
2191 u32 pordevsr2; /* POR I/O device status 2 */ 2191 u32 pordevsr2; /* POR I/O device status 2 */
2192 #if defined(CONFIG_ARCH_C29X) 2192 #if defined(CONFIG_ARCH_C29X)
2193 #define MPC85xx_PORDEVSR2_DDR_SPD_0 0x00000008 2193 #define MPC85xx_PORDEVSR2_DDR_SPD_0 0x00000008
2194 #define MPC85xx_PORDEVSR2_DDR_SPD_0_SHIFT 3 2194 #define MPC85xx_PORDEVSR2_DDR_SPD_0_SHIFT 3
2195 #endif 2195 #endif
2196 #define MPC85xx_PORDEVSR2_SBC_MASK 0x10000000 2196 #define MPC85xx_PORDEVSR2_SBC_MASK 0x10000000
2197 /* The 8544 RM says this is bit 26, but it's really bit 24 */ 2197 /* The 8544 RM says this is bit 26, but it's really bit 24 */
2198 #define MPC85xx_PORDEVSR2_SEC_CFG 0x00000080 2198 #define MPC85xx_PORDEVSR2_SEC_CFG 0x00000080
2199 u8 res1[8]; 2199 u8 res1[8];
2200 u32 gpporcr; /* General-purpose POR configuration */ 2200 u32 gpporcr; /* General-purpose POR configuration */
2201 u8 res2[12]; 2201 u8 res2[12];
2202 #if defined(CONFIG_ARCH_MPC8536) 2202 #if defined(CONFIG_ARCH_MPC8536)
2203 u32 gencfgr; /* General Configuration Register */ 2203 u32 gencfgr; /* General Configuration Register */
2204 #define MPC85xx_GENCFGR_SDHC_WP_INV 0x20000000 2204 #define MPC85xx_GENCFGR_SDHC_WP_INV 0x20000000
2205 #else 2205 #else
2206 u32 gpiocr; /* GPIO control */ 2206 u32 gpiocr; /* GPIO control */
2207 #endif 2207 #endif
2208 u8 res3[12]; 2208 u8 res3[12];
2209 #if defined(CONFIG_ARCH_MPC8569) 2209 #if defined(CONFIG_ARCH_MPC8569)
2210 u32 plppar1; /* Platform port pin assignment 1 */ 2210 u32 plppar1; /* Platform port pin assignment 1 */
2211 u32 plppar2; /* Platform port pin assignment 2 */ 2211 u32 plppar2; /* Platform port pin assignment 2 */
2212 u32 plpdir1; /* Platform port pin direction 1 */ 2212 u32 plpdir1; /* Platform port pin direction 1 */
2213 u32 plpdir2; /* Platform port pin direction 2 */ 2213 u32 plpdir2; /* Platform port pin direction 2 */
2214 #else 2214 #else
2215 u32 gpoutdr; /* General-purpose output data */ 2215 u32 gpoutdr; /* General-purpose output data */
2216 u8 res4[12]; 2216 u8 res4[12];
2217 #endif 2217 #endif
2218 u32 gpindr; /* General-purpose input data */ 2218 u32 gpindr; /* General-purpose input data */
2219 u8 res5[12]; 2219 u8 res5[12];
2220 u32 pmuxcr; /* Alt. function signal multiplex control */ 2220 u32 pmuxcr; /* Alt. function signal multiplex control */
2221 #if defined(CONFIG_ARCH_P1010) 2221 #if defined(CONFIG_ARCH_P1010)
2222 #define MPC85xx_PMUXCR_TSEC1_0_1588 0x40000000 2222 #define MPC85xx_PMUXCR_TSEC1_0_1588 0x40000000
2223 #define MPC85xx_PMUXCR_TSEC1_0_RES 0xC0000000 2223 #define MPC85xx_PMUXCR_TSEC1_0_RES 0xC0000000
2224 #define MPC85xx_PMUXCR_TSEC1_1_1588_TRIG 0x10000000 2224 #define MPC85xx_PMUXCR_TSEC1_1_1588_TRIG 0x10000000
2225 #define MPC85xx_PMUXCR_TSEC1_1_GPIO_12 0x20000000 2225 #define MPC85xx_PMUXCR_TSEC1_1_GPIO_12 0x20000000
2226 #define MPC85xx_PMUXCR_TSEC1_1_RES 0x30000000 2226 #define MPC85xx_PMUXCR_TSEC1_1_RES 0x30000000
2227 #define MPC85xx_PMUXCR_TSEC1_2_DMA 0x04000000 2227 #define MPC85xx_PMUXCR_TSEC1_2_DMA 0x04000000
2228 #define MPC85xx_PMUXCR_TSEC1_2_GPIO 0x08000000 2228 #define MPC85xx_PMUXCR_TSEC1_2_GPIO 0x08000000
2229 #define MPC85xx_PMUXCR_TSEC1_2_RES 0x0C000000 2229 #define MPC85xx_PMUXCR_TSEC1_2_RES 0x0C000000
2230 #define MPC85xx_PMUXCR_TSEC1_3_RES 0x01000000 2230 #define MPC85xx_PMUXCR_TSEC1_3_RES 0x01000000
2231 #define MPC85xx_PMUXCR_TSEC1_3_GPIO_15 0x02000000 2231 #define MPC85xx_PMUXCR_TSEC1_3_GPIO_15 0x02000000
2232 #define MPC85xx_PMUXCR_IFC_ADDR16_SDHC 0x00400000 2232 #define MPC85xx_PMUXCR_IFC_ADDR16_SDHC 0x00400000
2233 #define MPC85xx_PMUXCR_IFC_ADDR16_USB 0x00800000 2233 #define MPC85xx_PMUXCR_IFC_ADDR16_USB 0x00800000
2234 #define MPC85xx_PMUXCR_IFC_ADDR16_IFC_CS2 0x00C00000 2234 #define MPC85xx_PMUXCR_IFC_ADDR16_IFC_CS2 0x00C00000
2235 #define MPC85xx_PMUXCR_IFC_ADDR17_18_SDHC 0x00100000 2235 #define MPC85xx_PMUXCR_IFC_ADDR17_18_SDHC 0x00100000
2236 #define MPC85xx_PMUXCR_IFC_ADDR17_18_USB 0x00200000 2236 #define MPC85xx_PMUXCR_IFC_ADDR17_18_USB 0x00200000
2237 #define MPC85xx_PMUXCR_IFC_ADDR17_18_DMA 0x00300000 2237 #define MPC85xx_PMUXCR_IFC_ADDR17_18_DMA 0x00300000
2238 #define MPC85xx_PMUXCR_IFC_ADDR19_SDHC_DATA 0x00040000 2238 #define MPC85xx_PMUXCR_IFC_ADDR19_SDHC_DATA 0x00040000
2239 #define MPC85xx_PMUXCR_IFC_ADDR19_USB 0x00080000 2239 #define MPC85xx_PMUXCR_IFC_ADDR19_USB 0x00080000
2240 #define MPC85xx_PMUXCR_IFC_ADDR19_DMA 0x000C0000 2240 #define MPC85xx_PMUXCR_IFC_ADDR19_DMA 0x000C0000
2241 #define MPC85xx_PMUXCR_IFC_ADDR20_21_SDHC_DATA 0x00010000 2241 #define MPC85xx_PMUXCR_IFC_ADDR20_21_SDHC_DATA 0x00010000
2242 #define MPC85xx_PMUXCR_IFC_ADDR20_21_USB 0x00020000 2242 #define MPC85xx_PMUXCR_IFC_ADDR20_21_USB 0x00020000
2243 #define MPC85xx_PMUXCR_IFC_ADDR20_21_RES 0x00030000 2243 #define MPC85xx_PMUXCR_IFC_ADDR20_21_RES 0x00030000
2244 #define MPC85xx_PMUXCR_IFC_ADDR22_SDHC 0x00004000 2244 #define MPC85xx_PMUXCR_IFC_ADDR22_SDHC 0x00004000
2245 #define MPC85xx_PMUXCR_IFC_ADDR22_USB 0x00008000 2245 #define MPC85xx_PMUXCR_IFC_ADDR22_USB 0x00008000
2246 #define MPC85xx_PMUXCR_IFC_ADDR22_RES 0x0000C000 2246 #define MPC85xx_PMUXCR_IFC_ADDR22_RES 0x0000C000
2247 #define MPC85xx_PMUXCR_IFC_ADDR23_SDHC 0x00001000 2247 #define MPC85xx_PMUXCR_IFC_ADDR23_SDHC 0x00001000
2248 #define MPC85xx_PMUXCR_IFC_ADDR23_USB 0x00002000 2248 #define MPC85xx_PMUXCR_IFC_ADDR23_USB 0x00002000
2249 #define MPC85xx_PMUXCR_IFC_ADDR23_RES 0x00003000 2249 #define MPC85xx_PMUXCR_IFC_ADDR23_RES 0x00003000
2250 #define MPC85xx_PMUXCR_IFC_ADDR24_SDHC 0x00000400 2250 #define MPC85xx_PMUXCR_IFC_ADDR24_SDHC 0x00000400
2251 #define MPC85xx_PMUXCR_IFC_ADDR24_USB 0x00000800 2251 #define MPC85xx_PMUXCR_IFC_ADDR24_USB 0x00000800
2252 #define MPC85xx_PMUXCR_IFC_ADDR24_RES 0x00000C00 2252 #define MPC85xx_PMUXCR_IFC_ADDR24_RES 0x00000C00
2253 #define MPC85xx_PMUXCR_IFC_PAR_PERR_RES 0x00000300 2253 #define MPC85xx_PMUXCR_IFC_PAR_PERR_RES 0x00000300
2254 #define MPC85xx_PMUXCR_IFC_PAR_PERR_USB 0x00000200 2254 #define MPC85xx_PMUXCR_IFC_PAR_PERR_USB 0x00000200
2255 #define MPC85xx_PMUXCR_LCLK_RES 0x00000040 2255 #define MPC85xx_PMUXCR_LCLK_RES 0x00000040
2256 #define MPC85xx_PMUXCR_LCLK_USB 0x00000080 2256 #define MPC85xx_PMUXCR_LCLK_USB 0x00000080
2257 #define MPC85xx_PMUXCR_LCLK_IFC_CS3 0x000000C0 2257 #define MPC85xx_PMUXCR_LCLK_IFC_CS3 0x000000C0
2258 #define MPC85xx_PMUXCR_SPI_RES 0x00000030 2258 #define MPC85xx_PMUXCR_SPI_RES 0x00000030
2259 #define MPC85xx_PMUXCR_SPI_GPIO 0x00000020 2259 #define MPC85xx_PMUXCR_SPI_GPIO 0x00000020
2260 #define MPC85xx_PMUXCR_CAN1_UART 0x00000004 2260 #define MPC85xx_PMUXCR_CAN1_UART 0x00000004
2261 #define MPC85xx_PMUXCR_CAN1_TDM 0x00000008 2261 #define MPC85xx_PMUXCR_CAN1_TDM 0x00000008
2262 #define MPC85xx_PMUXCR_CAN1_RES 0x0000000C 2262 #define MPC85xx_PMUXCR_CAN1_RES 0x0000000C
2263 #define MPC85xx_PMUXCR_CAN2_UART 0x00000001 2263 #define MPC85xx_PMUXCR_CAN2_UART 0x00000001
2264 #define MPC85xx_PMUXCR_CAN2_TDM 0x00000002 2264 #define MPC85xx_PMUXCR_CAN2_TDM 0x00000002
2265 #define MPC85xx_PMUXCR_CAN2_RES 0x00000003 2265 #define MPC85xx_PMUXCR_CAN2_RES 0x00000003
2266 #endif 2266 #endif
2267 #if defined(CONFIG_ARCH_P1023) 2267 #if defined(CONFIG_ARCH_P1023)
2268 #define MPC85xx_PMUXCR_TSEC1_1 0x10000000 2268 #define MPC85xx_PMUXCR_TSEC1_1 0x10000000
2269 #else 2269 #else
2270 #define MPC85xx_PMUXCR_SD_DATA 0x80000000 2270 #define MPC85xx_PMUXCR_SD_DATA 0x80000000
2271 #define MPC85xx_PMUXCR_SDHC_CD 0x40000000 2271 #define MPC85xx_PMUXCR_SDHC_CD 0x40000000
2272 #define MPC85xx_PMUXCR_SDHC_WP 0x20000000 2272 #define MPC85xx_PMUXCR_SDHC_WP 0x20000000
2273 #define MPC85xx_PMUXCR_ELBC_OFF_USB2_ON 0x01000000 2273 #define MPC85xx_PMUXCR_ELBC_OFF_USB2_ON 0x01000000
2274 #define MPC85xx_PMUXCR_TDM_ENA 0x00800000 2274 #define MPC85xx_PMUXCR_TDM_ENA 0x00800000
2275 #define MPC85xx_PMUXCR_QE0 0x00008000 2275 #define MPC85xx_PMUXCR_QE0 0x00008000
2276 #define MPC85xx_PMUXCR_QE1 0x00004000 2276 #define MPC85xx_PMUXCR_QE1 0x00004000
2277 #define MPC85xx_PMUXCR_QE2 0x00002000 2277 #define MPC85xx_PMUXCR_QE2 0x00002000
2278 #define MPC85xx_PMUXCR_QE3 0x00001000 2278 #define MPC85xx_PMUXCR_QE3 0x00001000
2279 #define MPC85xx_PMUXCR_QE4 0x00000800 2279 #define MPC85xx_PMUXCR_QE4 0x00000800
2280 #define MPC85xx_PMUXCR_QE5 0x00000400 2280 #define MPC85xx_PMUXCR_QE5 0x00000400
2281 #define MPC85xx_PMUXCR_QE6 0x00000200 2281 #define MPC85xx_PMUXCR_QE6 0x00000200
2282 #define MPC85xx_PMUXCR_QE7 0x00000100 2282 #define MPC85xx_PMUXCR_QE7 0x00000100
2283 #define MPC85xx_PMUXCR_QE8 0x00000080 2283 #define MPC85xx_PMUXCR_QE8 0x00000080
2284 #define MPC85xx_PMUXCR_QE9 0x00000040 2284 #define MPC85xx_PMUXCR_QE9 0x00000040
2285 #define MPC85xx_PMUXCR_QE10 0x00000020 2285 #define MPC85xx_PMUXCR_QE10 0x00000020
2286 #define MPC85xx_PMUXCR_QE11 0x00000010 2286 #define MPC85xx_PMUXCR_QE11 0x00000010
2287 #define MPC85xx_PMUXCR_QE12 0x00000008 2287 #define MPC85xx_PMUXCR_QE12 0x00000008
2288 #endif 2288 #endif
2289 #if defined(CONFIG_ARCH_P1022) 2289 #if defined(CONFIG_ARCH_P1022)
2290 #define MPC85xx_PMUXCR_TDM_MASK 0x0001cc00 2290 #define MPC85xx_PMUXCR_TDM_MASK 0x0001cc00
2291 #define MPC85xx_PMUXCR_TDM 0x00014800 2291 #define MPC85xx_PMUXCR_TDM 0x00014800
2292 #define MPC85xx_PMUXCR_SPI_MASK 0x00600000 2292 #define MPC85xx_PMUXCR_SPI_MASK 0x00600000
2293 #define MPC85xx_PMUXCR_SPI 0x00000000 2293 #define MPC85xx_PMUXCR_SPI 0x00000000
2294 #endif 2294 #endif
2295 #if defined(CONFIG_ARCH_BSC9131) 2295 #if defined(CONFIG_ARCH_BSC9131)
2296 #define MPC85xx_PMUXCR_TSEC2_DMA_GPIO_IRQ 0x40000000 2296 #define MPC85xx_PMUXCR_TSEC2_DMA_GPIO_IRQ 0x40000000
2297 #define MPC85xx_PMUXCR_TSEC2_USB 0xC0000000 2297 #define MPC85xx_PMUXCR_TSEC2_USB 0xC0000000
2298 #define MPC85xx_PMUXCR_TSEC2_1588_PPS 0x10000000 2298 #define MPC85xx_PMUXCR_TSEC2_1588_PPS 0x10000000
2299 #define MPC85xx_PMUXCR_TSEC2_1588_RSVD 0x30000000 2299 #define MPC85xx_PMUXCR_TSEC2_1588_RSVD 0x30000000
2300 #define MPC85xx_PMUXCR_IFC_AD_GPIO 0x04000000 2300 #define MPC85xx_PMUXCR_IFC_AD_GPIO 0x04000000
2301 #define MPC85xx_PMUXCR_IFC_AD_GPIO_MASK 0x0C000000 2301 #define MPC85xx_PMUXCR_IFC_AD_GPIO_MASK 0x0C000000
2302 #define MPC85xx_PMUXCR_IFC_AD15_GPIO 0x01000000 2302 #define MPC85xx_PMUXCR_IFC_AD15_GPIO 0x01000000
2303 #define MPC85xx_PMUXCR_IFC_AD15_TIMER2 0x02000000 2303 #define MPC85xx_PMUXCR_IFC_AD15_TIMER2 0x02000000
2304 #define MPC85xx_PMUXCR_IFC_AD16_GPO8 0x00400000 2304 #define MPC85xx_PMUXCR_IFC_AD16_GPO8 0x00400000
2305 #define MPC85xx_PMUXCR_IFC_AD16_MSRCID0 0x00800000 2305 #define MPC85xx_PMUXCR_IFC_AD16_MSRCID0 0x00800000
2306 #define MPC85xx_PMUXCR_IFC_AD17_GPO 0x00100000 2306 #define MPC85xx_PMUXCR_IFC_AD17_GPO 0x00100000
2307 #define MPC85xx_PMUXCR_IFC_AD17_GPO_MASK 0x00300000 2307 #define MPC85xx_PMUXCR_IFC_AD17_GPO_MASK 0x00300000
2308 #define MPC85xx_PMUXCR_IFC_AD17_MSRCID_DSP 0x00200000 2308 #define MPC85xx_PMUXCR_IFC_AD17_MSRCID_DSP 0x00200000
2309 #define MPC85xx_PMUXCR_IFC_CS2_GPO65 0x00040000 2309 #define MPC85xx_PMUXCR_IFC_CS2_GPO65 0x00040000
2310 #define MPC85xx_PMUXCR_IFC_CS2_DSP_TDI 0x00080000 2310 #define MPC85xx_PMUXCR_IFC_CS2_DSP_TDI 0x00080000
2311 #define MPC85xx_PMUXCR_SDHC_USIM 0x00010000 2311 #define MPC85xx_PMUXCR_SDHC_USIM 0x00010000
2312 #define MPC85xx_PMUXCR_SDHC_TDM_RFS_RCK 0x00020000 2312 #define MPC85xx_PMUXCR_SDHC_TDM_RFS_RCK 0x00020000
2313 #define MPC85xx_PMUXCR_SDHC_GPIO77 0x00030000 2313 #define MPC85xx_PMUXCR_SDHC_GPIO77 0x00030000
2314 #define MPC85xx_PMUXCR_SDHC_RESV 0x00004000 2314 #define MPC85xx_PMUXCR_SDHC_RESV 0x00004000
2315 #define MPC85xx_PMUXCR_SDHC_TDM_TXD_RXD 0x00008000 2315 #define MPC85xx_PMUXCR_SDHC_TDM_TXD_RXD 0x00008000
2316 #define MPC85xx_PMUXCR_SDHC_GPIO_TIMER4 0x0000C000 2316 #define MPC85xx_PMUXCR_SDHC_GPIO_TIMER4 0x0000C000
2317 #define MPC85xx_PMUXCR_USB_CLK_UART_SIN 0x00001000 2317 #define MPC85xx_PMUXCR_USB_CLK_UART_SIN 0x00001000
2318 #define MPC85xx_PMUXCR_USB_CLK_GPIO69 0x00002000 2318 #define MPC85xx_PMUXCR_USB_CLK_GPIO69 0x00002000
2319 #define MPC85xx_PMUXCR_USB_CLK_TIMER3 0x00003000 2319 #define MPC85xx_PMUXCR_USB_CLK_TIMER3 0x00003000
2320 #define MPC85xx_PMUXCR_USB_UART_GPIO0 0x00000400 2320 #define MPC85xx_PMUXCR_USB_UART_GPIO0 0x00000400
2321 #define MPC85xx_PMUXCR_USB_RSVD 0x00000C00 2321 #define MPC85xx_PMUXCR_USB_RSVD 0x00000C00
2322 #define MPC85xx_PMUXCR_USB_GPIO62_TRIG_IN 0x00000800 2322 #define MPC85xx_PMUXCR_USB_GPIO62_TRIG_IN 0x00000800
2323 #define MPC85xx_PMUXCR_USB_D1_2_IIC2_SDA_SCL 0x00000100 2323 #define MPC85xx_PMUXCR_USB_D1_2_IIC2_SDA_SCL 0x00000100
2324 #define MPC85xx_PMUXCR_USB_D1_2_GPIO71_72 0x00000200 2324 #define MPC85xx_PMUXCR_USB_D1_2_GPIO71_72 0x00000200
2325 #define MPC85xx_PMUXCR_USB_D1_2_RSVD 0x00000300 2325 #define MPC85xx_PMUXCR_USB_D1_2_RSVD 0x00000300
2326 #define MPC85xx_PMUXCR_USB_DIR_GPIO2 0x00000040 2326 #define MPC85xx_PMUXCR_USB_DIR_GPIO2 0x00000040
2327 #define MPC85xx_PMUXCR_USB_DIR_TIMER1 0x00000080 2327 #define MPC85xx_PMUXCR_USB_DIR_TIMER1 0x00000080
2328 #define MPC85xx_PMUXCR_USB_DIR_MCP_B 0x000000C0 2328 #define MPC85xx_PMUXCR_USB_DIR_MCP_B 0x000000C0
2329 #define MPC85xx_PMUXCR_SPI1_UART3 0x00000010 2329 #define MPC85xx_PMUXCR_SPI1_UART3 0x00000010
2330 #define MPC85xx_PMUXCR_SPI1_SIM 0x00000020 2330 #define MPC85xx_PMUXCR_SPI1_SIM 0x00000020
2331 #define MPC85xx_PMUXCR_SPI1_CKSTP_IN_GPO74 0x00000030 2331 #define MPC85xx_PMUXCR_SPI1_CKSTP_IN_GPO74 0x00000030
2332 #define MPC85xx_PMUXCR_SPI1_CS2_CKSTP_OUT_B 0x00000004 2332 #define MPC85xx_PMUXCR_SPI1_CS2_CKSTP_OUT_B 0x00000004
2333 #define MPC85xx_PMUXCR_SPI1_CS2_dbg_adi1_rxen 0x00000008 2333 #define MPC85xx_PMUXCR_SPI1_CS2_dbg_adi1_rxen 0x00000008
2334 #define MPC85xx_PMUXCR_SPI1_CS2_GPO75 0x0000000C 2334 #define MPC85xx_PMUXCR_SPI1_CS2_GPO75 0x0000000C
2335 #define MPC85xx_PMUXCR_SPI1_CS3_ANT_TCXO_PWM 0x00000001 2335 #define MPC85xx_PMUXCR_SPI1_CS3_ANT_TCXO_PWM 0x00000001
2336 #define MPC85xx_PMUXCR_SPI1_CS3_dbg_adi2_rxen 0x00000002 2336 #define MPC85xx_PMUXCR_SPI1_CS3_dbg_adi2_rxen 0x00000002
2337 #define MPC85xx_PMUXCR_SPI1_CS3_GPO76 0x00000003 2337 #define MPC85xx_PMUXCR_SPI1_CS3_GPO76 0x00000003
2338 #endif 2338 #endif
2339 #ifdef CONFIG_ARCH_BSC9132 2339 #ifdef CONFIG_ARCH_BSC9132
2340 #define MPC85xx_PMUXCR0_SIM_SEL_MASK 0x0003b000 2340 #define MPC85xx_PMUXCR0_SIM_SEL_MASK 0x0003b000
2341 #define MPC85xx_PMUXCR0_SIM_SEL 0x00014000 2341 #define MPC85xx_PMUXCR0_SIM_SEL 0x00014000
2342 #endif 2342 #endif
2343 #if defined(CONFIG_ARCH_C29X) 2343 #if defined(CONFIG_ARCH_C29X)
2344 #define MPC85xx_PMUXCR_SPI_MASK 0x00000300 2344 #define MPC85xx_PMUXCR_SPI_MASK 0x00000300
2345 #define MPC85xx_PMUXCR_SPI 0x00000000 2345 #define MPC85xx_PMUXCR_SPI 0x00000000
2346 #define MPC85xx_PMUXCR_SPI_GPIO 0x00000100 2346 #define MPC85xx_PMUXCR_SPI_GPIO 0x00000100
2347 #endif 2347 #endif
2348 u32 pmuxcr2; /* Alt. function signal multiplex control 2 */ 2348 u32 pmuxcr2; /* Alt. function signal multiplex control 2 */
2349 #if defined(CONFIG_ARCH_P1010) 2349 #if defined(CONFIG_ARCH_P1010)
2350 #define MPC85xx_PMUXCR2_UART_GPIO 0x40000000 2350 #define MPC85xx_PMUXCR2_UART_GPIO 0x40000000
2351 #define MPC85xx_PMUXCR2_UART_TDM 0x80000000 2351 #define MPC85xx_PMUXCR2_UART_TDM 0x80000000
2352 #define MPC85xx_PMUXCR2_UART_RES 0xC0000000 2352 #define MPC85xx_PMUXCR2_UART_RES 0xC0000000
2353 #define MPC85xx_PMUXCR2_IRQ2_TRIG_IN 0x10000000 2353 #define MPC85xx_PMUXCR2_IRQ2_TRIG_IN 0x10000000
2354 #define MPC85xx_PMUXCR2_IRQ2_RES 0x30000000 2354 #define MPC85xx_PMUXCR2_IRQ2_RES 0x30000000
2355 #define MPC85xx_PMUXCR2_IRQ3_SRESET 0x04000000 2355 #define MPC85xx_PMUXCR2_IRQ3_SRESET 0x04000000
2356 #define MPC85xx_PMUXCR2_IRQ3_RES 0x0C000000 2356 #define MPC85xx_PMUXCR2_IRQ3_RES 0x0C000000
2357 #define MPC85xx_PMUXCR2_GPIO01_DRVVBUS 0x01000000 2357 #define MPC85xx_PMUXCR2_GPIO01_DRVVBUS 0x01000000
2358 #define MPC85xx_PMUXCR2_GPIO01_RES 0x03000000 2358 #define MPC85xx_PMUXCR2_GPIO01_RES 0x03000000
2359 #define MPC85xx_PMUXCR2_GPIO23_CKSTP 0x00400000 2359 #define MPC85xx_PMUXCR2_GPIO23_CKSTP 0x00400000
2360 #define MPC85xx_PMUXCR2_GPIO23_RES 0x00800000 2360 #define MPC85xx_PMUXCR2_GPIO23_RES 0x00800000
2361 #define MPC85xx_PMUXCR2_GPIO23_USB 0x00C00000 2361 #define MPC85xx_PMUXCR2_GPIO23_USB 0x00C00000
2362 #define MPC85xx_PMUXCR2_GPIO4_MCP 0x00100000 2362 #define MPC85xx_PMUXCR2_GPIO4_MCP 0x00100000
2363 #define MPC85xx_PMUXCR2_GPIO4_RES 0x00200000 2363 #define MPC85xx_PMUXCR2_GPIO4_RES 0x00200000
2364 #define MPC85xx_PMUXCR2_GPIO4_CLK_OUT 0x00300000 2364 #define MPC85xx_PMUXCR2_GPIO4_CLK_OUT 0x00300000
2365 #define MPC85xx_PMUXCR2_GPIO5_UDE 0x00040000 2365 #define MPC85xx_PMUXCR2_GPIO5_UDE 0x00040000
2366 #define MPC85xx_PMUXCR2_GPIO5_RES 0x00080000 2366 #define MPC85xx_PMUXCR2_GPIO5_RES 0x00080000
2367 #define MPC85xx_PMUXCR2_READY_ASLEEP 0x00020000 2367 #define MPC85xx_PMUXCR2_READY_ASLEEP 0x00020000
2368 #define MPC85xx_PMUXCR2_DDR_ECC_MUX 0x00010000 2368 #define MPC85xx_PMUXCR2_DDR_ECC_MUX 0x00010000
2369 #define MPC85xx_PMUXCR2_DEBUG_PORT_EXPOSE 0x00008000 2369 #define MPC85xx_PMUXCR2_DEBUG_PORT_EXPOSE 0x00008000
2370 #define MPC85xx_PMUXCR2_POST_EXPOSE 0x00004000 2370 #define MPC85xx_PMUXCR2_POST_EXPOSE 0x00004000
2371 #define MPC85xx_PMUXCR2_DEBUG_MUX_SEL_USBPHY 0x00002000 2371 #define MPC85xx_PMUXCR2_DEBUG_MUX_SEL_USBPHY 0x00002000
2372 #define MPC85xx_PMUXCR2_PLL_LKDT_EXPOSE 0x00001000 2372 #define MPC85xx_PMUXCR2_PLL_LKDT_EXPOSE 0x00001000
2373 #endif 2373 #endif
2374 #if defined(CONFIG_ARCH_P1022) 2374 #if defined(CONFIG_ARCH_P1022)
2375 #define MPC85xx_PMUXCR2_ETSECUSB_MASK 0x001f8000 2375 #define MPC85xx_PMUXCR2_ETSECUSB_MASK 0x001f8000
2376 #define MPC85xx_PMUXCR2_USB 0x00150000 2376 #define MPC85xx_PMUXCR2_USB 0x00150000
2377 #endif 2377 #endif
2378 #if defined(CONFIG_ARCH_BSC9131) || defined(CONFIG_ARCH_BSC9132) 2378 #if defined(CONFIG_ARCH_BSC9131) || defined(CONFIG_ARCH_BSC9132)
2379 #if defined(CONFIG_ARCH_BSC9131) 2379 #if defined(CONFIG_ARCH_BSC9131)
2380 #define MPC85xx_PMUXCR2_UART_CTS_B0_SIM_PD 0X40000000 2380 #define MPC85xx_PMUXCR2_UART_CTS_B0_SIM_PD 0X40000000
2381 #define MPC85xx_PMUXCR2_UART_CTS_B0_DSP_TMS 0X80000000 2381 #define MPC85xx_PMUXCR2_UART_CTS_B0_DSP_TMS 0X80000000
2382 #define MPC85xx_PMUXCR2_UART_CTS_B0_GPIO42 0xC0000000 2382 #define MPC85xx_PMUXCR2_UART_CTS_B0_GPIO42 0xC0000000
2383 #define MPC85xx_PMUXCR2_UART_RTS_B0_PWM2 0x10000000 2383 #define MPC85xx_PMUXCR2_UART_RTS_B0_PWM2 0x10000000
2384 #define MPC85xx_PMUXCR2_UART_RTS_B0_DSP_TCK 0x20000000 2384 #define MPC85xx_PMUXCR2_UART_RTS_B0_DSP_TCK 0x20000000
2385 #define MPC85xx_PMUXCR2_UART_RTS_B0_GPIO43 0x30000000 2385 #define MPC85xx_PMUXCR2_UART_RTS_B0_GPIO43 0x30000000
2386 #define MPC85xx_PMUXCR2_UART_CTS_B1_SIM_PD 0x04000000 2386 #define MPC85xx_PMUXCR2_UART_CTS_B1_SIM_PD 0x04000000
2387 #define MPC85xx_PMUXCR2_UART_CTS_B1_SRESET_B 0x08000000 2387 #define MPC85xx_PMUXCR2_UART_CTS_B1_SRESET_B 0x08000000
2388 #define MPC85xx_PMUXCR2_UART_CTS_B1_GPIO44 0x0C000000 2388 #define MPC85xx_PMUXCR2_UART_CTS_B1_GPIO44 0x0C000000
2389 #define MPC85xx_PMUXCR2_UART_RTS_B1_PPS_LED 0x01000000 2389 #define MPC85xx_PMUXCR2_UART_RTS_B1_PPS_LED 0x01000000
2390 #define MPC85xx_PMUXCR2_UART_RTS_B1_RSVD 0x02000000 2390 #define MPC85xx_PMUXCR2_UART_RTS_B1_RSVD 0x02000000
2391 #define MPC85xx_PMUXCR2_UART_RTS_B1_GPIO45 0x03000000 2391 #define MPC85xx_PMUXCR2_UART_RTS_B1_GPIO45 0x03000000
2392 #define MPC85xx_PMUXCR2_TRIG_OUT_ASLEEP 0x00400000 2392 #define MPC85xx_PMUXCR2_TRIG_OUT_ASLEEP 0x00400000
2393 #define MPC85xx_PMUXCR2_TRIG_OUT_DSP_TRST_B 0x00800000 2393 #define MPC85xx_PMUXCR2_TRIG_OUT_DSP_TRST_B 0x00800000
2394 #define MPC85xx_PMUXCR2_ANT1_TIMER5 0x00100000 2394 #define MPC85xx_PMUXCR2_ANT1_TIMER5 0x00100000
2395 #define MPC85xx_PMUXCR2_ANT1_TSEC_1588 0x00200000 2395 #define MPC85xx_PMUXCR2_ANT1_TSEC_1588 0x00200000
2396 #define MPC85xx_PMUXCR2_ANT1_GPIO95_19 0x00300000 2396 #define MPC85xx_PMUXCR2_ANT1_GPIO95_19 0x00300000
2397 #define MPC85xx_PMUXCR2_ANT1_TX_RX_FRAME_MAX3_LOCK 0x00040000 2397 #define MPC85xx_PMUXCR2_ANT1_TX_RX_FRAME_MAX3_LOCK 0x00040000
2398 #define MPC85xx_PMUXCR2_ANT1_TX_RX_FRAME_RSVD 0x00080000 2398 #define MPC85xx_PMUXCR2_ANT1_TX_RX_FRAME_RSVD 0x00080000
2399 #define MPC85xx_PMUXCR2_ANT1_TX_RX_FRAME_GPIO80_20 0x000C0000 2399 #define MPC85xx_PMUXCR2_ANT1_TX_RX_FRAME_GPIO80_20 0x000C0000
2400 #define MPC85xx_PMUXCR2_ANT1_DIO0_3_SPI3_CS0 0x00010000 2400 #define MPC85xx_PMUXCR2_ANT1_DIO0_3_SPI3_CS0 0x00010000
2401 #define MPC85xx_PMUXCR2_ANT1_DIO0_3_ANT2_DO_3 0x00020000 2401 #define MPC85xx_PMUXCR2_ANT1_DIO0_3_ANT2_DO_3 0x00020000
2402 #define MPC85xx_PMUXCR2_ANT1_DIO0_3_GPIO81_84 0x00030000 2402 #define MPC85xx_PMUXCR2_ANT1_DIO0_3_GPIO81_84 0x00030000
2403 #define MPC85xx_PMUXCR2_ANT1_DIO4_7_SPI4 0x00004000 2403 #define MPC85xx_PMUXCR2_ANT1_DIO4_7_SPI4 0x00004000
2404 #define MPC85xx_PMUXCR2_ANT1_DIO4_7_ANT2_DO4_7 0x00008000 2404 #define MPC85xx_PMUXCR2_ANT1_DIO4_7_ANT2_DO4_7 0x00008000
2405 #define MPC85xx_PMUXCR2_ANT1_DIO4_7_GPIO85_88 0x0000C000 2405 #define MPC85xx_PMUXCR2_ANT1_DIO4_7_GPIO85_88 0x0000C000
2406 #define MPC85xx_PMUXCR2_ANT1_DIO8_9_MAX2_1_LOCK 0x00001000 2406 #define MPC85xx_PMUXCR2_ANT1_DIO8_9_MAX2_1_LOCK 0x00001000
2407 #define MPC85xx_PMUXCR2_ANT1_DIO8_9_ANT2_DO8_9 0x00002000 2407 #define MPC85xx_PMUXCR2_ANT1_DIO8_9_ANT2_DO8_9 0x00002000
2408 #define MPC85xx_PMUXCR2_ANT1_DIO8_9_GPIO21_22 0x00003000 2408 #define MPC85xx_PMUXCR2_ANT1_DIO8_9_GPIO21_22 0x00003000
2409 #define MPC85xx_PMUXCR2_ANT1_DIO10_11_TIMER6_7 0x00000400 2409 #define MPC85xx_PMUXCR2_ANT1_DIO10_11_TIMER6_7 0x00000400
2410 #define MPC85xx_PMUXCR2_ANT1_DIO10_11_ANT2_DO10_11 0x00000800 2410 #define MPC85xx_PMUXCR2_ANT1_DIO10_11_ANT2_DO10_11 0x00000800
2411 #define MPC85xx_PMUXCR2_ANT1_DIO10_11_GPIO23_24 0x00000C00 2411 #define MPC85xx_PMUXCR2_ANT1_DIO10_11_GPIO23_24 0x00000C00
2412 #define MPC85xx_PMUXCR2_ANT2_RSVD 0x00000100 2412 #define MPC85xx_PMUXCR2_ANT2_RSVD 0x00000100
2413 #define MPC85xx_PMUXCR2_ANT2_GPO90_91_DMA 0x00000300 2413 #define MPC85xx_PMUXCR2_ANT2_GPO90_91_DMA 0x00000300
2414 #define MPC85xx_PMUXCR2_ANT2_ENABLE_DIO0_10_USB 0x00000040 2414 #define MPC85xx_PMUXCR2_ANT2_ENABLE_DIO0_10_USB 0x00000040
2415 #define MPC85xx_PMUXCR2_ANT2_ENABLE_DIO0_10_GPIO 0x000000C0 2415 #define MPC85xx_PMUXCR2_ANT2_ENABLE_DIO0_10_GPIO 0x000000C0
2416 #define MPC85xx_PMUXCR2_ANT2_DIO11_RSVD 0x00000010 2416 #define MPC85xx_PMUXCR2_ANT2_DIO11_RSVD 0x00000010
2417 #define MPC85xx_PMUXCR2_ANT2_DIO11_TIMER8 0x00000020 2417 #define MPC85xx_PMUXCR2_ANT2_DIO11_TIMER8 0x00000020
2418 #define MPC85xx_PMUXCR2_ANT2_DIO11_GPIO61 0x00000030 2418 #define MPC85xx_PMUXCR2_ANT2_DIO11_GPIO61 0x00000030
2419 #define MPC85xx_PMUXCR2_ANT3_AGC_GPO53 0x00000004 2419 #define MPC85xx_PMUXCR2_ANT3_AGC_GPO53 0x00000004
2420 #define MPC85xx_PMUXCR2_ANT3_DO_TDM 0x00000001 2420 #define MPC85xx_PMUXCR2_ANT3_DO_TDM 0x00000001
2421 #define MPC85xx_PMUXCR2_ANT3_DO_GPIO46_49 0x00000002 2421 #define MPC85xx_PMUXCR2_ANT3_DO_GPIO46_49 0x00000002
2422 #endif 2422 #endif
2423 u32 pmuxcr3; 2423 u32 pmuxcr3;
2424 #if defined(CONFIG_ARCH_BSC9131) 2424 #if defined(CONFIG_ARCH_BSC9131)
2425 #define MPC85xx_PMUXCR3_ANT3_DO4_5_TDM 0x40000000 2425 #define MPC85xx_PMUXCR3_ANT3_DO4_5_TDM 0x40000000
2426 #define MPC85xx_PMUXCR3_ANT3_DO4_5_GPIO_50_51 0x80000000 2426 #define MPC85xx_PMUXCR3_ANT3_DO4_5_GPIO_50_51 0x80000000
2427 #define MPC85xx_PMUXCR3_ANT3_DO6_7_TRIG_IN_SRESET_B 0x10000000 2427 #define MPC85xx_PMUXCR3_ANT3_DO6_7_TRIG_IN_SRESET_B 0x10000000
2428 #define MPC85xx_PMUXCR3_ANT3_DO6_7_GPIO_52_53 0x20000000 2428 #define MPC85xx_PMUXCR3_ANT3_DO6_7_GPIO_52_53 0x20000000
2429 #define MPC85xx_PMUXCR3_ANT3_DO8_MCP_B 0x04000000 2429 #define MPC85xx_PMUXCR3_ANT3_DO8_MCP_B 0x04000000
2430 #define MPC85xx_PMUXCR3_ANT3_DO8_GPIO54 0x08000000 2430 #define MPC85xx_PMUXCR3_ANT3_DO8_GPIO54 0x08000000
2431 #define MPC85xx_PMUXCR3_ANT3_DO9_10_CKSTP_IN_OUT 0x01000000 2431 #define MPC85xx_PMUXCR3_ANT3_DO9_10_CKSTP_IN_OUT 0x01000000
2432 #define MPC85xx_PMUXCR3_ANT3_DO9_10_GPIO55_56 0x02000000 2432 #define MPC85xx_PMUXCR3_ANT3_DO9_10_GPIO55_56 0x02000000
2433 #define MPC85xx_PMUXCR3_ANT3_DO11_IRQ_OUT 0x00400000 2433 #define MPC85xx_PMUXCR3_ANT3_DO11_IRQ_OUT 0x00400000
2434 #define MPC85xx_PMUXCR3_ANT3_DO11_GPIO57 0x00800000 2434 #define MPC85xx_PMUXCR3_ANT3_DO11_GPIO57 0x00800000
2435 #define MPC85xx_PMUXCR3_SPI2_CS2_GPO93 0x00100000 2435 #define MPC85xx_PMUXCR3_SPI2_CS2_GPO93 0x00100000
2436 #define MPC85xx_PMUXCR3_SPI2_CS3_GPO94 0x00040000 2436 #define MPC85xx_PMUXCR3_SPI2_CS3_GPO94 0x00040000
2437 #define MPC85xx_PMUXCR3_ANT2_AGC_RSVD 0x00010000 2437 #define MPC85xx_PMUXCR3_ANT2_AGC_RSVD 0x00010000
2438 #define MPC85xx_PMUXCR3_ANT2_GPO89 0x00030000 2438 #define MPC85xx_PMUXCR3_ANT2_GPO89 0x00030000
2439 #endif 2439 #endif
2440 #ifdef CONFIG_ARCH_BSC9132 2440 #ifdef CONFIG_ARCH_BSC9132
2441 #define MPC85xx_PMUXCR3_USB_SEL_MASK 0x0000ff00 2441 #define MPC85xx_PMUXCR3_USB_SEL_MASK 0x0000ff00
2442 #define MPC85xx_PMUXCR3_UART2_SEL 0x00005000 2442 #define MPC85xx_PMUXCR3_UART2_SEL 0x00005000
2443 #define MPC85xx_PMUXCR3_UART3_SEL_MASK 0xc0000000 2443 #define MPC85xx_PMUXCR3_UART3_SEL_MASK 0xc0000000
2444 #define MPC85xx_PMUXCR3_UART3_SEL 0x40000000 2444 #define MPC85xx_PMUXCR3_UART3_SEL 0x40000000
2445 #endif 2445 #endif
2446 u32 pmuxcr4; 2446 u32 pmuxcr4;
2447 #else 2447 #else
2448 u8 res6[8]; 2448 u8 res6[8];
2449 #endif 2449 #endif
2450 u32 devdisr; /* Device disable control */ 2450 u32 devdisr; /* Device disable control */
2451 #define MPC85xx_DEVDISR_PCI1 0x80000000 2451 #define MPC85xx_DEVDISR_PCI1 0x80000000
2452 #define MPC85xx_DEVDISR_PCI2 0x40000000 2452 #define MPC85xx_DEVDISR_PCI2 0x40000000
2453 #define MPC85xx_DEVDISR_PCIE 0x20000000 2453 #define MPC85xx_DEVDISR_PCIE 0x20000000
2454 #define MPC85xx_DEVDISR_LBC 0x08000000 2454 #define MPC85xx_DEVDISR_LBC 0x08000000
2455 #define MPC85xx_DEVDISR_PCIE2 0x04000000 2455 #define MPC85xx_DEVDISR_PCIE2 0x04000000
2456 #define MPC85xx_DEVDISR_PCIE3 0x02000000 2456 #define MPC85xx_DEVDISR_PCIE3 0x02000000
2457 #define MPC85xx_DEVDISR_SEC 0x01000000 2457 #define MPC85xx_DEVDISR_SEC 0x01000000
2458 #define MPC85xx_DEVDISR_SRIO 0x00080000 2458 #define MPC85xx_DEVDISR_SRIO 0x00080000
2459 #define MPC85xx_DEVDISR_RMSG 0x00040000 2459 #define MPC85xx_DEVDISR_RMSG 0x00040000
2460 #define MPC85xx_DEVDISR_DDR 0x00010000 2460 #define MPC85xx_DEVDISR_DDR 0x00010000
2461 #define MPC85xx_DEVDISR_CPU 0x00008000 2461 #define MPC85xx_DEVDISR_CPU 0x00008000
2462 #define MPC85xx_DEVDISR_CPU0 MPC85xx_DEVDISR_CPU 2462 #define MPC85xx_DEVDISR_CPU0 MPC85xx_DEVDISR_CPU
2463 #define MPC85xx_DEVDISR_TB 0x00004000 2463 #define MPC85xx_DEVDISR_TB 0x00004000
2464 #define MPC85xx_DEVDISR_TB0 MPC85xx_DEVDISR_TB 2464 #define MPC85xx_DEVDISR_TB0 MPC85xx_DEVDISR_TB
2465 #define MPC85xx_DEVDISR_CPU1 0x00002000 2465 #define MPC85xx_DEVDISR_CPU1 0x00002000
2466 #define MPC85xx_DEVDISR_TB1 0x00001000 2466 #define MPC85xx_DEVDISR_TB1 0x00001000
2467 #define MPC85xx_DEVDISR_DMA 0x00000400 2467 #define MPC85xx_DEVDISR_DMA 0x00000400
2468 #define MPC85xx_DEVDISR_TSEC1 0x00000080 2468 #define MPC85xx_DEVDISR_TSEC1 0x00000080
2469 #define MPC85xx_DEVDISR_TSEC2 0x00000040 2469 #define MPC85xx_DEVDISR_TSEC2 0x00000040
2470 #define MPC85xx_DEVDISR_TSEC3 0x00000020 2470 #define MPC85xx_DEVDISR_TSEC3 0x00000020
2471 #define MPC85xx_DEVDISR_TSEC4 0x00000010 2471 #define MPC85xx_DEVDISR_TSEC4 0x00000010
2472 #define MPC85xx_DEVDISR_I2C 0x00000004 2472 #define MPC85xx_DEVDISR_I2C 0x00000004
2473 #define MPC85xx_DEVDISR_DUART 0x00000002 2473 #define MPC85xx_DEVDISR_DUART 0x00000002
2474 u8 res7[12]; 2474 u8 res7[12];
2475 u32 powmgtcsr; /* Power management status & control */ 2475 u32 powmgtcsr; /* Power management status & control */
2476 u8 res8[12]; 2476 u8 res8[12];
2477 u32 mcpsumr; /* Machine check summary */ 2477 u32 mcpsumr; /* Machine check summary */
2478 u8 res9[12]; 2478 u8 res9[12];
2479 u32 pvr; /* Processor version */ 2479 u32 pvr; /* Processor version */
2480 u32 svr; /* System version */ 2480 u32 svr; /* System version */
2481 u8 res10[8]; 2481 u8 res10[8];
2482 u32 rstcr; /* Reset control */ 2482 u32 rstcr; /* Reset control */
2483 #if defined(CONFIG_ARCH_MPC8568) || defined(CONFIG_ARCH_MPC8569) 2483 #if defined(CONFIG_ARCH_MPC8568) || defined(CONFIG_ARCH_MPC8569)
2484 u8 res11a[76]; 2484 u8 res11a[76];
2485 par_io_t qe_par_io[7]; 2485 par_io_t qe_par_io[7];
2486 u8 res11b[1600]; 2486 u8 res11b[1600];
2487 #elif defined(CONFIG_ARCH_P1021) || defined(CONFIG_ARCH_P1025) 2487 #elif defined(CONFIG_ARCH_P1021) || defined(CONFIG_ARCH_P1025)
2488 u8 res11a[12]; 2488 u8 res11a[12];
2489 u32 iovselsr; 2489 u32 iovselsr;
2490 u8 res11b[60]; 2490 u8 res11b[60];
2491 par_io_t qe_par_io[3]; 2491 par_io_t qe_par_io[3];
2492 u8 res11c[1496]; 2492 u8 res11c[1496];
2493 #else 2493 #else
2494 u8 res11a[1868]; 2494 u8 res11a[1868];
2495 #endif 2495 #endif
2496 u32 clkdvdr; /* Clock Divide register */ 2496 u32 clkdvdr; /* Clock Divide register */
2497 u8 res12[1532]; 2497 u8 res12[1532];
2498 u32 clkocr; /* Clock out select */ 2498 u32 clkocr; /* Clock out select */
2499 u8 res13[12]; 2499 u8 res13[12];
2500 u32 ddrdllcr; /* DDR DLL control */ 2500 u32 ddrdllcr; /* DDR DLL control */
2501 u8 res14[12]; 2501 u8 res14[12];
2502 u32 lbcdllcr; /* LBC DLL control */ 2502 u32 lbcdllcr; /* LBC DLL control */
2503 #if defined(CONFIG_ARCH_BSC9131) 2503 #if defined(CONFIG_ARCH_BSC9131)
2504 u8 res15[12]; 2504 u8 res15[12];
2505 u32 halt_req_mask; 2505 u32 halt_req_mask;
2506 #define HALTED_TO_HALT_REQ_MASK_0 0x80000000 2506 #define HALTED_TO_HALT_REQ_MASK_0 0x80000000
2507 u8 res18[232]; 2507 u8 res18[232];
2508 #else 2508 #else
2509 u8 res15[248]; 2509 u8 res15[248];
2510 #endif 2510 #endif
2511 u32 lbiuiplldcr0; /* LBIU PLL Debug Reg 0 */ 2511 u32 lbiuiplldcr0; /* LBIU PLL Debug Reg 0 */
2512 u32 lbiuiplldcr1; /* LBIU PLL Debug Reg 1 */ 2512 u32 lbiuiplldcr1; /* LBIU PLL Debug Reg 1 */
2513 u32 ddrioovcr; /* DDR IO Override Control */ 2513 u32 ddrioovcr; /* DDR IO Override Control */
2514 u32 tsec12ioovcr; /* eTSEC 1/2 IO override control */ 2514 u32 tsec12ioovcr; /* eTSEC 1/2 IO override control */
2515 u32 tsec34ioovcr; /* eTSEC 3/4 IO override control */ 2515 u32 tsec34ioovcr; /* eTSEC 3/4 IO override control */
2516 u8 res16[52]; 2516 u8 res16[52];
2517 u32 sdhcdcr; /* SDHC debug control register */ 2517 u32 sdhcdcr; /* SDHC debug control register */
2518 u8 res17[61592]; 2518 u8 res17[61592];
2519 } ccsr_gur_t; 2519 } ccsr_gur_t;
2520 #endif 2520 #endif
2521 2521
2522 #define SDHCDCR_CD_INV 0x80000000 /* invert SDHC card detect */ 2522 #define SDHCDCR_CD_INV 0x80000000 /* invert SDHC card detect */
2523 2523
2524 #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2 2524 #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2
2525 #define MAX_SERDES 4 2525 #define MAX_SERDES 4
2526 #if defined(CONFIG_ARCH_T1024) || defined(CONFIG_ARCH_T1023) 2526 #if defined(CONFIG_ARCH_T1024) || defined(CONFIG_ARCH_T1023)
2527 #define SRDS_MAX_LANES 4 2527 #define SRDS_MAX_LANES 4
2528 #else 2528 #else
2529 #define SRDS_MAX_LANES 8 2529 #define SRDS_MAX_LANES 8
2530 #endif 2530 #endif
2531 #define SRDS_MAX_BANK 2 2531 #define SRDS_MAX_BANK 2
2532 typedef struct serdes_corenet { 2532 typedef struct serdes_corenet {
2533 struct { 2533 struct {
2534 u32 rstctl; /* Reset Control Register */ 2534 u32 rstctl; /* Reset Control Register */
2535 #define SRDS_RSTCTL_RST 0x80000000 2535 #define SRDS_RSTCTL_RST 0x80000000
2536 #define SRDS_RSTCTL_RSTDONE 0x40000000 2536 #define SRDS_RSTCTL_RSTDONE 0x40000000
2537 #define SRDS_RSTCTL_RSTERR 0x20000000 2537 #define SRDS_RSTCTL_RSTERR 0x20000000
2538 #define SRDS_RSTCTL_SWRST 0x10000000 2538 #define SRDS_RSTCTL_SWRST 0x10000000
2539 #define SRDS_RSTCTL_SDEN 0x00000020 2539 #define SRDS_RSTCTL_SDEN 0x00000020
2540 #define SRDS_RSTCTL_SDRST_B 0x00000040 2540 #define SRDS_RSTCTL_SDRST_B 0x00000040
2541 #define SRDS_RSTCTL_PLLRST_B 0x00000080 2541 #define SRDS_RSTCTL_PLLRST_B 0x00000080
2542 #define SRDS_RSTCTL_RSTERR_SHIFT 29 2542 #define SRDS_RSTCTL_RSTERR_SHIFT 29
2543 u32 pllcr0; /* PLL Control Register 0 */ 2543 u32 pllcr0; /* PLL Control Register 0 */
2544 #define SRDS_PLLCR0_POFF 0x80000000 2544 #define SRDS_PLLCR0_POFF 0x80000000
2545 #define SRDS_PLLCR0_RFCK_SEL_MASK 0x70000000 2545 #define SRDS_PLLCR0_RFCK_SEL_MASK 0x70000000
2546 #define SRDS_PLLCR0_RFCK_SEL_100 0x00000000 2546 #define SRDS_PLLCR0_RFCK_SEL_100 0x00000000
2547 #define SRDS_PLLCR0_RFCK_SEL_125 0x10000000 2547 #define SRDS_PLLCR0_RFCK_SEL_125 0x10000000
2548 #define SRDS_PLLCR0_RFCK_SEL_156_25 0x20000000 2548 #define SRDS_PLLCR0_RFCK_SEL_156_25 0x20000000
2549 #define SRDS_PLLCR0_RFCK_SEL_150 0x30000000 2549 #define SRDS_PLLCR0_RFCK_SEL_150 0x30000000
2550 #define SRDS_PLLCR0_RFCK_SEL_161_13 0x40000000 2550 #define SRDS_PLLCR0_RFCK_SEL_161_13 0x40000000
2551 #define SRDS_PLLCR0_RFCK_SEL_122_88 0x50000000 2551 #define SRDS_PLLCR0_RFCK_SEL_122_88 0x50000000
2552 #define SRDS_PLLCR0_PLL_LCK 0x00800000 2552 #define SRDS_PLLCR0_PLL_LCK 0x00800000
2553 #define SRDS_PLLCR0_DCBIAS_OUT_EN 0x02000000 2553 #define SRDS_PLLCR0_DCBIAS_OUT_EN 0x02000000
2554 #define SRDS_PLLCR0_FRATE_SEL_MASK 0x000f0000 2554 #define SRDS_PLLCR0_FRATE_SEL_MASK 0x000f0000
2555 #define SRDS_PLLCR0_FRATE_SEL_5 0x00000000 2555 #define SRDS_PLLCR0_FRATE_SEL_5 0x00000000
2556 #define SRDS_PLLCR0_FRATE_SEL_4_9152 0x00030000 2556 #define SRDS_PLLCR0_FRATE_SEL_4_9152 0x00030000
2557 #define SRDS_PLLCR0_FRATE_SEL_3_75 0x00050000 2557 #define SRDS_PLLCR0_FRATE_SEL_3_75 0x00050000
2558 #define SRDS_PLLCR0_FRATE_SEL_5_15 0x00060000 2558 #define SRDS_PLLCR0_FRATE_SEL_5_15 0x00060000
2559 #define SRDS_PLLCR0_FRATE_SEL_4 0x00070000 2559 #define SRDS_PLLCR0_FRATE_SEL_4 0x00070000
2560 #define SRDS_PLLCR0_FRATE_SEL_3_125 0x00090000 2560 #define SRDS_PLLCR0_FRATE_SEL_3_125 0x00090000
2561 #define SRDS_PLLCR0_FRATE_SEL_3_0 0x000a0000 2561 #define SRDS_PLLCR0_FRATE_SEL_3_0 0x000a0000
2562 #define SRDS_PLLCR0_FRATE_SEL_3_072 0x000c0000 2562 #define SRDS_PLLCR0_FRATE_SEL_3_072 0x000c0000
2563 #define SRDS_PLLCR0_DCBIAS_OVRD 0x000000F0 2563 #define SRDS_PLLCR0_DCBIAS_OVRD 0x000000F0
2564 #define SRDS_PLLCR0_DCBIAS_OVRD_SHIFT 4 2564 #define SRDS_PLLCR0_DCBIAS_OVRD_SHIFT 4
2565 u32 pllcr1; /* PLL Control Register 1 */ 2565 u32 pllcr1; /* PLL Control Register 1 */
2566 #define SRDS_PLLCR1_BCAP_EN 0x20000000 2566 #define SRDS_PLLCR1_BCAP_EN 0x20000000
2567 #define SRDS_PLLCR1_BCAP_OVD 0x10000000 2567 #define SRDS_PLLCR1_BCAP_OVD 0x10000000
2568 #define SRDS_PLLCR1_PLL_FCAP 0x001F8000 2568 #define SRDS_PLLCR1_PLL_FCAP 0x001F8000
2569 #define SRDS_PLLCR1_PLL_FCAP_SHIFT 15 2569 #define SRDS_PLLCR1_PLL_FCAP_SHIFT 15
2570 #define SRDS_PLLCR1_PLL_BWSEL 0x08000000 2570 #define SRDS_PLLCR1_PLL_BWSEL 0x08000000
2571 #define SRDS_PLLCR1_BYP_CAL 0x02000000 2571 #define SRDS_PLLCR1_BYP_CAL 0x02000000
2572 u32 pllsr2; /* At 0x00c, PLL Status Register 2 */ 2572 u32 pllsr2; /* At 0x00c, PLL Status Register 2 */
2573 #define SRDS_PLLSR2_BCAP_EN 0x00800000 2573 #define SRDS_PLLSR2_BCAP_EN 0x00800000
2574 #define SRDS_PLLSR2_BCAP_EN_SHIFT 23 2574 #define SRDS_PLLSR2_BCAP_EN_SHIFT 23
2575 #define SRDS_PLLSR2_FCAP 0x003F0000 2575 #define SRDS_PLLSR2_FCAP 0x003F0000
2576 #define SRDS_PLLSR2_FCAP_SHIFT 16 2576 #define SRDS_PLLSR2_FCAP_SHIFT 16
2577 #define SRDS_PLLSR2_DCBIAS 0x000F0000 2577 #define SRDS_PLLSR2_DCBIAS 0x000F0000
2578 #define SRDS_PLLSR2_DCBIAS_SHIFT 16 2578 #define SRDS_PLLSR2_DCBIAS_SHIFT 16
2579 u32 pllcr3; 2579 u32 pllcr3;
2580 u32 pllcr4; 2580 u32 pllcr4;
2581 u8 res_18[0x20-0x18]; 2581 u8 res_18[0x20-0x18];
2582 } bank[2]; 2582 } bank[2];
2583 u8 res_40[0x90-0x40]; 2583 u8 res_40[0x90-0x40];
2584 u32 srdstcalcr; /* 0x90 TX Calibration Control */ 2584 u32 srdstcalcr; /* 0x90 TX Calibration Control */
2585 u8 res_94[0xa0-0x94]; 2585 u8 res_94[0xa0-0x94];
2586 u32 srdsrcalcr; /* 0xa0 RX Calibration Control */ 2586 u32 srdsrcalcr; /* 0xa0 RX Calibration Control */
2587 u8 res_a4[0xb0-0xa4]; 2587 u8 res_a4[0xb0-0xa4];
2588 u32 srdsgr0; /* 0xb0 General Register 0 */ 2588 u32 srdsgr0; /* 0xb0 General Register 0 */
2589 u8 res_b4[0xe0-0xb4]; 2589 u8 res_b4[0xe0-0xb4];
2590 u32 srdspccr0; /* 0xe0 Protocol Converter Config 0 */ 2590 u32 srdspccr0; /* 0xe0 Protocol Converter Config 0 */
2591 u32 srdspccr1; /* 0xe4 Protocol Converter Config 1 */ 2591 u32 srdspccr1; /* 0xe4 Protocol Converter Config 1 */
2592 u32 srdspccr2; /* 0xe8 Protocol Converter Config 2 */ 2592 u32 srdspccr2; /* 0xe8 Protocol Converter Config 2 */
2593 u32 srdspccr3; /* 0xec Protocol Converter Config 3 */ 2593 u32 srdspccr3; /* 0xec Protocol Converter Config 3 */
2594 u32 srdspccr4; /* 0xf0 Protocol Converter Config 4 */ 2594 u32 srdspccr4; /* 0xf0 Protocol Converter Config 4 */
2595 u8 res_f4[0x100-0xf4]; 2595 u8 res_f4[0x100-0xf4];
2596 struct { 2596 struct {
2597 u32 lnpssr; /* 0x100, 0x120, ..., 0x1e0 */ 2597 u32 lnpssr; /* 0x100, 0x120, ..., 0x1e0 */
2598 u8 res_104[0x120-0x104]; 2598 u8 res_104[0x120-0x104];
2599 } srdslnpssr[8]; 2599 } srdslnpssr[8];
2600 u8 res_200[0x800-0x200]; 2600 u8 res_200[0x800-0x200];
2601 struct { 2601 struct {
2602 u32 gcr0; /* 0x800 General Control Register 0 */ 2602 u32 gcr0; /* 0x800 General Control Register 0 */
2603 u32 gcr1; /* 0x804 General Control Register 1 */ 2603 u32 gcr1; /* 0x804 General Control Register 1 */
2604 u32 gcr2; /* 0x808 General Control Register 2 */ 2604 u32 gcr2; /* 0x808 General Control Register 2 */
2605 u32 res_80c; 2605 u32 res_80c;
2606 u32 recr0; /* 0x810 Receive Equalization Control */ 2606 u32 recr0; /* 0x810 Receive Equalization Control */
2607 u32 res_814; 2607 u32 res_814;
2608 u32 tecr0; /* 0x818 Transmit Equalization Control */ 2608 u32 tecr0; /* 0x818 Transmit Equalization Control */
2609 u32 res_81c; 2609 u32 res_81c;
2610 u32 ttlcr0; /* 0x820 Transition Tracking Loop Ctrl 0 */ 2610 u32 ttlcr0; /* 0x820 Transition Tracking Loop Ctrl 0 */
2611 u8 res_824[0x840-0x824]; 2611 u8 res_824[0x840-0x824];
2612 } lane[8]; /* Lane A, B, C, D, E, F, G, H */ 2612 } lane[8]; /* Lane A, B, C, D, E, F, G, H */
2613 u8 res_a00[0x1000-0xa00]; /* from 0xa00 to 0xfff */ 2613 u8 res_a00[0x1000-0xa00]; /* from 0xa00 to 0xfff */
2614 } serdes_corenet_t; 2614 } serdes_corenet_t;
2615 2615
2616 #else /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */ 2616 #else /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */
2617 2617
2618 #define SRDS_MAX_LANES 18 2618 #define SRDS_MAX_LANES 18
2619 #define SRDS_MAX_BANK 3 2619 #define SRDS_MAX_BANK 3
2620 typedef struct serdes_corenet { 2620 typedef struct serdes_corenet {
2621 struct { 2621 struct {
2622 u32 rstctl; /* Reset Control Register */ 2622 u32 rstctl; /* Reset Control Register */
2623 #define SRDS_RSTCTL_RST 0x80000000 2623 #define SRDS_RSTCTL_RST 0x80000000
2624 #define SRDS_RSTCTL_RSTDONE 0x40000000 2624 #define SRDS_RSTCTL_RSTDONE 0x40000000
2625 #define SRDS_RSTCTL_RSTERR 0x20000000 2625 #define SRDS_RSTCTL_RSTERR 0x20000000
2626 #define SRDS_RSTCTL_SDPD 0x00000020 2626 #define SRDS_RSTCTL_SDPD 0x00000020
2627 u32 pllcr0; /* PLL Control Register 0 */ 2627 u32 pllcr0; /* PLL Control Register 0 */
2628 #define SRDS_PLLCR0_RFCK_SEL_MASK 0x70000000 2628 #define SRDS_PLLCR0_RFCK_SEL_MASK 0x70000000
2629 #define SRDS_PLLCR0_PVCOCNT_EN 0x02000000 2629 #define SRDS_PLLCR0_PVCOCNT_EN 0x02000000
2630 #define SRDS_PLLCR0_RFCK_SEL_100 0x00000000 2630 #define SRDS_PLLCR0_RFCK_SEL_100 0x00000000
2631 #define SRDS_PLLCR0_RFCK_SEL_125 0x10000000 2631 #define SRDS_PLLCR0_RFCK_SEL_125 0x10000000
2632 #define SRDS_PLLCR0_RFCK_SEL_156_25 0x20000000 2632 #define SRDS_PLLCR0_RFCK_SEL_156_25 0x20000000
2633 #define SRDS_PLLCR0_RFCK_SEL_150 0x30000000 2633 #define SRDS_PLLCR0_RFCK_SEL_150 0x30000000
2634 #define SRDS_PLLCR0_RFCK_SEL_161_13 0x40000000 2634 #define SRDS_PLLCR0_RFCK_SEL_161_13 0x40000000
2635 #define SRDS_PLLCR0_FRATE_SEL_MASK 0x00030000 2635 #define SRDS_PLLCR0_FRATE_SEL_MASK 0x00030000
2636 #define SRDS_PLLCR0_FRATE_SEL_5 0x00000000 2636 #define SRDS_PLLCR0_FRATE_SEL_5 0x00000000
2637 #define SRDS_PLLCR0_FRATE_SEL_6_25 0x00010000 2637 #define SRDS_PLLCR0_FRATE_SEL_6_25 0x00010000
2638 u32 pllcr1; /* PLL Control Register 1 */ 2638 u32 pllcr1; /* PLL Control Register 1 */
2639 #define SRDS_PLLCR1_PLL_BWSEL 0x08000000 2639 #define SRDS_PLLCR1_PLL_BWSEL 0x08000000
2640 u32 res[5]; 2640 u32 res[5];
2641 } bank[3]; 2641 } bank[3];
2642 u32 res1[12]; 2642 u32 res1[12];
2643 u32 srdstcalcr; /* TX Calibration Control */ 2643 u32 srdstcalcr; /* TX Calibration Control */
2644 u32 res2[3]; 2644 u32 res2[3];
2645 u32 srdsrcalcr; /* RX Calibration Control */ 2645 u32 srdsrcalcr; /* RX Calibration Control */
2646 u32 res3[3]; 2646 u32 res3[3];
2647 u32 srdsgr0; /* General Register 0 */ 2647 u32 srdsgr0; /* General Register 0 */
2648 u32 res4[11]; 2648 u32 res4[11];
2649 u32 srdspccr0; /* Protocol Converter Config 0 */ 2649 u32 srdspccr0; /* Protocol Converter Config 0 */
2650 u32 srdspccr1; /* Protocol Converter Config 1 */ 2650 u32 srdspccr1; /* Protocol Converter Config 1 */
2651 u32 srdspccr2; /* Protocol Converter Config 2 */ 2651 u32 srdspccr2; /* Protocol Converter Config 2 */
2652 #define SRDS_PCCR2_RST_XGMII1 0x00800000 2652 #define SRDS_PCCR2_RST_XGMII1 0x00800000
2653 #define SRDS_PCCR2_RST_XGMII2 0x00400000 2653 #define SRDS_PCCR2_RST_XGMII2 0x00400000
2654 u32 res5[197]; 2654 u32 res5[197];
2655 struct serdes_lane { 2655 struct serdes_lane {
2656 u32 gcr0; /* General Control Register 0 */ 2656 u32 gcr0; /* General Control Register 0 */
2657 #define SRDS_GCR0_RRST 0x00400000 2657 #define SRDS_GCR0_RRST 0x00400000
2658 #define SRDS_GCR0_1STLANE 0x00010000 2658 #define SRDS_GCR0_1STLANE 0x00010000
2659 #define SRDS_GCR0_UOTHL 0x00100000 2659 #define SRDS_GCR0_UOTHL 0x00100000
2660 u32 gcr1; /* General Control Register 1 */ 2660 u32 gcr1; /* General Control Register 1 */
2661 #define SRDS_GCR1_REIDL_CTL_MASK 0x001f0000 2661 #define SRDS_GCR1_REIDL_CTL_MASK 0x001f0000
2662 #define SRDS_GCR1_REIDL_CTL_PCIE 0x00100000 2662 #define SRDS_GCR1_REIDL_CTL_PCIE 0x00100000
2663 #define SRDS_GCR1_REIDL_CTL_SRIO 0x00000000 2663 #define SRDS_GCR1_REIDL_CTL_SRIO 0x00000000
2664 #define SRDS_GCR1_REIDL_CTL_SGMII 0x00040000 2664 #define SRDS_GCR1_REIDL_CTL_SGMII 0x00040000
2665 #define SRDS_GCR1_OPAD_CTL 0x04000000 2665 #define SRDS_GCR1_OPAD_CTL 0x04000000
2666 u32 res1[4]; 2666 u32 res1[4];
2667 u32 tecr0; /* TX Equalization Control Reg 0 */ 2667 u32 tecr0; /* TX Equalization Control Reg 0 */
2668 #define SRDS_TECR0_TEQ_TYPE_MASK 0x30000000 2668 #define SRDS_TECR0_TEQ_TYPE_MASK 0x30000000
2669 #define SRDS_TECR0_TEQ_TYPE_2LVL 0x10000000 2669 #define SRDS_TECR0_TEQ_TYPE_2LVL 0x10000000
2670 u32 res3; 2670 u32 res3;
2671 u32 ttlcr0; /* Transition Tracking Loop Ctrl 0 */ 2671 u32 ttlcr0; /* Transition Tracking Loop Ctrl 0 */
2672 #define SRDS_TTLCR0_FLT_SEL_MASK 0x3f000000 2672 #define SRDS_TTLCR0_FLT_SEL_MASK 0x3f000000
2673 #define SRDS_TTLCR0_FLT_SEL_KFR_26 0x10000000 2673 #define SRDS_TTLCR0_FLT_SEL_KFR_26 0x10000000
2674 #define SRDS_TTLCR0_FLT_SEL_KPH_28 0x08000000 2674 #define SRDS_TTLCR0_FLT_SEL_KPH_28 0x08000000
2675 #define SRDS_TTLCR0_FLT_SEL_750PPM 0x03000000 2675 #define SRDS_TTLCR0_FLT_SEL_750PPM 0x03000000
2676 #define SRDS_TTLCR0_PM_DIS 0x00004000 2676 #define SRDS_TTLCR0_PM_DIS 0x00004000
2677 #define SRDS_TTLCR0_FREQOVD_EN 0x00000001 2677 #define SRDS_TTLCR0_FREQOVD_EN 0x00000001
2678 u32 res4[7]; 2678 u32 res4[7];
2679 } lane[24]; 2679 } lane[24];
2680 u32 res6[384]; 2680 u32 res6[384];
2681 } serdes_corenet_t; 2681 } serdes_corenet_t;
2682 #endif /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */ 2682 #endif /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */
2683 2683
2684 enum { 2684 enum {
2685 FSL_SRDS_B1_LANE_A = 0, 2685 FSL_SRDS_B1_LANE_A = 0,
2686 FSL_SRDS_B1_LANE_B = 1, 2686 FSL_SRDS_B1_LANE_B = 1,
2687 FSL_SRDS_B1_LANE_C = 2, 2687 FSL_SRDS_B1_LANE_C = 2,
2688 FSL_SRDS_B1_LANE_D = 3, 2688 FSL_SRDS_B1_LANE_D = 3,
2689 FSL_SRDS_B1_LANE_E = 4, 2689 FSL_SRDS_B1_LANE_E = 4,
2690 FSL_SRDS_B1_LANE_F = 5, 2690 FSL_SRDS_B1_LANE_F = 5,
2691 FSL_SRDS_B1_LANE_G = 6, 2691 FSL_SRDS_B1_LANE_G = 6,
2692 FSL_SRDS_B1_LANE_H = 7, 2692 FSL_SRDS_B1_LANE_H = 7,
2693 FSL_SRDS_B1_LANE_I = 8, 2693 FSL_SRDS_B1_LANE_I = 8,
2694 FSL_SRDS_B1_LANE_J = 9, 2694 FSL_SRDS_B1_LANE_J = 9,
2695 FSL_SRDS_B2_LANE_A = 16, 2695 FSL_SRDS_B2_LANE_A = 16,
2696 FSL_SRDS_B2_LANE_B = 17, 2696 FSL_SRDS_B2_LANE_B = 17,
2697 FSL_SRDS_B2_LANE_C = 18, 2697 FSL_SRDS_B2_LANE_C = 18,
2698 FSL_SRDS_B2_LANE_D = 19, 2698 FSL_SRDS_B2_LANE_D = 19,
2699 FSL_SRDS_B3_LANE_A = 20, 2699 FSL_SRDS_B3_LANE_A = 20,
2700 FSL_SRDS_B3_LANE_B = 21, 2700 FSL_SRDS_B3_LANE_B = 21,
2701 FSL_SRDS_B3_LANE_C = 22, 2701 FSL_SRDS_B3_LANE_C = 22,
2702 FSL_SRDS_B3_LANE_D = 23, 2702 FSL_SRDS_B3_LANE_D = 23,
2703 }; 2703 };
2704 2704
2705 typedef struct ccsr_qman {
2706 #ifdef CONFIG_SYS_FSL_QMAN_V3
2707 u8 res0[0x200];
2708 #else
2709 struct {
2710 u32 qcsp_lio_cfg; /* 0x0 - SW Portal n LIO cfg */
2711 u32 qcsp_io_cfg; /* 0x4 - SW Portal n IO cfg */
2712 u32 res;
2713 u32 qcsp_dd_cfg; /* 0xc - SW Portal n Dynamic Debug cfg */
2714 } qcsp[32];
2715 #endif
2716 /* Not actually reserved, but irrelevant to u-boot */
2717 u8 res[0xbf8 - 0x200];
2718 u32 ip_rev_1;
2719 u32 ip_rev_2;
2720 u32 fqd_bare; /* FQD Extended Base Addr Register */
2721 u32 fqd_bar; /* FQD Base Addr Register */
2722 u8 res1[0x8];
2723 u32 fqd_ar; /* FQD Attributes Register */
2724 u8 res2[0xc];
2725 u32 pfdr_bare; /* PFDR Extended Base Addr Register */
2726 u32 pfdr_bar; /* PFDR Base Addr Register */
2727 u8 res3[0x8];
2728 u32 pfdr_ar; /* PFDR Attributes Register */
2729 u8 res4[0x4c];
2730 u32 qcsp_bare; /* QCSP Extended Base Addr Register */
2731 u32 qcsp_bar; /* QCSP Base Addr Register */
2732 u8 res5[0x78];
2733 u32 ci_sched_cfg; /* Initiator Scheduling Configuration */
2734 u32 srcidr; /* Source ID Register */
2735 u32 liodnr; /* LIODN Register */
2736 u8 res6[4];
2737 u32 ci_rlm_cfg; /* Initiator Read Latency Monitor Cfg */
2738 u32 ci_rlm_avg; /* Initiator Read Latency Monitor Avg */
2739 u8 res7[0x2e8];
2740 #ifdef CONFIG_SYS_FSL_QMAN_V3
2741 struct {
2742 u32 qcsp_lio_cfg; /* 0x0 - SW Portal n LIO cfg */
2743 u32 qcsp_io_cfg; /* 0x4 - SW Portal n IO cfg */
2744 u32 res;
2745 u32 qcsp_dd_cfg; /* 0xc - SW Portal n Dynamic Debug cfg*/
2746 } qcsp[50];
2747 #endif
2748 } ccsr_qman_t;
2749
2750 typedef struct ccsr_bman {
2751 /* Not actually reserved, but irrelevant to u-boot */
2752 u8 res[0xbf8];
2753 u32 ip_rev_1;
2754 u32 ip_rev_2;
2755 u32 fbpr_bare; /* FBPR Extended Base Addr Register */
2756 u32 fbpr_bar; /* FBPR Base Addr Register */
2757 u8 res1[0x8];
2758 u32 fbpr_ar; /* FBPR Attributes Register */
2759 u8 res2[0xf0];
2760 u32 srcidr; /* Source ID Register */
2761 u32 liodnr; /* LIODN Register */
2762 u8 res7[0x2f4];
2763 } ccsr_bman_t;
2764
2765 typedef struct ccsr_pme { 2705 typedef struct ccsr_pme {
2766 u8 res0[0x804]; 2706 u8 res0[0x804];
2767 u32 liodnbr; /* LIODN Base Register */ 2707 u32 liodnbr; /* LIODN Base Register */
2768 u8 res1[0x1f8]; 2708 u8 res1[0x1f8];
2769 u32 srcidr; /* Source ID Register */ 2709 u32 srcidr; /* Source ID Register */
2770 u8 res2[8]; 2710 u8 res2[8];
2771 u32 liodnr; /* LIODN Register */ 2711 u32 liodnr; /* LIODN Register */
2772 u8 res3[0x1e8]; 2712 u8 res3[0x1e8];
2773 u32 pm_ip_rev_1; /* PME IP Block Revision Reg 1*/ 2713 u32 pm_ip_rev_1; /* PME IP Block Revision Reg 1*/
2774 u32 pm_ip_rev_2; /* PME IP Block Revision Reg 1*/ 2714 u32 pm_ip_rev_2; /* PME IP Block Revision Reg 1*/
2775 u8 res4[0x400]; 2715 u8 res4[0x400];
2776 } ccsr_pme_t; 2716 } ccsr_pme_t;
2777 2717
2778 struct ccsr_pamu { 2718 struct ccsr_pamu {
2779 u32 ppbah; 2719 u32 ppbah;
2780 u32 ppbal; 2720 u32 ppbal;
2781 u32 pplah; 2721 u32 pplah;
2782 u32 pplal; 2722 u32 pplal;
2783 u32 spbah; 2723 u32 spbah;
2784 u32 spbal; 2724 u32 spbal;
2785 u32 splah; 2725 u32 splah;
2786 u32 splal; 2726 u32 splal;
2787 u32 obah; 2727 u32 obah;
2788 u32 obal; 2728 u32 obal;
2789 u32 olah; 2729 u32 olah;
2790 u32 olal; 2730 u32 olal;
2791 }; 2731 };
2792 2732
2793 #ifdef CONFIG_SYS_FSL_RAID_ENGINE 2733 #ifdef CONFIG_SYS_FSL_RAID_ENGINE
2794 struct ccsr_raide { 2734 struct ccsr_raide {
2795 u8 res0[0x543]; 2735 u8 res0[0x543];
2796 u32 liodnbr; /* LIODN Base Register */ 2736 u32 liodnbr; /* LIODN Base Register */
2797 u8 res1[0xab8]; 2737 u8 res1[0xab8];
2798 struct { 2738 struct {
2799 struct { 2739 struct {
2800 u32 cfg0; /* cfg register 0 */ 2740 u32 cfg0; /* cfg register 0 */
2801 u32 cfg1; /* cfg register 1 */ 2741 u32 cfg1; /* cfg register 1 */
2802 u8 res1[0x3f8]; 2742 u8 res1[0x3f8];
2803 } ring[2]; 2743 } ring[2];
2804 u8 res[0x800]; 2744 u8 res[0x800];
2805 } jq[2]; 2745 } jq[2];
2806 }; 2746 };
2807 #endif 2747 #endif
2808 2748
2809 #ifdef CONFIG_SYS_DPAA_RMAN 2749 #ifdef CONFIG_SYS_DPAA_RMAN
2810 struct ccsr_rman { 2750 struct ccsr_rman {
2811 u8 res0[0xf64]; 2751 u8 res0[0xf64];
2812 u32 mmliodnbr; /* Message Manager LIODN Base Register */ 2752 u32 mmliodnbr; /* Message Manager LIODN Base Register */
2813 u32 mmitar; /* RMAN Inbound Translation Address Register */ 2753 u32 mmitar; /* RMAN Inbound Translation Address Register */
2814 u32 mmitdr; /* RMAN Inbound Translation Data Register */ 2754 u32 mmitdr; /* RMAN Inbound Translation Data Register */
2815 u8 res4[0x1f090]; 2755 u8 res4[0x1f090];
2816 }; 2756 };
2817 #endif 2757 #endif
2818 2758
2819 #ifdef CONFIG_SYS_PMAN 2759 #ifdef CONFIG_SYS_PMAN
2820 struct ccsr_pman { 2760 struct ccsr_pman {
2821 u8 res_00[0x40]; 2761 u8 res_00[0x40];
2822 u32 poes1; /* PMAN Operation Error Status Register 1 */ 2762 u32 poes1; /* PMAN Operation Error Status Register 1 */
2823 u32 poes2; /* PMAN Operation Error Status Register 2 */ 2763 u32 poes2; /* PMAN Operation Error Status Register 2 */
2824 u32 poeah; /* PMAN Operation Error Address High */ 2764 u32 poeah; /* PMAN Operation Error Address High */
2825 u32 poeal; /* PMAN Operation Error Address Low */ 2765 u32 poeal; /* PMAN Operation Error Address Low */
2826 u8 res_50[0x50]; 2766 u8 res_50[0x50];
2827 u32 pr1; /* PMAN Revision Register 1 */ 2767 u32 pr1; /* PMAN Revision Register 1 */
2828 u32 pr2; /* PMAN Revision Register 2 */ 2768 u32 pr2; /* PMAN Revision Register 2 */
2829 u8 res_a8[0x8]; 2769 u8 res_a8[0x8];
2830 u32 pcap; /* PMAN Capabilities Register */ 2770 u32 pcap; /* PMAN Capabilities Register */
2831 u8 res_b4[0xc]; 2771 u8 res_b4[0xc];
2832 u32 pc1; /* PMAN Control Register 1 */ 2772 u32 pc1; /* PMAN Control Register 1 */
2833 u32 pc2; /* PMAN Control Register 2 */ 2773 u32 pc2; /* PMAN Control Register 2 */
2834 u32 pc3; /* PMAN Control Register 3 */ 2774 u32 pc3; /* PMAN Control Register 3 */
2835 u32 pc4; /* PMAN Control Register 4 */ 2775 u32 pc4; /* PMAN Control Register 4 */
2836 u32 pc5; /* PMAN Control Register 5 */ 2776 u32 pc5; /* PMAN Control Register 5 */
2837 u32 pc6; /* PMAN Control Register 6 */ 2777 u32 pc6; /* PMAN Control Register 6 */
2838 u8 res_d8[0x8]; 2778 u8 res_d8[0x8];
2839 u32 ppa1; /* PMAN Prefetch Attributes Register 1 */ 2779 u32 ppa1; /* PMAN Prefetch Attributes Register 1 */
2840 u32 ppa2; /* PMAN Prefetch Attributes Register 2 */ 2780 u32 ppa2; /* PMAN Prefetch Attributes Register 2 */
2841 u8 res_e8[0x8]; 2781 u8 res_e8[0x8];
2842 u32 pics; /* PMAN Interrupt Control and Status */ 2782 u32 pics; /* PMAN Interrupt Control and Status */
2843 u8 res_f4[0xf0c]; 2783 u8 res_f4[0xf0c];
2844 }; 2784 };
2845 #endif 2785 #endif
2846 2786
2847 #ifdef CONFIG_FSL_CORENET 2787 #ifdef CONFIG_FSL_CORENET
2848 #define CONFIG_SYS_FSL_CORENET_CCM_OFFSET 0x0000 2788 #define CONFIG_SYS_FSL_CORENET_CCM_OFFSET 0x0000
2849 #ifdef CONFIG_SYS_PMAN 2789 #ifdef CONFIG_SYS_PMAN
2850 #define CONFIG_SYS_FSL_CORENET_PMAN1_OFFSET 0x4000 2790 #define CONFIG_SYS_FSL_CORENET_PMAN1_OFFSET 0x4000
2851 #define CONFIG_SYS_FSL_CORENET_PMAN2_OFFSET 0x5000 2791 #define CONFIG_SYS_FSL_CORENET_PMAN2_OFFSET 0x5000
2852 #define CONFIG_SYS_FSL_CORENET_PMAN3_OFFSET 0x6000 2792 #define CONFIG_SYS_FSL_CORENET_PMAN3_OFFSET 0x6000
2853 #endif 2793 #endif
2854 #define CONFIG_SYS_MPC8xxx_DDR_OFFSET 0x8000 2794 #define CONFIG_SYS_MPC8xxx_DDR_OFFSET 0x8000
2855 #define CONFIG_SYS_MPC8xxx_DDR2_OFFSET 0x9000 2795 #define CONFIG_SYS_MPC8xxx_DDR2_OFFSET 0x9000
2856 #define CONFIG_SYS_MPC8xxx_DDR3_OFFSET 0xA000 2796 #define CONFIG_SYS_MPC8xxx_DDR3_OFFSET 0xA000
2857 #define CONFIG_SYS_FSL_CORENET_CLK_OFFSET 0xE1000 2797 #define CONFIG_SYS_FSL_CORENET_CLK_OFFSET 0xE1000
2858 #define CONFIG_SYS_FSL_CORENET_RCPM_OFFSET 0xE2000 2798 #define CONFIG_SYS_FSL_CORENET_RCPM_OFFSET 0xE2000
2859 #ifdef CONFIG_SYS_FSL_SFP_VER_3_0 2799 #ifdef CONFIG_SYS_FSL_SFP_VER_3_0
2860 /* In SFPv3, OSPR register is now at offset 0x200. 2800 /* In SFPv3, OSPR register is now at offset 0x200.
2861 * * So directly mapping sfp register map to this address */ 2801 * * So directly mapping sfp register map to this address */
2862 #define CONFIG_SYS_OSPR_OFFSET 0x200 2802 #define CONFIG_SYS_OSPR_OFFSET 0x200
2863 #define CONFIG_SYS_SFP_OFFSET (0xE8000 + CONFIG_SYS_OSPR_OFFSET) 2803 #define CONFIG_SYS_SFP_OFFSET (0xE8000 + CONFIG_SYS_OSPR_OFFSET)
2864 #else 2804 #else
2865 #define CONFIG_SYS_SFP_OFFSET 0xE8000 2805 #define CONFIG_SYS_SFP_OFFSET 0xE8000
2866 #endif 2806 #endif
2867 #define CONFIG_SYS_FSL_CORENET_SERDES_OFFSET 0xEA000 2807 #define CONFIG_SYS_FSL_CORENET_SERDES_OFFSET 0xEA000
2868 #define CONFIG_SYS_FSL_CORENET_SERDES2_OFFSET 0xEB000 2808 #define CONFIG_SYS_FSL_CORENET_SERDES2_OFFSET 0xEB000
2869 #define CONFIG_SYS_FSL_CORENET_SERDES3_OFFSET 0xEC000 2809 #define CONFIG_SYS_FSL_CORENET_SERDES3_OFFSET 0xEC000
2870 #define CONFIG_SYS_FSL_CORENET_SERDES4_OFFSET 0xED000 2810 #define CONFIG_SYS_FSL_CORENET_SERDES4_OFFSET 0xED000
2871 #define CONFIG_SYS_FSL_CPC_OFFSET 0x10000 2811 #define CONFIG_SYS_FSL_CPC_OFFSET 0x10000
2872 #define CONFIG_SYS_FSL_SCFG_OFFSET 0xFC000 2812 #define CONFIG_SYS_FSL_SCFG_OFFSET 0xFC000
2873 #define CONFIG_SYS_FSL_PAMU_OFFSET 0x20000 2813 #define CONFIG_SYS_FSL_PAMU_OFFSET 0x20000
2874 #define CONFIG_SYS_MPC85xx_DMA1_OFFSET 0x100000 2814 #define CONFIG_SYS_MPC85xx_DMA1_OFFSET 0x100000
2875 #define CONFIG_SYS_MPC85xx_DMA2_OFFSET 0x101000 2815 #define CONFIG_SYS_MPC85xx_DMA2_OFFSET 0x101000
2876 #define CONFIG_SYS_MPC85xx_DMA3_OFFSET 0x102000 2816 #define CONFIG_SYS_MPC85xx_DMA3_OFFSET 0x102000
2877 #define CONFIG_SYS_MPC85xx_DMA_OFFSET CONFIG_SYS_MPC85xx_DMA1_OFFSET 2817 #define CONFIG_SYS_MPC85xx_DMA_OFFSET CONFIG_SYS_MPC85xx_DMA1_OFFSET
2878 #define CONFIG_SYS_MPC85xx_ESPI_OFFSET 0x110000 2818 #define CONFIG_SYS_MPC85xx_ESPI_OFFSET 0x110000
2879 #define CONFIG_SYS_MPC85xx_ESDHC_OFFSET 0x114000 2819 #define CONFIG_SYS_MPC85xx_ESDHC_OFFSET 0x114000
2880 #define CONFIG_SYS_MPC85xx_LBC_OFFSET 0x124000 2820 #define CONFIG_SYS_MPC85xx_LBC_OFFSET 0x124000
2881 #define CONFIG_SYS_MPC85xx_IFC_OFFSET 0x124000 2821 #define CONFIG_SYS_MPC85xx_IFC_OFFSET 0x124000
2882 #define CONFIG_SYS_MPC85xx_GPIO_OFFSET 0x130000 2822 #define CONFIG_SYS_MPC85xx_GPIO_OFFSET 0x130000
2883 #define CONFIG_SYS_MPC85xx_TDM_OFFSET 0x185000 2823 #define CONFIG_SYS_MPC85xx_TDM_OFFSET 0x185000
2884 #define CONFIG_SYS_MPC85xx_QE_OFFSET 0x140000 2824 #define CONFIG_SYS_MPC85xx_QE_OFFSET 0x140000
2885 #define CONFIG_SYS_FSL_CORENET_RMAN_OFFSET 0x1e0000 2825 #define CONFIG_SYS_FSL_CORENET_RMAN_OFFSET 0x1e0000
2886 #if defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && !defined(CONFIG_ARCH_B4860) && \ 2826 #if defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2) && !defined(CONFIG_ARCH_B4860) && \
2887 !defined(CONFIG_ARCH_B4420) 2827 !defined(CONFIG_ARCH_B4420)
2888 #define CONFIG_SYS_MPC85xx_PCIE1_OFFSET 0x240000 2828 #define CONFIG_SYS_MPC85xx_PCIE1_OFFSET 0x240000
2889 #define CONFIG_SYS_MPC85xx_PCIE2_OFFSET 0x250000 2829 #define CONFIG_SYS_MPC85xx_PCIE2_OFFSET 0x250000
2890 #define CONFIG_SYS_MPC85xx_PCIE3_OFFSET 0x260000 2830 #define CONFIG_SYS_MPC85xx_PCIE3_OFFSET 0x260000
2891 #define CONFIG_SYS_MPC85xx_PCIE4_OFFSET 0x270000 2831 #define CONFIG_SYS_MPC85xx_PCIE4_OFFSET 0x270000
2892 #else 2832 #else
2893 #define CONFIG_SYS_MPC85xx_PCIE1_OFFSET 0x200000 2833 #define CONFIG_SYS_MPC85xx_PCIE1_OFFSET 0x200000
2894 #define CONFIG_SYS_MPC85xx_PCIE2_OFFSET 0x201000 2834 #define CONFIG_SYS_MPC85xx_PCIE2_OFFSET 0x201000
2895 #define CONFIG_SYS_MPC85xx_PCIE3_OFFSET 0x202000 2835 #define CONFIG_SYS_MPC85xx_PCIE3_OFFSET 0x202000
2896 #define CONFIG_SYS_MPC85xx_PCIE4_OFFSET 0x203000 2836 #define CONFIG_SYS_MPC85xx_PCIE4_OFFSET 0x203000
2897 #endif 2837 #endif
2898 #define CONFIG_SYS_MPC85xx_USB1_OFFSET 0x210000 2838 #define CONFIG_SYS_MPC85xx_USB1_OFFSET 0x210000
2899 #define CONFIG_SYS_MPC85xx_USB2_OFFSET 0x211000 2839 #define CONFIG_SYS_MPC85xx_USB2_OFFSET 0x211000
2900 #define CONFIG_SYS_MPC85xx_USB1_PHY_OFFSET 0x214000 2840 #define CONFIG_SYS_MPC85xx_USB1_PHY_OFFSET 0x214000
2901 #define CONFIG_SYS_MPC85xx_USB2_PHY_OFFSET 0x214100 2841 #define CONFIG_SYS_MPC85xx_USB2_PHY_OFFSET 0x214100
2902 #define CONFIG_SYS_MPC85xx_SATA1_OFFSET 0x220000 2842 #define CONFIG_SYS_MPC85xx_SATA1_OFFSET 0x220000
2903 #define CONFIG_SYS_MPC85xx_SATA2_OFFSET 0x221000 2843 #define CONFIG_SYS_MPC85xx_SATA2_OFFSET 0x221000
2904 #define CONFIG_SYS_FSL_SEC_OFFSET 0x300000 2844 #define CONFIG_SYS_FSL_SEC_OFFSET 0x300000
2905 #define CONFIG_SYS_FSL_JR0_OFFSET 0x301000 2845 #define CONFIG_SYS_FSL_JR0_OFFSET 0x301000
2906 #define CONFIG_SYS_SEC_MON_OFFSET 0x314000 2846 #define CONFIG_SYS_SEC_MON_OFFSET 0x314000
2907 #define CONFIG_SYS_FSL_CORENET_PME_OFFSET 0x316000 2847 #define CONFIG_SYS_FSL_CORENET_PME_OFFSET 0x316000
2908 #define CONFIG_SYS_FSL_QMAN_OFFSET 0x318000 2848 #define CONFIG_SYS_FSL_QMAN_OFFSET 0x318000
2909 #define CONFIG_SYS_FSL_BMAN_OFFSET 0x31a000 2849 #define CONFIG_SYS_FSL_BMAN_OFFSET 0x31a000
2910 #define CONFIG_SYS_FSL_RAID_ENGINE_OFFSET 0x320000 2850 #define CONFIG_SYS_FSL_RAID_ENGINE_OFFSET 0x320000
2911 #define CONFIG_SYS_FSL_FM1_OFFSET 0x400000 2851 #define CONFIG_SYS_FSL_FM1_OFFSET 0x400000
2912 #define CONFIG_SYS_FSL_FM1_RX0_1G_OFFSET 0x488000 2852 #define CONFIG_SYS_FSL_FM1_RX0_1G_OFFSET 0x488000
2913 #define CONFIG_SYS_FSL_FM1_RX1_1G_OFFSET 0x489000 2853 #define CONFIG_SYS_FSL_FM1_RX1_1G_OFFSET 0x489000
2914 #define CONFIG_SYS_FSL_FM1_RX2_1G_OFFSET 0x48a000 2854 #define CONFIG_SYS_FSL_FM1_RX2_1G_OFFSET 0x48a000
2915 #define CONFIG_SYS_FSL_FM1_RX3_1G_OFFSET 0x48b000 2855 #define CONFIG_SYS_FSL_FM1_RX3_1G_OFFSET 0x48b000
2916 #define CONFIG_SYS_FSL_FM1_RX4_1G_OFFSET 0x48c000 2856 #define CONFIG_SYS_FSL_FM1_RX4_1G_OFFSET 0x48c000
2917 #define CONFIG_SYS_FSL_FM1_RX5_1G_OFFSET 0x48d000 2857 #define CONFIG_SYS_FSL_FM1_RX5_1G_OFFSET 0x48d000
2918 #define CONFIG_SYS_FSL_FM1_RX0_10G_OFFSET 0x490000 2858 #define CONFIG_SYS_FSL_FM1_RX0_10G_OFFSET 0x490000
2919 #define CONFIG_SYS_FSL_FM1_RX1_10G_OFFSET 0x491000 2859 #define CONFIG_SYS_FSL_FM1_RX1_10G_OFFSET 0x491000
2920 #define CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET 0x4e0000 2860 #define CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET 0x4e0000
2921 #define CONFIG_SYS_FSL_FM2_OFFSET 0x500000 2861 #define CONFIG_SYS_FSL_FM2_OFFSET 0x500000
2922 #define CONFIG_SYS_FSL_FM2_RX0_1G_OFFSET 0x588000 2862 #define CONFIG_SYS_FSL_FM2_RX0_1G_OFFSET 0x588000
2923 #define CONFIG_SYS_FSL_FM2_RX1_1G_OFFSET 0x589000 2863 #define CONFIG_SYS_FSL_FM2_RX1_1G_OFFSET 0x589000
2924 #define CONFIG_SYS_FSL_FM2_RX2_1G_OFFSET 0x58a000 2864 #define CONFIG_SYS_FSL_FM2_RX2_1G_OFFSET 0x58a000
2925 #define CONFIG_SYS_FSL_FM2_RX3_1G_OFFSET 0x58b000 2865 #define CONFIG_SYS_FSL_FM2_RX3_1G_OFFSET 0x58b000
2926 #define CONFIG_SYS_FSL_FM2_RX4_1G_OFFSET 0x58c000 2866 #define CONFIG_SYS_FSL_FM2_RX4_1G_OFFSET 0x58c000
2927 #define CONFIG_SYS_FSL_FM2_RX5_1G_OFFSET 0x58d000 2867 #define CONFIG_SYS_FSL_FM2_RX5_1G_OFFSET 0x58d000
2928 #define CONFIG_SYS_FSL_FM2_RX0_10G_OFFSET 0x590000 2868 #define CONFIG_SYS_FSL_FM2_RX0_10G_OFFSET 0x590000
2929 #define CONFIG_SYS_FSL_FM2_RX1_10G_OFFSET 0x591000 2869 #define CONFIG_SYS_FSL_FM2_RX1_10G_OFFSET 0x591000
2930 #define CONFIG_SYS_FSL_CLUSTER_1_L2_OFFSET 0xC20000 2870 #define CONFIG_SYS_FSL_CLUSTER_1_L2_OFFSET 0xC20000
2931 #else 2871 #else
2932 #define CONFIG_SYS_MPC85xx_ECM_OFFSET 0x0000 2872 #define CONFIG_SYS_MPC85xx_ECM_OFFSET 0x0000
2933 #define CONFIG_SYS_MPC8xxx_DDR_OFFSET 0x2000 2873 #define CONFIG_SYS_MPC8xxx_DDR_OFFSET 0x2000
2934 #define CONFIG_SYS_MPC85xx_LBC_OFFSET 0x5000 2874 #define CONFIG_SYS_MPC85xx_LBC_OFFSET 0x5000
2935 #define CONFIG_SYS_MPC8xxx_DDR2_OFFSET 0x6000 2875 #define CONFIG_SYS_MPC8xxx_DDR2_OFFSET 0x6000
2936 #define CONFIG_SYS_MPC85xx_ESPI_OFFSET 0x7000 2876 #define CONFIG_SYS_MPC85xx_ESPI_OFFSET 0x7000
2937 #define CONFIG_SYS_MPC85xx_PCI1_OFFSET 0x8000 2877 #define CONFIG_SYS_MPC85xx_PCI1_OFFSET 0x8000
2938 #define CONFIG_SYS_MPC85xx_PCIX_OFFSET 0x8000 2878 #define CONFIG_SYS_MPC85xx_PCIX_OFFSET 0x8000
2939 #define CONFIG_SYS_MPC85xx_PCI2_OFFSET 0x9000 2879 #define CONFIG_SYS_MPC85xx_PCI2_OFFSET 0x9000
2940 #define CONFIG_SYS_MPC85xx_PCIX2_OFFSET 0x9000 2880 #define CONFIG_SYS_MPC85xx_PCIX2_OFFSET 0x9000
2941 #define CONFIG_SYS_MPC85xx_PCIE1_OFFSET 0xa000 2881 #define CONFIG_SYS_MPC85xx_PCIE1_OFFSET 0xa000
2942 #define CONFIG_SYS_MPC85xx_PCIE2_OFFSET 0x9000 2882 #define CONFIG_SYS_MPC85xx_PCIE2_OFFSET 0x9000
2943 #if defined(CONFIG_ARCH_MPC8572) || defined(CONFIG_ARCH_P2020) 2883 #if defined(CONFIG_ARCH_MPC8572) || defined(CONFIG_ARCH_P2020)
2944 #define CONFIG_SYS_MPC85xx_PCIE3_OFFSET 0x8000 2884 #define CONFIG_SYS_MPC85xx_PCIE3_OFFSET 0x8000
2945 #else 2885 #else
2946 #define CONFIG_SYS_MPC85xx_PCIE3_OFFSET 0xb000 2886 #define CONFIG_SYS_MPC85xx_PCIE3_OFFSET 0xb000
2947 #endif 2887 #endif
2948 #define CONFIG_SYS_MPC85xx_GPIO_OFFSET 0xF000 2888 #define CONFIG_SYS_MPC85xx_GPIO_OFFSET 0xF000
2949 #define CONFIG_SYS_MPC85xx_SATA1_OFFSET 0x18000 2889 #define CONFIG_SYS_MPC85xx_SATA1_OFFSET 0x18000
2950 #define CONFIG_SYS_MPC85xx_SATA2_OFFSET 0x19000 2890 #define CONFIG_SYS_MPC85xx_SATA2_OFFSET 0x19000
2951 #define CONFIG_SYS_MPC85xx_IFC_OFFSET 0x1e000 2891 #define CONFIG_SYS_MPC85xx_IFC_OFFSET 0x1e000
2952 #define CONFIG_SYS_MPC85xx_L2_OFFSET 0x20000 2892 #define CONFIG_SYS_MPC85xx_L2_OFFSET 0x20000
2953 #define CONFIG_SYS_MPC85xx_DMA_OFFSET 0x21000 2893 #define CONFIG_SYS_MPC85xx_DMA_OFFSET 0x21000
2954 #define CONFIG_SYS_MPC85xx_USB1_OFFSET 0x22000 2894 #define CONFIG_SYS_MPC85xx_USB1_OFFSET 0x22000
2955 #define CONFIG_SYS_MPC85xx_USB2_OFFSET 0x23000 2895 #define CONFIG_SYS_MPC85xx_USB2_OFFSET 0x23000
2956 #define CONFIG_SYS_MPC85xx_USB1_PHY_OFFSET 0xE5000 2896 #define CONFIG_SYS_MPC85xx_USB1_PHY_OFFSET 0xE5000
2957 #define CONFIG_SYS_MPC85xx_USB2_PHY_OFFSET 0xE5100 2897 #define CONFIG_SYS_MPC85xx_USB2_PHY_OFFSET 0xE5100
2958 #ifdef CONFIG_TSECV2 2898 #ifdef CONFIG_TSECV2
2959 #define CONFIG_SYS_TSEC1_OFFSET 0xB0000 2899 #define CONFIG_SYS_TSEC1_OFFSET 0xB0000
2960 #elif defined(CONFIG_TSECV2_1) 2900 #elif defined(CONFIG_TSECV2_1)
2961 #define CONFIG_SYS_TSEC1_OFFSET 0x10000 2901 #define CONFIG_SYS_TSEC1_OFFSET 0x10000
2962 #else 2902 #else
2963 #define CONFIG_SYS_TSEC1_OFFSET 0x24000 2903 #define CONFIG_SYS_TSEC1_OFFSET 0x24000
2964 #endif 2904 #endif
2965 #define CONFIG_SYS_MDIO1_OFFSET 0x24000 2905 #define CONFIG_SYS_MDIO1_OFFSET 0x24000
2966 #define CONFIG_SYS_MPC85xx_ESDHC_OFFSET 0x2e000 2906 #define CONFIG_SYS_MPC85xx_ESDHC_OFFSET 0x2e000
2967 #if defined(CONFIG_ARCH_C29X) 2907 #if defined(CONFIG_ARCH_C29X)
2968 #define CONFIG_SYS_FSL_SEC_OFFSET 0x80000 2908 #define CONFIG_SYS_FSL_SEC_OFFSET 0x80000
2969 #define CONFIG_SYS_FSL_JR0_OFFSET 0x81000 2909 #define CONFIG_SYS_FSL_JR0_OFFSET 0x81000
2970 #else 2910 #else
2971 #define CONFIG_SYS_FSL_SEC_OFFSET 0x30000 2911 #define CONFIG_SYS_FSL_SEC_OFFSET 0x30000
2972 #define CONFIG_SYS_FSL_JR0_OFFSET 0x31000 2912 #define CONFIG_SYS_FSL_JR0_OFFSET 0x31000
2973 #endif 2913 #endif
2974 #define CONFIG_SYS_MPC85xx_SERDES2_OFFSET 0xE3100 2914 #define CONFIG_SYS_MPC85xx_SERDES2_OFFSET 0xE3100
2975 #define CONFIG_SYS_MPC85xx_SERDES1_OFFSET 0xE3000 2915 #define CONFIG_SYS_MPC85xx_SERDES1_OFFSET 0xE3000
2976 #define CONFIG_SYS_SEC_MON_OFFSET 0xE6000 2916 #define CONFIG_SYS_SEC_MON_OFFSET 0xE6000
2977 #define CONFIG_SYS_SFP_OFFSET 0xE7000 2917 #define CONFIG_SYS_SFP_OFFSET 0xE7000
2978 #define CONFIG_SYS_MPC85xx_CPM_OFFSET 0x80000 2918 #define CONFIG_SYS_MPC85xx_CPM_OFFSET 0x80000
2979 #define CONFIG_SYS_FSL_QMAN_OFFSET 0x88000 2919 #define CONFIG_SYS_FSL_QMAN_OFFSET 0x88000
2980 #define CONFIG_SYS_FSL_BMAN_OFFSET 0x8a000 2920 #define CONFIG_SYS_FSL_BMAN_OFFSET 0x8a000
2981 #define CONFIG_SYS_FSL_FM1_OFFSET 0x100000 2921 #define CONFIG_SYS_FSL_FM1_OFFSET 0x100000
2982 #define CONFIG_SYS_FSL_FM1_RX0_1G_OFFSET 0x188000 2922 #define CONFIG_SYS_FSL_FM1_RX0_1G_OFFSET 0x188000
2983 #define CONFIG_SYS_FSL_FM1_RX1_1G_OFFSET 0x189000 2923 #define CONFIG_SYS_FSL_FM1_RX1_1G_OFFSET 0x189000
2984 #define CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET 0x1e0000 2924 #define CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET 0x1e0000
2985 #endif 2925 #endif
2986 2926
2987 #define CONFIG_SYS_MPC85xx_PIC_OFFSET 0x40000 2927 #define CONFIG_SYS_MPC85xx_PIC_OFFSET 0x40000
2988 #define CONFIG_SYS_MPC85xx_GUTS_OFFSET 0xE0000 2928 #define CONFIG_SYS_MPC85xx_GUTS_OFFSET 0xE0000
2989 #define CONFIG_SYS_FSL_SRIO_OFFSET 0xC0000 2929 #define CONFIG_SYS_FSL_SRIO_OFFSET 0xC0000
2990 2930
2991 #if defined(CONFIG_ARCH_BSC9132) 2931 #if defined(CONFIG_ARCH_BSC9132)
2992 #define CONFIG_SYS_FSL_DSP_CCSR_DDR_OFFSET 0x10000 2932 #define CONFIG_SYS_FSL_DSP_CCSR_DDR_OFFSET 0x10000
2993 #define CONFIG_SYS_FSL_DSP_CCSR_DDR_ADDR \ 2933 #define CONFIG_SYS_FSL_DSP_CCSR_DDR_ADDR \
2994 (CONFIG_SYS_FSL_DSP_CCSRBAR + CONFIG_SYS_FSL_DSP_CCSR_DDR_OFFSET) 2934 (CONFIG_SYS_FSL_DSP_CCSRBAR + CONFIG_SYS_FSL_DSP_CCSR_DDR_OFFSET)
2995 #endif 2935 #endif
2996 2936
2997 #define CONFIG_SYS_FSL_CPC_ADDR \ 2937 #define CONFIG_SYS_FSL_CPC_ADDR \
2998 (CONFIG_SYS_CCSRBAR + CONFIG_SYS_FSL_CPC_OFFSET) 2938 (CONFIG_SYS_CCSRBAR + CONFIG_SYS_FSL_CPC_OFFSET)
2999 #define CONFIG_SYS_FSL_SCFG_ADDR \ 2939 #define CONFIG_SYS_FSL_SCFG_ADDR \
3000 (CONFIG_SYS_CCSRBAR + CONFIG_SYS_FSL_SCFG_OFFSET) 2940 (CONFIG_SYS_CCSRBAR + CONFIG_SYS_FSL_SCFG_OFFSET)
3001 #define CONFIG_SYS_FSL_SCFG_PIXCLK_ADDR \ 2941 #define CONFIG_SYS_FSL_SCFG_PIXCLK_ADDR \
3002 (CONFIG_SYS_FSL_SCFG_ADDR + CONFIG_SYS_FSL_SCFG_PIXCLKCR_OFFSET) 2942 (CONFIG_SYS_FSL_SCFG_ADDR + CONFIG_SYS_FSL_SCFG_PIXCLKCR_OFFSET)
3003 #define CONFIG_SYS_FSL_SCFG_IODSECR1_ADDR \ 2943 #define CONFIG_SYS_FSL_SCFG_IODSECR1_ADDR \
3004 (CONFIG_SYS_FSL_SCFG_ADDR + CONFIG_SYS_FSL_SCFG_IODSECR1_OFFSET) 2944 (CONFIG_SYS_FSL_SCFG_ADDR + CONFIG_SYS_FSL_SCFG_IODSECR1_OFFSET)
3005 #define CONFIG_SYS_FSL_QMAN_ADDR \ 2945 #define CONFIG_SYS_FSL_QMAN_ADDR \
3006 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_QMAN_OFFSET) 2946 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_QMAN_OFFSET)
3007 #define CONFIG_SYS_FSL_BMAN_ADDR \ 2947 #define CONFIG_SYS_FSL_BMAN_ADDR \
3008 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_BMAN_OFFSET) 2948 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_BMAN_OFFSET)
3009 #define CONFIG_SYS_FSL_CORENET_PME_ADDR \ 2949 #define CONFIG_SYS_FSL_CORENET_PME_ADDR \
3010 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_PME_OFFSET) 2950 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_PME_OFFSET)
3011 #define CONFIG_SYS_FSL_RAID_ENGINE_ADDR \ 2951 #define CONFIG_SYS_FSL_RAID_ENGINE_ADDR \
3012 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_RAID_ENGINE_OFFSET) 2952 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_RAID_ENGINE_OFFSET)
3013 #define CONFIG_SYS_FSL_CORENET_RMAN_ADDR \ 2953 #define CONFIG_SYS_FSL_CORENET_RMAN_ADDR \
3014 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_RMAN_OFFSET) 2954 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_RMAN_OFFSET)
3015 #define CONFIG_SYS_MPC85xx_GUTS_ADDR \ 2955 #define CONFIG_SYS_MPC85xx_GUTS_ADDR \
3016 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_GUTS_OFFSET) 2956 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_GUTS_OFFSET)
3017 #define CONFIG_SYS_FSL_CORENET_CCM_ADDR \ 2957 #define CONFIG_SYS_FSL_CORENET_CCM_ADDR \
3018 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_CCM_OFFSET) 2958 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_CCM_OFFSET)
3019 #define CONFIG_SYS_FSL_CORENET_CLK_ADDR \ 2959 #define CONFIG_SYS_FSL_CORENET_CLK_ADDR \
3020 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_CLK_OFFSET) 2960 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_CLK_OFFSET)
3021 #define CONFIG_SYS_FSL_CORENET_RCPM_ADDR \ 2961 #define CONFIG_SYS_FSL_CORENET_RCPM_ADDR \
3022 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_RCPM_OFFSET) 2962 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_RCPM_OFFSET)
3023 #define CONFIG_SYS_MPC85xx_ECM_ADDR \ 2963 #define CONFIG_SYS_MPC85xx_ECM_ADDR \
3024 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_ECM_OFFSET) 2964 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_ECM_OFFSET)
3025 #define CONFIG_SYS_FSL_DDR_ADDR \ 2965 #define CONFIG_SYS_FSL_DDR_ADDR \
3026 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC8xxx_DDR_OFFSET) 2966 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC8xxx_DDR_OFFSET)
3027 #define CONFIG_SYS_FSL_DDR2_ADDR \ 2967 #define CONFIG_SYS_FSL_DDR2_ADDR \
3028 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC8xxx_DDR2_OFFSET) 2968 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC8xxx_DDR2_OFFSET)
3029 #define CONFIG_SYS_FSL_DDR3_ADDR \ 2969 #define CONFIG_SYS_FSL_DDR3_ADDR \
3030 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC8xxx_DDR3_OFFSET) 2970 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC8xxx_DDR3_OFFSET)
3031 #define CONFIG_SYS_LBC_ADDR \ 2971 #define CONFIG_SYS_LBC_ADDR \
3032 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_LBC_OFFSET) 2972 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_LBC_OFFSET)
3033 #define CONFIG_SYS_IFC_ADDR \ 2973 #define CONFIG_SYS_IFC_ADDR \
3034 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_IFC_OFFSET) 2974 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_IFC_OFFSET)
3035 #define CONFIG_SYS_MPC85xx_ESPI_ADDR \ 2975 #define CONFIG_SYS_MPC85xx_ESPI_ADDR \
3036 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_ESPI_OFFSET) 2976 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_ESPI_OFFSET)
3037 #define CONFIG_SYS_MPC85xx_PCIX_ADDR \ 2977 #define CONFIG_SYS_MPC85xx_PCIX_ADDR \
3038 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCIX_OFFSET) 2978 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCIX_OFFSET)
3039 #define CONFIG_SYS_MPC85xx_PCIX2_ADDR \ 2979 #define CONFIG_SYS_MPC85xx_PCIX2_ADDR \
3040 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCIX2_OFFSET) 2980 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCIX2_OFFSET)
3041 #define CONFIG_SYS_MPC85xx_GPIO_ADDR \ 2981 #define CONFIG_SYS_MPC85xx_GPIO_ADDR \
3042 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_GPIO_OFFSET) 2982 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_GPIO_OFFSET)
3043 #define CONFIG_SYS_MPC85xx_SATA1_ADDR \ 2983 #define CONFIG_SYS_MPC85xx_SATA1_ADDR \
3044 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_SATA1_OFFSET) 2984 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_SATA1_OFFSET)
3045 #define CONFIG_SYS_MPC85xx_SATA2_ADDR \ 2985 #define CONFIG_SYS_MPC85xx_SATA2_ADDR \
3046 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_SATA2_OFFSET) 2986 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_SATA2_OFFSET)
3047 #define CONFIG_SYS_MPC85xx_L2_ADDR \ 2987 #define CONFIG_SYS_MPC85xx_L2_ADDR \
3048 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_L2_OFFSET) 2988 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_L2_OFFSET)
3049 #define CONFIG_SYS_MPC85xx_DMA_ADDR \ 2989 #define CONFIG_SYS_MPC85xx_DMA_ADDR \
3050 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_DMA_OFFSET) 2990 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_DMA_OFFSET)
3051 #define CONFIG_SYS_MPC85xx_ESDHC_ADDR \ 2991 #define CONFIG_SYS_MPC85xx_ESDHC_ADDR \
3052 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_ESDHC_OFFSET) 2992 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_ESDHC_OFFSET)
3053 #define CONFIG_SYS_MPC8xxx_PIC_ADDR \ 2993 #define CONFIG_SYS_MPC8xxx_PIC_ADDR \
3054 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PIC_OFFSET) 2994 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PIC_OFFSET)
3055 #define CONFIG_SYS_MPC85xx_CPM_ADDR \ 2995 #define CONFIG_SYS_MPC85xx_CPM_ADDR \
3056 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_CPM_OFFSET) 2996 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_CPM_OFFSET)
3057 #define CONFIG_SYS_MPC85xx_SERDES1_ADDR \ 2997 #define CONFIG_SYS_MPC85xx_SERDES1_ADDR \
3058 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_SERDES1_OFFSET) 2998 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_SERDES1_OFFSET)
3059 #define CONFIG_SYS_MPC85xx_SERDES2_ADDR \ 2999 #define CONFIG_SYS_MPC85xx_SERDES2_ADDR \
3060 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_SERDES2_OFFSET) 3000 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_SERDES2_OFFSET)
3061 #define CONFIG_SYS_FSL_CORENET_SERDES_ADDR \ 3001 #define CONFIG_SYS_FSL_CORENET_SERDES_ADDR \
3062 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_SERDES_OFFSET) 3002 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_SERDES_OFFSET)
3063 #define CONFIG_SYS_FSL_CORENET_SERDES2_ADDR \ 3003 #define CONFIG_SYS_FSL_CORENET_SERDES2_ADDR \
3064 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_SERDES2_OFFSET) 3004 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_SERDES2_OFFSET)
3065 #define CONFIG_SYS_FSL_CORENET_SERDES3_ADDR \ 3005 #define CONFIG_SYS_FSL_CORENET_SERDES3_ADDR \
3066 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_SERDES3_OFFSET) 3006 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_SERDES3_OFFSET)
3067 #define CONFIG_SYS_FSL_CORENET_SERDES4_ADDR \ 3007 #define CONFIG_SYS_FSL_CORENET_SERDES4_ADDR \
3068 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_SERDES4_OFFSET) 3008 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CORENET_SERDES4_OFFSET)
3069 #define CONFIG_SYS_MPC85xx_USB1_ADDR \ 3009 #define CONFIG_SYS_MPC85xx_USB1_ADDR \
3070 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB1_OFFSET) 3010 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB1_OFFSET)
3071 #define CONFIG_SYS_MPC85xx_USB2_ADDR \ 3011 #define CONFIG_SYS_MPC85xx_USB2_ADDR \
3072 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB2_OFFSET) 3012 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB2_OFFSET)
3073 #define CONFIG_SYS_MPC85xx_USB1_PHY_ADDR \ 3013 #define CONFIG_SYS_MPC85xx_USB1_PHY_ADDR \
3074 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB1_PHY_OFFSET) 3014 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB1_PHY_OFFSET)
3075 #define CONFIG_SYS_MPC85xx_USB2_PHY_ADDR \ 3015 #define CONFIG_SYS_MPC85xx_USB2_PHY_ADDR \
3076 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB2_PHY_OFFSET) 3016 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB2_PHY_OFFSET)
3077 #define CONFIG_SYS_FSL_SEC_ADDR \ 3017 #define CONFIG_SYS_FSL_SEC_ADDR \
3078 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_SEC_OFFSET) 3018 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_SEC_OFFSET)
3079 #define CONFIG_SYS_FSL_JR0_ADDR \ 3019 #define CONFIG_SYS_FSL_JR0_ADDR \
3080 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_JR0_OFFSET) 3020 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_JR0_OFFSET)
3081 #define CONFIG_SYS_FSL_FM1_ADDR \ 3021 #define CONFIG_SYS_FSL_FM1_ADDR \
3082 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_FM1_OFFSET) 3022 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_FM1_OFFSET)
3083 #define CONFIG_SYS_FSL_FM1_DTSEC1_ADDR \ 3023 #define CONFIG_SYS_FSL_FM1_DTSEC1_ADDR \
3084 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET) 3024 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_FM1_DTSEC1_OFFSET)
3085 #define CONFIG_SYS_FSL_FM2_ADDR \ 3025 #define CONFIG_SYS_FSL_FM2_ADDR \
3086 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_FM2_OFFSET) 3026 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_FM2_OFFSET)
3087 #define CONFIG_SYS_FSL_SRIO_ADDR \ 3027 #define CONFIG_SYS_FSL_SRIO_ADDR \
3088 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_SRIO_OFFSET) 3028 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_SRIO_OFFSET)
3089 #define CONFIG_SYS_PAMU_ADDR \ 3029 #define CONFIG_SYS_PAMU_ADDR \
3090 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_PAMU_OFFSET) 3030 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_PAMU_OFFSET)
3091 3031
3092 #define CONFIG_SYS_PCI1_ADDR \ 3032 #define CONFIG_SYS_PCI1_ADDR \
3093 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCI1_OFFSET) 3033 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCI1_OFFSET)
3094 #define CONFIG_SYS_PCI2_ADDR \ 3034 #define CONFIG_SYS_PCI2_ADDR \
3095 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCI2_OFFSET) 3035 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCI2_OFFSET)
3096 #define CONFIG_SYS_PCIE1_ADDR \ 3036 #define CONFIG_SYS_PCIE1_ADDR \
3097 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCIE1_OFFSET) 3037 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCIE1_OFFSET)
3098 #define CONFIG_SYS_PCIE2_ADDR \ 3038 #define CONFIG_SYS_PCIE2_ADDR \
3099 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCIE2_OFFSET) 3039 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCIE2_OFFSET)
3100 #define CONFIG_SYS_PCIE3_ADDR \ 3040 #define CONFIG_SYS_PCIE3_ADDR \
3101 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCIE3_OFFSET) 3041 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCIE3_OFFSET)
3102 #define CONFIG_SYS_PCIE4_ADDR \ 3042 #define CONFIG_SYS_PCIE4_ADDR \
3103 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCIE4_OFFSET) 3043 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_PCIE4_OFFSET)
3104 3044
3105 #define CONFIG_SYS_SFP_ADDR \ 3045 #define CONFIG_SYS_SFP_ADDR \
3106 (CONFIG_SYS_IMMR + CONFIG_SYS_SFP_OFFSET) 3046 (CONFIG_SYS_IMMR + CONFIG_SYS_SFP_OFFSET)
3107 3047
3108 #define CONFIG_SYS_SEC_MON_ADDR \ 3048 #define CONFIG_SYS_SEC_MON_ADDR \
3109 (CONFIG_SYS_IMMR + CONFIG_SYS_SEC_MON_OFFSET) 3049 (CONFIG_SYS_IMMR + CONFIG_SYS_SEC_MON_OFFSET)
3110 3050
3111 #define TSEC_BASE_ADDR (CONFIG_SYS_IMMR + CONFIG_SYS_TSEC1_OFFSET) 3051 #define TSEC_BASE_ADDR (CONFIG_SYS_IMMR + CONFIG_SYS_TSEC1_OFFSET)
3112 #define MDIO_BASE_ADDR (CONFIG_SYS_IMMR + CONFIG_SYS_MDIO1_OFFSET) 3052 #define MDIO_BASE_ADDR (CONFIG_SYS_IMMR + CONFIG_SYS_MDIO1_OFFSET)
3113 3053
3114 #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2 3054 #ifdef CONFIG_SYS_FSL_QORIQ_CHASSIS2
3115 struct ccsr_cluster_l2 { 3055 struct ccsr_cluster_l2 {
3116 u32 l2csr0; /* 0x000 L2 cache control and status register 0 */ 3056 u32 l2csr0; /* 0x000 L2 cache control and status register 0 */
3117 u32 l2csr1; /* 0x004 L2 cache control and status register 1 */ 3057 u32 l2csr1; /* 0x004 L2 cache control and status register 1 */
3118 u32 l2cfg0; /* 0x008 L2 cache configuration register 0 */ 3058 u32 l2cfg0; /* 0x008 L2 cache configuration register 0 */
3119 u8 res_0c[500];/* 0x00c - 0x1ff */ 3059 u8 res_0c[500];/* 0x00c - 0x1ff */
3120 u32 l2pir0; /* 0x200 L2 cache partitioning ID register 0 */ 3060 u32 l2pir0; /* 0x200 L2 cache partitioning ID register 0 */
3121 u8 res_204[4]; 3061 u8 res_204[4];
3122 u32 l2par0; /* 0x208 L2 cache partitioning allocation register 0 */ 3062 u32 l2par0; /* 0x208 L2 cache partitioning allocation register 0 */
3123 u32 l2pwr0; /* 0x20c L2 cache partitioning way register 0 */ 3063 u32 l2pwr0; /* 0x20c L2 cache partitioning way register 0 */
3124 u32 l2pir1; /* 0x210 L2 cache partitioning ID register 1 */ 3064 u32 l2pir1; /* 0x210 L2 cache partitioning ID register 1 */
3125 u8 res_214[4]; 3065 u8 res_214[4];
3126 u32 l2par1; /* 0x218 L2 cache partitioning allocation register 1 */ 3066 u32 l2par1; /* 0x218 L2 cache partitioning allocation register 1 */
3127 u32 l2pwr1; /* 0x21c L2 cache partitioning way register 1 */ 3067 u32 l2pwr1; /* 0x21c L2 cache partitioning way register 1 */
3128 u32 u2pir2; /* 0x220 L2 cache partitioning ID register 2 */ 3068 u32 u2pir2; /* 0x220 L2 cache partitioning ID register 2 */
3129 u8 res_224[4]; 3069 u8 res_224[4];
3130 u32 l2par2; /* 0x228 L2 cache partitioning allocation register 2 */ 3070 u32 l2par2; /* 0x228 L2 cache partitioning allocation register 2 */
3131 u32 l2pwr2; /* 0x22c L2 cache partitioning way register 2 */ 3071 u32 l2pwr2; /* 0x22c L2 cache partitioning way register 2 */
3132 u32 l2pir3; /* 0x230 L2 cache partitioning ID register 3 */ 3072 u32 l2pir3; /* 0x230 L2 cache partitioning ID register 3 */
3133 u8 res_234[4]; 3073 u8 res_234[4];
3134 u32 l2par3; /* 0x238 L2 cache partitining allocation register 3 */ 3074 u32 l2par3; /* 0x238 L2 cache partitining allocation register 3 */
3135 u32 l2pwr3; /* 0x23c L2 cache partitining way register 3 */ 3075 u32 l2pwr3; /* 0x23c L2 cache partitining way register 3 */
3136 u32 l2pir4; /* 0x240 L2 cache partitioning ID register 3 */ 3076 u32 l2pir4; /* 0x240 L2 cache partitioning ID register 3 */
3137 u8 res244[4]; 3077 u8 res244[4];
3138 u32 l2par4; /* 0x248 L2 cache partitioning allocation register 3 */ 3078 u32 l2par4; /* 0x248 L2 cache partitioning allocation register 3 */
3139 u32 l2pwr4; /* 0x24c L2 cache partitioning way register 3 */ 3079 u32 l2pwr4; /* 0x24c L2 cache partitioning way register 3 */
3140 u32 l2pir5; /* 0x250 L2 cache partitioning ID register 3 */ 3080 u32 l2pir5; /* 0x250 L2 cache partitioning ID register 3 */
3141 u8 res_254[4]; 3081 u8 res_254[4];
3142 u32 l2par5; /* 0x258 L2 cache partitioning allocation register 3 */ 3082 u32 l2par5; /* 0x258 L2 cache partitioning allocation register 3 */
3143 u32 l2pwr5; /* 0x25c L2 cache partitioning way register 3 */ 3083 u32 l2pwr5; /* 0x25c L2 cache partitioning way register 3 */
3144 u32 l2pir6; /* 0x260 L2 cache partitioning ID register 3 */ 3084 u32 l2pir6; /* 0x260 L2 cache partitioning ID register 3 */
3145 u8 res_264[4]; 3085 u8 res_264[4];
3146 u32 l2par6; /* 0x268 L2 cache partitioning allocation register 3 */ 3086 u32 l2par6; /* 0x268 L2 cache partitioning allocation register 3 */
3147 u32 l2pwr6; /* 0x26c L2 cache partitioning way register 3 */ 3087 u32 l2pwr6; /* 0x26c L2 cache partitioning way register 3 */
3148 u32 l2pir7; /* 0x270 L2 cache partitioning ID register 3 */ 3088 u32 l2pir7; /* 0x270 L2 cache partitioning ID register 3 */
3149 u8 res274[4]; 3089 u8 res274[4];
3150 u32 l2par7; /* 0x278 L2 cache partitioning allocation register 3 */ 3090 u32 l2par7; /* 0x278 L2 cache partitioning allocation register 3 */
3151 u32 l2pwr7; /* 0x27c L2 cache partitioning way register 3 */ 3091 u32 l2pwr7; /* 0x27c L2 cache partitioning way register 3 */
3152 u8 res_280[0xb80]; /* 0x280 - 0xdff */ 3092 u8 res_280[0xb80]; /* 0x280 - 0xdff */
3153 u32 l2errinjhi; /* 0xe00 L2 cache error injection mask high */ 3093 u32 l2errinjhi; /* 0xe00 L2 cache error injection mask high */
3154 u32 l2errinjlo; /* 0xe04 L2 cache error injection mask low */ 3094 u32 l2errinjlo; /* 0xe04 L2 cache error injection mask low */
3155 u32 l2errinjctl;/* 0xe08 L2 cache error injection control */ 3095 u32 l2errinjctl;/* 0xe08 L2 cache error injection control */
3156 u8 res_e0c[20]; /* 0xe0c - 0x01f */ 3096 u8 res_e0c[20]; /* 0xe0c - 0x01f */
3157 u32 l2captdatahi; /* 0xe20 L2 cache error capture data high */ 3097 u32 l2captdatahi; /* 0xe20 L2 cache error capture data high */
3158 u32 l2captdatalo; /* 0xe24 L2 cache error capture data low */ 3098 u32 l2captdatalo; /* 0xe24 L2 cache error capture data low */
3159 u32 l2captecc; /* 0xe28 L2 cache error capture ECC syndrome */ 3099 u32 l2captecc; /* 0xe28 L2 cache error capture ECC syndrome */
3160 u8 res_e2c[20]; /* 0xe2c - 0xe3f */ 3100 u8 res_e2c[20]; /* 0xe2c - 0xe3f */
3161 u32 l2errdet; /* 0xe40 L2 cache error detect */ 3101 u32 l2errdet; /* 0xe40 L2 cache error detect */
3162 u32 l2errdis; /* 0xe44 L2 cache error disable */ 3102 u32 l2errdis; /* 0xe44 L2 cache error disable */
3163 u32 l2errinten; /* 0xe48 L2 cache error interrupt enable */ 3103 u32 l2errinten; /* 0xe48 L2 cache error interrupt enable */
3164 u32 l2errattr; /* 0xe4c L2 cache error attribute */ 3104 u32 l2errattr; /* 0xe4c L2 cache error attribute */
3165 u32 l2erreaddr; /* 0xe50 L2 cache error extended address */ 3105 u32 l2erreaddr; /* 0xe50 L2 cache error extended address */
3166 u32 l2erraddr; /* 0xe54 L2 cache error address */ 3106 u32 l2erraddr; /* 0xe54 L2 cache error address */
3167 u32 l2errctl; /* 0xe58 L2 cache error control */ 3107 u32 l2errctl; /* 0xe58 L2 cache error control */
3168 }; 3108 };
3169 #define CONFIG_SYS_FSL_CLUSTER_1_L2 \ 3109 #define CONFIG_SYS_FSL_CLUSTER_1_L2 \
3170 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CLUSTER_1_L2_OFFSET) 3110 (CONFIG_SYS_IMMR + CONFIG_SYS_FSL_CLUSTER_1_L2_OFFSET)
3171 #endif /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */ 3111 #endif /* CONFIG_SYS_FSL_QORIQ_CHASSIS2 */
3172 3112
3173 #define CONFIG_SYS_DCSR_DCFG_OFFSET 0X20000 3113 #define CONFIG_SYS_DCSR_DCFG_OFFSET 0X20000
3174 struct dcsr_dcfg_regs { 3114 struct dcsr_dcfg_regs {
3175 u8 res_0[0x520]; 3115 u8 res_0[0x520];
3176 u32 ecccr1; 3116 u32 ecccr1;
3177 #define DCSR_DCFG_ECC_DISABLE_USB1 0x00008000 3117 #define DCSR_DCFG_ECC_DISABLE_USB1 0x00008000
3178 #define DCSR_DCFG_ECC_DISABLE_USB2 0x00004000 3118 #define DCSR_DCFG_ECC_DISABLE_USB2 0x00004000
3179 u8 res_524[0x1000 - 0x524]; /* 0x524 - 0x1000 */ 3119 u8 res_524[0x1000 - 0x524]; /* 0x524 - 0x1000 */
3180 }; 3120 };
3181 3121
3182 #define CONFIG_SYS_MPC85xx_SCFG \ 3122 #define CONFIG_SYS_MPC85xx_SCFG \
3183 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_SCFG_OFFSET) 3123 (CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_SCFG_OFFSET)
3184 #define CONFIG_SYS_MPC85xx_SCFG_OFFSET 0xfc000 3124 #define CONFIG_SYS_MPC85xx_SCFG_OFFSET 0xfc000
3185 /* The supplement configuration unit register */ 3125 /* The supplement configuration unit register */
3186 struct ccsr_scfg { 3126 struct ccsr_scfg {
3187 u32 dpslpcr; /* 0x000 Deep Sleep Control register */ 3127 u32 dpslpcr; /* 0x000 Deep Sleep Control register */
3188 u32 usb1dpslpcsr;/* 0x004 USB1 Deep Sleep Control Status register */ 3128 u32 usb1dpslpcsr;/* 0x004 USB1 Deep Sleep Control Status register */
3189 u32 usb2dpslpcsr;/* 0x008 USB2 Deep Sleep Control Status register */ 3129 u32 usb2dpslpcsr;/* 0x008 USB2 Deep Sleep Control Status register */
3190 u32 fmclkdpslpcr;/* 0x00c FM Clock Deep Sleep Control register */ 3130 u32 fmclkdpslpcr;/* 0x00c FM Clock Deep Sleep Control register */
3191 u32 res1[4]; 3131 u32 res1[4];
3192 u32 esgmiiselcr;/* 0x020 Ethernet Switch SGMII Select Control reg */ 3132 u32 esgmiiselcr;/* 0x020 Ethernet Switch SGMII Select Control reg */
3193 u32 res2; 3133 u32 res2;
3194 u32 pixclkcr; /* 0x028 Pixel Clock Control register */ 3134 u32 pixclkcr; /* 0x028 Pixel Clock Control register */
3195 u32 res3[245]; 3135 u32 res3[245];
3196 u32 qeioclkcr; /* 0x400 QUICC Engine IO Clock Control register */ 3136 u32 qeioclkcr; /* 0x400 QUICC Engine IO Clock Control register */
3197 u32 emiiocr; /* 0x404 EMI MDIO Control Register */ 3137 u32 emiiocr; /* 0x404 EMI MDIO Control Register */
3198 u32 sdhciovselcr;/* 0x408 SDHC IO VSEL Control register */ 3138 u32 sdhciovselcr;/* 0x408 SDHC IO VSEL Control register */
3199 u32 qmifrstcr; /* 0x40c QMAN Interface Reset Control register */ 3139 u32 qmifrstcr; /* 0x40c QMAN Interface Reset Control register */
3200 u32 res4[60]; 3140 u32 res4[60];
3201 u32 sparecr[8]; /* 0x500 Spare Control register(0-7) */ 3141 u32 sparecr[8]; /* 0x500 Spare Control register(0-7) */
3202 }; 3142 };
3203 #endif /*__IMMAP_85xx__*/ 3143 #endif /*__IMMAP_85xx__*/
3204 3144
board/freescale/p1023rdb/p1023rdb.c
1 /* 1 /*
2 * Copyright 2013 Freescale Semiconductor, Inc. 2 * Copyright 2013 Freescale Semiconductor, Inc.
3 * 3 *
4 * Authors: Roy Zang <tie-fei.zang@freescale.com> 4 * Authors: Roy Zang <tie-fei.zang@freescale.com>
5 * Chunhe Lan <Chunhe.Lan@freescale.com> 5 * Chunhe Lan <Chunhe.Lan@freescale.com>
6 * 6 *
7 * SPDX-License-Identifier: GPL-2.0+ 7 * SPDX-License-Identifier: GPL-2.0+
8 */ 8 */
9 9
10 #include <common.h> 10 #include <common.h>
11 #include <command.h> 11 #include <command.h>
12 #include <pci.h> 12 #include <pci.h>
13 #include <asm/io.h> 13 #include <asm/io.h>
14 #include <asm/cache.h> 14 #include <asm/cache.h>
15 #include <asm/processor.h> 15 #include <asm/processor.h>
16 #include <asm/mmu.h> 16 #include <asm/mmu.h>
17 #include <asm/immap_85xx.h> 17 #include <asm/immap_85xx.h>
18 #include <asm/fsl_pci.h> 18 #include <asm/fsl_pci.h>
19 #include <fsl_ddr_sdram.h> 19 #include <fsl_ddr_sdram.h>
20 #include <asm/fsl_portals.h> 20 #include <asm/fsl_portals.h>
21 #include <fsl_qbman.h>
21 #include <libfdt.h> 22 #include <libfdt.h>
22 #include <fdt_support.h> 23 #include <fdt_support.h>
23 #include <netdev.h> 24 #include <netdev.h>
24 #include <malloc.h> 25 #include <malloc.h>
25 #include <fm_eth.h> 26 #include <fm_eth.h>
26 #include <fsl_mdio.h> 27 #include <fsl_mdio.h>
27 #include <miiphy.h> 28 #include <miiphy.h>
28 #include <phy.h> 29 #include <phy.h>
29 #include <fsl_dtsec.h> 30 #include <fsl_dtsec.h>
30 31
31 DECLARE_GLOBAL_DATA_PTR; 32 DECLARE_GLOBAL_DATA_PTR;
32 33
33 int board_early_init_f(void) 34 int board_early_init_f(void)
34 { 35 {
35 fsl_lbc_t *lbc = LBC_BASE_ADDR; 36 fsl_lbc_t *lbc = LBC_BASE_ADDR;
36 37
37 /* Set ABSWP to implement conversion of addresses in the LBC */ 38 /* Set ABSWP to implement conversion of addresses in the LBC */
38 setbits_be32(&lbc->lbcr, CONFIG_SYS_LBC_LBCR); 39 setbits_be32(&lbc->lbcr, CONFIG_SYS_LBC_LBCR);
39 40
40 return 0; 41 return 0;
41 } 42 }
42 43
43 int checkboard(void) 44 int checkboard(void)
44 { 45 {
45 printf("Board: P1023 RDB\n"); 46 printf("Board: P1023 RDB\n");
46 47
47 return 0; 48 return 0;
48 } 49 }
49 50
50 #ifdef CONFIG_PCI 51 #ifdef CONFIG_PCI
51 void pci_init_board(void) 52 void pci_init_board(void)
52 { 53 {
53 fsl_pcie_init_board(0); 54 fsl_pcie_init_board(0);
54 } 55 }
55 #endif 56 #endif
56 57
57 int board_early_init_r(void) 58 int board_early_init_r(void)
58 { 59 {
59 const unsigned int flashbase = CONFIG_SYS_FLASH_BASE; 60 const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
60 int flash_esel = find_tlb_idx((void *)flashbase, 1); 61 int flash_esel = find_tlb_idx((void *)flashbase, 1);
61 62
62 /* 63 /*
63 * Remap Boot flash + PROMJET region to caching-inhibited 64 * Remap Boot flash + PROMJET region to caching-inhibited
64 * so that flash can be erased properly. 65 * so that flash can be erased properly.
65 */ 66 */
66 67
67 /* Flush d-cache and invalidate i-cache of any FLASH data */ 68 /* Flush d-cache and invalidate i-cache of any FLASH data */
68 flush_dcache(); 69 flush_dcache();
69 invalidate_icache(); 70 invalidate_icache();
70 71
71 if (flash_esel == -1) { 72 if (flash_esel == -1) {
72 /* very unlikely unless something is messed up */ 73 /* very unlikely unless something is messed up */
73 puts("Error: Could not find TLB for FLASH BASE\n"); 74 puts("Error: Could not find TLB for FLASH BASE\n");
74 flash_esel = 2; /* give our best effort to continue */ 75 flash_esel = 2; /* give our best effort to continue */
75 } else { 76 } else {
76 /* invalidate existing TLB entry for flash + promjet */ 77 /* invalidate existing TLB entry for flash + promjet */
77 disable_tlb(flash_esel); 78 disable_tlb(flash_esel);
78 } 79 }
79 80
80 set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS, 81 set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
81 MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, 82 MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
82 0, flash_esel, BOOKE_PAGESZ_256M, 1); 83 0, flash_esel, BOOKE_PAGESZ_256M, 1);
83 84
84 setup_portals(); 85 setup_qbman_portals();
85 86
86 return 0; 87 return 0;
87 } 88 }
88 89
89 unsigned long get_board_sys_clk(ulong dummy) 90 unsigned long get_board_sys_clk(ulong dummy)
90 { 91 {
91 return gd->bus_clk; 92 return gd->bus_clk;
92 } 93 }
93 94
94 unsigned long get_board_ddr_clk(ulong dummy) 95 unsigned long get_board_ddr_clk(ulong dummy)
95 { 96 {
96 return gd->mem_clk; 97 return gd->mem_clk;
97 } 98 }
98 99
99 int board_eth_init(bd_t *bis) 100 int board_eth_init(bd_t *bis)
100 { 101 {
101 ccsr_gur_t *gur = (ccsr_gur_t *)CONFIG_SYS_MPC85xx_GUTS_ADDR; 102 ccsr_gur_t *gur = (ccsr_gur_t *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
102 struct fsl_pq_mdio_info dtsec_mdio_info; 103 struct fsl_pq_mdio_info dtsec_mdio_info;
103 104
104 /* 105 /*
105 * Need to set dTSEC 1 pin multiplexing to TSEC. The default setting 106 * Need to set dTSEC 1 pin multiplexing to TSEC. The default setting
106 * is not correct. 107 * is not correct.
107 */ 108 */
108 setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_TSEC1_1); 109 setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_TSEC1_1);
109 110
110 dtsec_mdio_info.regs = 111 dtsec_mdio_info.regs =
111 (struct tsec_mii_mng *)CONFIG_SYS_FM1_DTSEC1_MDIO_ADDR; 112 (struct tsec_mii_mng *)CONFIG_SYS_FM1_DTSEC1_MDIO_ADDR;
112 dtsec_mdio_info.name = DEFAULT_FM_MDIO_NAME; 113 dtsec_mdio_info.name = DEFAULT_FM_MDIO_NAME;
113 114
114 /* Register the 1G MDIO bus */ 115 /* Register the 1G MDIO bus */
115 fsl_pq_mdio_init(bis, &dtsec_mdio_info); 116 fsl_pq_mdio_init(bis, &dtsec_mdio_info);
116 117
117 fm_info_set_phy_address(FM1_DTSEC1, CONFIG_SYS_FM1_DTSEC1_PHY_ADDR); 118 fm_info_set_phy_address(FM1_DTSEC1, CONFIG_SYS_FM1_DTSEC1_PHY_ADDR);
118 fm_info_set_phy_address(FM1_DTSEC2, CONFIG_SYS_FM1_DTSEC2_PHY_ADDR); 119 fm_info_set_phy_address(FM1_DTSEC2, CONFIG_SYS_FM1_DTSEC2_PHY_ADDR);
119 120
120 fm_info_set_mdio(FM1_DTSEC1, 121 fm_info_set_mdio(FM1_DTSEC1,
121 miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME)); 122 miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME));
122 fm_info_set_mdio(FM1_DTSEC2, 123 fm_info_set_mdio(FM1_DTSEC2,
123 miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME)); 124 miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME));
124 125
125 #ifdef CONFIG_FMAN_ENET 126 #ifdef CONFIG_FMAN_ENET
126 cpu_eth_init(bis); 127 cpu_eth_init(bis);
127 #endif 128 #endif
128 129
129 return pci_eth_init(bis); 130 return pci_eth_init(bis);
130 } 131 }
131 132
132 #if defined(CONFIG_OF_BOARD_SETUP) 133 #if defined(CONFIG_OF_BOARD_SETUP)
133 int ft_board_setup(void *blob, bd_t *bd) 134 int ft_board_setup(void *blob, bd_t *bd)
134 { 135 {
135 phys_addr_t base; 136 phys_addr_t base;
136 phys_size_t size; 137 phys_size_t size;
137 138
138 ft_cpu_setup(blob, bd); 139 ft_cpu_setup(blob, bd);
139 140
140 base = env_get_bootm_low(); 141 base = env_get_bootm_low();
141 size = env_get_bootm_size(); 142 size = env_get_bootm_size();
142 143
143 fdt_fixup_memory(blob, (u64)base, (u64)size); 144 fdt_fixup_memory(blob, (u64)base, (u64)size);
144 145
145 #ifdef CONFIG_HAS_FSL_DR_USB 146 #ifdef CONFIG_HAS_FSL_DR_USB
146 fsl_fdt_fixup_dr_usb(blob, bd); 147 fsl_fdt_fixup_dr_usb(blob, bd);
147 #endif 148 #endif
148 149
149 fdt_fixup_fman_ethernet(blob); 150 fdt_fixup_fman_ethernet(blob);
150 151
151 return 0; 152 return 0;
152 } 153 }
153 #endif 154 #endif
154 155
board/keymile/kmp204x/kmp204x.c
1 /* 1 /*
2 * (C) Copyright 2013 Keymile AG 2 * (C) Copyright 2013 Keymile AG
3 * Valentin Longchamp <valentin.longchamp@keymile.com> 3 * Valentin Longchamp <valentin.longchamp@keymile.com>
4 * 4 *
5 * Copyright 2011,2012 Freescale Semiconductor, Inc. 5 * Copyright 2011,2012 Freescale Semiconductor, Inc.
6 * 6 *
7 * SPDX-License-Identifier: GPL-2.0+ 7 * SPDX-License-Identifier: GPL-2.0+
8 */ 8 */
9 9
10 #include <common.h> 10 #include <common.h>
11 #include <command.h> 11 #include <command.h>
12 #include <netdev.h> 12 #include <netdev.h>
13 #include <linux/compiler.h> 13 #include <linux/compiler.h>
14 #include <asm/mmu.h> 14 #include <asm/mmu.h>
15 #include <asm/processor.h> 15 #include <asm/processor.h>
16 #include <asm/cache.h> 16 #include <asm/cache.h>
17 #include <asm/immap_85xx.h> 17 #include <asm/immap_85xx.h>
18 #include <asm/fsl_law.h> 18 #include <asm/fsl_law.h>
19 #include <asm/fsl_serdes.h> 19 #include <asm/fsl_serdes.h>
20 #include <asm/fsl_portals.h> 20 #include <asm/fsl_portals.h>
21 #include <asm/fsl_liodn.h> 21 #include <asm/fsl_liodn.h>
22 #include <fm_eth.h> 22 #include <fm_eth.h>
23 23
24 #include "../common/common.h" 24 #include "../common/common.h"
25 #include "kmp204x.h" 25 #include "kmp204x.h"
26 26
27 DECLARE_GLOBAL_DATA_PTR; 27 DECLARE_GLOBAL_DATA_PTR;
28 28
29 static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN]; 29 static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
30 30
31 int checkboard(void) 31 int checkboard(void)
32 { 32 {
33 printf("Board: Keymile %s\n", CONFIG_KM_BOARD_NAME); 33 printf("Board: Keymile %s\n", CONFIG_KM_BOARD_NAME);
34 34
35 return 0; 35 return 0;
36 } 36 }
37 37
38 /* I2C deblocking uses the algorithm defined in board/keymile/common/common.c 38 /* I2C deblocking uses the algorithm defined in board/keymile/common/common.c
39 * 2 dedicated QRIO GPIOs externally pull the SCL and SDA lines 39 * 2 dedicated QRIO GPIOs externally pull the SCL and SDA lines
40 * For I2C only the low state is activly driven and high state is pulled-up 40 * For I2C only the low state is activly driven and high state is pulled-up
41 * by a resistor. Therefore the deblock GPIOs are used 41 * by a resistor. Therefore the deblock GPIOs are used
42 * -> as an active output to drive a low state 42 * -> as an active output to drive a low state
43 * -> as an open-drain input to have a pulled-up high state 43 * -> as an open-drain input to have a pulled-up high state
44 */ 44 */
45 45
46 /* QRIO GPIOs used for deblocking */ 46 /* QRIO GPIOs used for deblocking */
47 #define DEBLOCK_PORT1 GPIO_A 47 #define DEBLOCK_PORT1 GPIO_A
48 #define DEBLOCK_SCL1 20 48 #define DEBLOCK_SCL1 20
49 #define DEBLOCK_SDA1 21 49 #define DEBLOCK_SDA1 21
50 50
51 /* By default deblock GPIOs are floating */ 51 /* By default deblock GPIOs are floating */
52 static void i2c_deblock_gpio_cfg(void) 52 static void i2c_deblock_gpio_cfg(void)
53 { 53 {
54 /* set I2C bus 1 deblocking GPIOs input, but 0 value for open drain */ 54 /* set I2C bus 1 deblocking GPIOs input, but 0 value for open drain */
55 qrio_gpio_direction_input(DEBLOCK_PORT1, DEBLOCK_SCL1); 55 qrio_gpio_direction_input(DEBLOCK_PORT1, DEBLOCK_SCL1);
56 qrio_gpio_direction_input(DEBLOCK_PORT1, DEBLOCK_SDA1); 56 qrio_gpio_direction_input(DEBLOCK_PORT1, DEBLOCK_SDA1);
57 57
58 qrio_set_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1, 0); 58 qrio_set_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1, 0);
59 qrio_set_gpio(DEBLOCK_PORT1, DEBLOCK_SDA1, 0); 59 qrio_set_gpio(DEBLOCK_PORT1, DEBLOCK_SDA1, 0);
60 } 60 }
61 61
62 void set_sda(int state) 62 void set_sda(int state)
63 { 63 {
64 qrio_set_opendrain_gpio(DEBLOCK_PORT1, DEBLOCK_SDA1, state); 64 qrio_set_opendrain_gpio(DEBLOCK_PORT1, DEBLOCK_SDA1, state);
65 } 65 }
66 66
67 void set_scl(int state) 67 void set_scl(int state)
68 { 68 {
69 qrio_set_opendrain_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1, state); 69 qrio_set_opendrain_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1, state);
70 } 70 }
71 71
72 int get_sda(void) 72 int get_sda(void)
73 { 73 {
74 return qrio_get_gpio(DEBLOCK_PORT1, DEBLOCK_SDA1); 74 return qrio_get_gpio(DEBLOCK_PORT1, DEBLOCK_SDA1);
75 } 75 }
76 76
77 int get_scl(void) 77 int get_scl(void)
78 { 78 {
79 return qrio_get_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1); 79 return qrio_get_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1);
80 } 80 }
81 81
82 82
83 #define ZL30158_RST 8 83 #define ZL30158_RST 8
84 #define BFTIC4_RST 0 84 #define BFTIC4_RST 0
85 #define RSTRQSR1_WDT_RR 0x00200000 85 #define RSTRQSR1_WDT_RR 0x00200000
86 #define RSTRQSR1_SW_RR 0x00100000 86 #define RSTRQSR1_SW_RR 0x00100000
87 87
88 int board_early_init_f(void) 88 int board_early_init_f(void)
89 { 89 {
90 ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); 90 ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
91 bool cpuwd_flag = false; 91 bool cpuwd_flag = false;
92 92
93 /* configure mode for uP reset request */ 93 /* configure mode for uP reset request */
94 qrio_uprstreq(UPREQ_CORE_RST); 94 qrio_uprstreq(UPREQ_CORE_RST);
95 95
96 /* board only uses the DDR_MCK0, so disable the DDR_MCK1/2/3 */ 96 /* board only uses the DDR_MCK0, so disable the DDR_MCK1/2/3 */
97 setbits_be32(&gur->ddrclkdr, 0x001f000f); 97 setbits_be32(&gur->ddrclkdr, 0x001f000f);
98 98
99 /* set reset reason according CPU register */ 99 /* set reset reason according CPU register */
100 if ((gur->rstrqsr1 & (RSTRQSR1_WDT_RR | RSTRQSR1_SW_RR)) == 100 if ((gur->rstrqsr1 & (RSTRQSR1_WDT_RR | RSTRQSR1_SW_RR)) ==
101 RSTRQSR1_WDT_RR) 101 RSTRQSR1_WDT_RR)
102 cpuwd_flag = true; 102 cpuwd_flag = true;
103 103
104 qrio_cpuwd_flag(cpuwd_flag); 104 qrio_cpuwd_flag(cpuwd_flag);
105 /* clear CPU bits by writing 1 */ 105 /* clear CPU bits by writing 1 */
106 setbits_be32(&gur->rstrqsr1, RSTRQSR1_WDT_RR | RSTRQSR1_SW_RR); 106 setbits_be32(&gur->rstrqsr1, RSTRQSR1_WDT_RR | RSTRQSR1_SW_RR);
107 107
108 /* set the BFTIC's prstcfg to reset at power-up and unit reset only */ 108 /* set the BFTIC's prstcfg to reset at power-up and unit reset only */
109 qrio_prstcfg(BFTIC4_RST, PRSTCFG_POWUP_UNIT_RST); 109 qrio_prstcfg(BFTIC4_RST, PRSTCFG_POWUP_UNIT_RST);
110 /* and enable WD on it */ 110 /* and enable WD on it */
111 qrio_wdmask(BFTIC4_RST, true); 111 qrio_wdmask(BFTIC4_RST, true);
112 112
113 /* set the ZL30138's prstcfg to reset at power-up only */ 113 /* set the ZL30138's prstcfg to reset at power-up only */
114 qrio_prstcfg(ZL30158_RST, PRSTCFG_POWUP_RST); 114 qrio_prstcfg(ZL30158_RST, PRSTCFG_POWUP_RST);
115 /* and take it out of reset as soon as possible (needed for Hooper) */ 115 /* and take it out of reset as soon as possible (needed for Hooper) */
116 qrio_prst(ZL30158_RST, false, false); 116 qrio_prst(ZL30158_RST, false, false);
117 117
118 return 0; 118 return 0;
119 } 119 }
120 120
121 int board_early_init_r(void) 121 int board_early_init_r(void)
122 { 122 {
123 int ret = 0; 123 int ret = 0;
124 /* Flush d-cache and invalidate i-cache of any FLASH data */ 124 /* Flush d-cache and invalidate i-cache of any FLASH data */
125 flush_dcache(); 125 flush_dcache();
126 invalidate_icache(); 126 invalidate_icache();
127 127
128 set_liodns(); 128 set_liodns();
129 setup_portals(); 129 setup_qbman_portals();
130 130
131 ret = trigger_fpga_config(); 131 ret = trigger_fpga_config();
132 if (ret) 132 if (ret)
133 printf("error triggering PCIe FPGA config\n"); 133 printf("error triggering PCIe FPGA config\n");
134 134
135 /* enable the Unit LED (red) & Boot LED (on) */ 135 /* enable the Unit LED (red) & Boot LED (on) */
136 qrio_set_leds(); 136 qrio_set_leds();
137 137
138 /* enable Application Buffer */ 138 /* enable Application Buffer */
139 qrio_enable_app_buffer(); 139 qrio_enable_app_buffer();
140 140
141 return ret; 141 return ret;
142 } 142 }
143 143
144 unsigned long get_board_sys_clk(unsigned long dummy) 144 unsigned long get_board_sys_clk(unsigned long dummy)
145 { 145 {
146 return 66666666; 146 return 66666666;
147 } 147 }
148 148
149 #define ETH_FRONT_PHY_RST 15 149 #define ETH_FRONT_PHY_RST 15
150 #define QSFP2_RST 11 150 #define QSFP2_RST 11
151 #define QSFP1_RST 10 151 #define QSFP1_RST 10
152 #define ZL30343_RST 9 152 #define ZL30343_RST 9
153 153
154 int misc_init_f(void) 154 int misc_init_f(void)
155 { 155 {
156 /* configure QRIO pis for i2c deblocking */ 156 /* configure QRIO pis for i2c deblocking */
157 i2c_deblock_gpio_cfg(); 157 i2c_deblock_gpio_cfg();
158 158
159 /* configure the front phy's prstcfg and take it out of reset */ 159 /* configure the front phy's prstcfg and take it out of reset */
160 qrio_prstcfg(ETH_FRONT_PHY_RST, PRSTCFG_POWUP_UNIT_CORE_RST); 160 qrio_prstcfg(ETH_FRONT_PHY_RST, PRSTCFG_POWUP_UNIT_CORE_RST);
161 qrio_prst(ETH_FRONT_PHY_RST, false, false); 161 qrio_prst(ETH_FRONT_PHY_RST, false, false);
162 162
163 /* set the ZL30343 prstcfg to reset at power-up only */ 163 /* set the ZL30343 prstcfg to reset at power-up only */
164 qrio_prstcfg(ZL30343_RST, PRSTCFG_POWUP_RST); 164 qrio_prstcfg(ZL30343_RST, PRSTCFG_POWUP_RST);
165 /* and enable the WD on it */ 165 /* and enable the WD on it */
166 qrio_wdmask(ZL30343_RST, true); 166 qrio_wdmask(ZL30343_RST, true);
167 167
168 /* set the QSFPs' prstcfg to reset at power-up and unit rst only */ 168 /* set the QSFPs' prstcfg to reset at power-up and unit rst only */
169 qrio_prstcfg(QSFP1_RST, PRSTCFG_POWUP_UNIT_RST); 169 qrio_prstcfg(QSFP1_RST, PRSTCFG_POWUP_UNIT_RST);
170 qrio_prstcfg(QSFP2_RST, PRSTCFG_POWUP_UNIT_RST); 170 qrio_prstcfg(QSFP2_RST, PRSTCFG_POWUP_UNIT_RST);
171 171
172 /* and enable the WD on them */ 172 /* and enable the WD on them */
173 qrio_wdmask(QSFP1_RST, true); 173 qrio_wdmask(QSFP1_RST, true);
174 qrio_wdmask(QSFP2_RST, true); 174 qrio_wdmask(QSFP2_RST, true);
175 175
176 return 0; 176 return 0;
177 } 177 }
178 178
179 #define NUM_SRDS_BANKS 2 179 #define NUM_SRDS_BANKS 2
180 180
181 int misc_init_r(void) 181 int misc_init_r(void)
182 { 182 {
183 serdes_corenet_t *regs = (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR; 183 serdes_corenet_t *regs = (void *)CONFIG_SYS_FSL_CORENET_SERDES_ADDR;
184 u32 expected[NUM_SRDS_BANKS] = {SRDS_PLLCR0_RFCK_SEL_100, 184 u32 expected[NUM_SRDS_BANKS] = {SRDS_PLLCR0_RFCK_SEL_100,
185 SRDS_PLLCR0_RFCK_SEL_125}; 185 SRDS_PLLCR0_RFCK_SEL_125};
186 unsigned int i; 186 unsigned int i;
187 187
188 /* check SERDES reference clocks */ 188 /* check SERDES reference clocks */
189 for (i = 0; i < NUM_SRDS_BANKS; i++) { 189 for (i = 0; i < NUM_SRDS_BANKS; i++) {
190 u32 actual = in_be32(&regs->bank[i].pllcr0); 190 u32 actual = in_be32(&regs->bank[i].pllcr0);
191 actual &= SRDS_PLLCR0_RFCK_SEL_MASK; 191 actual &= SRDS_PLLCR0_RFCK_SEL_MASK;
192 if (actual != expected[i]) { 192 if (actual != expected[i]) {
193 printf("Warning: SERDES bank %u expects reference \ 193 printf("Warning: SERDES bank %u expects reference \
194 clock %sMHz, but actual is %sMHz\n", i + 1, 194 clock %sMHz, but actual is %sMHz\n", i + 1,
195 serdes_clock_to_string(expected[i]), 195 serdes_clock_to_string(expected[i]),
196 serdes_clock_to_string(actual)); 196 serdes_clock_to_string(actual));
197 } 197 }
198 } 198 }
199 199
200 ivm_read_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN); 200 ivm_read_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
201 return 0; 201 return 0;
202 } 202 }
203 203
204 #if defined(CONFIG_HUSH_INIT_VAR) 204 #if defined(CONFIG_HUSH_INIT_VAR)
205 int hush_init_var(void) 205 int hush_init_var(void)
206 { 206 {
207 ivm_analyze_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN); 207 ivm_analyze_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN);
208 return 0; 208 return 0;
209 } 209 }
210 #endif 210 #endif
211 211
212 #if defined(CONFIG_LAST_STAGE_INIT) 212 #if defined(CONFIG_LAST_STAGE_INIT)
213 213
214 int last_stage_init(void) 214 int last_stage_init(void)
215 { 215 {
216 #if defined(CONFIG_KMCOGE4) 216 #if defined(CONFIG_KMCOGE4)
217 /* on KMCOGE4, the BFTIC4 is on the LBAPP2 */ 217 /* on KMCOGE4, the BFTIC4 is on the LBAPP2 */
218 struct bfticu_iomap *bftic4 = 218 struct bfticu_iomap *bftic4 =
219 (struct bfticu_iomap *)CONFIG_SYS_LBAPP2_BASE; 219 (struct bfticu_iomap *)CONFIG_SYS_LBAPP2_BASE;
220 u8 dip_switch = in_8((u8 *)&(bftic4->mswitch)) & BFTICU_DIPSWITCH_MASK; 220 u8 dip_switch = in_8((u8 *)&(bftic4->mswitch)) & BFTICU_DIPSWITCH_MASK;
221 221
222 if (dip_switch != 0) { 222 if (dip_switch != 0) {
223 /* start bootloader */ 223 /* start bootloader */
224 puts("DIP: Enabled\n"); 224 puts("DIP: Enabled\n");
225 env_set("actual_bank", "0"); 225 env_set("actual_bank", "0");
226 } 226 }
227 #endif 227 #endif
228 set_km_env(); 228 set_km_env();
229 229
230 return 0; 230 return 0;
231 } 231 }
232 #endif 232 #endif
233 233
234 #ifdef CONFIG_SYS_DPAA_FMAN 234 #ifdef CONFIG_SYS_DPAA_FMAN
235 void fdt_fixup_fman_mac_addresses(void *blob) 235 void fdt_fixup_fman_mac_addresses(void *blob)
236 { 236 {
237 int node, i, ret; 237 int node, i, ret;
238 char *tmp, *end; 238 char *tmp, *end;
239 unsigned char mac_addr[6]; 239 unsigned char mac_addr[6];
240 240
241 /* get the mac addr from env */ 241 /* get the mac addr from env */
242 tmp = env_get("ethaddr"); 242 tmp = env_get("ethaddr");
243 if (!tmp) { 243 if (!tmp) {
244 printf("ethaddr env variable not defined\n"); 244 printf("ethaddr env variable not defined\n");
245 return; 245 return;
246 } 246 }
247 for (i = 0; i < 6; i++) { 247 for (i = 0; i < 6; i++) {
248 mac_addr[i] = tmp ? simple_strtoul(tmp, &end, 16) : 0; 248 mac_addr[i] = tmp ? simple_strtoul(tmp, &end, 16) : 0;
249 if (tmp) 249 if (tmp)
250 tmp = (*end) ? end+1 : end; 250 tmp = (*end) ? end+1 : end;
251 } 251 }
252 252
253 /* find the correct fdt ethernet path and correct it */ 253 /* find the correct fdt ethernet path and correct it */
254 node = fdt_path_offset(blob, "/soc/fman/ethernet@e8000"); 254 node = fdt_path_offset(blob, "/soc/fman/ethernet@e8000");
255 if (node < 0) { 255 if (node < 0) {
256 printf("no /soc/fman/ethernet path offset\n"); 256 printf("no /soc/fman/ethernet path offset\n");
257 return; 257 return;
258 } 258 }
259 ret = fdt_setprop(blob, node, "local-mac-address", &mac_addr, 6); 259 ret = fdt_setprop(blob, node, "local-mac-address", &mac_addr, 6);
260 if (ret) { 260 if (ret) {
261 printf("error setting local-mac-address property\n"); 261 printf("error setting local-mac-address property\n");
262 return; 262 return;
263 } 263 }
264 } 264 }
265 #endif 265 #endif
266 266
267 int ft_board_setup(void *blob, bd_t *bd) 267 int ft_board_setup(void *blob, bd_t *bd)
268 { 268 {
269 phys_addr_t base; 269 phys_addr_t base;
270 phys_size_t size; 270 phys_size_t size;
271 271
272 ft_cpu_setup(blob, bd); 272 ft_cpu_setup(blob, bd);
273 273
274 base = env_get_bootm_low(); 274 base = env_get_bootm_low();
275 size = env_get_bootm_size(); 275 size = env_get_bootm_size();
276 276
277 fdt_fixup_memory(blob, (u64)base, (u64)size); 277 fdt_fixup_memory(blob, (u64)base, (u64)size);
278 278
279 #if defined(CONFIG_HAS_FSL_DR_USB) || defined(CONFIG_HAS_FSL_MPH_USB) 279 #if defined(CONFIG_HAS_FSL_DR_USB) || defined(CONFIG_HAS_FSL_MPH_USB)
280 fsl_fdt_fixup_dr_usb(blob, bd); 280 fsl_fdt_fixup_dr_usb(blob, bd);
281 #endif 281 #endif
282 282
283 #ifdef CONFIG_PCI 283 #ifdef CONFIG_PCI
284 pci_of_setup(blob, bd); 284 pci_of_setup(blob, bd);
285 #endif 285 #endif
286 286
287 fdt_fixup_liodn(blob); 287 fdt_fixup_liodn(blob);
288 #ifdef CONFIG_SYS_DPAA_FMAN 288 #ifdef CONFIG_SYS_DPAA_FMAN
289 fdt_fixup_fman_ethernet(blob); 289 fdt_fixup_fman_ethernet(blob);
290 fdt_fixup_fman_mac_addresses(blob); 290 fdt_fixup_fman_mac_addresses(blob);
291 #endif 291 #endif
292 292
293 return 0; 293 return 0;
294 } 294 }
295 295
296 #if defined(CONFIG_POST) 296 #if defined(CONFIG_POST)
297 297
298 /* DIC26_SELFTEST GPIO used to start factory test sw */ 298 /* DIC26_SELFTEST GPIO used to start factory test sw */
299 #define SELFTEST_PORT GPIO_A 299 #define SELFTEST_PORT GPIO_A
300 #define SELFTEST_PIN 31 300 #define SELFTEST_PIN 31
301 301
302 int post_hotkeys_pressed(void) 302 int post_hotkeys_pressed(void)
303 { 303 {
304 qrio_gpio_direction_input(SELFTEST_PORT, SELFTEST_PIN); 304 qrio_gpio_direction_input(SELFTEST_PORT, SELFTEST_PIN);
305 return qrio_get_gpio(SELFTEST_PORT, SELFTEST_PIN); 305 return qrio_get_gpio(SELFTEST_PORT, SELFTEST_PIN);
306 } 306 }
307 #endif 307 #endif
308 308
board/varisys/cyrus/cyrus.c
1 /* 1 /*
2 * Based on corenet_ds.c 2 * Based on corenet_ds.c
3 * 3 *
4 * SPDX-License-Identifier: GPL-2.0+ 4 * SPDX-License-Identifier: GPL-2.0+
5 */ 5 */
6 6
7 #include <common.h> 7 #include <common.h>
8 #include <command.h> 8 #include <command.h>
9 #include <netdev.h> 9 #include <netdev.h>
10 #include <linux/compiler.h> 10 #include <linux/compiler.h>
11 #include <asm/mmu.h> 11 #include <asm/mmu.h>
12 #include <asm/processor.h> 12 #include <asm/processor.h>
13 #include <asm/cache.h> 13 #include <asm/cache.h>
14 #include <asm/immap_85xx.h> 14 #include <asm/immap_85xx.h>
15 #include <asm/fsl_law.h> 15 #include <asm/fsl_law.h>
16 #include <asm/fsl_serdes.h> 16 #include <asm/fsl_serdes.h>
17 #include <asm/fsl_portals.h> 17 #include <asm/fsl_portals.h>
18 #include <asm/fsl_liodn.h> 18 #include <asm/fsl_liodn.h>
19 #include <fm_eth.h> 19 #include <fm_eth.h>
20 #include <pci.h> 20 #include <pci.h>
21 21
22 #include "cyrus.h" 22 #include "cyrus.h"
23 #include "../common/eeprom.h" 23 #include "../common/eeprom.h"
24 24
25 DECLARE_GLOBAL_DATA_PTR; 25 DECLARE_GLOBAL_DATA_PTR;
26 26
27 #define GPIO_OPENDRAIN 0x30000000 27 #define GPIO_OPENDRAIN 0x30000000
28 #define GPIO_DIR 0x3c000004 28 #define GPIO_DIR 0x3c000004
29 #define GPIO_INITIAL 0x30000000 29 #define GPIO_INITIAL 0x30000000
30 #define GPIO_VGA_SWITCH 0x00001000 30 #define GPIO_VGA_SWITCH 0x00001000
31 31
32 int checkboard(void) 32 int checkboard(void)
33 { 33 {
34 printf("Board: CYRUS\n"); 34 printf("Board: CYRUS\n");
35 35
36 return 0; 36 return 0;
37 } 37 }
38 38
39 int board_early_init_f(void) 39 int board_early_init_f(void)
40 { 40 {
41 ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); 41 ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
42 ccsr_gpio_t *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR); 42 ccsr_gpio_t *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
43 43
44 /* 44 /*
45 * Only use DDR1_MCK0/3 and DDR2_MCK0/3 45 * Only use DDR1_MCK0/3 and DDR2_MCK0/3
46 * disable DDR1_MCK1/2/4/5 and DDR2_MCK1/2/4/5 to reduce 46 * disable DDR1_MCK1/2/4/5 and DDR2_MCK1/2/4/5 to reduce
47 * the noise introduced by these unterminated and unused clock pairs. 47 * the noise introduced by these unterminated and unused clock pairs.
48 */ 48 */
49 setbits_be32(&gur->ddrclkdr, 0x001B001B); 49 setbits_be32(&gur->ddrclkdr, 0x001B001B);
50 50
51 /* Set GPIO reset lines to open-drain, tristate */ 51 /* Set GPIO reset lines to open-drain, tristate */
52 setbits_be32(&pgpio->gpdat, GPIO_INITIAL); 52 setbits_be32(&pgpio->gpdat, GPIO_INITIAL);
53 setbits_be32(&pgpio->gpodr, GPIO_OPENDRAIN); 53 setbits_be32(&pgpio->gpodr, GPIO_OPENDRAIN);
54 54
55 /* Set GPIO Direction */ 55 /* Set GPIO Direction */
56 setbits_be32(&pgpio->gpdir, GPIO_DIR); 56 setbits_be32(&pgpio->gpdir, GPIO_DIR);
57 57
58 return 0; 58 return 0;
59 } 59 }
60 60
61 int board_early_init_r(void) 61 int board_early_init_r(void)
62 { 62 {
63 fsl_lbc_t *lbc = LBC_BASE_ADDR; 63 fsl_lbc_t *lbc = LBC_BASE_ADDR;
64 64
65 out_be32(&lbc->lbcr, 0); 65 out_be32(&lbc->lbcr, 0);
66 /* 1 clock LALE cycle */ 66 /* 1 clock LALE cycle */
67 out_be32(&lbc->lcrr, 0x80000000 | CONFIG_SYS_LBC_LCRR); 67 out_be32(&lbc->lcrr, 0x80000000 | CONFIG_SYS_LBC_LCRR);
68 68
69 set_liodns(); 69 set_liodns();
70 70
71 #ifdef CONFIG_SYS_DPAA_QBMAN 71 #ifdef CONFIG_SYS_DPAA_QBMAN
72 setup_portals(); 72 setup_qbman_portals();
73 #endif 73 #endif
74 print_lbc_regs(); 74 print_lbc_regs();
75 return 0; 75 return 0;
76 } 76 }
77 77
78 int misc_init_r(void) 78 int misc_init_r(void)
79 { 79 {
80 return 0; 80 return 0;
81 } 81 }
82 82
83 int ft_board_setup(void *blob, bd_t *bd) 83 int ft_board_setup(void *blob, bd_t *bd)
84 { 84 {
85 phys_addr_t base; 85 phys_addr_t base;
86 phys_size_t size; 86 phys_size_t size;
87 87
88 ft_cpu_setup(blob, bd); 88 ft_cpu_setup(blob, bd);
89 89
90 base = env_get_bootm_low(); 90 base = env_get_bootm_low();
91 size = env_get_bootm_size(); 91 size = env_get_bootm_size();
92 92
93 fdt_fixup_memory(blob, (u64)base, (u64)size); 93 fdt_fixup_memory(blob, (u64)base, (u64)size);
94 94
95 #ifdef CONFIG_PCI 95 #ifdef CONFIG_PCI
96 pci_of_setup(blob, bd); 96 pci_of_setup(blob, bd);
97 #endif 97 #endif
98 98
99 fdt_fixup_liodn(blob); 99 fdt_fixup_liodn(blob);
100 fsl_fdt_fixup_dr_usb(blob, bd); 100 fsl_fdt_fixup_dr_usb(blob, bd);
101 101
102 #ifdef CONFIG_SYS_DPAA_FMAN 102 #ifdef CONFIG_SYS_DPAA_FMAN
103 fdt_fixup_fman_ethernet(blob); 103 fdt_fixup_fman_ethernet(blob);
104 #endif 104 #endif
105 105
106 return 0; 106 return 0;
107 } 107 }
108 108
109 int mac_read_from_eeprom(void) 109 int mac_read_from_eeprom(void)
110 { 110 {
111 init_eeprom(CONFIG_SYS_EEPROM_BUS_NUM, 111 init_eeprom(CONFIG_SYS_EEPROM_BUS_NUM,
112 CONFIG_SYS_I2C_EEPROM_ADDR, 112 CONFIG_SYS_I2C_EEPROM_ADDR,
113 CONFIG_SYS_I2C_EEPROM_ADDR_LEN); 113 CONFIG_SYS_I2C_EEPROM_ADDR_LEN);
114 114
115 return mac_read_from_eeprom_common(); 115 return mac_read_from_eeprom_common();
116 } 116 }
117 117
drivers/misc/Makefile
1 # 1 #
2 # (C) Copyright 2000-2007 2 # (C) Copyright 2000-2007
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. 3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 # 4 #
5 # SPDX-License-Identifier: GPL-2.0+ 5 # SPDX-License-Identifier: GPL-2.0+
6 # 6 #
7 7
8 obj-$(CONFIG_MISC) += misc-uclass.o 8 obj-$(CONFIG_MISC) += misc-uclass.o
9 obj-$(CONFIG_ALI152X) += ali512x.o 9 obj-$(CONFIG_ALI152X) += ali512x.o
10 obj-$(CONFIG_ALTERA_SYSID) += altera_sysid.o 10 obj-$(CONFIG_ALTERA_SYSID) += altera_sysid.o
11 obj-$(CONFIG_ATSHA204A) += atsha204a-i2c.o 11 obj-$(CONFIG_ATSHA204A) += atsha204a-i2c.o
12 obj-$(CONFIG_DS4510) += ds4510.o 12 obj-$(CONFIG_DS4510) += ds4510.o
13 obj-$(CONFIG_CBMEM_CONSOLE) += cbmem_console.o 13 obj-$(CONFIG_CBMEM_CONSOLE) += cbmem_console.o
14 ifndef CONFIG_SPL_BUILD 14 ifndef CONFIG_SPL_BUILD
15 obj-$(CONFIG_CROS_EC) += cros_ec.o 15 obj-$(CONFIG_CROS_EC) += cros_ec.o
16 obj-$(CONFIG_CROS_EC_LPC) += cros_ec_lpc.o 16 obj-$(CONFIG_CROS_EC_LPC) += cros_ec_lpc.o
17 obj-$(CONFIG_CROS_EC_I2C) += cros_ec_i2c.o 17 obj-$(CONFIG_CROS_EC_I2C) += cros_ec_i2c.o
18 obj-$(CONFIG_CROS_EC_SANDBOX) += cros_ec_sandbox.o 18 obj-$(CONFIG_CROS_EC_SANDBOX) += cros_ec_sandbox.o
19 obj-$(CONFIG_CROS_EC_SPI) += cros_ec_spi.o 19 obj-$(CONFIG_CROS_EC_SPI) += cros_ec_spi.o
20 endif 20 endif
21 obj-$(CONFIG_FSL_IIM) += fsl_iim.o 21 obj-$(CONFIG_FSL_IIM) += fsl_iim.o
22 obj-$(CONFIG_LED_STATUS_GPIO) += gpio_led.o 22 obj-$(CONFIG_LED_STATUS_GPIO) += gpio_led.o
23 obj-$(CONFIG_$(SPL_)I2C_EEPROM) += i2c_eeprom.o 23 obj-$(CONFIG_$(SPL_)I2C_EEPROM) += i2c_eeprom.o
24 obj-$(CONFIG_FSL_MC9SDZ60) += mc9sdz60.o 24 obj-$(CONFIG_FSL_MC9SDZ60) += mc9sdz60.o
25 obj-$(CONFIG_MXC_OCOTP) += mxc_ocotp.o 25 obj-$(CONFIG_MXC_OCOTP) += mxc_ocotp.o
26 obj-$(CONFIG_MXS_OCOTP) += mxs_ocotp.o 26 obj-$(CONFIG_MXS_OCOTP) += mxs_ocotp.o
27 obj-$(CONFIG_NUVOTON_NCT6102D) += nuvoton_nct6102d.o 27 obj-$(CONFIG_NUVOTON_NCT6102D) += nuvoton_nct6102d.o
28 obj-$(CONFIG_NS87308) += ns87308.o 28 obj-$(CONFIG_NS87308) += ns87308.o
29 obj-$(CONFIG_$(SPL_)PWRSEQ) += pwrseq-uclass.o 29 obj-$(CONFIG_$(SPL_)PWRSEQ) += pwrseq-uclass.o
30 ifdef CONFIG_DM_I2C 30 ifdef CONFIG_DM_I2C
31 ifndef CONFIG_SPL_BUILD 31 ifndef CONFIG_SPL_BUILD
32 obj-$(CONFIG_SANDBOX) += i2c_eeprom_emul.o 32 obj-$(CONFIG_SANDBOX) += i2c_eeprom_emul.o
33 endif 33 endif
34 endif 34 endif
35 obj-$(CONFIG_SMSC_LPC47M) += smsc_lpc47m.o 35 obj-$(CONFIG_SMSC_LPC47M) += smsc_lpc47m.o
36 obj-$(CONFIG_SMSC_SIO1007) += smsc_sio1007.o 36 obj-$(CONFIG_SMSC_SIO1007) += smsc_sio1007.o
37 obj-$(CONFIG_LED_STATUS) += status_led.o 37 obj-$(CONFIG_LED_STATUS) += status_led.o
38 obj-$(CONFIG_SANDBOX) += swap_case.o 38 obj-$(CONFIG_SANDBOX) += swap_case.o
39 ifdef CONFIG_SPL_OF_PLATDATA 39 ifdef CONFIG_SPL_OF_PLATDATA
40 ifdef CONFIG_SPL_BUILD 40 ifdef CONFIG_SPL_BUILD
41 obj-$(CONFIG_SANDBOX) += spltest_sandbox.o 41 obj-$(CONFIG_SANDBOX) += spltest_sandbox.o
42 endif 42 endif
43 endif 43 endif
44 obj-$(CONFIG_SANDBOX) += syscon_sandbox.o 44 obj-$(CONFIG_SANDBOX) += syscon_sandbox.o
45 obj-$(CONFIG_TEGRA_CAR) += tegra_car.o 45 obj-$(CONFIG_TEGRA_CAR) += tegra_car.o
46 obj-$(CONFIG_TEGRA186_BPMP) += tegra186_bpmp.o 46 obj-$(CONFIG_TEGRA186_BPMP) += tegra186_bpmp.o
47 obj-$(CONFIG_TWL4030_LED) += twl4030_led.o 47 obj-$(CONFIG_TWL4030_LED) += twl4030_led.o
48 obj-$(CONFIG_FSL_IFC) += fsl_ifc.o 48 obj-$(CONFIG_FSL_IFC) += fsl_ifc.o
49 obj-$(CONFIG_FSL_SEC_MON) += fsl_sec_mon.o 49 obj-$(CONFIG_FSL_SEC_MON) += fsl_sec_mon.o
50 obj-$(CONFIG_PCA9551_LED) += pca9551_led.o 50 obj-$(CONFIG_PCA9551_LED) += pca9551_led.o
51 obj-$(CONFIG_FSL_DEVICE_DISABLE) += fsl_devdis.o 51 obj-$(CONFIG_FSL_DEVICE_DISABLE) += fsl_devdis.o
52 obj-$(CONFIG_WINBOND_W83627) += winbond_w83627.o 52 obj-$(CONFIG_WINBOND_W83627) += winbond_w83627.o
53 obj-$(CONFIG_QFW) += qfw.o 53 obj-$(CONFIG_QFW) += qfw.o
54 obj-$(CONFIG_ROCKCHIP_EFUSE) += rockchip-efuse.o 54 obj-$(CONFIG_ROCKCHIP_EFUSE) += rockchip-efuse.o
55 obj-$(CONFIG_STM32_RCC) += stm32_rcc.o 55 obj-$(CONFIG_STM32_RCC) += stm32_rcc.o
56 obj-$(CONFIG_SYS_DPAA_QBMAN) += fsl_portals.o
56 57
drivers/misc/fsl_portals.c
File was created 1 /*
2 * Copyright 2008-2011 Freescale Semiconductor, Inc.
3 * Copyright 2017 NXP
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8 #include <common.h>
9 #include <libfdt.h>
10 #include <fdt_support.h>
11
12 #include <asm/processor.h>
13 #include <asm/io.h>
14 #ifdef CONFIG_PPC
15 #include <asm/fsl_portals.h>
16 #include <asm/fsl_liodn.h>
17 #endif
18 #include <fsl_qbman.h>
19
20 #define MAX_BPORTALS (CONFIG_SYS_BMAN_CINH_SIZE / CONFIG_SYS_BMAN_SP_CINH_SIZE)
21 #define MAX_QPORTALS (CONFIG_SYS_QMAN_CINH_SIZE / CONFIG_SYS_QMAN_SP_CINH_SIZE)
22 void setup_qbman_portals(void)
23 {
24 void __iomem *bpaddr = (void *)CONFIG_SYS_BMAN_CINH_BASE +
25 CONFIG_SYS_BMAN_SWP_ISDR_REG;
26 void __iomem *qpaddr = (void *)CONFIG_SYS_QMAN_CINH_BASE +
27 CONFIG_SYS_QMAN_SWP_ISDR_REG;
28 #ifdef CONFIG_PPC
29 struct ccsr_qman *qman = (void *)CONFIG_SYS_FSL_QMAN_ADDR;
30
31 /* Set the Qman initiator BAR to match the LAW (for DQRR stashing) */
32 #ifdef CONFIG_PHYS_64BIT
33 out_be32(&qman->qcsp_bare, (u32)(CONFIG_SYS_QMAN_MEM_PHYS >> 32));
34 #endif
35 out_be32(&qman->qcsp_bar, (u32)CONFIG_SYS_QMAN_MEM_PHYS);
36 #endif
37 #ifdef CONFIG_FSL_CORENET
38 int i;
39
40 for (i = 0; i < CONFIG_SYS_QMAN_NUM_PORTALS; i++) {
41 u8 sdest = qp_info[i].sdest;
42 u16 fliodn = qp_info[i].fliodn;
43 u16 dliodn = qp_info[i].dliodn;
44 u16 liodn_off = qp_info[i].liodn_offset;
45
46 out_be32(&qman->qcsp[i].qcsp_lio_cfg, (liodn_off << 16) |
47 dliodn);
48 /* set frame liodn */
49 out_be32(&qman->qcsp[i].qcsp_io_cfg, (sdest << 16) | fliodn);
50 }
51 #endif
52
53 /* Change default state of BMan ISDR portals to all 1s */
54 inhibit_portals(bpaddr, CONFIG_SYS_BMAN_NUM_PORTALS, MAX_BPORTALS,
55 CONFIG_SYS_BMAN_SP_CINH_SIZE);
56 inhibit_portals(qpaddr, CONFIG_SYS_QMAN_NUM_PORTALS, MAX_QPORTALS,
57 CONFIG_SYS_QMAN_SP_CINH_SIZE);
58 }
59
60 void inhibit_portals(void __iomem *addr, int max_portals,
61 int arch_max_portals, int portal_cinh_size)
62 {
63 u32 val;
64 int i;
65
66 /* arch_max_portals is the maximum based on memory size. This includes
67 * the reserved memory in the SoC. max_portals the number of physical
68 * portals in the SoC
69 */
70 if (max_portals > arch_max_portals) {
71 printf("ERROR: portal config error\n");
72 max_portals = arch_max_portals;
73 }
74
75 for (i = 0; i < max_portals; i++) {
76 out_be32(addr, -1);
77 val = in_be32(addr);
78 if (!val) {
79 printf("ERROR: Stopped after %d portals\n", i);
80 return;
81 }
82 addr += portal_cinh_size;
83 }
84 debug("Cleared %d portals\n", i);
85 }
86
87 #ifdef CONFIG_PPC
88 static int fdt_qportal(void *blob, int off, int id, char *name,
89 enum fsl_dpaa_dev dev, int create)
90 {
91 int childoff, dev_off, ret = 0;
92 u32 dev_handle;
93 #ifdef CONFIG_FSL_CORENET
94 int num;
95 u32 liodns[2];
96 #endif
97
98 childoff = fdt_subnode_offset(blob, off, name);
99 if (create) {
100 char handle[64], *p;
101
102 strncpy(handle, name, sizeof(handle));
103 p = strchr(handle, '@');
104 if (!strncmp(name, "fman", 4)) {
105 *p = *(p + 1);
106 p++;
107 }
108 *p = '\0';
109
110 dev_off = fdt_path_offset(blob, handle);
111 /* skip this node if alias is not found */
112 if (dev_off == -FDT_ERR_BADPATH)
113 return 0;
114 if (dev_off < 0)
115 return dev_off;
116
117 if (childoff <= 0)
118 childoff = fdt_add_subnode(blob, off, name);
119
120 /* need to update the dev_off after adding a subnode */
121 dev_off = fdt_path_offset(blob, handle);
122 if (dev_off < 0)
123 return dev_off;
124
125 if (childoff > 0) {
126 dev_handle = fdt_get_phandle(blob, dev_off);
127 if (dev_handle <= 0) {
128 dev_handle = fdt_alloc_phandle(blob);
129 ret = fdt_set_phandle(blob, dev_off,
130 dev_handle);
131 if (ret < 0)
132 return ret;
133 }
134
135 ret = fdt_setprop(blob, childoff, "dev-handle",
136 &dev_handle, sizeof(dev_handle));
137 if (ret < 0)
138 return ret;
139
140 #ifdef CONFIG_FSL_CORENET
141 num = get_dpaa_liodn(dev, &liodns[0], id);
142 ret = fdt_setprop(blob, childoff, "fsl,liodn",
143 &liodns[0], sizeof(u32) * num);
144 if (!strncmp(name, "pme", 3)) {
145 u32 pme_rev1, pme_rev2;
146 ccsr_pme_t *pme_regs =
147 (void *)CONFIG_SYS_FSL_CORENET_PME_ADDR;
148
149 pme_rev1 = in_be32(&pme_regs->pm_ip_rev_1);
150 pme_rev2 = in_be32(&pme_regs->pm_ip_rev_2);
151 ret = fdt_setprop(blob, childoff,
152 "fsl,pme-rev1", &pme_rev1,
153 sizeof(u32));
154 if (ret < 0)
155 return ret;
156 ret = fdt_setprop(blob, childoff,
157 "fsl,pme-rev2", &pme_rev2,
158 sizeof(u32));
159 }
160 #endif
161 } else {
162 return childoff;
163 }
164 } else {
165 if (childoff > 0)
166 ret = fdt_del_node(blob, childoff);
167 }
168
169 return ret;
170 }
171 #endif /* CONFIG_PPC */
172
173 void fdt_fixup_qportals(void *blob)
174 {
175 int off, err;
176 unsigned int maj, min;
177 unsigned int ip_cfg;
178 struct ccsr_qman *qman = (void *)CONFIG_SYS_FSL_QMAN_ADDR;
179 u32 rev_1 = in_be32(&qman->ip_rev_1);
180 u32 rev_2 = in_be32(&qman->ip_rev_2);
181 char compat[64];
182 int compat_len;
183
184 maj = (rev_1 >> 8) & 0xff;
185 min = rev_1 & 0xff;
186 ip_cfg = rev_2 & 0xff;
187
188 compat_len = sprintf(compat, "fsl,qman-portal-%u.%u.%u",
189 maj, min, ip_cfg) + 1;
190 compat_len += sprintf(compat + compat_len, "fsl,qman-portal") + 1;
191
192 off = fdt_node_offset_by_compatible(blob, -1, "fsl,qman-portal");
193 while (off != -FDT_ERR_NOTFOUND) {
194 #ifdef CONFIG_PPC
195 #ifdef CONFIG_FSL_CORENET
196 u32 liodns[2];
197 #endif
198 const int *ci = fdt_getprop(blob, off, "cell-index", &err);
199 int i;
200
201 if (!ci)
202 goto err;
203
204 i = *ci;
205 #ifdef CONFIG_SYS_DPAA_FMAN
206 int j;
207 #endif
208
209 #endif /* CONFIG_PPC */
210 err = fdt_setprop(blob, off, "compatible", compat, compat_len);
211 if (err < 0)
212 goto err;
213 #ifdef CONFIG_PPC
214 #ifdef CONFIG_FSL_CORENET
215 liodns[0] = qp_info[i].dliodn;
216 liodns[1] = qp_info[i].fliodn;
217 err = fdt_setprop(blob, off, "fsl,liodn",
218 &liodns, sizeof(u32) * 2);
219 if (err < 0)
220 goto err;
221 #endif
222
223 i++;
224
225 err = fdt_qportal(blob, off, i, "crypto@0", FSL_HW_PORTAL_SEC,
226 IS_E_PROCESSOR(get_svr()));
227 if (err < 0)
228 goto err;
229
230 #ifdef CONFIG_FSL_CORENET
231 #ifdef CONFIG_SYS_DPAA_PME
232 err = fdt_qportal(blob, off, i, "pme@0", FSL_HW_PORTAL_PME, 1);
233 if (err < 0)
234 goto err;
235 #else
236 fdt_qportal(blob, off, i, "pme@0", FSL_HW_PORTAL_PME, 0);
237 #endif
238 #endif
239
240 #ifdef CONFIG_SYS_DPAA_FMAN
241 for (j = 0; j < CONFIG_SYS_NUM_FMAN; j++) {
242 char name[] = "fman@0";
243
244 name[sizeof(name) - 2] = '0' + j;
245 err = fdt_qportal(blob, off, i, name,
246 FSL_HW_PORTAL_FMAN1 + j, 1);
247 if (err < 0)
248 goto err;
249 }
250 #endif
251 #ifdef CONFIG_SYS_DPAA_RMAN
252 err = fdt_qportal(blob, off, i, "rman@0",
253 FSL_HW_PORTAL_RMAN, 1);
254 if (err < 0)
255 goto err;
256 #endif
257 #endif /* CONFIG_PPC */
258
259 err:
260 if (err < 0) {
261 printf("ERROR: unable to create props for %s: %s\n",
262 fdt_get_name(blob, off, NULL),
263 fdt_strerror(err));
264 return;
265 }
266
267 off = fdt_node_offset_by_compatible(blob, off,
268 "fsl,qman-portal");
269 }
270 }
271
272 void fdt_fixup_bportals(void *blob)
273 {
274 int off, err;
275 unsigned int maj, min;
276 unsigned int ip_cfg;
277 struct ccsr_bman *bman = (void *)CONFIG_SYS_FSL_BMAN_ADDR;
278 u32 rev_1 = in_be32(&bman->ip_rev_1);
279 u32 rev_2 = in_be32(&bman->ip_rev_2);
280 char compat[64];
281 int compat_len;
282
283 maj = (rev_1 >> 8) & 0xff;
284 min = rev_1 & 0xff;
285
286 ip_cfg = rev_2 & 0xff;
287
288 compat_len = sprintf(compat, "fsl,bman-portal-%u.%u.%u",
289 maj, min, ip_cfg) + 1;
290 compat_len += sprintf(compat + compat_len, "fsl,bman-portal") + 1;
291
292 off = fdt_node_offset_by_compatible(blob, -1, "fsl,bman-portal");
293 while (off != -FDT_ERR_NOTFOUND) {
294 err = fdt_setprop(blob, off, "compatible", compat, compat_len);
295 if (err < 0) {
296 printf("ERROR: unable to create props for %s: %s\n",
297 fdt_get_name(blob, off, NULL),
298 fdt_strerror(err));
299 return;
300 }
301
302 off = fdt_node_offset_by_compatible(blob, off,
303 "fsl,bman-portal");
304 }
305 }
306
include/configs/ls1043a_common.h
1 /* 1 /*
2 * Copyright (C) 2015 Freescale Semiconductor 2 * Copyright (C) 2015 Freescale Semiconductor
3 * 3 *
4 * SPDX-License-Identifier: GPL-2.0+ 4 * SPDX-License-Identifier: GPL-2.0+
5 */ 5 */
6 6
7 #ifndef __LS1043A_COMMON_H 7 #ifndef __LS1043A_COMMON_H
8 #define __LS1043A_COMMON_H 8 #define __LS1043A_COMMON_H
9 9
10 /* SPL build */ 10 /* SPL build */
11 #ifdef CONFIG_SPL_BUILD 11 #ifdef CONFIG_SPL_BUILD
12 #define SPL_NO_FMAN 12 #define SPL_NO_FMAN
13 #define SPL_NO_DSPI 13 #define SPL_NO_DSPI
14 #define SPL_NO_PCIE 14 #define SPL_NO_PCIE
15 #define SPL_NO_ENV 15 #define SPL_NO_ENV
16 #define SPL_NO_MISC 16 #define SPL_NO_MISC
17 #define SPL_NO_USB 17 #define SPL_NO_USB
18 #define SPL_NO_SATA 18 #define SPL_NO_SATA
19 #define SPL_NO_QE 19 #define SPL_NO_QE
20 #define SPL_NO_EEPROM 20 #define SPL_NO_EEPROM
21 #endif 21 #endif
22 #if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_NAND_BOOT)) 22 #if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_NAND_BOOT))
23 #define SPL_NO_MMC 23 #define SPL_NO_MMC
24 #endif 24 #endif
25 #if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SD_BOOT_QSPI)) 25 #if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SD_BOOT_QSPI))
26 #define SPL_NO_IFC 26 #define SPL_NO_IFC
27 #endif 27 #endif
28 28
29 #define CONFIG_REMAKE_ELF 29 #define CONFIG_REMAKE_ELF
30 #define CONFIG_FSL_LAYERSCAPE 30 #define CONFIG_FSL_LAYERSCAPE
31 #define CONFIG_MP 31 #define CONFIG_MP
32 #define CONFIG_GICV2 32 #define CONFIG_GICV2
33 33
34 #include <asm/arch/stream_id_lsch2.h> 34 #include <asm/arch/stream_id_lsch2.h>
35 #include <asm/arch/config.h> 35 #include <asm/arch/config.h>
36 36
37 /* Link Definitions */ 37 /* Link Definitions */
38 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_FSL_OCRAM_BASE + 0xfff0) 38 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_FSL_OCRAM_BASE + 0xfff0)
39 39
40 #define CONFIG_SUPPORT_RAW_INITRD 40 #define CONFIG_SUPPORT_RAW_INITRD
41 41
42 #define CONFIG_SKIP_LOWLEVEL_INIT 42 #define CONFIG_SKIP_LOWLEVEL_INIT
43 43
44 #define CONFIG_VERY_BIG_RAM 44 #define CONFIG_VERY_BIG_RAM
45 #define CONFIG_SYS_DDR_SDRAM_BASE 0x80000000 45 #define CONFIG_SYS_DDR_SDRAM_BASE 0x80000000
46 #define CONFIG_SYS_FSL_DDR_SDRAM_BASE_PHY 0 46 #define CONFIG_SYS_FSL_DDR_SDRAM_BASE_PHY 0
47 #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE 47 #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE
48 #define CONFIG_SYS_DDR_BLOCK2_BASE 0x880000000ULL 48 #define CONFIG_SYS_DDR_BLOCK2_BASE 0x880000000ULL
49 49
50 #define CPU_RELEASE_ADDR secondary_boot_func 50 #define CPU_RELEASE_ADDR secondary_boot_func
51 51
52 /* Generic Timer Definitions */ 52 /* Generic Timer Definitions */
53 #define COUNTER_FREQUENCY 25000000 /* 25MHz */ 53 #define COUNTER_FREQUENCY 25000000 /* 25MHz */
54 54
55 /* Size of malloc() pool */ 55 /* Size of malloc() pool */
56 #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 1024 * 1024) 56 #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 1024 * 1024)
57 57
58 /* Serial Port */ 58 /* Serial Port */
59 #define CONFIG_CONS_INDEX 1 59 #define CONFIG_CONS_INDEX 1
60 #define CONFIG_SYS_NS16550_SERIAL 60 #define CONFIG_SYS_NS16550_SERIAL
61 #define CONFIG_SYS_NS16550_REG_SIZE 1 61 #define CONFIG_SYS_NS16550_REG_SIZE 1
62 #define CONFIG_SYS_NS16550_CLK (get_serial_clock()) 62 #define CONFIG_SYS_NS16550_CLK (get_serial_clock())
63 63
64 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } 64 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
65 65
66 /* SD boot SPL */ 66 /* SD boot SPL */
67 #ifdef CONFIG_SD_BOOT 67 #ifdef CONFIG_SD_BOOT
68 #define CONFIG_SPL_FRAMEWORK 68 #define CONFIG_SPL_FRAMEWORK
69 #define CONFIG_SPL_TARGET "u-boot-with-spl.bin" 69 #define CONFIG_SPL_TARGET "u-boot-with-spl.bin"
70 70
71 #define CONFIG_SPL_TEXT_BASE 0x10000000 71 #define CONFIG_SPL_TEXT_BASE 0x10000000
72 #define CONFIG_SPL_MAX_SIZE 0x17000 72 #define CONFIG_SPL_MAX_SIZE 0x17000
73 #define CONFIG_SPL_STACK 0x1001e000 73 #define CONFIG_SPL_STACK 0x1001e000
74 #define CONFIG_SPL_PAD_TO 0x1d000 74 #define CONFIG_SPL_PAD_TO 0x1d000
75 75
76 #define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SPL_BSS_START_ADDR + \ 76 #define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SPL_BSS_START_ADDR + \
77 CONFIG_SPL_BSS_MAX_SIZE) 77 CONFIG_SPL_BSS_MAX_SIZE)
78 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 78 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
79 #define CONFIG_SPL_BSS_START_ADDR 0x8f000000 79 #define CONFIG_SPL_BSS_START_ADDR 0x8f000000
80 #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 80 #define CONFIG_SPL_BSS_MAX_SIZE 0x80000
81 81
82 #ifdef CONFIG_SECURE_BOOT 82 #ifdef CONFIG_SECURE_BOOT
83 #define CONFIG_U_BOOT_HDR_SIZE (16 << 10) 83 #define CONFIG_U_BOOT_HDR_SIZE (16 << 10)
84 /* 84 /*
85 * HDR would be appended at end of image and copied to DDR along 85 * HDR would be appended at end of image and copied to DDR along
86 * with U-Boot image. Here u-boot max. size is 512K. So if binary 86 * with U-Boot image. Here u-boot max. size is 512K. So if binary
87 * size increases then increase this size in case of secure boot as 87 * size increases then increase this size in case of secure boot as
88 * it uses raw u-boot image instead of fit image. 88 * it uses raw u-boot image instead of fit image.
89 */ 89 */
90 #define CONFIG_SYS_MONITOR_LEN (0x100000 + CONFIG_U_BOOT_HDR_SIZE) 90 #define CONFIG_SYS_MONITOR_LEN (0x100000 + CONFIG_U_BOOT_HDR_SIZE)
91 #else 91 #else
92 #define CONFIG_SYS_MONITOR_LEN 0x100000 92 #define CONFIG_SYS_MONITOR_LEN 0x100000
93 #endif /* ifdef CONFIG_SECURE_BOOT */ 93 #endif /* ifdef CONFIG_SECURE_BOOT */
94 #endif 94 #endif
95 95
96 /* NAND SPL */ 96 /* NAND SPL */
97 #ifdef CONFIG_NAND_BOOT 97 #ifdef CONFIG_NAND_BOOT
98 #define CONFIG_SPL_PBL_PAD 98 #define CONFIG_SPL_PBL_PAD
99 #define CONFIG_SPL_FRAMEWORK 99 #define CONFIG_SPL_FRAMEWORK
100 #define CONFIG_SPL_TARGET "u-boot-with-spl.bin" 100 #define CONFIG_SPL_TARGET "u-boot-with-spl.bin"
101 #define CONFIG_SPL_TEXT_BASE 0x10000000 101 #define CONFIG_SPL_TEXT_BASE 0x10000000
102 #define CONFIG_SPL_MAX_SIZE 0x1a000 102 #define CONFIG_SPL_MAX_SIZE 0x1a000
103 #define CONFIG_SPL_STACK 0x1001d000 103 #define CONFIG_SPL_STACK 0x1001d000
104 #define CONFIG_SYS_NAND_U_BOOT_DST CONFIG_SYS_TEXT_BASE 104 #define CONFIG_SYS_NAND_U_BOOT_DST CONFIG_SYS_TEXT_BASE
105 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE 105 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
106 #define CONFIG_SYS_SPL_MALLOC_START 0x80200000 106 #define CONFIG_SYS_SPL_MALLOC_START 0x80200000
107 #define CONFIG_SPL_BSS_START_ADDR 0x80100000 107 #define CONFIG_SPL_BSS_START_ADDR 0x80100000
108 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 108 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
109 #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 109 #define CONFIG_SPL_BSS_MAX_SIZE 0x80000
110 110
111 #ifdef CONFIG_SECURE_BOOT 111 #ifdef CONFIG_SECURE_BOOT
112 #define CONFIG_U_BOOT_HDR_SIZE (16 << 10) 112 #define CONFIG_U_BOOT_HDR_SIZE (16 << 10)
113 #endif /* ifdef CONFIG_SECURE_BOOT */ 113 #endif /* ifdef CONFIG_SECURE_BOOT */
114 114
115 #ifdef CONFIG_U_BOOT_HDR_SIZE 115 #ifdef CONFIG_U_BOOT_HDR_SIZE
116 /* 116 /*
117 * HDR would be appended at end of image and copied to DDR along 117 * HDR would be appended at end of image and copied to DDR along
118 * with U-Boot image. Here u-boot max. size is 512K. So if binary 118 * with U-Boot image. Here u-boot max. size is 512K. So if binary
119 * size increases then increase this size in case of secure boot as 119 * size increases then increase this size in case of secure boot as
120 * it uses raw u-boot image instead of fit image. 120 * it uses raw u-boot image instead of fit image.
121 */ 121 */
122 #define CONFIG_SYS_MONITOR_LEN (0x100000 + CONFIG_U_BOOT_HDR_SIZE) 122 #define CONFIG_SYS_MONITOR_LEN (0x100000 + CONFIG_U_BOOT_HDR_SIZE)
123 #else 123 #else
124 #define CONFIG_SYS_MONITOR_LEN 0x100000 124 #define CONFIG_SYS_MONITOR_LEN 0x100000
125 #endif /* ifdef CONFIG_U_BOOT_HDR_SIZE */ 125 #endif /* ifdef CONFIG_U_BOOT_HDR_SIZE */
126 126
127 #endif 127 #endif
128 128
129 /* IFC */ 129 /* IFC */
130 #ifndef SPL_NO_IFC 130 #ifndef SPL_NO_IFC
131 #if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI) 131 #if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
132 #define CONFIG_FSL_IFC 132 #define CONFIG_FSL_IFC
133 /* 133 /*
134 * CONFIG_SYS_FLASH_BASE has the final address (core view) 134 * CONFIG_SYS_FLASH_BASE has the final address (core view)
135 * CONFIG_SYS_FLASH_BASE_PHYS has the final address (IFC view) 135 * CONFIG_SYS_FLASH_BASE_PHYS has the final address (IFC view)
136 * CONFIG_SYS_FLASH_BASE_PHYS_EARLY has the temporary IFC address 136 * CONFIG_SYS_FLASH_BASE_PHYS_EARLY has the temporary IFC address
137 * CONFIG_SYS_TEXT_BASE is linked to 0x60000000 for booting 137 * CONFIG_SYS_TEXT_BASE is linked to 0x60000000 for booting
138 */ 138 */
139 #define CONFIG_SYS_FLASH_BASE 0x60000000 139 #define CONFIG_SYS_FLASH_BASE 0x60000000
140 #define CONFIG_SYS_FLASH_BASE_PHYS CONFIG_SYS_FLASH_BASE 140 #define CONFIG_SYS_FLASH_BASE_PHYS CONFIG_SYS_FLASH_BASE
141 #define CONFIG_SYS_FLASH_BASE_PHYS_EARLY 0x00000000 141 #define CONFIG_SYS_FLASH_BASE_PHYS_EARLY 0x00000000
142 142
143 #ifdef CONFIG_MTD_NOR_FLASH 143 #ifdef CONFIG_MTD_NOR_FLASH
144 #define CONFIG_FLASH_CFI_DRIVER 144 #define CONFIG_FLASH_CFI_DRIVER
145 #define CONFIG_SYS_FLASH_CFI 145 #define CONFIG_SYS_FLASH_CFI
146 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 146 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
147 #define CONFIG_SYS_FLASH_QUIET_TEST 147 #define CONFIG_SYS_FLASH_QUIET_TEST
148 #define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */ 148 #define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
149 #endif 149 #endif
150 #endif 150 #endif
151 #endif 151 #endif
152 152
153 /* I2C */ 153 /* I2C */
154 #define CONFIG_SYS_I2C 154 #define CONFIG_SYS_I2C
155 #define CONFIG_SYS_I2C_MXC 155 #define CONFIG_SYS_I2C_MXC
156 #define CONFIG_SYS_I2C_MXC_I2C1 156 #define CONFIG_SYS_I2C_MXC_I2C1
157 #define CONFIG_SYS_I2C_MXC_I2C2 157 #define CONFIG_SYS_I2C_MXC_I2C2
158 #define CONFIG_SYS_I2C_MXC_I2C3 158 #define CONFIG_SYS_I2C_MXC_I2C3
159 #define CONFIG_SYS_I2C_MXC_I2C4 159 #define CONFIG_SYS_I2C_MXC_I2C4
160 160
161 /* PCIe */ 161 /* PCIe */
162 #ifndef SPL_NO_PCIE 162 #ifndef SPL_NO_PCIE
163 #define CONFIG_PCIE1 /* PCIE controller 1 */ 163 #define CONFIG_PCIE1 /* PCIE controller 1 */
164 #define CONFIG_PCIE2 /* PCIE controller 2 */ 164 #define CONFIG_PCIE2 /* PCIE controller 2 */
165 #define CONFIG_PCIE3 /* PCIE controller 3 */ 165 #define CONFIG_PCIE3 /* PCIE controller 3 */
166 166
167 #ifdef CONFIG_PCI 167 #ifdef CONFIG_PCI
168 #define CONFIG_PCI_SCAN_SHOW 168 #define CONFIG_PCI_SCAN_SHOW
169 #endif 169 #endif
170 #endif 170 #endif
171 171
172 /* Command line configuration */ 172 /* Command line configuration */
173 173
174 /* MMC */ 174 /* MMC */
175 #ifndef SPL_NO_MMC 175 #ifndef SPL_NO_MMC
176 #ifdef CONFIG_MMC 176 #ifdef CONFIG_MMC
177 #define CONFIG_FSL_ESDHC 177 #define CONFIG_FSL_ESDHC
178 #define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33 178 #define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
179 #endif 179 #endif
180 #endif 180 #endif
181 181
182 /* DSPI */ 182 /* DSPI */
183 #ifndef SPL_NO_DSPI 183 #ifndef SPL_NO_DSPI
184 #define CONFIG_FSL_DSPI 184 #define CONFIG_FSL_DSPI
185 #ifdef CONFIG_FSL_DSPI 185 #ifdef CONFIG_FSL_DSPI
186 #define CONFIG_DM_SPI_FLASH 186 #define CONFIG_DM_SPI_FLASH
187 #define CONFIG_SPI_FLASH_STMICRO /* cs0 */ 187 #define CONFIG_SPI_FLASH_STMICRO /* cs0 */
188 #define CONFIG_SPI_FLASH_SST /* cs1 */ 188 #define CONFIG_SPI_FLASH_SST /* cs1 */
189 #define CONFIG_SPI_FLASH_EON /* cs2 */ 189 #define CONFIG_SPI_FLASH_EON /* cs2 */
190 #if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI) 190 #if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
191 #define CONFIG_SF_DEFAULT_BUS 1 191 #define CONFIG_SF_DEFAULT_BUS 1
192 #define CONFIG_SF_DEFAULT_CS 0 192 #define CONFIG_SF_DEFAULT_CS 0
193 #endif 193 #endif
194 #endif 194 #endif
195 #endif 195 #endif
196 196
197 #define CONFIG_SYS_DPAA_QBMAN /* Support Q/Bman */
198
197 /* FMan ucode */ 199 /* FMan ucode */
198 #ifndef SPL_NO_FMAN 200 #ifndef SPL_NO_FMAN
199 #define CONFIG_SYS_DPAA_FMAN 201 #define CONFIG_SYS_DPAA_FMAN
200 #ifdef CONFIG_SYS_DPAA_FMAN 202 #ifdef CONFIG_SYS_DPAA_FMAN
201 #define CONFIG_SYS_FM_MURAM_SIZE 0x60000 203 #define CONFIG_SYS_FM_MURAM_SIZE 0x60000
202 204
203 #ifdef CONFIG_NAND_BOOT 205 #ifdef CONFIG_NAND_BOOT
204 /* Store Fman ucode at offeset 0x900000(72 blocks). */ 206 /* Store Fman ucode at offeset 0x900000(72 blocks). */
205 #define CONFIG_SYS_QE_FMAN_FW_IN_NAND 207 #define CONFIG_SYS_QE_FMAN_FW_IN_NAND
206 #define CONFIG_SYS_FMAN_FW_ADDR (72 * CONFIG_SYS_NAND_BLOCK_SIZE) 208 #define CONFIG_SYS_FMAN_FW_ADDR (72 * CONFIG_SYS_NAND_BLOCK_SIZE)
207 #elif defined(CONFIG_SD_BOOT) 209 #elif defined(CONFIG_SD_BOOT)
208 /* 210 /*
209 * PBL SD boot image should stored at 0x1000(8 blocks), the size of the image is 211 * PBL SD boot image should stored at 0x1000(8 blocks), the size of the image is
210 * about 1MB (2040 blocks), Env is stored after the image, and the env size is 212 * about 1MB (2040 blocks), Env is stored after the image, and the env size is
211 * 0x2000 (16 blocks), 8 + 2040 + 16 = 2064, enlarge it to 18432(0x4800). 213 * 0x2000 (16 blocks), 8 + 2040 + 16 = 2064, enlarge it to 18432(0x4800).
212 */ 214 */
213 #define CONFIG_SYS_QE_FMAN_FW_IN_MMC 215 #define CONFIG_SYS_QE_FMAN_FW_IN_MMC
214 #define CONFIG_SYS_FMAN_FW_ADDR (512 * 0x4800) 216 #define CONFIG_SYS_FMAN_FW_ADDR (512 * 0x4800)
215 #define CONFIG_SYS_QE_FW_ADDR (512 * 0x4a08) 217 #define CONFIG_SYS_QE_FW_ADDR (512 * 0x4a08)
216 #elif defined(CONFIG_QSPI_BOOT) 218 #elif defined(CONFIG_QSPI_BOOT)
217 #define CONFIG_SYS_QE_FW_IN_SPIFLASH 219 #define CONFIG_SYS_QE_FW_IN_SPIFLASH
218 #define CONFIG_SYS_FMAN_FW_ADDR 0x40900000 220 #define CONFIG_SYS_FMAN_FW_ADDR 0x40900000
219 #define CONFIG_ENV_SPI_BUS 0 221 #define CONFIG_ENV_SPI_BUS 0
220 #define CONFIG_ENV_SPI_CS 0 222 #define CONFIG_ENV_SPI_CS 0
221 #define CONFIG_ENV_SPI_MAX_HZ 1000000 223 #define CONFIG_ENV_SPI_MAX_HZ 1000000
222 #define CONFIG_ENV_SPI_MODE 0x03 224 #define CONFIG_ENV_SPI_MODE 0x03
223 #else 225 #else
224 #define CONFIG_SYS_QE_FMAN_FW_IN_NOR 226 #define CONFIG_SYS_QE_FMAN_FW_IN_NOR
225 /* FMan fireware Pre-load address */ 227 /* FMan fireware Pre-load address */
226 #define CONFIG_SYS_FMAN_FW_ADDR 0x60900000 228 #define CONFIG_SYS_FMAN_FW_ADDR 0x60900000
227 #define CONFIG_SYS_QE_FW_ADDR 0x60940000 229 #define CONFIG_SYS_QE_FW_ADDR 0x60940000
228 #endif 230 #endif
229 #define CONFIG_SYS_QE_FMAN_FW_LENGTH 0x10000 231 #define CONFIG_SYS_QE_FMAN_FW_LENGTH 0x10000
230 #define CONFIG_SYS_FDT_PAD (0x3000 + CONFIG_SYS_QE_FMAN_FW_LENGTH) 232 #define CONFIG_SYS_FDT_PAD (0x3000 + CONFIG_SYS_QE_FMAN_FW_LENGTH)
231 #endif 233 #endif
232 #endif 234 #endif
233 235
234 /* Miscellaneous configurable options */ 236 /* Miscellaneous configurable options */
235 #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_DDR_SDRAM_BASE + 0x10000000) 237 #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_DDR_SDRAM_BASE + 0x10000000)
236 238
237 #define CONFIG_HWCONFIG 239 #define CONFIG_HWCONFIG
238 #define HWCONFIG_BUFFER_SIZE 128 240 #define HWCONFIG_BUFFER_SIZE 128
239 241
240 #ifndef SPL_NO_MISC 242 #ifndef SPL_NO_MISC
241 #include <config_distro_defaults.h> 243 #include <config_distro_defaults.h>
242 #ifndef CONFIG_SPL_BUILD 244 #ifndef CONFIG_SPL_BUILD
243 #define BOOT_TARGET_DEVICES(func) \ 245 #define BOOT_TARGET_DEVICES(func) \
244 func(MMC, mmc, 0) \ 246 func(MMC, mmc, 0) \
245 func(USB, usb, 0) 247 func(USB, usb, 0)
246 #include <config_distro_bootcmd.h> 248 #include <config_distro_bootcmd.h>
247 #endif 249 #endif
248 250
249 /* Initial environment variables */ 251 /* Initial environment variables */
250 #define CONFIG_EXTRA_ENV_SETTINGS \ 252 #define CONFIG_EXTRA_ENV_SETTINGS \
251 "hwconfig=fsl_ddr:bank_intlv=auto\0" \ 253 "hwconfig=fsl_ddr:bank_intlv=auto\0" \
252 "fdt_high=0xffffffffffffffff\0" \ 254 "fdt_high=0xffffffffffffffff\0" \
253 "initrd_high=0xffffffffffffffff\0" \ 255 "initrd_high=0xffffffffffffffff\0" \
254 "fdt_addr=0x64f00000\0" \ 256 "fdt_addr=0x64f00000\0" \
255 "kernel_addr=0x61000000\0" \ 257 "kernel_addr=0x61000000\0" \
256 "scriptaddr=0x80000000\0" \ 258 "scriptaddr=0x80000000\0" \
257 "scripthdraddr=0x80080000\0" \ 259 "scripthdraddr=0x80080000\0" \
258 "fdtheader_addr_r=0x80100000\0" \ 260 "fdtheader_addr_r=0x80100000\0" \
259 "kernelheader_addr_r=0x80200000\0" \ 261 "kernelheader_addr_r=0x80200000\0" \
260 "kernel_addr_r=0x81000000\0" \ 262 "kernel_addr_r=0x81000000\0" \
261 "fdt_addr_r=0x90000000\0" \ 263 "fdt_addr_r=0x90000000\0" \
262 "load_addr=0xa0000000\0" \ 264 "load_addr=0xa0000000\0" \
263 "kernelheader_addr=0x60800000\0" \ 265 "kernelheader_addr=0x60800000\0" \
264 "kernel_size=0x2800000\0" \ 266 "kernel_size=0x2800000\0" \
265 "kernelheader_size=0x40000\0" \ 267 "kernelheader_size=0x40000\0" \
266 "kernel_addr_sd=0x8000\0" \ 268 "kernel_addr_sd=0x8000\0" \
267 "kernel_size_sd=0x14000\0" \ 269 "kernel_size_sd=0x14000\0" \
268 "kernelhdr_addr_sd=0x4000\0" \ 270 "kernelhdr_addr_sd=0x4000\0" \
269 "kernelhdr_size_sd=0x10\0" \ 271 "kernelhdr_size_sd=0x10\0" \
270 "console=ttyS0,115200\0" \ 272 "console=ttyS0,115200\0" \
271 "boot_os=y\0" \ 273 "boot_os=y\0" \
272 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ 274 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
273 BOOTENV \ 275 BOOTENV \
274 "boot_scripts=ls1043ardb_boot.scr\0" \ 276 "boot_scripts=ls1043ardb_boot.scr\0" \
275 "boot_script_hdr=hdr_ls1043ardb_bs.out\0" \ 277 "boot_script_hdr=hdr_ls1043ardb_bs.out\0" \
276 "scan_dev_for_boot_part=" \ 278 "scan_dev_for_boot_part=" \
277 "part list ${devtype} ${devnum} devplist; " \ 279 "part list ${devtype} ${devnum} devplist; " \
278 "env exists devplist || setenv devplist 1; " \ 280 "env exists devplist || setenv devplist 1; " \
279 "for distro_bootpart in ${devplist}; do " \ 281 "for distro_bootpart in ${devplist}; do " \
280 "if fstype ${devtype} " \ 282 "if fstype ${devtype} " \
281 "${devnum}:${distro_bootpart} " \ 283 "${devnum}:${distro_bootpart} " \
282 "bootfstype; then " \ 284 "bootfstype; then " \
283 "run scan_dev_for_boot; " \ 285 "run scan_dev_for_boot; " \
284 "fi; " \ 286 "fi; " \
285 "done\0" \ 287 "done\0" \
286 "scan_dev_for_boot=" \ 288 "scan_dev_for_boot=" \
287 "echo Scanning ${devtype} " \ 289 "echo Scanning ${devtype} " \
288 "${devnum}:${distro_bootpart}...; " \ 290 "${devnum}:${distro_bootpart}...; " \
289 "for prefix in ${boot_prefixes}; do " \ 291 "for prefix in ${boot_prefixes}; do " \
290 "run scan_dev_for_scripts; " \ 292 "run scan_dev_for_scripts; " \
291 "done;\0" \ 293 "done;\0" \
292 "boot_a_script=" \ 294 "boot_a_script=" \
293 "load ${devtype} ${devnum}:${distro_bootpart} " \ 295 "load ${devtype} ${devnum}:${distro_bootpart} " \
294 "${scriptaddr} ${prefix}${script}; " \ 296 "${scriptaddr} ${prefix}${script}; " \
295 "env exists secureboot && load ${devtype} " \ 297 "env exists secureboot && load ${devtype} " \
296 "${devnum}:${distro_bootpart} " \ 298 "${devnum}:${distro_bootpart} " \
297 "${scripthdraddr} ${prefix}${boot_script_hdr} " \ 299 "${scripthdraddr} ${prefix}${boot_script_hdr} " \
298 "&& esbc_validate ${scripthdraddr};" \ 300 "&& esbc_validate ${scripthdraddr};" \
299 "source ${scriptaddr}\0" \ 301 "source ${scriptaddr}\0" \
300 "qspi_bootcmd=echo Trying load from qspi..;" \ 302 "qspi_bootcmd=echo Trying load from qspi..;" \
301 "sf probe && sf read $load_addr " \ 303 "sf probe && sf read $load_addr " \
302 "$kernel_addr $kernel_size; env exists secureboot " \ 304 "$kernel_addr $kernel_size; env exists secureboot " \
303 "&& sf read $kernelheader_addr_r $kernelheader_addr " \ 305 "&& sf read $kernelheader_addr_r $kernelheader_addr " \
304 "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \ 306 "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \
305 "bootm $load_addr#$board\0" \ 307 "bootm $load_addr#$board\0" \
306 "nor_bootcmd=echo Trying load from nor..;" \ 308 "nor_bootcmd=echo Trying load from nor..;" \
307 "cp.b $kernel_addr $load_addr " \ 309 "cp.b $kernel_addr $load_addr " \
308 "$kernel_size; env exists secureboot " \ 310 "$kernel_size; env exists secureboot " \
309 "&& cp.b $kernelheader_addr $kernelheader_addr_r " \ 311 "&& cp.b $kernelheader_addr $kernelheader_addr_r " \
310 "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \ 312 "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \
311 "bootm $load_addr#$board\0" \ 313 "bootm $load_addr#$board\0" \
312 "sd_bootcmd=echo Trying load from SD ..;" \ 314 "sd_bootcmd=echo Trying load from SD ..;" \
313 "mmcinfo; mmc read $load_addr " \ 315 "mmcinfo; mmc read $load_addr " \
314 "$kernel_addr_sd $kernel_size_sd && " \ 316 "$kernel_addr_sd $kernel_size_sd && " \
315 "env exists secureboot && mmc read $kernelheader_addr_r " \ 317 "env exists secureboot && mmc read $kernelheader_addr_r " \
316 "$kernelhdr_addr_sd $kernelhdr_size_sd " \ 318 "$kernelhdr_addr_sd $kernelhdr_size_sd " \
317 " && esbc_validate ${kernelheader_addr_r};" \ 319 " && esbc_validate ${kernelheader_addr_r};" \
318 "bootm $load_addr#$board\0" 320 "bootm $load_addr#$board\0"
319 321
320 322
321 #undef CONFIG_BOOTCOMMAND 323 #undef CONFIG_BOOTCOMMAND
322 #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) 324 #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
323 #define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \ 325 #define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \
324 "env exists secureboot && esbc_halt;" 326 "env exists secureboot && esbc_halt;"
325 #elif defined(CONFIG_SD_BOOT) 327 #elif defined(CONFIG_SD_BOOT)
326 #define CONFIG_BOOTCOMMAND "run distro_bootcmd; run sd_bootcmd; " \ 328 #define CONFIG_BOOTCOMMAND "run distro_bootcmd; run sd_bootcmd; " \
327 "env exists secureboot && esbc_halt;" 329 "env exists secureboot && esbc_halt;"
328 #else 330 #else
329 #define CONFIG_BOOTCOMMAND "run distro_bootcmd; run nor_bootcmd; " \ 331 #define CONFIG_BOOTCOMMAND "run distro_bootcmd; run nor_bootcmd; " \
330 "env exists secureboot && esbc_halt;" 332 "env exists secureboot && esbc_halt;"
331 #endif 333 #endif
332 #endif 334 #endif
333 335
334 /* Monitor Command Prompt */ 336 /* Monitor Command Prompt */
335 #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */ 337 #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
336 #define CONFIG_SYS_LONGHELP 338 #define CONFIG_SYS_LONGHELP
337 339
338 #ifndef SPL_NO_MISC 340 #ifndef SPL_NO_MISC
339 #ifndef CONFIG_CMDLINE_EDITING 341 #ifndef CONFIG_CMDLINE_EDITING
340 #define CONFIG_CMDLINE_EDITING 1 342 #define CONFIG_CMDLINE_EDITING 1
341 #endif 343 #endif
342 #endif 344 #endif
343 345
344 #define CONFIG_AUTO_COMPLETE 346 #define CONFIG_AUTO_COMPLETE
345 #define CONFIG_SYS_MAXARGS 64 /* max command args */ 347 #define CONFIG_SYS_MAXARGS 64 /* max command args */
346 348
347 #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */ 349 #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */
348 350
349 #include <asm/arch/soc.h> 351 #include <asm/arch/soc.h>
350 352
351 #endif /* __LS1043A_COMMON_H */ 353 #endif /* __LS1043A_COMMON_H */
352 354
File was created 1 /*
2 * Copyright 2017 NXP
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7 #ifndef __FSL_QBMAN_H__
8 #define __FSL_QBMAN_H__
9 void fdt_fixup_qportals(void *blob);
10 void fdt_fixup_bportals(void *blob);
11 void inhibit_portals(void __iomem *addr, int max_portals,
12 int arch_max_portals, int portal_cinh_size);
13 void setup_qbman_portals(void);
14
15 struct ccsr_qman {
16 #ifdef CONFIG_SYS_FSL_QMAN_V3
17 u8 res0[0x200];
18 #else
19 struct {
20 u32 qcsp_lio_cfg; /* 0x0 - SW Portal n LIO cfg */
21 u32 qcsp_io_cfg; /* 0x4 - SW Portal n IO cfg */
22 u32 res;
23 u32 qcsp_dd_cfg; /* 0xc - SW Portal Dynamic Debug cfg */
24 } qcsp[32];
25 #endif
26 /* Not actually reserved, but irrelevant to u-boot */
27 u8 res[0xbf8 - 0x200];
28 u32 ip_rev_1;
29 u32 ip_rev_2;
30 u32 fqd_bare; /* FQD Extended Base Addr Register */
31 u32 fqd_bar; /* FQD Base Addr Register */
32 u8 res1[0x8];
33 u32 fqd_ar; /* FQD Attributes Register */
34 u8 res2[0xc];
35 u32 pfdr_bare; /* PFDR Extended Base Addr Register */
36 u32 pfdr_bar; /* PFDR Base Addr Register */
37 u8 res3[0x8];
38 u32 pfdr_ar; /* PFDR Attributes Register */
39 u8 res4[0x4c];
40 u32 qcsp_bare; /* QCSP Extended Base Addr Register */
41 u32 qcsp_bar; /* QCSP Base Addr Register */
42 u8 res5[0x78];
43 u32 ci_sched_cfg; /* Initiator Scheduling Configuration */
44 u32 srcidr; /* Source ID Register */
45 u32 liodnr; /* LIODN Register */
46 u8 res6[4];
47 u32 ci_rlm_cfg; /* Initiator Read Latency Monitor Cfg */
48 u32 ci_rlm_avg; /* Initiator Read Latency Monitor Avg */
49 u8 res7[0x2e8];
50 #ifdef CONFIG_SYS_FSL_QMAN_V3
51 struct {
52 u32 qcsp_lio_cfg; /* 0x0 - SW Portal n LIO cfg */
53 u32 qcsp_io_cfg; /* 0x4 - SW Portal n IO cfg */
54 u32 res;
55 u32 qcsp_dd_cfg; /* 0xc - SW Portal n Dynamic Debug cfg*/
56 } qcsp[50];
57 #endif
58 };
59
60 struct ccsr_bman {
61 /* Not actually reserved, but irrelevant to u-boot */
62 u8 res[0xbf8];
63 u32 ip_rev_1;
64 u32 ip_rev_2;
65 u32 fbpr_bare; /* FBPR Extended Base Addr Register */
66 u32 fbpr_bar; /* FBPR Base Addr Register */
67 u8 res1[0x8];
68 u32 fbpr_ar; /* FBPR Attributes Register */
69 u8 res2[0xf0];
70 u32 srcidr; /* Source ID Register */
71 u32 liodnr; /* LIODN Register */
72 u8 res7[0x2f4];
73 };
74
75 #endif /* __FSL_QBMAN_H__ */
76