Sriram Dash | 9262367 | 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 | f413d1c | 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 | 9262367 | 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 | 9262367 | 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 | 9262367 | 2016-06-13 09:58:34 +0530 | [diff] [blame] | 68 | case SVR_P5040: |
Sriram Dash | f413d1c | 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 | 9262367 | 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 |
| 142 | } |
| 143 | return false; |
| 144 | } |
| 145 | |
| 146 | bool has_erratum_a004477(void) |
| 147 | { |
| 148 | u32 svr = get_svr(); |
| 149 | u32 soc = SVR_SOC_VER(svr); |
| 150 | |
| 151 | switch (soc) { |
| 152 | #ifdef CONFIG_PPC |
| 153 | case SVR_P1010: |
| 154 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); |
| 155 | case SVR_P1022: |
| 156 | case SVR_9131: |
| 157 | case SVR_9132: |
| 158 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); |
| 159 | case SVR_P2020: |
| 160 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0) || |
| 161 | IS_SVR_REV(svr, 2, 1); |
| 162 | case SVR_B4860: |
| 163 | case SVR_B4420: |
| 164 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); |
| 165 | case SVR_P4080: |
| 166 | return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0); |
| 167 | #endif |
| 168 | } |
| 169 | |
| 170 | return false; |
| 171 | } |
| 172 | |
Sriram Dash | ef53b8c | 2016-06-13 09:58:36 +0530 | [diff] [blame] | 173 | bool has_erratum_a008751(void) |
| 174 | { |
| 175 | u32 svr = get_svr(); |
| 176 | u32 soc = SVR_SOC_VER(svr); |
| 177 | |
| 178 | switch (soc) { |
| 179 | #ifdef CONFIG_ARM64 |
Prabhakar Kushwaha | 49cdce1 | 2016-06-24 13:48:13 +0530 | [diff] [blame] | 180 | case SVR_LS2080A: |
| 181 | case SVR_LS2085A: |
Sriram Dash | ef53b8c | 2016-06-13 09:58:36 +0530 | [diff] [blame] | 182 | return IS_SVR_REV(svr, 1, 0); |
| 183 | #endif |
| 184 | } |
| 185 | return false; |
| 186 | } |
| 187 | |
Sriram Dash | 9262367 | 2016-06-13 09:58:34 +0530 | [diff] [blame] | 188 | #endif |