1 // SPDX-License-Identifier: GPL-2.0+
3 * Freescale USB Controller
5 * Copyright 2013 Freescale Semiconductor, Inc.
9 #include <fsl_errata.h>
11 #if defined(CONFIG_FSL_LSCH2) || defined(CONFIG_FSL_LSCH3) || \
13 #include <asm/arch/clock.h>
16 /* USB Erratum Checking code */
17 #if defined(CONFIG_PPC) || defined(CONFIG_ARM)
18 bool has_dual_phy(void)
21 u32 soc = SVR_SOC_VER(svr);
29 return IS_SVR_REV(svr, 1, 0);
36 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
40 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
47 bool has_erratum_a006261(void)
50 u32 soc = SVR_SOC_VER(svr);
55 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
58 return IS_SVR_REV(svr, 1, 0) ||
59 IS_SVR_REV(svr, 1, 1) ||
60 IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1);
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);
68 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
70 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
72 return IS_SVR_REV(svr, 1, 0) ||
73 IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1);
80 bool has_erratum_a007075(void)
83 u32 soc = SVR_SOC_VER(svr);
89 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
91 return IS_SVR_REV(svr, 1, 0);
93 return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
99 bool has_erratum_a007798(void)
102 return SVR_SOC_VER(get_svr()) == SVR_T4240 &&
103 IS_SVR_REV(get_svr(), 2, 0);
108 bool has_erratum_a007792(void)
111 u32 soc = SVR_SOC_VER(svr);
118 return IS_SVR_REV(svr, 2, 0);
121 return IS_SVR_REV(svr, 1, 0);
128 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
134 bool has_erratum_a005697(void)
137 u32 soc = SVR_SOC_VER(svr);
143 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
147 return IS_SVR_REV(svr, 1, 0);
153 bool has_erratum_a004477(void)
156 u32 soc = SVR_SOC_VER(svr);
161 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
165 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
167 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0) ||
168 IS_SVR_REV(svr, 2, 1);
171 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
173 return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
180 bool has_erratum_a008751(void)
183 u32 soc = SVR_SOC_VER(svr);
189 return IS_SVR_REV(svr, 1, 0);
195 bool has_erratum_a010151(void)
198 u32 soc = SVR_SOC_VER(svr);
201 if (IS_SVR_DEV(svr, SVR_DEV(SVR_LS1043A)))
202 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
215 return IS_SVR_REV(svr, 1, 0);
217 #ifdef CONFIG_ARCH_LS1021A
221 case SOC_VER_SLS1020:
222 return IS_SVR_REV(svr, 2, 0);