xref: /rk3399_rockchip-uboot/include/fsl_errata.h (revision a07bdad749ea080e009a82ba40e791dc7361ab54)
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_LS102XA)
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 #endif /*  _FSL_ERRATA_H */
62