Jiafei Pan | 41fe2d7 | 2021-08-24 12:01:27 +0800 | [diff] [blame] | 1 | /* |
Wasim Khan | d27f16b | 2022-02-23 12:03:48 +0100 | [diff] [blame] | 2 | * Copyright 2021-2022 NXP |
Jiafei Pan | 41fe2d7 | 2021-08-24 12:01:27 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
Wasim Khan | d27f16b | 2022-02-23 12:03:48 +0100 | [diff] [blame] | 8 | #include <common/debug.h> |
Jiafei Pan | 41fe2d7 | 2021-08-24 12:01:27 +0800 | [diff] [blame] | 9 | #include <mmio.h> |
| 10 | |
| 11 | void erratum_a050426(void) |
| 12 | { |
| 13 | uint32_t i, val3, val4; |
| 14 | |
Wasim Khan | d27f16b | 2022-02-23 12:03:48 +0100 | [diff] [blame] | 15 | /* |
| 16 | * Part of this Errata is implemented in RCW and SCRATCHRW5 |
| 17 | * register is updated to hold Errata number. |
| 18 | * Validate whether RCW has already included required changes |
| 19 | */ |
| 20 | if (mmio_read_32(0x01e00210) != 0x00050426) { |
| 21 | ERROR("%s: Invalid RCW : ERR050426 not implemented\n", __func__); |
| 22 | } |
| 23 | |
Jiafei Pan | 41fe2d7 | 2021-08-24 12:01:27 +0800 | [diff] [blame] | 24 | /* Enable BIST to access Internal memory locations */ |
| 25 | val3 = mmio_read_32(0x700117E60); |
| 26 | mmio_write_32(0x700117E60, (val3 | 0x80000001)); |
| 27 | val4 = mmio_read_32(0x700117E90); |
| 28 | mmio_write_32(0x700117E90, (val4 & 0xFFDFFFFF)); |
| 29 | |
| 30 | /* wriop Internal Memory.*/ |
| 31 | for (i = 0U; i < 4U; i++) { |
| 32 | mmio_write_32(0x706312000 + (i * 4), 0x55555555); |
| 33 | mmio_write_32(0x706312400 + (i * 4), 0x55555555); |
| 34 | mmio_write_32(0x706312800 + (i * 4), 0x55555555); |
| 35 | mmio_write_32(0x706314000 + (i * 4), 0x55555555); |
| 36 | mmio_write_32(0x706314400 + (i * 4), 0x55555555); |
| 37 | mmio_write_32(0x706314800 + (i * 4), 0x55555555); |
| 38 | mmio_write_32(0x706314c00 + (i * 4), 0x55555555); |
| 39 | } |
| 40 | for (i = 0U; i < 3U; i++) { |
| 41 | mmio_write_32(0x706316000 + (i * 4), 0x55555555); |
| 42 | mmio_write_32(0x706320000 + (i * 4), 0x55555555); |
| 43 | mmio_write_32(0x706320400 + (i * 4), 0x55555555); |
| 44 | } |
| 45 | for (i = 0U; i < 2U; i++) { |
| 46 | mmio_write_32(0x70640a000 + (i * 4), 0x55555555); |
| 47 | } |
| 48 | for (i = 0U; i < 3U; i++) { |
| 49 | mmio_write_32(0x706518000 + (i * 4), 0x55555555); |
| 50 | mmio_write_32(0x706519000 + (i * 4), 0x55555555); |
| 51 | } |
| 52 | for (i = 0U; i < 4U; i++) { |
| 53 | mmio_write_32(0x706522000 + (i * 4), 0x55555555); |
| 54 | mmio_write_32(0x706522800 + (i * 4), 0x55555555); |
| 55 | mmio_write_32(0x706523000 + (i * 4), 0x55555555); |
| 56 | mmio_write_32(0x706523800 + (i * 4), 0x55555555); |
| 57 | mmio_write_32(0x706524000 + (i * 4), 0x55555555); |
| 58 | mmio_write_32(0x706524800 + (i * 4), 0x55555555); |
| 59 | mmio_write_32(0x706608000 + (i * 4), 0x55555555); |
| 60 | mmio_write_32(0x706608800 + (i * 4), 0x55555555); |
| 61 | mmio_write_32(0x706609000 + (i * 4), 0x55555555); |
| 62 | mmio_write_32(0x706609800 + (i * 4), 0x55555555); |
| 63 | mmio_write_32(0x70660a000 + (i * 4), 0x55555555); |
| 64 | mmio_write_32(0x70660a800 + (i * 4), 0x55555555); |
| 65 | mmio_write_32(0x70660b000 + (i * 4), 0x55555555); |
| 66 | mmio_write_32(0x70660b800 + (i * 4), 0x55555555); |
| 67 | } |
| 68 | for (i = 0U; i < 3U; i++) { |
| 69 | mmio_write_32(0x70660c000 + (i * 4), 0x55555555); |
| 70 | mmio_write_32(0x70660c800 + (i * 4), 0x55555555); |
| 71 | } |
| 72 | for (i = 0U; i < 2U; i++) { |
| 73 | mmio_write_32(0x706718000 + (i * 4), 0x55555555); |
| 74 | mmio_write_32(0x706718800 + (i * 4), 0x55555555); |
| 75 | } |
Wasim Khan | d27f16b | 2022-02-23 12:03:48 +0100 | [diff] [blame] | 76 | mmio_write_32(0x706b0a000, 0x55555555); |
Jiafei Pan | 41fe2d7 | 2021-08-24 12:01:27 +0800 | [diff] [blame] | 77 | |
| 78 | for (i = 0U; i < 4U; i++) { |
| 79 | mmio_write_32(0x706b0e000 + (i * 4), 0x55555555); |
| 80 | mmio_write_32(0x706b0e800 + (i * 4), 0x55555555); |
| 81 | } |
| 82 | for (i = 0U; i < 2U; i++) { |
| 83 | mmio_write_32(0x706b10000 + (i * 4), 0x55555555); |
| 84 | mmio_write_32(0x706b10400 + (i * 4), 0x55555555); |
| 85 | } |
| 86 | for (i = 0U; i < 4U; i++) { |
| 87 | mmio_write_32(0x706b14000 + (i * 4), 0x55555555); |
| 88 | mmio_write_32(0x706b14800 + (i * 4), 0x55555555); |
| 89 | mmio_write_32(0x706b15000 + (i * 4), 0x55555555); |
| 90 | mmio_write_32(0x706b15800 + (i * 4), 0x55555555); |
| 91 | } |
Wasim Khan | d27f16b | 2022-02-23 12:03:48 +0100 | [diff] [blame] | 92 | mmio_write_32(0x706e12000, 0x55555555); |
Jiafei Pan | 41fe2d7 | 2021-08-24 12:01:27 +0800 | [diff] [blame] | 93 | |
| 94 | for (i = 0U; i < 4U; i++) { |
| 95 | mmio_write_32(0x706e14000 + (i * 4), 0x55555555); |
| 96 | mmio_write_32(0x706e14800 + (i * 4), 0x55555555); |
| 97 | } |
| 98 | for (i = 0U; i < 2U; i++) { |
| 99 | mmio_write_32(0x706e16000 + (i * 4), 0x55555555); |
| 100 | mmio_write_32(0x706e16400 + (i * 4), 0x55555555); |
| 101 | } |
| 102 | for (i = 0U; i < 3U; i++) { |
| 103 | mmio_write_32(0x706e1a000 + (i * 4), 0x55555555); |
| 104 | mmio_write_32(0x706e1a800 + (i * 4), 0x55555555); |
| 105 | mmio_write_32(0x706e1b000 + (i * 4), 0x55555555); |
| 106 | mmio_write_32(0x706e1b800 + (i * 4), 0x55555555); |
| 107 | mmio_write_32(0x706e1c000 + (i * 4), 0x55555555); |
| 108 | mmio_write_32(0x706e1c800 + (i * 4), 0x55555555); |
| 109 | mmio_write_32(0x706e1e000 + (i * 4), 0x55555555); |
| 110 | mmio_write_32(0x706e1e800 + (i * 4), 0x55555555); |
| 111 | mmio_write_32(0x706e1f000 + (i * 4), 0x55555555); |
| 112 | mmio_write_32(0x706e1f800 + (i * 4), 0x55555555); |
| 113 | mmio_write_32(0x706e20000 + (i * 4), 0x55555555); |
| 114 | mmio_write_32(0x706e20800 + (i * 4), 0x55555555); |
| 115 | } |
| 116 | for (i = 0U; i < 4U; i++) { |
| 117 | mmio_write_32(0x707108000 + (i * 4), 0x55555555); |
| 118 | mmio_write_32(0x707109000 + (i * 4), 0x55555555); |
| 119 | mmio_write_32(0x70710a000 + (i * 4), 0x55555555); |
| 120 | } |
| 121 | for (i = 0U; i < 2U; i++) { |
| 122 | mmio_write_32(0x70711c000 + (i * 4), 0x55555555); |
| 123 | mmio_write_32(0x70711c800 + (i * 4), 0x55555555); |
| 124 | mmio_write_32(0x70711d000 + (i * 4), 0x55555555); |
| 125 | mmio_write_32(0x70711d800 + (i * 4), 0x55555555); |
| 126 | mmio_write_32(0x70711e000 + (i * 4), 0x55555555); |
| 127 | } |
| 128 | for (i = 0U; i < 4U; i++) { |
| 129 | mmio_write_32(0x707120000 + (i * 4), 0x55555555); |
| 130 | mmio_write_32(0x707121000 + (i * 4), 0x55555555); |
| 131 | } |
| 132 | for (i = 0U; i < 3U; i++) { |
| 133 | mmio_write_32(0x707122000 + (i * 4), 0x55555555); |
| 134 | mmio_write_32(0x70725a000 + (i * 4), 0x55555555); |
| 135 | mmio_write_32(0x70725b000 + (i * 4), 0x55555555); |
| 136 | mmio_write_32(0x70725c000 + (i * 4), 0x55555555); |
| 137 | mmio_write_32(0x70725e000 + (i * 4), 0x55555555); |
| 138 | mmio_write_32(0x70725e400 + (i * 4), 0x55555555); |
| 139 | mmio_write_32(0x70725e800 + (i * 4), 0x55555555); |
| 140 | mmio_write_32(0x70725ec00 + (i * 4), 0x55555555); |
| 141 | mmio_write_32(0x70725f000 + (i * 4), 0x55555555); |
| 142 | mmio_write_32(0x70725f400 + (i * 4), 0x55555555); |
| 143 | mmio_write_32(0x707340000 + (i * 4), 0x55555555); |
| 144 | mmio_write_32(0x707346000 + (i * 4), 0x55555555); |
| 145 | mmio_write_32(0x707484000 + (i * 4), 0x55555555); |
| 146 | mmio_write_32(0x70748a000 + (i * 4), 0x55555555); |
| 147 | mmio_write_32(0x70748b000 + (i * 4), 0x55555555); |
| 148 | mmio_write_32(0x70748c000 + (i * 4), 0x55555555); |
| 149 | mmio_write_32(0x70748d000 + (i * 4), 0x55555555); |
| 150 | } |
| 151 | |
| 152 | /* EDMA Internal Memory.*/ |
| 153 | for (i = 0U; i < 5U; i++) { |
| 154 | mmio_write_32(0x70a208000 + (i * 4), 0x55555555); |
| 155 | mmio_write_32(0x70a208800 + (i * 4), 0x55555555); |
| 156 | mmio_write_32(0x70a209000 + (i * 4), 0x55555555); |
| 157 | mmio_write_32(0x70a209800 + (i * 4), 0x55555555); |
| 158 | } |
| 159 | |
Jiafei Pan | 41fe2d7 | 2021-08-24 12:01:27 +0800 | [diff] [blame] | 160 | /* QDMA Internal Memory.*/ |
| 161 | for (i = 0U; i < 5U; i++) { |
| 162 | mmio_write_32(0x70b008000 + (i * 4), 0x55555555); |
| 163 | mmio_write_32(0x70b00c000 + (i * 4), 0x55555555); |
| 164 | mmio_write_32(0x70b010000 + (i * 4), 0x55555555); |
| 165 | mmio_write_32(0x70b014000 + (i * 4), 0x55555555); |
| 166 | mmio_write_32(0x70b018000 + (i * 4), 0x55555555); |
| 167 | mmio_write_32(0x70b018400 + (i * 4), 0x55555555); |
| 168 | mmio_write_32(0x70b01a000 + (i * 4), 0x55555555); |
| 169 | mmio_write_32(0x70b01a400 + (i * 4), 0x55555555); |
| 170 | mmio_write_32(0x70b01c000 + (i * 4), 0x55555555); |
| 171 | mmio_write_32(0x70b01d000 + (i * 4), 0x55555555); |
| 172 | mmio_write_32(0x70b01e000 + (i * 4), 0x55555555); |
| 173 | mmio_write_32(0x70b01e800 + (i * 4), 0x55555555); |
| 174 | mmio_write_32(0x70b01f000 + (i * 4), 0x55555555); |
| 175 | mmio_write_32(0x70b01f800 + (i * 4), 0x55555555); |
| 176 | mmio_write_32(0x70b020000 + (i * 4), 0x55555555); |
| 177 | mmio_write_32(0x70b020400 + (i * 4), 0x55555555); |
| 178 | mmio_write_32(0x70b020800 + (i * 4), 0x55555555); |
| 179 | mmio_write_32(0x70b020c00 + (i * 4), 0x55555555); |
| 180 | mmio_write_32(0x70b022000 + (i * 4), 0x55555555); |
| 181 | mmio_write_32(0x70b022400 + (i * 4), 0x55555555); |
| 182 | mmio_write_32(0x70b024000 + (i * 4), 0x55555555); |
| 183 | mmio_write_32(0x70b024800 + (i * 4), 0x55555555); |
| 184 | mmio_write_32(0x70b025000 + (i * 4), 0x55555555); |
| 185 | mmio_write_32(0x70b025800 + (i * 4), 0x55555555); |
| 186 | } |
| 187 | for (i = 0U; i < 4U; i++) { |
| 188 | mmio_write_32(0x70b026000 + (i * 4), 0x55555555); |
| 189 | mmio_write_32(0x70b026200 + (i * 4), 0x55555555); |
| 190 | } |
| 191 | for (i = 0U; i < 5U; i++) { |
| 192 | mmio_write_32(0x70b028000 + (i * 4), 0x55555555); |
| 193 | mmio_write_32(0x70b028800 + (i * 4), 0x55555555); |
| 194 | mmio_write_32(0x70b029000 + (i * 4), 0x55555555); |
| 195 | mmio_write_32(0x70b029800 + (i * 4), 0x55555555); |
| 196 | } |
| 197 | |
Jiafei Pan | 41fe2d7 | 2021-08-24 12:01:27 +0800 | [diff] [blame] | 198 | /* Disable BIST */ |
| 199 | mmio_write_32(0x700117E60, val3); |
| 200 | mmio_write_32(0x700117E90, val4); |
| 201 | } |