Sriram Dash | 9e8da5c | 2016-06-13 09:58:34 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Freescale USB Controller |
| 3 | * |
| 4 | * Copyright 2013 Freescale Semiconductor, Inc. |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0+ |
| 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <fsl_errata.h> |
| 11 | #include<fsl_usb.h> |
| 12 | |
| 13 | /* USB Erratum Checking code */ |
| 14 | #if defined(CONFIG_PPC) || defined(CONFIG_ARM) |
| 15 | bool has_dual_phy(void) |
| 16 | { |
| 17 | u32 svr = get_svr(); |
| 18 | u32 soc = SVR_SOC_VER(svr); |
| 19 | |
| 20 | switch (soc) { |
| 21 | #ifdef CONFIG_PPC |
| 22 | case SVR_T1023: |
| 23 | case SVR_T1024: |
| 24 | case SVR_T1013: |
| 25 | case SVR_T1014: |
| 26 | return IS_SVR_REV(svr, 1, 0); |
| 27 | case SVR_T1040: |
| 28 | case SVR_T1042: |
| 29 | case SVR_T1020: |
| 30 | case SVR_T1022: |
| 31 | case SVR_T2080: |
| 32 | case SVR_T2081: |
| 33 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); |
| 34 | case SVR_T4240: |
| 35 | case SVR_T4160: |
| 36 | case SVR_T4080: |
| 37 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); |
| 38 | #endif |
| 39 | } |
| 40 | |
| 41 | return false; |
| 42 | } |
| 43 | |
| 44 | bool has_erratum_a006261(void) |
| 45 | { |
| 46 | u32 svr = get_svr(); |
| 47 | u32 soc = SVR_SOC_VER(svr); |
| 48 | |
| 49 | switch (soc) { |
| 50 | #ifdef CONFIG_PPC |
| 51 | case SVR_P1010: |
| 52 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); |
| 53 | case SVR_P2041: |
| 54 | case SVR_P2040: |
| 55 | return IS_SVR_REV(svr, 1, 0) || |
Sriram Dash | 5467da2 | 2016-08-17 11:47:54 +0530 | [diff] [blame] | 56 | IS_SVR_REV(svr, 1, 1) || |
| 57 | IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1); |
Sriram Dash | 9e8da5c | 2016-06-13 09:58:34 +0530 | [diff] [blame] | 58 | case SVR_P3041: |
| 59 | return IS_SVR_REV(svr, 1, 0) || |
| 60 | IS_SVR_REV(svr, 1, 1) || |
| 61 | IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1); |
| 62 | case SVR_P5010: |
| 63 | case SVR_P5020: |
| 64 | case SVR_P5021: |
| 65 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); |
| 66 | case SVR_T4240: |
Sriram Dash | 9e8da5c | 2016-06-13 09:58:34 +0530 | [diff] [blame] | 67 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); |
Sriram Dash | 9e8da5c | 2016-06-13 09:58:34 +0530 | [diff] [blame] | 68 | case SVR_P5040: |
Sriram Dash | 5467da2 | 2016-08-17 11:47:54 +0530 | [diff] [blame] | 69 | return IS_SVR_REV(svr, 1, 0) || |
| 70 | IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1); |
Sriram Dash | 9e8da5c | 2016-06-13 09:58:34 +0530 | [diff] [blame] | 71 | #endif |
| 72 | } |
| 73 | |
| 74 | return false; |
| 75 | } |
| 76 | |
| 77 | bool has_erratum_a007075(void) |
| 78 | { |
| 79 | u32 svr = get_svr(); |
| 80 | u32 soc = SVR_SOC_VER(svr); |
| 81 | |
| 82 | switch (soc) { |
| 83 | #ifdef CONFIG_PPC |
| 84 | case SVR_B4860: |
| 85 | case SVR_B4420: |
| 86 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); |
| 87 | case SVR_P1010: |
| 88 | return IS_SVR_REV(svr, 1, 0); |
| 89 | case SVR_P4080: |
| 90 | return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0); |
| 91 | #endif |
| 92 | } |
| 93 | return false; |
| 94 | } |
| 95 | |
| 96 | bool has_erratum_a007798(void) |
| 97 | { |
| 98 | #ifdef CONFIG_PPC |
| 99 | return SVR_SOC_VER(get_svr()) == SVR_T4240 && |
| 100 | IS_SVR_REV(get_svr(), 2, 0); |
| 101 | #endif |
| 102 | return false; |
| 103 | } |
| 104 | |
| 105 | bool has_erratum_a007792(void) |
| 106 | { |
| 107 | u32 svr = get_svr(); |
| 108 | u32 soc = SVR_SOC_VER(svr); |
| 109 | |
| 110 | switch (soc) { |
| 111 | #ifdef CONFIG_PPC |
| 112 | case SVR_T4240: |
| 113 | case SVR_T4160: |
| 114 | case SVR_T4080: |
| 115 | return IS_SVR_REV(svr, 2, 0); |
| 116 | case SVR_T1024: |
| 117 | case SVR_T1023: |
| 118 | return IS_SVR_REV(svr, 1, 0); |
| 119 | case SVR_T1040: |
| 120 | case SVR_T1042: |
| 121 | case SVR_T1020: |
| 122 | case SVR_T1022: |
| 123 | case SVR_T2080: |
| 124 | case SVR_T2081: |
| 125 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); |
| 126 | #endif |
| 127 | } |
| 128 | return false; |
| 129 | } |
| 130 | |
| 131 | bool has_erratum_a005697(void) |
| 132 | { |
| 133 | u32 svr = get_svr(); |
| 134 | u32 soc = SVR_SOC_VER(svr); |
| 135 | |
| 136 | switch (soc) { |
| 137 | #ifdef CONFIG_PPC |
| 138 | case SVR_9131: |
| 139 | case SVR_9132: |
| 140 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); |
| 141 | #endif |
jerry.huang@nxp.com | f3dece7 | 2016-12-01 11:44:25 +0800 | [diff] [blame] | 142 | #ifdef ONFIG_ARM64 |
| 143 | case SVR_LS1012A: |
| 144 | return IS_SVR_REV(svr, 1, 0); |
| 145 | #endif |
Sriram Dash | 9e8da5c | 2016-06-13 09:58:34 +0530 | [diff] [blame] | 146 | } |
| 147 | return false; |
| 148 | } |
| 149 | |
| 150 | bool has_erratum_a004477(void) |
| 151 | { |
| 152 | u32 svr = get_svr(); |
| 153 | u32 soc = SVR_SOC_VER(svr); |
| 154 | |
| 155 | switch (soc) { |
| 156 | #ifdef CONFIG_PPC |
| 157 | case SVR_P1010: |
| 158 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); |
| 159 | case SVR_P1022: |
| 160 | case SVR_9131: |
| 161 | case SVR_9132: |
| 162 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); |
| 163 | case SVR_P2020: |
| 164 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0) || |
| 165 | IS_SVR_REV(svr, 2, 1); |
| 166 | case SVR_B4860: |
| 167 | case SVR_B4420: |
| 168 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); |
| 169 | case SVR_P4080: |
| 170 | return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0); |
| 171 | #endif |
| 172 | } |
| 173 | |
| 174 | return false; |
| 175 | } |
| 176 | |
Sriram Dash | 0182095 | 2016-06-13 09:58:36 +0530 | [diff] [blame] | 177 | bool has_erratum_a008751(void) |
| 178 | { |
| 179 | u32 svr = get_svr(); |
| 180 | u32 soc = SVR_SOC_VER(svr); |
| 181 | |
| 182 | switch (soc) { |
| 183 | #ifdef CONFIG_ARM64 |
Prabhakar Kushwaha | ac7f242 | 2016-06-24 13:48:13 +0530 | [diff] [blame] | 184 | case SVR_LS2080A: |
| 185 | case SVR_LS2085A: |
Sriram Dash | 0182095 | 2016-06-13 09:58:36 +0530 | [diff] [blame] | 186 | return IS_SVR_REV(svr, 1, 0); |
| 187 | #endif |
| 188 | } |
| 189 | return false; |
| 190 | } |
| 191 | |
Sriram Dash | a1f422e | 2016-09-23 12:57:52 +0530 | [diff] [blame] | 192 | bool has_erratum_a010151(void) |
| 193 | { |
| 194 | u32 svr = get_svr(); |
| 195 | u32 soc = SVR_SOC_VER(svr); |
| 196 | |
| 197 | switch (soc) { |
| 198 | #ifdef CONFIG_ARM64 |
| 199 | case SVR_LS2080A: |
| 200 | case SVR_LS2085A: |
| 201 | case SVR_LS1046A: |
| 202 | case SVR_LS1012A: |
| 203 | return IS_SVR_REV(svr, 1, 0); |
| 204 | case SVR_LS1043A: |
| 205 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); |
| 206 | #endif |
York Sun | c4f047c | 2017-03-27 11:41:03 -0700 | [diff] [blame] | 207 | #ifdef CONFIG_ARCH_LS1021A |
Sriram Dash | a1f422e | 2016-09-23 12:57:52 +0530 | [diff] [blame] | 208 | case SOC_VER_LS1020: |
| 209 | case SOC_VER_LS1021: |
| 210 | case SOC_VER_LS1022: |
| 211 | case SOC_VER_SLS1020: |
| 212 | return IS_SVR_REV(svr, 2, 0); |
| 213 | #endif |
| 214 | } |
| 215 | return false; |
| 216 | } |
| 217 | |
Sriram Dash | 9e8da5c | 2016-06-13 09:58:34 +0530 | [diff] [blame] | 218 | #endif |