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