Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 5 | */ |
| 6 | |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 7 | #include <debug.h> |
Soren Brinkmann | e5bdcaa | 2016-06-22 09:02:56 -0700 | [diff] [blame] | 8 | #include <generic_delay_timer.h> |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 9 | #include <mmio.h> |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 10 | #include <platform.h> |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 11 | #include <stdbool.h> |
| 12 | #include <string.h> |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 13 | #include <xlat_tables.h> |
| 14 | #include "../zynqmp_private.h" |
Siva Durga Prasad Paladugu | 00ae6c5 | 2017-02-20 17:55:50 +0530 | [diff] [blame] | 15 | #include "pm_api_sys.h" |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 16 | |
| 17 | /* |
| 18 | * Table of regions to map using the MMU. |
| 19 | * This doesn't include TZRAM as the 'mem_layout' argument passed to |
| 20 | * configure_mmu_elx() will give the available subset of that, |
| 21 | */ |
| 22 | const mmap_region_t plat_arm_mmap[] = { |
| 23 | { DEVICE0_BASE, DEVICE0_BASE, DEVICE0_SIZE, MT_DEVICE | MT_RW | MT_SECURE }, |
| 24 | { DEVICE1_BASE, DEVICE1_BASE, DEVICE1_SIZE, MT_DEVICE | MT_RW | MT_SECURE }, |
| 25 | { CRF_APB_BASE, CRF_APB_BASE, CRF_APB_SIZE, MT_DEVICE | MT_RW | MT_SECURE }, |
| 26 | {0} |
| 27 | }; |
| 28 | |
| 29 | static unsigned int zynqmp_get_silicon_ver(void) |
| 30 | { |
Soren Brinkmann | 8586399 | 2016-09-16 10:34:47 -0700 | [diff] [blame] | 31 | static unsigned int ver; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 32 | |
Soren Brinkmann | 8586399 | 2016-09-16 10:34:47 -0700 | [diff] [blame] | 33 | if (!ver) { |
| 34 | ver = mmio_read_32(ZYNQMP_CSU_BASEADDR + |
| 35 | ZYNQMP_CSU_VERSION_OFFSET); |
| 36 | ver &= ZYNQMP_SILICON_VER_MASK; |
| 37 | ver >>= ZYNQMP_SILICON_VER_SHIFT; |
| 38 | } |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 39 | |
| 40 | return ver; |
| 41 | } |
| 42 | |
| 43 | unsigned int zynqmp_get_uart_clk(void) |
| 44 | { |
| 45 | unsigned int ver = zynqmp_get_silicon_ver(); |
| 46 | |
Siva Durga Prasad Paladugu | dff0712 | 2018-09-04 18:02:25 +0530 | [diff] [blame] | 47 | if (ver == ZYNQMP_CSU_VERSION_QEMU) |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 48 | return 133000000; |
Siva Durga Prasad Paladugu | dff0712 | 2018-09-04 18:02:25 +0530 | [diff] [blame] | 49 | else |
| 50 | return 100000000; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 51 | } |
| 52 | |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 53 | #if LOG_LEVEL >= LOG_LEVEL_NOTICE |
| 54 | static const struct { |
| 55 | unsigned int id; |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 56 | unsigned int ver; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 57 | char *name; |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 58 | bool evexists; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 59 | } zynqmp_devices[] = { |
| 60 | { |
| 61 | .id = 0x10, |
| 62 | .name = "3EG", |
| 63 | }, |
| 64 | { |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 65 | .id = 0x10, |
| 66 | .ver = 0x2c, |
| 67 | .name = "3CG", |
| 68 | }, |
| 69 | { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 70 | .id = 0x11, |
| 71 | .name = "2EG", |
| 72 | }, |
| 73 | { |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 74 | .id = 0x11, |
| 75 | .ver = 0x2c, |
| 76 | .name = "2CG", |
| 77 | }, |
| 78 | { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 79 | .id = 0x20, |
| 80 | .name = "5EV", |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 81 | .evexists = true, |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 82 | }, |
| 83 | { |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 84 | .id = 0x20, |
| 85 | .ver = 0x100, |
| 86 | .name = "5EG", |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 87 | .evexists = true, |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 88 | }, |
| 89 | { |
| 90 | .id = 0x20, |
| 91 | .ver = 0x12c, |
| 92 | .name = "5CG", |
| 93 | }, |
| 94 | { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 95 | .id = 0x21, |
| 96 | .name = "4EV", |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 97 | .evexists = true, |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 98 | }, |
| 99 | { |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 100 | .id = 0x21, |
| 101 | .ver = 0x100, |
| 102 | .name = "4EG", |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 103 | .evexists = true, |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 104 | }, |
| 105 | { |
| 106 | .id = 0x21, |
| 107 | .ver = 0x12c, |
| 108 | .name = "4CG", |
| 109 | }, |
| 110 | { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 111 | .id = 0x30, |
| 112 | .name = "7EV", |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 113 | .evexists = true, |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 114 | }, |
| 115 | { |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 116 | .id = 0x30, |
| 117 | .ver = 0x100, |
| 118 | .name = "7EG", |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 119 | .evexists = true, |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 120 | }, |
| 121 | { |
| 122 | .id = 0x30, |
| 123 | .ver = 0x12c, |
| 124 | .name = "7CG", |
| 125 | }, |
| 126 | { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 127 | .id = 0x38, |
| 128 | .name = "9EG", |
| 129 | }, |
| 130 | { |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 131 | .id = 0x38, |
| 132 | .ver = 0x2c, |
| 133 | .name = "9CG", |
| 134 | }, |
| 135 | { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 136 | .id = 0x39, |
| 137 | .name = "6EG", |
| 138 | }, |
| 139 | { |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 140 | .id = 0x39, |
| 141 | .ver = 0x2c, |
| 142 | .name = "6CG", |
| 143 | }, |
| 144 | { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 145 | .id = 0x40, |
| 146 | .name = "11EG", |
| 147 | }, |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 148 | { /* For testing purpose only */ |
| 149 | .id = 0x50, |
| 150 | .ver = 0x2c, |
| 151 | .name = "15CG", |
| 152 | }, |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 153 | { |
| 154 | .id = 0x50, |
| 155 | .name = "15EG", |
| 156 | }, |
| 157 | { |
| 158 | .id = 0x58, |
| 159 | .name = "19EG", |
| 160 | }, |
| 161 | { |
| 162 | .id = 0x59, |
| 163 | .name = "17EG", |
| 164 | }, |
Siva Durga Prasad Paladugu | 19d69c0 | 2017-06-06 12:54:52 +0530 | [diff] [blame] | 165 | { |
| 166 | .id = 0x60, |
| 167 | .name = "28DR", |
| 168 | }, |
| 169 | { |
| 170 | .id = 0x61, |
| 171 | .name = "21DR", |
| 172 | }, |
| 173 | { |
| 174 | .id = 0x62, |
| 175 | .name = "29DR", |
| 176 | }, |
| 177 | { |
| 178 | .id = 0x63, |
| 179 | .name = "23DR", |
| 180 | }, |
| 181 | { |
| 182 | .id = 0x64, |
| 183 | .name = "27DR", |
| 184 | }, |
| 185 | { |
| 186 | .id = 0x65, |
| 187 | .name = "25DR", |
| 188 | }, |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 189 | }; |
| 190 | |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 191 | #define ZYNQMP_PL_STATUS_BIT 9 |
| 192 | #define ZYNQMP_PL_STATUS_MASK BIT(ZYNQMP_PL_STATUS_BIT) |
| 193 | #define ZYNQMP_CSU_VERSION_MASK ~(ZYNQMP_PL_STATUS_MASK) |
| 194 | |
| 195 | static char *zynqmp_get_silicon_idcode_name(void) |
Soren Brinkmann | cb36681 | 2016-09-22 12:21:11 -0700 | [diff] [blame] | 196 | { |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 197 | uint32_t id, ver, chipid[2]; |
| 198 | size_t i, j, len; |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 199 | const char *name = "EG/EV"; |
Soren Brinkmann | cb36681 | 2016-09-22 12:21:11 -0700 | [diff] [blame] | 200 | |
Siva Durga Prasad Paladugu | 6a8933c | 2018-06-20 17:03:57 +0530 | [diff] [blame] | 201 | #ifdef IMAGE_BL32 |
| 202 | /* |
| 203 | * For BL32, get the chip id info directly by reading corresponding |
| 204 | * registers instead of making pm call. This has limitation |
| 205 | * that these registers should be configured to have access |
| 206 | * from APU which is default case. |
| 207 | */ |
| 208 | chipid[0] = mmio_read_32(ZYNQMP_CSU_BASEADDR + ZYNQMP_CSU_IDCODE_OFFSET); |
| 209 | chipid[1] = mmio_read_32(EFUSE_BASEADDR + EFUSE_IPDISABLE_OFFSET); |
| 210 | #else |
| 211 | if (pm_get_chipid(chipid) != PM_RET_SUCCESS) |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 212 | return "UNKN"; |
Siva Durga Prasad Paladugu | 6a8933c | 2018-06-20 17:03:57 +0530 | [diff] [blame] | 213 | #endif |
Soren Brinkmann | cb36681 | 2016-09-22 12:21:11 -0700 | [diff] [blame] | 214 | |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 215 | id = chipid[0] & (ZYNQMP_CSU_IDCODE_DEVICE_CODE_MASK | |
| 216 | ZYNQMP_CSU_IDCODE_SVD_MASK); |
Soren Brinkmann | cb36681 | 2016-09-22 12:21:11 -0700 | [diff] [blame] | 217 | id >>= ZYNQMP_CSU_IDCODE_SVD_SHIFT; |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 218 | ver = chipid[1] >> ZYNQMP_EFUSE_IPDISABLE_SHIFT; |
Soren Brinkmann | cb36681 | 2016-09-22 12:21:11 -0700 | [diff] [blame] | 219 | |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 220 | for (i = 0; i < ARRAY_SIZE(zynqmp_devices); i++) { |
| 221 | if (zynqmp_devices[i].id == id && |
| 222 | zynqmp_devices[i].ver == (ver & ZYNQMP_CSU_VERSION_MASK)) |
| 223 | break; |
| 224 | } |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 225 | |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 226 | if (i >= ARRAY_SIZE(zynqmp_devices)) |
| 227 | return "UNKN"; |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 228 | |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 229 | if (!zynqmp_devices[i].evexists) |
| 230 | return zynqmp_devices[i].name; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 231 | |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 232 | if (ver & ZYNQMP_PL_STATUS_MASK) |
| 233 | return zynqmp_devices[i].name; |
Siva Durga Prasad Paladugu | 83e3725 | 2018-05-01 11:10:25 +0530 | [diff] [blame] | 234 | |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 235 | len = strlen(zynqmp_devices[i].name) - 2; |
| 236 | for (j = 0; j < strlen(name); j++) { |
| 237 | zynqmp_devices[i].name[len] = name[j]; |
| 238 | len++; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 239 | } |
Siva Durga Prasad Paladugu | b76656d | 2018-03-05 18:47:15 +0530 | [diff] [blame] | 240 | zynqmp_devices[i].name[len] = '\0'; |
| 241 | |
| 242 | return zynqmp_devices[i].name; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | static unsigned int zynqmp_get_rtl_ver(void) |
| 246 | { |
| 247 | uint32_t ver; |
| 248 | |
| 249 | ver = mmio_read_32(ZYNQMP_CSU_BASEADDR + ZYNQMP_CSU_VERSION_OFFSET); |
| 250 | ver &= ZYNQMP_RTL_VER_MASK; |
| 251 | ver >>= ZYNQMP_RTL_VER_SHIFT; |
| 252 | |
| 253 | return ver; |
| 254 | } |
| 255 | |
| 256 | static char *zynqmp_print_silicon_idcode(void) |
| 257 | { |
| 258 | uint32_t id, maskid, tmp; |
| 259 | |
| 260 | id = mmio_read_32(ZYNQMP_CSU_BASEADDR + ZYNQMP_CSU_IDCODE_OFFSET); |
| 261 | |
| 262 | tmp = id; |
| 263 | tmp &= ZYNQMP_CSU_IDCODE_XILINX_ID_MASK | |
Soren Brinkmann | 3111413 | 2016-05-20 07:05:00 -0700 | [diff] [blame] | 264 | ZYNQMP_CSU_IDCODE_FAMILY_MASK; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 265 | maskid = ZYNQMP_CSU_IDCODE_XILINX_ID << ZYNQMP_CSU_IDCODE_XILINX_ID_SHIFT | |
Soren Brinkmann | 3111413 | 2016-05-20 07:05:00 -0700 | [diff] [blame] | 266 | ZYNQMP_CSU_IDCODE_FAMILY << ZYNQMP_CSU_IDCODE_FAMILY_SHIFT; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 267 | if (tmp != maskid) { |
| 268 | ERROR("Incorrect XILINX IDCODE 0x%x, maskid 0x%x\n", id, maskid); |
| 269 | return "UNKN"; |
| 270 | } |
| 271 | VERBOSE("Xilinx IDCODE 0x%x\n", id); |
| 272 | return zynqmp_get_silicon_idcode_name(); |
| 273 | } |
| 274 | |
| 275 | static unsigned int zynqmp_get_ps_ver(void) |
| 276 | { |
| 277 | uint32_t ver = mmio_read_32(ZYNQMP_CSU_BASEADDR + ZYNQMP_CSU_VERSION_OFFSET); |
| 278 | |
| 279 | ver &= ZYNQMP_PS_VER_MASK; |
| 280 | ver >>= ZYNQMP_PS_VER_SHIFT; |
| 281 | |
| 282 | return ver + 1; |
| 283 | } |
| 284 | |
| 285 | static void zynqmp_print_platform_name(void) |
| 286 | { |
| 287 | unsigned int ver = zynqmp_get_silicon_ver(); |
| 288 | unsigned int rtl = zynqmp_get_rtl_ver(); |
| 289 | char *label = "Unknown"; |
| 290 | |
| 291 | switch (ver) { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 292 | case ZYNQMP_CSU_VERSION_QEMU: |
| 293 | label = "QEMU"; |
| 294 | break; |
| 295 | case ZYNQMP_CSU_VERSION_SILICON: |
| 296 | label = "silicon"; |
| 297 | break; |
Jonathan Wright | ff957ed | 2018-03-14 15:24:00 +0000 | [diff] [blame] | 298 | default: |
| 299 | /* Do nothing in default case */ |
| 300 | break; |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 301 | } |
| 302 | |
Siva Durga Prasad Paladugu | 40808bc | 2018-04-30 19:43:03 +0530 | [diff] [blame] | 303 | NOTICE("ATF running on XCZU%s/%s v%d/RTL%d.%d at 0x%x\n", |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 304 | zynqmp_print_silicon_idcode(), label, zynqmp_get_ps_ver(), |
Siva Durga Prasad Paladugu | 40808bc | 2018-04-30 19:43:03 +0530 | [diff] [blame] | 305 | (rtl & 0xf0) >> 4, rtl & 0xf, BL31_BASE); |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 306 | } |
| 307 | #else |
| 308 | static inline void zynqmp_print_platform_name(void) { } |
| 309 | #endif |
| 310 | |
Soren Brinkmann | b43d943 | 2016-04-18 11:49:42 -0700 | [diff] [blame] | 311 | unsigned int zynqmp_get_bootmode(void) |
| 312 | { |
Siva Durga Prasad Paladugu | 00ae6c5 | 2017-02-20 17:55:50 +0530 | [diff] [blame] | 313 | uint32_t r; |
Siva Durga Prasad Paladugu | 40808bc | 2018-04-30 19:43:03 +0530 | [diff] [blame] | 314 | unsigned int ret; |
Siva Durga Prasad Paladugu | 00ae6c5 | 2017-02-20 17:55:50 +0530 | [diff] [blame] | 315 | |
Siva Durga Prasad Paladugu | 40808bc | 2018-04-30 19:43:03 +0530 | [diff] [blame] | 316 | ret = pm_mmio_read(CRL_APB_BOOT_MODE_USER, &r); |
| 317 | |
| 318 | if (ret != PM_RET_SUCCESS) |
Siva Durga Prasad Paladugu | 00ae6c5 | 2017-02-20 17:55:50 +0530 | [diff] [blame] | 319 | r = mmio_read_32(CRL_APB_BOOT_MODE_USER); |
Soren Brinkmann | b43d943 | 2016-04-18 11:49:42 -0700 | [diff] [blame] | 320 | |
| 321 | return r & CRL_APB_BOOT_MODE_MASK; |
| 322 | } |
| 323 | |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 324 | void zynqmp_config_setup(void) |
| 325 | { |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 326 | zynqmp_print_platform_name(); |
Soren Brinkmann | e5bdcaa | 2016-06-22 09:02:56 -0700 | [diff] [blame] | 327 | generic_delay_timer_init(); |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 328 | } |
| 329 | |
Antonio Nino Diaz | e82e29c | 2016-05-19 10:00:28 +0100 | [diff] [blame] | 330 | unsigned int plat_get_syscnt_freq2(void) |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 331 | { |
Soren Brinkmann | cfcb1a2 | 2016-09-16 10:31:06 -0700 | [diff] [blame] | 332 | unsigned int ver = zynqmp_get_silicon_ver(); |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 333 | |
Siva Durga Prasad Paladugu | dff0712 | 2018-09-04 18:02:25 +0530 | [diff] [blame] | 334 | if (ver == ZYNQMP_CSU_VERSION_QEMU) |
Soren Brinkmann | cfcb1a2 | 2016-09-16 10:31:06 -0700 | [diff] [blame] | 335 | return 50000000; |
Siva Durga Prasad Paladugu | dff0712 | 2018-09-04 18:02:25 +0530 | [diff] [blame] | 336 | else |
| 337 | return mmio_read_32(IOU_SCNTRS_BASEFREQ); |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 338 | } |