Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Dipen Dudhat | 00c4294 | 2011-01-20 16:29:35 +0530 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2010-2011 Freescale Semiconductor, Inc. |
| 4 | * Author: Dipen Dudhat <dipen.dudhat@freescale.com> |
Dipen Dudhat | 00c4294 | 2011-01-20 16:29:35 +0530 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
York Sun | 37562f6 | 2013-10-22 12:39:02 -0700 | [diff] [blame] | 8 | #include <fsl_ifc.h> |
Dipen Dudhat | 00c4294 | 2011-01-20 16:29:35 +0530 | [diff] [blame] | 9 | |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 10 | struct ifc_regs ifc_cfg_default_boot[CONFIG_SYS_FSL_IFC_BANK_COUNT] = { |
| 11 | { |
| 12 | "cs0", |
Dipen Dudhat | 00c4294 | 2011-01-20 16:29:35 +0530 | [diff] [blame] | 13 | #if defined(CONFIG_SYS_CSPR0) && defined(CONFIG_SYS_CSOR0) |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 14 | CONFIG_SYS_CSPR0, |
Kumar Gala | 7bc4f62 | 2012-08-17 08:20:25 +0000 | [diff] [blame] | 15 | #ifdef CONFIG_SYS_CSPR0_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 16 | CONFIG_SYS_CSPR0_EXT, |
| 17 | #else |
| 18 | 0, |
Kumar Gala | 7bc4f62 | 2012-08-17 08:20:25 +0000 | [diff] [blame] | 19 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 20 | #ifdef CONFIG_SYS_AMASK0 |
| 21 | CONFIG_SYS_AMASK0, |
| 22 | #else |
| 23 | 0, |
| 24 | #endif |
| 25 | CONFIG_SYS_CSOR0, |
| 26 | { |
| 27 | CONFIG_SYS_CS0_FTIM0, |
| 28 | CONFIG_SYS_CS0_FTIM1, |
| 29 | CONFIG_SYS_CS0_FTIM2, |
| 30 | CONFIG_SYS_CS0_FTIM3, |
| 31 | }, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 32 | #ifdef CONFIG_SYS_CSOR0_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 33 | CONFIG_SYS_CSOR0_EXT, |
| 34 | #else |
| 35 | 0, |
| 36 | #endif |
| 37 | #ifdef CONFIG_SYS_CSPR0_FINAL |
| 38 | CONFIG_SYS_CSPR0_FINAL, |
| 39 | #else |
| 40 | 0, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 41 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 42 | #ifdef CONFIG_SYS_AMASK0_FINAL |
| 43 | CONFIG_SYS_AMASK0_FINAL, |
| 44 | #else |
| 45 | 0, |
Dipen Dudhat | 00c4294 | 2011-01-20 16:29:35 +0530 | [diff] [blame] | 46 | #endif |
Poonam Aggrwal | 46b86ca | 2011-07-07 20:36:47 +0530 | [diff] [blame] | 47 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 48 | }, |
Dipen Dudhat | 00c4294 | 2011-01-20 16:29:35 +0530 | [diff] [blame] | 49 | |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 50 | #if CONFIG_SYS_FSL_IFC_BANK_COUNT >= 2 |
| 51 | { |
| 52 | "cs1", |
| 53 | #if defined(CONFIG_SYS_CSPR1) && defined(CONFIG_SYS_CSOR1) |
| 54 | CONFIG_SYS_CSPR1, |
Kumar Gala | 7bc4f62 | 2012-08-17 08:20:25 +0000 | [diff] [blame] | 55 | #ifdef CONFIG_SYS_CSPR1_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 56 | CONFIG_SYS_CSPR1_EXT, |
| 57 | #else |
| 58 | 0, |
Kumar Gala | 7bc4f62 | 2012-08-17 08:20:25 +0000 | [diff] [blame] | 59 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 60 | #ifdef CONFIG_SYS_AMASK1 |
| 61 | CONFIG_SYS_AMASK1, |
| 62 | #else |
| 63 | 0, |
| 64 | #endif |
| 65 | CONFIG_SYS_CSOR1, |
| 66 | { |
| 67 | CONFIG_SYS_CS1_FTIM0, |
| 68 | CONFIG_SYS_CS1_FTIM1, |
| 69 | CONFIG_SYS_CS1_FTIM2, |
| 70 | CONFIG_SYS_CS1_FTIM3, |
| 71 | }, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 72 | #ifdef CONFIG_SYS_CSOR1_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 73 | CONFIG_SYS_CSOR1_EXT, |
| 74 | #else |
| 75 | 0, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 76 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 77 | #ifdef CONFIG_SYS_CSPR1_FINAL |
| 78 | CONFIG_SYS_CSPR1_FINAL, |
| 79 | #else |
| 80 | 0, |
| 81 | #endif |
| 82 | #ifdef CONFIG_SYS_AMASK1_FINAL |
| 83 | CONFIG_SYS_AMASK1_FINAL, |
| 84 | #else |
| 85 | 0, |
| 86 | #endif |
| 87 | #endif |
| 88 | }, |
Dipen Dudhat | 00c4294 | 2011-01-20 16:29:35 +0530 | [diff] [blame] | 89 | #endif |
| 90 | |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 91 | #if CONFIG_SYS_FSL_IFC_BANK_COUNT >= 3 |
| 92 | { |
| 93 | "cs2", |
| 94 | #if defined(CONFIG_SYS_CSPR2) && defined(CONFIG_SYS_CSOR2) |
| 95 | CONFIG_SYS_CSPR2, |
Kumar Gala | 7bc4f62 | 2012-08-17 08:20:25 +0000 | [diff] [blame] | 96 | #ifdef CONFIG_SYS_CSPR2_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 97 | CONFIG_SYS_CSPR2_EXT, |
| 98 | #else |
| 99 | 0, |
Kumar Gala | 7bc4f62 | 2012-08-17 08:20:25 +0000 | [diff] [blame] | 100 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 101 | #ifdef CONFIG_SYS_AMASK2 |
| 102 | CONFIG_SYS_AMASK2, |
| 103 | #else |
| 104 | 0, |
| 105 | #endif |
| 106 | CONFIG_SYS_CSOR2, |
| 107 | { |
| 108 | CONFIG_SYS_CS2_FTIM0, |
| 109 | CONFIG_SYS_CS2_FTIM1, |
| 110 | CONFIG_SYS_CS2_FTIM2, |
| 111 | CONFIG_SYS_CS2_FTIM3, |
| 112 | }, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 113 | #ifdef CONFIG_SYS_CSOR2_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 114 | CONFIG_SYS_CSOR2_EXT, |
| 115 | #else |
| 116 | 0, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 117 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 118 | #ifdef CONFIG_SYS_CSPR2_FINAL |
| 119 | CONFIG_SYS_CSPR2_FINAL, |
| 120 | #else |
| 121 | 0, |
| 122 | #endif |
| 123 | #ifdef CONFIG_SYS_AMASK2_FINAL |
| 124 | CONFIG_SYS_AMASK2_FINAL, |
| 125 | #else |
| 126 | 0, |
| 127 | #endif |
| 128 | #endif |
| 129 | }, |
Dipen Dudhat | 00c4294 | 2011-01-20 16:29:35 +0530 | [diff] [blame] | 130 | #endif |
| 131 | |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 132 | #if CONFIG_SYS_FSL_IFC_BANK_COUNT >= 4 |
| 133 | { |
| 134 | "cs3", |
| 135 | #if defined(CONFIG_SYS_CSPR3) && defined(CONFIG_SYS_CSOR3) |
| 136 | CONFIG_SYS_CSPR3, |
Kumar Gala | 7bc4f62 | 2012-08-17 08:20:25 +0000 | [diff] [blame] | 137 | #ifdef CONFIG_SYS_CSPR3_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 138 | CONFIG_SYS_CSPR3_EXT, |
| 139 | #else |
| 140 | 0, |
| 141 | #endif |
| 142 | #ifdef CONFIG_SYS_AMASK3 |
| 143 | CONFIG_SYS_AMASK3, |
| 144 | #else |
| 145 | 0, |
Kumar Gala | 7bc4f62 | 2012-08-17 08:20:25 +0000 | [diff] [blame] | 146 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 147 | CONFIG_SYS_CSOR3, |
| 148 | { |
| 149 | CONFIG_SYS_CS3_FTIM0, |
| 150 | CONFIG_SYS_CS3_FTIM1, |
| 151 | CONFIG_SYS_CS3_FTIM2, |
| 152 | CONFIG_SYS_CS3_FTIM3, |
| 153 | }, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 154 | #ifdef CONFIG_SYS_CSOR3_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 155 | CONFIG_SYS_CSOR3_EXT, |
| 156 | #else |
| 157 | 0, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 158 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 159 | #ifdef CONFIG_SYS_CSPR3_FINAL |
| 160 | CONFIG_SYS_CSPR3_FINAL, |
| 161 | #else |
| 162 | 0, |
| 163 | #endif |
| 164 | #ifdef CONFIG_SYS_AMASK3_FINAL |
| 165 | CONFIG_SYS_AMASK3_FINAL, |
| 166 | #else |
| 167 | 0, |
| 168 | #endif |
| 169 | #endif |
| 170 | }, |
Dipen Dudhat | 00c4294 | 2011-01-20 16:29:35 +0530 | [diff] [blame] | 171 | #endif |
Mingkai Hu | 6f024c9 | 2013-05-16 10:18:13 +0800 | [diff] [blame] | 172 | |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 173 | #if CONFIG_SYS_FSL_IFC_BANK_COUNT >= 5 |
| 174 | { |
| 175 | "cs4", |
| 176 | #if defined(CONFIG_SYS_CSPR4) && defined(CONFIG_SYS_CSOR4) |
| 177 | CONFIG_SYS_CSPR4, |
Mingkai Hu | 6f024c9 | 2013-05-16 10:18:13 +0800 | [diff] [blame] | 178 | #ifdef CONFIG_SYS_CSPR4_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 179 | CONFIG_SYS_CSPR4_EXT, |
| 180 | #else |
| 181 | 0, |
Mingkai Hu | 6f024c9 | 2013-05-16 10:18:13 +0800 | [diff] [blame] | 182 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 183 | #ifdef CONFIG_SYS_AMASK4 |
| 184 | CONFIG_SYS_AMASK4, |
| 185 | #else |
| 186 | 0, |
| 187 | #endif |
| 188 | CONFIG_SYS_CSOR4, |
| 189 | { |
| 190 | CONFIG_SYS_CS4_FTIM0, |
| 191 | CONFIG_SYS_CS4_FTIM1, |
| 192 | CONFIG_SYS_CS4_FTIM2, |
| 193 | CONFIG_SYS_CS4_FTIM3, |
| 194 | }, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 195 | #ifdef CONFIG_SYS_CSOR4_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 196 | CONFIG_SYS_CSOR4_EXT, |
| 197 | #else |
| 198 | 0, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 199 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 200 | #ifdef CONFIG_SYS_CSPR4_FINAL |
| 201 | CONFIG_SYS_CSPR4_FINAL, |
| 202 | #else |
| 203 | 0, |
| 204 | #endif |
| 205 | #ifdef CONFIG_SYS_AMASK4_FINAL |
| 206 | CONFIG_SYS_AMASK4_FINAL, |
| 207 | #else |
| 208 | 0, |
| 209 | #endif |
| 210 | #endif |
| 211 | }, |
Mingkai Hu | 6f024c9 | 2013-05-16 10:18:13 +0800 | [diff] [blame] | 212 | #endif |
| 213 | |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 214 | #if CONFIG_SYS_FSL_IFC_BANK_COUNT >= 6 |
| 215 | { |
| 216 | "cs5", |
| 217 | #if defined(CONFIG_SYS_CSPR5) && defined(CONFIG_SYS_CSOR5) |
| 218 | CONFIG_SYS_CSPR5, |
Mingkai Hu | 6f024c9 | 2013-05-16 10:18:13 +0800 | [diff] [blame] | 219 | #ifdef CONFIG_SYS_CSPR5_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 220 | CONFIG_SYS_CSPR5_EXT, |
| 221 | #else |
| 222 | 0, |
Mingkai Hu | 6f024c9 | 2013-05-16 10:18:13 +0800 | [diff] [blame] | 223 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 224 | #ifdef CONFIG_SYS_AMASK5 |
| 225 | CONFIG_SYS_AMASK5, |
| 226 | #else |
| 227 | 0, |
| 228 | #endif |
| 229 | CONFIG_SYS_CSOR5, |
| 230 | { |
| 231 | CONFIG_SYS_CS5_FTIM0, |
| 232 | CONFIG_SYS_CS5_FTIM1, |
| 233 | CONFIG_SYS_CS5_FTIM2, |
| 234 | CONFIG_SYS_CS5_FTIM3, |
| 235 | }, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 236 | #ifdef CONFIG_SYS_CSOR5_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 237 | CONFIG_SYS_CSOR5_EXT, |
| 238 | #else |
| 239 | 0, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 240 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 241 | #ifdef CONFIG_SYS_CSPR5_FINAL |
| 242 | CONFIG_SYS_CSPR5_FINAL, |
| 243 | #else |
| 244 | 0, |
| 245 | #endif |
| 246 | #ifdef CONFIG_SYS_AMASK5_FINAL |
| 247 | CONFIG_SYS_AMASK5_FINAL, |
| 248 | #else |
| 249 | 0, |
| 250 | #endif |
| 251 | #endif |
| 252 | }, |
Mingkai Hu | 6f024c9 | 2013-05-16 10:18:13 +0800 | [diff] [blame] | 253 | #endif |
| 254 | |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 255 | #if CONFIG_SYS_FSL_IFC_BANK_COUNT >= 7 |
| 256 | { |
| 257 | "cs6", |
| 258 | #if defined(CONFIG_SYS_CSPR6) && defined(CONFIG_SYS_CSOR6) |
| 259 | CONFIG_SYS_CSPR6, |
Mingkai Hu | 6f024c9 | 2013-05-16 10:18:13 +0800 | [diff] [blame] | 260 | #ifdef CONFIG_SYS_CSPR6_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 261 | CONFIG_SYS_CSPR6_EXT, |
| 262 | #else |
| 263 | 0, |
| 264 | #endif |
| 265 | #ifdef CONFIG_SYS_AMASK6 |
| 266 | CONFIG_SYS_AMASK6, |
| 267 | #else |
| 268 | 0, |
Mingkai Hu | 6f024c9 | 2013-05-16 10:18:13 +0800 | [diff] [blame] | 269 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 270 | CONFIG_SYS_CSOR6, |
| 271 | { |
| 272 | CONFIG_SYS_CS6_FTIM0, |
| 273 | CONFIG_SYS_CS6_FTIM1, |
| 274 | CONFIG_SYS_CS6_FTIM2, |
| 275 | CONFIG_SYS_CS6_FTIM3, |
| 276 | }, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 277 | #ifdef CONFIG_SYS_CSOR6_EXT |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 278 | CONFIG_SYS_CSOR6_EXT, |
| 279 | #else |
| 280 | 0, |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 281 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 282 | #ifdef CONFIG_SYS_CSPR6_FINAL |
| 283 | CONFIG_SYS_CSPR6_FINAL, |
| 284 | #else |
| 285 | 0, |
Mingkai Hu | 6f024c9 | 2013-05-16 10:18:13 +0800 | [diff] [blame] | 286 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 287 | #ifdef CONFIG_SYS_AMASK6_FINAL |
| 288 | CONFIG_SYS_AMASK6_FINAL, |
| 289 | #else |
| 290 | 0, |
Mingkai Hu | 6f024c9 | 2013-05-16 10:18:13 +0800 | [diff] [blame] | 291 | #endif |
Prabhakar Kushwaha | a3aaf1d | 2013-10-04 10:05:36 +0530 | [diff] [blame] | 292 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 293 | }, |
Mingkai Hu | 6f024c9 | 2013-05-16 10:18:13 +0800 | [diff] [blame] | 294 | #endif |
York Sun | d377b61 | 2014-03-19 13:52:34 -0700 | [diff] [blame] | 295 | |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 296 | #if CONFIG_SYS_FSL_IFC_BANK_COUNT >= 8 |
| 297 | { |
| 298 | "cs7", |
| 299 | #if defined(CONFIG_SYS_CSPR7) && defined(CONFIG_SYS_CSOR7) |
| 300 | CONFIG_SYS_CSPR7, |
| 301 | #ifdef CONFIG_SYS_CSPR7_EXT |
| 302 | CONFIG_SYS_CSPR7_EXT, |
| 303 | #else |
| 304 | 0, |
York Sun | d377b61 | 2014-03-19 13:52:34 -0700 | [diff] [blame] | 305 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 306 | #ifdef CONFIG_SYS_AMASK7 |
| 307 | CONFIG_SYS_AMASK7, |
| 308 | #else |
| 309 | 0, |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 310 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 311 | CONFIG_SYS_CSOR7, |
| 312 | #ifdef CONFIG_SYS_CSOR7_EXT |
| 313 | CONFIG_SYS_CSOR7_EXT, |
| 314 | #else |
| 315 | 0, |
Prabhakar Kushwaha | 1c56fb2 | 2015-03-19 09:20:48 -0700 | [diff] [blame] | 316 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 317 | { |
| 318 | CONFIG_SYS_CS7_FTIM0, |
| 319 | CONFIG_SYS_CS7_FTIM1, |
| 320 | CONFIG_SYS_CS7_FTIM2, |
| 321 | CONFIG_SYS_CS7_FTIM3, |
| 322 | }, |
| 323 | #ifdef CONFIG_SYS_CSPR7_FINAL |
| 324 | CONFIG_SYS_CSPR7_FINAL, |
| 325 | #else |
| 326 | 0, |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 327 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 328 | #ifdef CONFIG_SYS_AMASK7_FINAL |
| 329 | CONFIG_SYS_AMASK7_FINAL, |
| 330 | #else |
| 331 | 0, |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 332 | #endif |
Prabhakar Kushwaha | 1c56fb2 | 2015-03-19 09:20:48 -0700 | [diff] [blame] | 333 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 334 | }, |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 335 | #endif |
Pankit Garg | 92d443b | 2018-11-05 18:01:33 +0000 | [diff] [blame] | 336 | }; |
| 337 | |
| 338 | __weak void ifc_cfg_boot_info(struct ifc_regs_info *regs_info) |
| 339 | { |
| 340 | regs_info->regs = ifc_cfg_default_boot; |
| 341 | regs_info->cs_size = CONFIG_SYS_FSL_IFC_BANK_COUNT; |
| 342 | } |
| 343 | |
| 344 | void print_ifc_regs(void) |
| 345 | { |
| 346 | int i, j; |
| 347 | |
| 348 | printf("IFC Controller Registers\n"); |
| 349 | for (i = 0; i < CONFIG_SYS_FSL_IFC_BANK_COUNT; i++) { |
| 350 | printf("CSPR%d:0x%08X\tAMASK%d:0x%08X\tCSOR%d:0x%08X\n", |
| 351 | i, get_ifc_cspr(i), i, get_ifc_amask(i), |
| 352 | i, get_ifc_csor(i)); |
| 353 | for (j = 0; j < 4; j++) |
| 354 | printf("IFC_FTIM%d:0x%08X\n", j, get_ifc_ftim(i, j)); |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | void init_early_memctl_regs(void) |
| 359 | { |
| 360 | int i, j; |
| 361 | struct ifc_regs *regs; |
| 362 | struct ifc_regs_info regs_info = {0}; |
| 363 | |
| 364 | ifc_cfg_boot_info(®s_info); |
| 365 | regs = regs_info.regs; |
| 366 | |
| 367 | for (i = 0 ; i < regs_info.cs_size; i++) { |
| 368 | if (regs[i].pr && (regs[i].pr & CSPR_V)) { |
| 369 | /* skip setting cspr/csor_ext in below condition */ |
| 370 | if (!(CONFIG_IS_ENABLED(A003399_NOR_WORKAROUND) && |
| 371 | i == 0 && |
| 372 | ((regs[0].pr & CSPR_MSEL) == CSPR_MSEL_NOR))) { |
| 373 | if (regs[i].pr_ext) |
| 374 | set_ifc_cspr_ext(i, regs[i].pr_ext); |
| 375 | if (regs[i].or_ext) |
| 376 | set_ifc_csor_ext(i, regs[i].or_ext); |
| 377 | } |
| 378 | |
| 379 | for (j = 0; j < ARRAY_SIZE(regs->ftim); j++) |
| 380 | set_ifc_ftim(i, j, regs[i].ftim[j]); |
| 381 | |
| 382 | set_ifc_csor(i, regs[i].or); |
| 383 | set_ifc_amask(i, regs[i].amask); |
| 384 | set_ifc_cspr(i, regs[i].pr); |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | void init_final_memctl_regs(void) |
| 390 | { |
| 391 | int i; |
| 392 | struct ifc_regs *regs; |
| 393 | struct ifc_regs_info regs_info; |
| 394 | |
| 395 | ifc_cfg_boot_info(®s_info); |
| 396 | regs = regs_info.regs; |
| 397 | |
| 398 | for (i = 0 ; i < regs_info.cs_size && i < ARRAY_SIZE(regs->ftim); i++) { |
| 399 | if (!(regs[i].pr_final & CSPR_V)) |
| 400 | continue; |
| 401 | if (regs[i].pr_final) |
| 402 | set_ifc_cspr(i, regs[i].pr_final); |
| 403 | if (regs[i].amask_final) |
| 404 | set_ifc_amask(i, (i == 1) ? regs[i].amask_final : |
| 405 | regs[i].amask); |
| 406 | } |
York Sun | d377b61 | 2014-03-19 13:52:34 -0700 | [diff] [blame] | 407 | } |