xref: /openbmc/u-boot/include/fsl_errata.h (revision 06feb5d0)
1 /*
2  * Copyright 2013 - 2015  Freescale Semiconductor, Inc.
3  *
4  * SPDX-License-Identifier:    GPL-2.0+
5  */
6 
7 #ifndef _FSL_ERRATA_H
8 #define _FSL_ERRATA_H
9 
10 #include <common.h>
11 #if defined(CONFIG_PPC)
12 #include <asm/processor.h>
13 #elif defined(CONFIG_ARCH_LS1021A)
14 #include <asm/arch-ls102xa/immap_ls102xa.h>
15 #elif defined(CONFIG_FSL_LAYERSCAPE)
16 #include <asm/arch/soc.h>
17 #endif
18 
19 
20 #ifdef CONFIG_SYS_FSL_ERRATUM_A006379
21 static inline bool has_erratum_a006379(void)
22 {
23 	u32 svr = get_svr();
24 	if (((SVR_SOC_VER(svr) == SVR_T4240) && SVR_MAJ(svr) <= 1) ||
25 	    ((SVR_SOC_VER(svr) == SVR_T4160) && SVR_MAJ(svr) <= 1) ||
26 	    ((SVR_SOC_VER(svr) == SVR_T4080) && SVR_MAJ(svr) <= 1) ||
27 	    ((SVR_SOC_VER(svr) == SVR_B4860) && SVR_MAJ(svr) <= 2) ||
28 	    ((SVR_SOC_VER(svr) == SVR_B4420) && SVR_MAJ(svr) <= 2) ||
29 	    ((SVR_SOC_VER(svr) == SVR_T2080) && SVR_MAJ(svr) <= 1) ||
30 	    ((SVR_SOC_VER(svr) == SVR_T2081) && SVR_MAJ(svr) <= 1))
31 		return true;
32 
33 	return false;
34 }
35 #endif
36 
37 #ifdef CONFIG_SYS_FSL_ERRATUM_A007186
38 static inline bool has_erratum_a007186(void)
39 {
40 	u32 svr = get_svr();
41 	u32 soc = SVR_SOC_VER(svr);
42 
43 	switch (soc) {
44 	case SVR_T4240:
45 		return IS_SVR_REV(svr, 2, 0);
46 	case SVR_T4160:
47 		return IS_SVR_REV(svr, 2, 0);
48 	case SVR_B4860:
49 		return IS_SVR_REV(svr, 2, 0);
50 	case SVR_B4420:
51 		return IS_SVR_REV(svr, 2, 0);
52 	case SVR_T2081:
53 	case SVR_T2080:
54 		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
55 	}
56 
57 	return false;
58 }
59 #endif
60 
61 #ifdef CONFIG_SYS_FSL_ERRATUM_A008378
62 static inline bool has_erratum_a008378(void)
63 {
64 	u32 svr = get_svr();
65 	u32 soc = SVR_SOC_VER(svr);
66 
67 
68 	switch (soc) {
69 #ifdef CONFIG_ARCH_LS1021A
70 	case SOC_VER_LS1020:
71 	case SOC_VER_LS1021:
72 	case SOC_VER_LS1022:
73 	case SOC_VER_SLS1020:
74 		return IS_SVR_REV(svr, 1, 0);
75 #endif
76 #ifdef CONFIG_PPC
77 	case SVR_T1023:
78 	case SVR_T1024:
79 		return IS_SVR_REV(svr, 1, 0);
80 	case SVR_T1020:
81 	case SVR_T1022:
82 	case SVR_T1040:
83 	case SVR_T1042:
84 		return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
85 #endif
86 	default:
87 		return false;
88 	}
89 }
90 #endif
91 
92 #endif /*  _FSL_ERRATA_H */
93