blob: 89051aa7412a6d233cdd9b7d958e681b296487b3 [file] [log] [blame]
York Sun133fbfa2013-09-16 12:49:31 -07001/*
Shengzhou Liua07bdad2015-11-20 15:52:03 +08002 * Copyright 2013 - 2015 Freescale Semiconductor, Inc.
York Sun133fbfa2013-09-16 12:49:31 -07003 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
Shengzhou Liua07bdad2015-11-20 15:52:03 +08007#ifndef _FSL_ERRATA_H
8#define _FSL_ERRATA_H
York Sun133fbfa2013-09-16 12:49:31 -07009
10#include <common.h>
Shengzhou Liua07bdad2015-11-20 15:52:03 +080011#if defined(CONFIG_PPC)
York Sun133fbfa2013-09-16 12:49:31 -070012#include <asm/processor.h>
York Sun73fb5832017-03-27 11:41:03 -070013#elif defined(CONFIG_ARCH_LS1021A)
Shengzhou Liua07bdad2015-11-20 15:52:03 +080014#include <asm/arch-ls102xa/immap_ls102xa.h>
15#elif defined(CONFIG_FSL_LAYERSCAPE)
16#include <asm/arch/soc.h>
17#endif
18
York Sun133fbfa2013-09-16 12:49:31 -070019
20#ifdef CONFIG_SYS_FSL_ERRATUM_A006379
21static inline bool has_erratum_a006379(void)
22{
23 u32 svr = get_svr();
24 if (((SVR_SOC_VER(svr) == SVR_T4240) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu842eaa12014-01-06 13:23:21 +080025 ((SVR_SOC_VER(svr) == SVR_T4160) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu5122dfa2014-04-25 16:31:22 +080026 ((SVR_SOC_VER(svr) == SVR_T4080) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu842eaa12014-01-06 13:23:21 +080027 ((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))
York Sun133fbfa2013-09-16 12:49:31 -070031 return true;
32
33 return false;
34}
35#endif
Zhao Qiange7f533c2014-10-30 14:07:39 +080036
37#ifdef CONFIG_SYS_FSL_ERRATUM_A007186
38static 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:
Shengzhou Liu9ca0d352015-03-09 17:12:22 +080054 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
Zhao Qiange7f533c2014-10-30 14:07:39 +080055 }
56
57 return false;
58}
59#endif
Shengzhou Liua07bdad2015-11-20 15:52:03 +080060
Shengzhou Liua46b1852015-11-20 15:52:04 +080061#ifdef CONFIG_SYS_FSL_ERRATUM_A008378
62static inline bool has_erratum_a008378(void)
63{
64 u32 svr = get_svr();
65 u32 soc = SVR_SOC_VER(svr);
66
67
68 switch (soc) {
York Sun73fb5832017-03-27 11:41:03 -070069#ifdef CONFIG_ARCH_LS1021A
Shengzhou Liua46b1852015-11-20 15:52:04 +080070 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
Shengzhou Liua07bdad2015-11-20 15:52:03 +080092#endif /* _FSL_ERRATA_H */