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