Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 1 | /* |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 2 | * Copyright (c) 2015-2019, Renesas Electronics Corporation. All rights reserved. |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <stdint.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 8 | |
| 9 | #include <common/debug.h> |
| 10 | |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 11 | #include "../qos_common.h" |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 12 | #include "../qos_reg.h" |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 13 | #include "qos_init_m3_v10.h" |
| 14 | |
| 15 | #define RCAR_QOS_VERSION "rev.0.19" |
| 16 | |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 17 | #if RCAR_QOS_TYPE == RCAR_QOS_TYPE_DEFAULT |
| 18 | static const mstat_slot_t mstat_fix[] = { |
| 19 | {0x0000U, 0x0000000000000000UL}, |
| 20 | {0x0008U, 0x0000000000000000UL}, |
| 21 | {0x0010U, 0x0000000000000000UL}, |
| 22 | {0x0018U, 0x0000000000000000UL}, |
| 23 | {0x0020U, 0x0000000000000000UL}, |
| 24 | {0x0028U, 0x0000000000000000UL}, |
| 25 | {0x0030U, 0x001004030000FFFFUL}, |
| 26 | {0x0038U, 0x001004030000FFFFUL}, |
| 27 | {0x0040U, 0x001414090000FFFFUL}, |
| 28 | {0x0048U, 0x0000000000000000UL}, |
| 29 | {0x0050U, 0x001410010000FFFFUL}, |
| 30 | {0x0058U, 0x00140C090000FFFFUL}, |
| 31 | {0x0060U, 0x00140C090000FFFFUL}, |
| 32 | {0x0068U, 0x0000000000000000UL}, |
| 33 | {0x0070U, 0x001410010000FFFFUL}, |
| 34 | {0x0078U, 0x001004020000FFFFUL}, |
| 35 | {0x0080U, 0x0000000000000000UL}, |
| 36 | {0x0088U, 0x001414090000FFFFUL}, |
| 37 | {0x0090U, 0x001408060000FFFFUL}, |
| 38 | {0x0098U, 0x0000000000000000UL}, |
| 39 | {0x00A0U, 0x000C08020000FFFFUL}, |
| 40 | {0x00A8U, 0x000C04010000FFFFUL}, |
| 41 | {0x00B0U, 0x000C04010000FFFFUL}, |
| 42 | {0x00B8U, 0x0000000000000000UL}, |
| 43 | {0x00C0U, 0x000C08020000FFFFUL}, |
| 44 | {0x00C8U, 0x000C04010000FFFFUL}, |
| 45 | {0x00D0U, 0x000C04010000FFFFUL}, |
| 46 | {0x00D8U, 0x000C04030000FFFFUL}, |
| 47 | {0x00E0U, 0x000C100F0000FFFFUL}, |
| 48 | {0x00E8U, 0x0000000000000000UL}, |
| 49 | {0x00F0U, 0x001010080000FFFFUL}, |
| 50 | {0x00F8U, 0x0000000000000000UL}, |
| 51 | {0x0100U, 0x0000000000000000UL}, |
| 52 | {0x0108U, 0x0000000000000000UL}, |
| 53 | {0x0110U, 0x001010080000FFFFUL}, |
| 54 | {0x0118U, 0x0000000000000000UL}, |
| 55 | {0x0120U, 0x0000000000000000UL}, |
| 56 | {0x0128U, 0x0000000000000000UL}, |
| 57 | {0x0130U, 0x0000000000000000UL}, |
| 58 | {0x0138U, 0x00100C0A0000FFFFUL}, |
| 59 | {0x0140U, 0x0000000000000000UL}, |
| 60 | {0x0148U, 0x0000000000000000UL}, |
| 61 | {0x0150U, 0x00100C0A0000FFFFUL}, |
| 62 | {0x0158U, 0x0000000000000000UL}, |
| 63 | {0x0160U, 0x00100C0A0000FFFFUL}, |
| 64 | {0x0168U, 0x0000000000000000UL}, |
| 65 | {0x0170U, 0x0000000000000000UL}, |
| 66 | {0x0178U, 0x001008050000FFFFUL}, |
| 67 | {0x0180U, 0x0000000000000000UL}, |
| 68 | {0x0188U, 0x0000000000000000UL}, |
| 69 | {0x0190U, 0x001028280000FFFFUL}, |
| 70 | {0x0198U, 0x0000000000000000UL}, |
| 71 | {0x01A0U, 0x00100C0A0000FFFFUL}, |
| 72 | {0x01A8U, 0x0000000000000000UL}, |
| 73 | {0x01B0U, 0x0000000000000000UL}, |
| 74 | {0x01B8U, 0x0000000000000000UL}, |
| 75 | {0x01C0U, 0x0000000000000000UL}, |
| 76 | {0x01C8U, 0x0000000000000000UL}, |
| 77 | {0x01D0U, 0x0000000000000000UL}, |
| 78 | {0x01D8U, 0x0000000000000000UL}, |
| 79 | {0x01E0U, 0x0000000000000000UL}, |
| 80 | {0x01E8U, 0x0000000000000000UL}, |
| 81 | {0x01F0U, 0x0000000000000000UL}, |
| 82 | {0x01F8U, 0x0000000000000000UL}, |
| 83 | {0x0200U, 0x0000000000000000UL}, |
| 84 | {0x0208U, 0x0000000000000000UL}, |
| 85 | {0x0210U, 0x0000000000000000UL}, |
| 86 | {0x0218U, 0x0000000000000000UL}, |
| 87 | {0x0220U, 0x0000000000000000UL}, |
| 88 | {0x0228U, 0x0000000000000000UL}, |
| 89 | {0x0230U, 0x0000000000000000UL}, |
| 90 | {0x0238U, 0x0000000000000000UL}, |
| 91 | {0x0240U, 0x0000000000000000UL}, |
| 92 | {0x0248U, 0x0000000000000000UL}, |
| 93 | {0x0250U, 0x0000000000000000UL}, |
| 94 | {0x0258U, 0x0000000000000000UL}, |
| 95 | {0x0260U, 0x0000000000000000UL}, |
| 96 | {0x0268U, 0x001408010000FFFFUL}, |
| 97 | {0x0270U, 0x001404010000FFFFUL}, |
| 98 | {0x0278U, 0x0000000000000000UL}, |
| 99 | {0x0280U, 0x0000000000000000UL}, |
| 100 | {0x0288U, 0x0000000000000000UL}, |
| 101 | {0x0290U, 0x001408010000FFFFUL}, |
| 102 | {0x0298U, 0x001404010000FFFFUL}, |
| 103 | {0x02A0U, 0x000C04010000FFFFUL}, |
| 104 | {0x02A8U, 0x000C04010000FFFFUL}, |
| 105 | {0x02B0U, 0x001404010000FFFFUL}, |
| 106 | {0x02B8U, 0x0000000000000000UL}, |
| 107 | {0x02C0U, 0x0000000000000000UL}, |
| 108 | {0x02C8U, 0x0000000000000000UL}, |
| 109 | {0x02D0U, 0x000C04010000FFFFUL}, |
| 110 | {0x02D8U, 0x000C04010000FFFFUL}, |
| 111 | {0x02E0U, 0x001404010000FFFFUL}, |
| 112 | {0x02E8U, 0x0000000000000000UL}, |
| 113 | {0x02F0U, 0x0000000000000000UL}, |
| 114 | {0x02F8U, 0x0000000000000000UL}, |
| 115 | {0x0300U, 0x0000000000000000UL}, |
| 116 | {0x0308U, 0x0000000000000000UL}, |
| 117 | {0x0310U, 0x0000000000000000UL}, |
| 118 | {0x0318U, 0x0000000000000000UL}, |
| 119 | {0x0320U, 0x0000000000000000UL}, |
| 120 | {0x0328U, 0x0000000000000000UL}, |
| 121 | {0x0330U, 0x0000000000000000UL}, |
| 122 | {0x0338U, 0x0000000000000000UL}, |
| 123 | {0x0340U, 0x0000000000000000UL}, |
| 124 | {0x0348U, 0x0000000000000000UL}, |
| 125 | {0x0350U, 0x0000000000000000UL}, |
| 126 | }; |
| 127 | |
| 128 | static const mstat_slot_t mstat_be[] = { |
| 129 | {0x0000U, 0x001200100C89C401UL}, |
| 130 | {0x0008U, 0x001200100C89C401UL}, |
| 131 | {0x0010U, 0x001200100C89C401UL}, |
| 132 | {0x0018U, 0x001200100C89C401UL}, |
| 133 | {0x0020U, 0x0000000000000000UL}, |
| 134 | {0x0028U, 0x001100100C803401UL}, |
| 135 | {0x0030U, 0x0000000000000000UL}, |
| 136 | {0x0038U, 0x0000000000000000UL}, |
| 137 | {0x0040U, 0x0000000000000000UL}, |
| 138 | {0x0048U, 0x0000000000000000UL}, |
| 139 | {0x0050U, 0x0000000000000000UL}, |
| 140 | {0x0058U, 0x0000000000000000UL}, |
| 141 | {0x0060U, 0x0000000000000000UL}, |
| 142 | {0x0068U, 0x0000000000000000UL}, |
| 143 | {0x0070U, 0x0000000000000000UL}, |
| 144 | {0x0078U, 0x0000000000000000UL}, |
| 145 | {0x0080U, 0x0000000000000000UL}, |
| 146 | {0x0088U, 0x0000000000000000UL}, |
| 147 | {0x0090U, 0x0000000000000000UL}, |
| 148 | {0x0098U, 0x0000000000000000UL}, |
| 149 | {0x00A0U, 0x0000000000000000UL}, |
| 150 | {0x00A8U, 0x0000000000000000UL}, |
| 151 | {0x00B0U, 0x0000000000000000UL}, |
| 152 | {0x00B8U, 0x0000000000000000UL}, |
| 153 | {0x00C0U, 0x0000000000000000UL}, |
| 154 | {0x00C8U, 0x0000000000000000UL}, |
| 155 | {0x00D0U, 0x0000000000000000UL}, |
| 156 | {0x00D8U, 0x0000000000000000UL}, |
| 157 | {0x00E0U, 0x0000000000000000UL}, |
| 158 | {0x00E8U, 0x0000000000000000UL}, |
| 159 | {0x00F0U, 0x0000000000000000UL}, |
| 160 | {0x00F8U, 0x0000000000000000UL}, |
| 161 | {0x0100U, 0x0000000000000000UL}, |
| 162 | {0x0108U, 0x0000000000000000UL}, |
| 163 | {0x0110U, 0x0000000000000000UL}, |
| 164 | {0x0118U, 0x0000000000000000UL}, |
| 165 | {0x0120U, 0x0000000000000000UL}, |
| 166 | {0x0128U, 0x0000000000000000UL}, |
| 167 | {0x0130U, 0x0000000000000000UL}, |
| 168 | {0x0138U, 0x0000000000000000UL}, |
| 169 | {0x0140U, 0x0000000000000000UL}, |
| 170 | {0x0148U, 0x0000000000000000UL}, |
| 171 | {0x0150U, 0x0000000000000000UL}, |
| 172 | {0x0158U, 0x0000000000000000UL}, |
| 173 | {0x0160U, 0x0000000000000000UL}, |
| 174 | {0x0168U, 0x0000000000000000UL}, |
| 175 | {0x0170U, 0x0000000000000000UL}, |
| 176 | {0x0178U, 0x0000000000000000UL}, |
| 177 | {0x0180U, 0x0000000000000000UL}, |
| 178 | {0x0188U, 0x0000000000000000UL}, |
| 179 | {0x0190U, 0x0000000000000000UL}, |
| 180 | {0x0198U, 0x0000000000000000UL}, |
| 181 | {0x01A0U, 0x0000000000000000UL}, |
| 182 | {0x01A8U, 0x0000000000000000UL}, |
| 183 | {0x01B0U, 0x0000000000000000UL}, |
| 184 | {0x01B8U, 0x0000000000000000UL}, |
| 185 | {0x01C0U, 0x001100500C8FFC01UL}, |
| 186 | {0x01C8U, 0x001100500C8FFC01UL}, |
| 187 | {0x01D0U, 0x001100500C8FFC01UL}, |
| 188 | {0x01D8U, 0x001100500C8FFC01UL}, |
| 189 | {0x01E0U, 0x0000000000000000UL}, |
| 190 | {0x01E8U, 0x001200100C803401UL}, |
| 191 | {0x01F0U, 0x001100100C80FC01UL}, |
| 192 | {0x01F8U, 0x0000000000000000UL}, |
| 193 | {0x0200U, 0x0000000000000000UL}, |
| 194 | {0x0208U, 0x001200100C80FC01UL}, |
| 195 | {0x0210U, 0x001100100C80FC01UL}, |
| 196 | {0x0218U, 0x001100100C825801UL}, |
| 197 | {0x0220U, 0x001100100C825801UL}, |
| 198 | {0x0228U, 0x0000000000000000UL}, |
| 199 | {0x0230U, 0x001100100C825801UL}, |
| 200 | {0x0238U, 0x001100100C825801UL}, |
| 201 | {0x0240U, 0x001200100C8BB801UL}, |
| 202 | {0x0248U, 0x001100100C8EA401UL}, |
| 203 | {0x0250U, 0x001200100C8BB801UL}, |
| 204 | {0x0258U, 0x001100100C8EA401UL}, |
| 205 | {0x0260U, 0x001100100C84E401UL}, |
| 206 | {0x0268U, 0x0000000000000000UL}, |
| 207 | {0x0270U, 0x0000000000000000UL}, |
| 208 | {0x0278U, 0x001100100C81F401UL}, |
| 209 | {0x0280U, 0x0000000000000000UL}, |
| 210 | {0x0288U, 0x0000000000000000UL}, |
| 211 | {0x0290U, 0x0000000000000000UL}, |
| 212 | {0x0298U, 0x0000000000000000UL}, |
| 213 | {0x02A0U, 0x0000000000000000UL}, |
| 214 | {0x02A8U, 0x0000000000000000UL}, |
| 215 | {0x02B0U, 0x0000000000000000UL}, |
| 216 | {0x02B8U, 0x001100100C803401UL}, |
| 217 | {0x02C0U, 0x0000000000000000UL}, |
| 218 | {0x02C8U, 0x0000000000000000UL}, |
| 219 | {0x02D0U, 0x0000000000000000UL}, |
| 220 | {0x02D8U, 0x0000000000000000UL}, |
| 221 | {0x02E0U, 0x0000000000000000UL}, |
| 222 | {0x02E8U, 0x001100100C803401UL}, |
| 223 | {0x02F0U, 0x001100300C8FFC01UL}, |
| 224 | {0x02F8U, 0x001100500C8FFC01UL}, |
| 225 | {0x0300U, 0x0000000000000000UL}, |
| 226 | {0x0308U, 0x001100300C8FFC01UL}, |
| 227 | {0x0310U, 0x001100500C8FFC01UL}, |
| 228 | {0x0318U, 0x001200100C803401UL}, |
| 229 | {0x0320U, 0x0000000000000000UL}, |
| 230 | {0x0328U, 0x0000000000000000UL}, |
| 231 | {0x0330U, 0x0000000000000000UL}, |
| 232 | {0x0338U, 0x0000000000000000UL}, |
| 233 | {0x0340U, 0x0000000000000000UL}, |
| 234 | {0x0348U, 0x0000000000000000UL}, |
| 235 | {0x0350U, 0x0000000000000000UL}, |
| 236 | }; |
| 237 | #endif |
| 238 | |
| 239 | static void dbsc_setting(void) |
| 240 | { |
| 241 | uint32_t md = 0; |
| 242 | |
| 243 | /* BUFCAM settings */ |
| 244 | /* DBSC_DBCAM0CNF0 not set */ |
| 245 | io_write_32(DBSC_DBCAM0CNF1, 0x00043218); /* dbcam0cnf1 */ |
| 246 | io_write_32(DBSC_DBCAM0CNF2, 0x000000F4); /* dbcam0cnf2 */ |
| 247 | io_write_32(DBSC_DBCAM0CNF3, 0x00000000); /* dbcam0cnf3 */ |
| 248 | io_write_32(DBSC_DBSCHCNT0, 0x080F0037); /* dbschcnt0 */ |
| 249 | /* DBSC_DBSCHCNT1 not set */ |
| 250 | io_write_32(DBSC_DBSCHSZ0, 0x00000001); /* dbschsz0 */ |
| 251 | io_write_32(DBSC_DBSCHRW0, 0x22421111); /* dbschrw0 */ |
| 252 | |
| 253 | md = (*((volatile uint32_t *)RST_MODEMR) & 0x000A0000) >> 17; |
| 254 | |
| 255 | switch (md) { |
| 256 | case 0x0: |
| 257 | /* DDR3200 */ |
| 258 | io_write_32(DBSC_SCFCTST2, 0x012F1123); |
| 259 | break; |
| 260 | case 0x1: /* MD19=0,MD17=1 : LPDDR4-3000, 4GByte(1GByte x4) */ |
| 261 | /* DDR2800 */ |
| 262 | io_write_32(DBSC_SCFCTST2, 0x012F1123); |
| 263 | break; |
| 264 | case 0x4: /* MD19=1,MD17=0 : LPDDR4-2400, 4GByte(1GByte x4) */ |
| 265 | /* DDR2400 */ |
| 266 | io_write_32(DBSC_SCFCTST2, 0x012F1123); |
| 267 | break; |
| 268 | default: /* MD19=1,MD17=1 : LPDDR4-1600, 4GByte(1GByte x4) */ |
| 269 | /* DDR1600 */ |
| 270 | io_write_32(DBSC_SCFCTST2, 0x012F1123); |
| 271 | break; |
| 272 | } |
| 273 | |
| 274 | /* QoS Settings */ |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 275 | io_write_32(DBSC_DBSCHQOS00, 0x00000F00); |
| 276 | io_write_32(DBSC_DBSCHQOS01, 0x00000B00); |
| 277 | io_write_32(DBSC_DBSCHQOS02, 0x00000000); |
| 278 | io_write_32(DBSC_DBSCHQOS03, 0x00000000); |
| 279 | /* DBSC_DBSCHQOS10 not set */ |
| 280 | /* DBSC_DBSCHQOS11 not set */ |
| 281 | /* DBSC_DBSCHQOS12 not set */ |
| 282 | /* DBSC_DBSCHQOS13 not set */ |
| 283 | /* DBSC_DBSCHQOS20 not set */ |
| 284 | /* DBSC_DBSCHQOS21 not set */ |
| 285 | /* DBSC_DBSCHQOS22 not set */ |
| 286 | /* DBSC_DBSCHQOS23 not set */ |
| 287 | /* DBSC_DBSCHQOS30 not set */ |
| 288 | /* DBSC_DBSCHQOS31 not set */ |
| 289 | /* DBSC_DBSCHQOS32 not set */ |
| 290 | /* DBSC_DBSCHQOS33 not set */ |
| 291 | io_write_32(DBSC_DBSCHQOS40, 0x00000300); |
| 292 | io_write_32(DBSC_DBSCHQOS41, 0x000002F0); |
| 293 | io_write_32(DBSC_DBSCHQOS42, 0x00000200); |
| 294 | io_write_32(DBSC_DBSCHQOS43, 0x00000100); |
| 295 | /* DBSC_DBSCHQOS50 not set */ |
| 296 | /* DBSC_DBSCHQOS51 not set */ |
| 297 | /* DBSC_DBSCHQOS52 not set */ |
| 298 | /* DBSC_DBSCHQOS53 not set */ |
| 299 | /* DBSC_DBSCHQOS60 not set */ |
| 300 | /* DBSC_DBSCHQOS61 not set */ |
| 301 | /* DBSC_DBSCHQOS62 not set */ |
| 302 | /* DBSC_DBSCHQOS63 not set */ |
| 303 | /* DBSC_DBSCHQOS70 not set */ |
| 304 | /* DBSC_DBSCHQOS71 not set */ |
| 305 | /* DBSC_DBSCHQOS72 not set */ |
| 306 | /* DBSC_DBSCHQOS73 not set */ |
| 307 | /* DBSC_DBSCHQOS80 not set */ |
| 308 | /* DBSC_DBSCHQOS81 not set */ |
| 309 | /* DBSC_DBSCHQOS82 not set */ |
| 310 | /* DBSC_DBSCHQOS83 not set */ |
| 311 | io_write_32(DBSC_DBSCHQOS90, 0x00000300); |
| 312 | io_write_32(DBSC_DBSCHQOS91, 0x000002F0); |
| 313 | io_write_32(DBSC_DBSCHQOS92, 0x00000200); |
| 314 | io_write_32(DBSC_DBSCHQOS93, 0x00000100); |
| 315 | /* DBSC_DBSCHQOS100 not set */ |
| 316 | /* DBSC_DBSCHQOS101 not set */ |
| 317 | /* DBSC_DBSCHQOS102 not set */ |
| 318 | /* DBSC_DBSCHQOS103 not set */ |
| 319 | /* DBSC_DBSCHQOS110 not set */ |
| 320 | /* DBSC_DBSCHQOS111 not set */ |
| 321 | /* DBSC_DBSCHQOS112 not set */ |
| 322 | /* DBSC_DBSCHQOS113 not set */ |
| 323 | /* DBSC_DBSCHQOS120 not set */ |
| 324 | /* DBSC_DBSCHQOS121 not set */ |
| 325 | /* DBSC_DBSCHQOS122 not set */ |
| 326 | /* DBSC_DBSCHQOS123 not set */ |
| 327 | io_write_32(DBSC_DBSCHQOS130, 0x00000100); |
| 328 | io_write_32(DBSC_DBSCHQOS131, 0x000000F0); |
| 329 | io_write_32(DBSC_DBSCHQOS132, 0x000000A0); |
| 330 | io_write_32(DBSC_DBSCHQOS133, 0x00000040); |
| 331 | io_write_32(DBSC_DBSCHQOS140, 0x000000C0); |
| 332 | io_write_32(DBSC_DBSCHQOS141, 0x000000B0); |
| 333 | io_write_32(DBSC_DBSCHQOS142, 0x00000080); |
| 334 | io_write_32(DBSC_DBSCHQOS143, 0x00000040); |
| 335 | io_write_32(DBSC_DBSCHQOS150, 0x00000040); |
| 336 | io_write_32(DBSC_DBSCHQOS151, 0x00000030); |
| 337 | io_write_32(DBSC_DBSCHQOS152, 0x00000020); |
| 338 | io_write_32(DBSC_DBSCHQOS153, 0x00000010); |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 339 | } |
| 340 | |
| 341 | void qos_init_m3_v10(void) |
| 342 | { |
| 343 | dbsc_setting(); |
| 344 | |
| 345 | /* DRAM Split Address mapping */ |
| 346 | #if RCAR_DRAM_SPLIT == RCAR_DRAM_SPLIT_4CH |
| 347 | #if RCAR_LSI == RCAR_M3 |
| 348 | #error "Don't set DRAM Split 4ch(M3)" |
| 349 | #else |
| 350 | ERROR("DRAM Split 4ch not supported.(M3)"); |
| 351 | panic(); |
| 352 | #endif |
| 353 | #elif (RCAR_DRAM_SPLIT == RCAR_DRAM_SPLIT_2CH) || \ |
| 354 | (RCAR_DRAM_SPLIT == RCAR_DRAM_SPLIT_AUTO) |
| 355 | NOTICE("BL2: DRAM Split is 2ch\n"); |
| 356 | io_write_32(AXI_ADSPLCR0, 0x00000000U); |
| 357 | io_write_32(AXI_ADSPLCR1, ADSPLCR0_ADRMODE_DEFAULT |
| 358 | | ADSPLCR0_SPLITSEL(0xFFU) |
| 359 | | ADSPLCR0_AREA(0x1CU) |
| 360 | | ADSPLCR0_SWP); |
| 361 | io_write_32(AXI_ADSPLCR2, 0x089A0000U); |
| 362 | io_write_32(AXI_ADSPLCR3, 0x00000000U); |
| 363 | #else |
| 364 | NOTICE("BL2: DRAM Split is OFF\n"); |
| 365 | #endif |
| 366 | |
| 367 | #if !(RCAR_QOS_TYPE == RCAR_QOS_NONE) |
| 368 | #if RCAR_QOS_TYPE == RCAR_QOS_TYPE_DEFAULT |
| 369 | NOTICE("BL2: QoS is default setting(%s)\n", RCAR_QOS_VERSION); |
| 370 | #endif |
| 371 | |
| 372 | /* Resource Alloc setting */ |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 373 | io_write_32(QOSCTRL_RAS, 0x00000028U); |
| 374 | io_write_32(QOSCTRL_FIXTH, 0x000F0005U); |
| 375 | io_write_32(QOSCTRL_REGGD, 0x00000000U); |
| 376 | io_write_64(QOSCTRL_DANN, 0x0101010102020201UL); |
| 377 | io_write_32(QOSCTRL_DANT, 0x00100804U); |
| 378 | io_write_32(QOSCTRL_EC, 0x00000000U); |
| 379 | io_write_64(QOSCTRL_EMS, 0x0000000000000000UL); |
| 380 | io_write_32(QOSCTRL_FSS, 0x000003e8U); |
| 381 | io_write_32(QOSCTRL_INSFC, 0xC7840001U); |
| 382 | io_write_32(QOSCTRL_BERR, 0x00000000U); |
| 383 | io_write_32(QOSCTRL_RACNT0, 0x00000000U); |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 384 | |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 385 | /* QOSBW setting */ |
| 386 | io_write_32(QOSCTRL_SL_INIT, |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 387 | SL_INIT_REFFSSLOT | SL_INIT_SLOTSSLOT | SL_INIT_SSLOTCLK); |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 388 | io_write_32(QOSCTRL_REF_ARS, 0x00330000U); |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 389 | |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 390 | /* QOSBW SRAM setting */ |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 391 | { |
| 392 | uint32_t i; |
| 393 | |
| 394 | for (i = 0U; i < ARRAY_SIZE(mstat_fix); i++) { |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 395 | io_write_64(QOSBW_FIX_QOS_BANK0 + mstat_fix[i].addr, |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 396 | mstat_fix[i].value); |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 397 | io_write_64(QOSBW_FIX_QOS_BANK1 + mstat_fix[i].addr, |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 398 | mstat_fix[i].value); |
| 399 | } |
| 400 | for (i = 0U; i < ARRAY_SIZE(mstat_be); i++) { |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 401 | io_write_64(QOSBW_BE_QOS_BANK0 + mstat_be[i].addr, |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 402 | mstat_be[i].value); |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 403 | io_write_64(QOSBW_BE_QOS_BANK1 + mstat_be[i].addr, |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 404 | mstat_be[i].value); |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | /* 3DG bus Leaf setting */ |
| 409 | io_write_32(0xFD820808U, 0x00001234U); |
| 410 | io_write_32(0xFD820800U, 0x00000006U); |
| 411 | io_write_32(0xFD821800U, 0x00000006U); |
| 412 | io_write_32(0xFD822800U, 0x00000006U); |
| 413 | io_write_32(0xFD823800U, 0x00000006U); |
| 414 | io_write_32(0xFD824800U, 0x00000006U); |
| 415 | io_write_32(0xFD825800U, 0x00000006U); |
| 416 | io_write_32(0xFD826800U, 0x00000006U); |
| 417 | io_write_32(0xFD827800U, 0x00000006U); |
| 418 | |
| 419 | /* RT bus Leaf setting */ |
| 420 | io_write_32(0xFFC50800U, 0x00000000U); |
| 421 | io_write_32(0xFFC51800U, 0x00000000U); |
| 422 | |
| 423 | /* Resource Alloc start */ |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 424 | io_write_32(QOSCTRL_RAEN, 0x00000001U); |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 425 | |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 426 | /* QOSBW start */ |
| 427 | io_write_32(QOSCTRL_STATQC, 0x00000001U); |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 428 | #else |
| 429 | NOTICE("BL2: QoS is None\n"); |
| 430 | |
| 431 | /* Resource Alloc setting */ |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 432 | io_write_32(QOSCTRL_EC, 0x00000000U); |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 433 | /* Resource Alloc start */ |
Marek Vasut | 2dd95b8 | 2019-06-14 01:41:10 +0200 | [diff] [blame^] | 434 | io_write_32(QOSCTRL_RAEN, 0x00000001U); |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 435 | #endif /* !(RCAR_QOS_TYPE == RCAR_QOS_NONE) */ |
| 436 | } |