Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 1 | /* |
Marek Vasut | e70e74b | 2019-06-14 02:27:52 +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 | #include <lib/mmio.h> |
| 11 | |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 12 | #include "qos_init.h" |
| 13 | #include "qos_common.h" |
| 14 | #if RCAR_LSI == RCAR_AUTO |
| 15 | #include "H3/qos_init_h3_v10.h" |
| 16 | #include "H3/qos_init_h3_v11.h" |
| 17 | #include "H3/qos_init_h3_v20.h" |
| 18 | #include "H3/qos_init_h3_v30.h" |
| 19 | #include "M3/qos_init_m3_v10.h" |
| 20 | #include "M3/qos_init_m3_v11.h" |
Marek Vasut | 3af2005 | 2019-02-25 14:57:08 +0100 | [diff] [blame] | 21 | #include "M3/qos_init_m3_v30.h" |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 22 | #include "M3N/qos_init_m3n_v10.h" |
Valentine Barshak | f218414 | 2018-10-30 02:06:17 +0300 | [diff] [blame] | 23 | #include "V3M/qos_init_v3m.h" |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 24 | #endif |
| 25 | #if RCAR_LSI == RCAR_H3 /* H3 */ |
| 26 | #include "H3/qos_init_h3_v10.h" |
| 27 | #include "H3/qos_init_h3_v11.h" |
| 28 | #include "H3/qos_init_h3_v20.h" |
| 29 | #include "H3/qos_init_h3_v30.h" |
| 30 | #endif |
| 31 | #if RCAR_LSI == RCAR_H3N /* H3 */ |
| 32 | #include "H3/qos_init_h3n_v30.h" |
| 33 | #endif |
| 34 | #if RCAR_LSI == RCAR_M3 /* M3 */ |
| 35 | #include "M3/qos_init_m3_v10.h" |
| 36 | #include "M3/qos_init_m3_v11.h" |
Marek Vasut | 3af2005 | 2019-02-25 14:57:08 +0100 | [diff] [blame] | 37 | #include "M3/qos_init_m3_v30.h" |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 38 | #endif |
| 39 | #if RCAR_LSI == RCAR_M3N /* M3N */ |
| 40 | #include "M3N/qos_init_m3n_v10.h" |
| 41 | #endif |
Valentine Barshak | f218414 | 2018-10-30 02:06:17 +0300 | [diff] [blame] | 42 | #if RCAR_LSI == RCAR_V3M /* V3M */ |
| 43 | #include "V3M/qos_init_v3m.h" |
| 44 | #endif |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 45 | #if RCAR_LSI == RCAR_E3 /* E3 */ |
| 46 | #include "E3/qos_init_e3_v10.h" |
| 47 | #endif |
Marek Vasut | 6f39e3c | 2018-06-14 06:26:45 +0200 | [diff] [blame] | 48 | #if RCAR_LSI == RCAR_D3 /* D3 */ |
| 49 | #include "D3/qos_init_d3.h" |
| 50 | #endif |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 51 | |
| 52 | /* Product Register */ |
Marek Vasut | e70e74b | 2019-06-14 02:27:52 +0200 | [diff] [blame^] | 53 | #define PRR 0xFFF00044U |
| 54 | #define PRR_PRODUCT_MASK 0x00007F00U |
| 55 | #define PRR_CUT_MASK 0x000000FFU |
| 56 | #define PRR_PRODUCT_H3 0x00004F00U /* R-Car H3 */ |
| 57 | #define PRR_PRODUCT_M3 0x00005200U /* R-Car M3 */ |
| 58 | #define PRR_PRODUCT_V3M 0x00005400U /* R-Car V3M */ |
| 59 | #define PRR_PRODUCT_M3N 0x00005500U /* R-Car M3N */ |
| 60 | #define PRR_PRODUCT_E3 0x00005700U /* R-Car E3 */ |
| 61 | #define PRR_PRODUCT_D3 0x00005800U /* R-Car D3 */ |
| 62 | #define PRR_PRODUCT_10 0x00U |
| 63 | #define PRR_PRODUCT_11 0x01U |
| 64 | #define PRR_PRODUCT_20 0x10U |
| 65 | #define PRR_PRODUCT_21 0x11U |
| 66 | #define PRR_PRODUCT_30 0x20U |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 67 | |
Valentine Barshak | f218414 | 2018-10-30 02:06:17 +0300 | [diff] [blame] | 68 | #if (RCAR_LSI != RCAR_E3) && (RCAR_LSI != RCAR_D3) && (RCAR_LSI != RCAR_V3M) |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 69 | |
| 70 | #define DRAM_CH_CNT 0x04 |
| 71 | uint32_t qos_init_ddr_ch; |
| 72 | uint8_t qos_init_ddr_phyvalid; |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 73 | #endif |
| 74 | |
| 75 | #define PRR_PRODUCT_ERR(reg) \ |
Marek Vasut | e70e74b | 2019-06-14 02:27:52 +0200 | [diff] [blame^] | 76 | do { \ |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 77 | ERROR("LSI Product ID(PRR=0x%x) QoS " \ |
Marek Vasut | e70e74b | 2019-06-14 02:27:52 +0200 | [diff] [blame^] | 78 | "initialize not supported.\n", reg); \ |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 79 | panic(); \ |
Marek Vasut | e70e74b | 2019-06-14 02:27:52 +0200 | [diff] [blame^] | 80 | } while (0) |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 81 | |
| 82 | #define PRR_CUT_ERR(reg) \ |
Marek Vasut | e70e74b | 2019-06-14 02:27:52 +0200 | [diff] [blame^] | 83 | do { \ |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 84 | ERROR("LSI Cut ID(PRR=0x%x) QoS " \ |
Marek Vasut | e70e74b | 2019-06-14 02:27:52 +0200 | [diff] [blame^] | 85 | "initialize not supported.\n", reg); \ |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 86 | panic(); \ |
Marek Vasut | e70e74b | 2019-06-14 02:27:52 +0200 | [diff] [blame^] | 87 | } while (0) |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 88 | |
| 89 | void rcar_qos_init(void) |
| 90 | { |
| 91 | uint32_t reg; |
Valentine Barshak | f218414 | 2018-10-30 02:06:17 +0300 | [diff] [blame] | 92 | #if (RCAR_LSI != RCAR_E3) && (RCAR_LSI != RCAR_D3) && (RCAR_LSI != RCAR_V3M) |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 93 | uint32_t i; |
| 94 | |
| 95 | qos_init_ddr_ch = 0; |
| 96 | qos_init_ddr_phyvalid = get_boardcnf_phyvalid(); |
| 97 | for (i = 0; i < DRAM_CH_CNT; i++) { |
| 98 | if ((qos_init_ddr_phyvalid & (1 << i))) { |
| 99 | qos_init_ddr_ch++; |
| 100 | } |
| 101 | } |
| 102 | #endif |
| 103 | |
| 104 | reg = mmio_read_32(PRR); |
| 105 | #if (RCAR_LSI == RCAR_AUTO) || RCAR_LSI_CUT_COMPAT |
| 106 | switch (reg & PRR_PRODUCT_MASK) { |
| 107 | case PRR_PRODUCT_H3: |
| 108 | #if (RCAR_LSI == RCAR_AUTO) || (RCAR_LSI == RCAR_H3) |
| 109 | switch (reg & PRR_CUT_MASK) { |
| 110 | case PRR_PRODUCT_10: |
| 111 | qos_init_h3_v10(); |
| 112 | break; |
| 113 | case PRR_PRODUCT_11: |
| 114 | qos_init_h3_v11(); |
| 115 | break; |
| 116 | case PRR_PRODUCT_20: |
| 117 | qos_init_h3_v20(); |
| 118 | break; |
| 119 | case PRR_PRODUCT_30: |
| 120 | default: |
| 121 | qos_init_h3_v30(); |
| 122 | break; |
| 123 | } |
| 124 | #elif (RCAR_LSI == RCAR_H3N) |
| 125 | switch (reg & PRR_CUT_MASK) { |
| 126 | case PRR_PRODUCT_30: |
| 127 | default: |
| 128 | qos_init_h3n_v30(); |
| 129 | break; |
| 130 | } |
| 131 | #else |
| 132 | PRR_PRODUCT_ERR(reg); |
| 133 | #endif |
| 134 | break; |
| 135 | case PRR_PRODUCT_M3: |
| 136 | #if (RCAR_LSI == RCAR_AUTO) || (RCAR_LSI == RCAR_M3) |
| 137 | switch (reg & PRR_CUT_MASK) { |
| 138 | case PRR_PRODUCT_10: |
| 139 | qos_init_m3_v10(); |
| 140 | break; |
Marek Vasut | 3af2005 | 2019-02-25 14:57:08 +0100 | [diff] [blame] | 141 | case PRR_PRODUCT_21: /* M3 Cut 13 */ |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 142 | qos_init_m3_v11(); |
| 143 | break; |
Marek Vasut | 3af2005 | 2019-02-25 14:57:08 +0100 | [diff] [blame] | 144 | case PRR_PRODUCT_30: /* M3 Cut 30 */ |
| 145 | default: |
| 146 | qos_init_m3_v30(); |
| 147 | break; |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 148 | } |
| 149 | #else |
| 150 | PRR_PRODUCT_ERR(reg); |
| 151 | #endif |
| 152 | break; |
| 153 | case PRR_PRODUCT_M3N: |
| 154 | #if (RCAR_LSI == RCAR_AUTO) || (RCAR_LSI == RCAR_M3N) |
| 155 | switch (reg & PRR_CUT_MASK) { |
| 156 | case PRR_PRODUCT_10: |
| 157 | default: |
| 158 | qos_init_m3n_v10(); |
| 159 | break; |
| 160 | } |
| 161 | #else |
| 162 | PRR_PRODUCT_ERR(reg); |
| 163 | #endif |
| 164 | break; |
Valentine Barshak | f218414 | 2018-10-30 02:06:17 +0300 | [diff] [blame] | 165 | case PRR_PRODUCT_V3M: |
| 166 | #if (RCAR_LSI == RCAR_AUTO) || (RCAR_LSI == RCAR_V3M) |
| 167 | switch (reg & PRR_CUT_MASK) { |
| 168 | case PRR_PRODUCT_10: |
| 169 | case PRR_PRODUCT_20: |
| 170 | default: |
| 171 | qos_init_v3m(); |
| 172 | break; |
| 173 | } |
| 174 | #else |
| 175 | PRR_PRODUCT_ERR(reg); |
| 176 | #endif |
| 177 | break; |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 178 | case PRR_PRODUCT_E3: |
| 179 | #if (RCAR_LSI == RCAR_E3) |
| 180 | switch (reg & PRR_CUT_MASK) { |
| 181 | case PRR_PRODUCT_10: |
| 182 | default: |
| 183 | qos_init_e3_v10(); |
| 184 | break; |
| 185 | } |
| 186 | #else |
| 187 | PRR_PRODUCT_ERR(reg); |
| 188 | #endif |
| 189 | break; |
Marek Vasut | 6f39e3c | 2018-06-14 06:26:45 +0200 | [diff] [blame] | 190 | case PRR_PRODUCT_D3: |
| 191 | #if (RCAR_LSI == RCAR_D3) |
| 192 | switch (reg & PRR_CUT_MASK) { |
| 193 | case PRR_PRODUCT_10: |
| 194 | default: |
| 195 | qos_init_d3(); |
| 196 | break; |
| 197 | } |
| 198 | #else |
| 199 | PRR_PRODUCT_ERR(reg); |
| 200 | #endif |
| 201 | break; |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 202 | default: |
| 203 | PRR_PRODUCT_ERR(reg); |
| 204 | break; |
| 205 | } |
| 206 | #else |
| 207 | #if RCAR_LSI == RCAR_H3 /* H3 */ |
| 208 | #if RCAR_LSI_CUT == RCAR_CUT_10 |
| 209 | /* H3 Cut 10 */ |
| 210 | if ((PRR_PRODUCT_H3 | PRR_PRODUCT_10) |
| 211 | != (reg & (PRR_PRODUCT_MASK | PRR_CUT_MASK))) { |
| 212 | PRR_PRODUCT_ERR(reg); |
| 213 | } |
| 214 | qos_init_h3_v10(); |
| 215 | #elif RCAR_LSI_CUT == RCAR_CUT_11 |
| 216 | /* H3 Cut 11 */ |
| 217 | if ((PRR_PRODUCT_H3 | PRR_PRODUCT_11) |
| 218 | != (reg & (PRR_PRODUCT_MASK | PRR_CUT_MASK))) { |
| 219 | PRR_PRODUCT_ERR(reg); |
| 220 | } |
| 221 | qos_init_h3_v11(); |
| 222 | #elif RCAR_LSI_CUT == RCAR_CUT_20 |
| 223 | /* H3 Cut 20 */ |
| 224 | if ((PRR_PRODUCT_H3 | PRR_PRODUCT_20) |
| 225 | != (reg & (PRR_PRODUCT_MASK | PRR_CUT_MASK))) { |
| 226 | PRR_PRODUCT_ERR(reg); |
| 227 | } |
| 228 | qos_init_h3_v20(); |
| 229 | #else |
| 230 | /* H3 Cut 30 or later */ |
| 231 | if ((PRR_PRODUCT_H3) |
| 232 | != (reg & (PRR_PRODUCT_MASK))) { |
| 233 | PRR_PRODUCT_ERR(reg); |
| 234 | } |
| 235 | qos_init_h3_v30(); |
| 236 | #endif |
| 237 | #elif RCAR_LSI == RCAR_H3N /* H3 */ |
| 238 | /* H3N Cut 30 or later */ |
| 239 | if ((PRR_PRODUCT_H3) |
| 240 | != (reg & (PRR_PRODUCT_MASK))) { |
| 241 | PRR_PRODUCT_ERR(reg); |
| 242 | } |
| 243 | qos_init_h3n_v30(); |
| 244 | #elif RCAR_LSI == RCAR_M3 /* M3 */ |
| 245 | #if RCAR_LSI_CUT == RCAR_CUT_10 |
| 246 | /* M3 Cut 10 */ |
| 247 | if ((PRR_PRODUCT_M3 | PRR_PRODUCT_10) |
| 248 | != (reg & (PRR_PRODUCT_MASK | PRR_CUT_MASK))) { |
| 249 | PRR_PRODUCT_ERR(reg); |
| 250 | } |
| 251 | qos_init_m3_v10(); |
Marek Vasut | 3af2005 | 2019-02-25 14:57:08 +0100 | [diff] [blame] | 252 | #elif RCAR_LSI_CUT == RCAR_CUT_11 |
| 253 | /* M3 Cut 11 */ |
| 254 | if ((PRR_PRODUCT_M3 | PRR_PRODUCT_20) |
| 255 | != (reg & (PRR_PRODUCT_MASK | PRR_CUT_MASK))) { |
| 256 | PRR_PRODUCT_ERR(reg); |
| 257 | } |
| 258 | qos_init_m3_v11(); |
| 259 | #elif RCAR_LSI_CUT == RCAR_CUT_13 |
| 260 | /* M3 Cut 13 */ |
| 261 | if ((PRR_PRODUCT_M3 | PRR_PRODUCT_21) |
| 262 | != (reg & (PRR_PRODUCT_MASK | PRR_CUT_MASK))) { |
| 263 | PRR_PRODUCT_ERR(reg); |
| 264 | } |
| 265 | qos_init_m3_v11(); |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 266 | #else |
Marek Vasut | 3af2005 | 2019-02-25 14:57:08 +0100 | [diff] [blame] | 267 | /* M3 Cut 30 or later */ |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 268 | if ((PRR_PRODUCT_M3) |
| 269 | != (reg & (PRR_PRODUCT_MASK))) { |
| 270 | PRR_PRODUCT_ERR(reg); |
| 271 | } |
Marek Vasut | 3af2005 | 2019-02-25 14:57:08 +0100 | [diff] [blame] | 272 | qos_init_m3_v30(); |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 273 | #endif |
| 274 | #elif RCAR_LSI == RCAR_M3N /* M3N */ |
| 275 | /* M3N Cut 10 or later */ |
| 276 | if ((PRR_PRODUCT_M3N) |
| 277 | != (reg & (PRR_PRODUCT_MASK))) { |
| 278 | PRR_PRODUCT_ERR(reg); |
| 279 | } |
| 280 | qos_init_m3n_v10(); |
Valentine Barshak | f218414 | 2018-10-30 02:06:17 +0300 | [diff] [blame] | 281 | #elif RCAR_LSI == RCAR_V3M /* V3M */ |
| 282 | /* V3M Cut 10 or later */ |
| 283 | if ((PRR_PRODUCT_V3M) |
| 284 | != (reg & (PRR_PRODUCT_MASK))) { |
| 285 | PRR_PRODUCT_ERR(reg); |
| 286 | } |
| 287 | qos_init_v3m(); |
Marek Vasut | 6f39e3c | 2018-06-14 06:26:45 +0200 | [diff] [blame] | 288 | #elif RCAR_LSI == RCAR_D3 /* D3 */ |
| 289 | /* D3 Cut 10 or later */ |
| 290 | if ((PRR_PRODUCT_D3) |
| 291 | != (reg & (PRR_PRODUCT_MASK))) { |
| 292 | PRR_PRODUCT_ERR(reg); |
| 293 | } |
| 294 | qos_init_d3(); |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 295 | #elif RCAR_LSI == RCAR_E3 /* E3 */ |
| 296 | /* E3 Cut 10 or later */ |
| 297 | if ((PRR_PRODUCT_E3) |
| 298 | != (reg & (PRR_PRODUCT_MASK))) { |
| 299 | PRR_PRODUCT_ERR(reg); |
| 300 | } |
| 301 | qos_init_e3_v10(); |
| 302 | #else |
| 303 | #error "Don't have QoS initialize routine(Unknown chip)." |
| 304 | #endif |
| 305 | #endif |
| 306 | } |
| 307 | |
Valentine Barshak | f218414 | 2018-10-30 02:06:17 +0300 | [diff] [blame] | 308 | #if (RCAR_LSI != RCAR_E3) && (RCAR_LSI != RCAR_D3) && (RCAR_LSI != RCAR_V3M) |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 309 | uint32_t get_refperiod(void) |
| 310 | { |
| 311 | uint32_t refperiod = QOSWT_WTSET0_CYCLE; |
| 312 | |
| 313 | #if (RCAR_LSI == RCAR_AUTO) || RCAR_LSI_CUT_COMPAT |
| 314 | uint32_t reg; |
| 315 | |
| 316 | reg = mmio_read_32(PRR); |
| 317 | switch (reg & PRR_PRODUCT_MASK) { |
| 318 | #if (RCAR_LSI == RCAR_AUTO) || (RCAR_LSI == RCAR_H3) |
| 319 | case PRR_PRODUCT_H3: |
| 320 | switch (reg & PRR_CUT_MASK) { |
| 321 | case PRR_PRODUCT_10: |
| 322 | case PRR_PRODUCT_11: |
| 323 | break; |
| 324 | case PRR_PRODUCT_20: |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 325 | case PRR_PRODUCT_30: |
| 326 | default: |
Marek Vasut | 48cc693 | 2018-12-12 16:35:00 +0100 | [diff] [blame] | 327 | refperiod = REFPERIOD_CYCLE; |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 328 | break; |
| 329 | } |
| 330 | break; |
| 331 | #elif (RCAR_LSI == RCAR_H3N) |
| 332 | case PRR_PRODUCT_H3: |
| 333 | switch (reg & PRR_CUT_MASK) { |
| 334 | case PRR_PRODUCT_30: |
| 335 | default: |
Marek Vasut | 48cc693 | 2018-12-12 16:35:00 +0100 | [diff] [blame] | 336 | refperiod = REFPERIOD_CYCLE; |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 337 | break; |
| 338 | } |
| 339 | break; |
| 340 | #endif |
| 341 | #if (RCAR_LSI == RCAR_AUTO) || (RCAR_LSI == RCAR_M3) |
| 342 | case PRR_PRODUCT_M3: |
| 343 | switch (reg & PRR_CUT_MASK) { |
| 344 | case PRR_PRODUCT_10: |
| 345 | break; |
Marek Vasut | 48cc693 | 2018-12-12 16:35:00 +0100 | [diff] [blame] | 346 | case PRR_PRODUCT_20: /* M3 Cut 11 */ |
Marek Vasut | 3af2005 | 2019-02-25 14:57:08 +0100 | [diff] [blame] | 347 | case PRR_PRODUCT_21: /* M3 Cut 13 */ |
| 348 | case PRR_PRODUCT_30: /* M3 Cut 30 */ |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 349 | default: |
Marek Vasut | 48cc693 | 2018-12-12 16:35:00 +0100 | [diff] [blame] | 350 | refperiod = REFPERIOD_CYCLE; |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 351 | break; |
| 352 | } |
| 353 | break; |
| 354 | #endif |
| 355 | #if (RCAR_LSI == RCAR_AUTO) || (RCAR_LSI == RCAR_M3N) |
| 356 | case PRR_PRODUCT_M3N: |
Marek Vasut | 48cc693 | 2018-12-12 16:35:00 +0100 | [diff] [blame] | 357 | refperiod = REFPERIOD_CYCLE; |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 358 | break; |
| 359 | #endif |
| 360 | default: |
| 361 | break; |
| 362 | } |
| 363 | #elif RCAR_LSI == RCAR_H3 |
| 364 | #if RCAR_LSI_CUT == RCAR_CUT_10 |
| 365 | /* H3 Cut 10 */ |
| 366 | #elif RCAR_LSI_CUT == RCAR_CUT_11 |
| 367 | /* H3 Cut 11 */ |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 368 | #else |
Marek Vasut | 48cc693 | 2018-12-12 16:35:00 +0100 | [diff] [blame] | 369 | /* H3 Cut 20 */ |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 370 | /* H3 Cut 30 or later */ |
Marek Vasut | 48cc693 | 2018-12-12 16:35:00 +0100 | [diff] [blame] | 371 | refperiod = REFPERIOD_CYCLE; |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 372 | #endif |
| 373 | #elif RCAR_LSI == RCAR_H3N |
| 374 | /* H3N Cut 30 or later */ |
Marek Vasut | 48cc693 | 2018-12-12 16:35:00 +0100 | [diff] [blame] | 375 | refperiod = REFPERIOD_CYCLE; |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 376 | #elif RCAR_LSI == RCAR_M3 |
| 377 | #if RCAR_LSI_CUT == RCAR_CUT_10 |
| 378 | /* M3 Cut 10 */ |
| 379 | #else |
Marek Vasut | 3af2005 | 2019-02-25 14:57:08 +0100 | [diff] [blame] | 380 | /* M3 Cut 11 */ |
| 381 | /* M3 Cut 13 */ |
| 382 | /* M3 Cut 30 or later */ |
Marek Vasut | 48cc693 | 2018-12-12 16:35:00 +0100 | [diff] [blame] | 383 | refperiod = REFPERIOD_CYCLE; |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 384 | #endif |
| 385 | #elif RCAR_LSI == RCAR_M3N /* for M3N */ |
Marek Vasut | 48cc693 | 2018-12-12 16:35:00 +0100 | [diff] [blame] | 386 | refperiod = REFPERIOD_CYCLE; |
Jorge Ramirez-Ortiz | 47503d2 | 2018-09-23 09:36:52 +0200 | [diff] [blame] | 387 | #endif |
| 388 | |
| 389 | return refperiod; |
| 390 | } |
Marek Vasut | 48cc693 | 2018-12-12 16:35:00 +0100 | [diff] [blame] | 391 | #endif |