blob: 88f4268658a1027697d4b24de2281636e54460a8 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
York Sunb1954252013-09-16 12:49:31 -07002/*
Shengzhou Liu7d8dfb82015-11-20 15:52:03 +08003 * Copyright 2013 - 2015 Freescale Semiconductor, Inc.
York Sunb1954252013-09-16 12:49:31 -07004 */
5
Shengzhou Liu7d8dfb82015-11-20 15:52:03 +08006#ifndef _FSL_ERRATA_H
7#define _FSL_ERRATA_H
York Sunb1954252013-09-16 12:49:31 -07008
9#include <common.h>
Shengzhou Liu7d8dfb82015-11-20 15:52:03 +080010#if defined(CONFIG_PPC)
York Sunb1954252013-09-16 12:49:31 -070011#include <asm/processor.h>
York Sunc4f047c2017-03-27 11:41:03 -070012#elif defined(CONFIG_ARCH_LS1021A)
Shengzhou Liu7d8dfb82015-11-20 15:52:03 +080013#include <asm/arch-ls102xa/immap_ls102xa.h>
14#elif defined(CONFIG_FSL_LAYERSCAPE)
15#include <asm/arch/soc.h>
16#endif
17
York Sunb1954252013-09-16 12:49:31 -070018
19#ifdef CONFIG_SYS_FSL_ERRATUM_A006379
20static inline bool has_erratum_a006379(void)
21{
22 u32 svr = get_svr();
23 if (((SVR_SOC_VER(svr) == SVR_T4240) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu64ca4b42014-01-06 13:23:21 +080024 ((SVR_SOC_VER(svr) == SVR_T4160) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu26ed2d02014-04-25 16:31:22 +080025 ((SVR_SOC_VER(svr) == SVR_T4080) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu64ca4b42014-01-06 13:23:21 +080026 ((SVR_SOC_VER(svr) == SVR_B4860) && SVR_MAJ(svr) <= 2) ||
27 ((SVR_SOC_VER(svr) == SVR_B4420) && SVR_MAJ(svr) <= 2) ||
28 ((SVR_SOC_VER(svr) == SVR_T2080) && SVR_MAJ(svr) <= 1) ||
29 ((SVR_SOC_VER(svr) == SVR_T2081) && SVR_MAJ(svr) <= 1))
York Sunb1954252013-09-16 12:49:31 -070030 return true;
31
32 return false;
33}
34#endif
Zhao Qiang440914d2014-10-30 14:07:39 +080035
36#ifdef CONFIG_SYS_FSL_ERRATUM_A007186
37static inline bool has_erratum_a007186(void)
38{
39 u32 svr = get_svr();
40 u32 soc = SVR_SOC_VER(svr);
41
42 switch (soc) {
43 case SVR_T4240:
44 return IS_SVR_REV(svr, 2, 0);
45 case SVR_T4160:
46 return IS_SVR_REV(svr, 2, 0);
47 case SVR_B4860:
48 return IS_SVR_REV(svr, 2, 0);
49 case SVR_B4420:
50 return IS_SVR_REV(svr, 2, 0);
51 case SVR_T2081:
52 case SVR_T2080:
Shengzhou Liu24e37d92015-03-09 17:12:22 +080053 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
Zhao Qiang440914d2014-10-30 14:07:39 +080054 }
55
56 return false;
57}
58#endif
Shengzhou Liu7d8dfb82015-11-20 15:52:03 +080059
Shengzhou Liu5a46e432015-11-20 15:52:04 +080060#ifdef CONFIG_SYS_FSL_ERRATUM_A008378
61static inline bool has_erratum_a008378(void)
62{
63 u32 svr = get_svr();
64 u32 soc = SVR_SOC_VER(svr);
65
66
67 switch (soc) {
York Sunc4f047c2017-03-27 11:41:03 -070068#ifdef CONFIG_ARCH_LS1021A
Shengzhou Liu5a46e432015-11-20 15:52:04 +080069 case SOC_VER_LS1020:
70 case SOC_VER_LS1021:
71 case SOC_VER_LS1022:
72 case SOC_VER_SLS1020:
73 return IS_SVR_REV(svr, 1, 0);
74#endif
75#ifdef CONFIG_PPC
76 case SVR_T1023:
77 case SVR_T1024:
78 return IS_SVR_REV(svr, 1, 0);
79 case SVR_T1020:
80 case SVR_T1022:
81 case SVR_T1040:
82 case SVR_T1042:
83 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
84#endif
85 default:
86 return false;
87 }
88}
89#endif
90
Shengzhou Liu7d8dfb82015-11-20 15:52:03 +080091#endif /* _FSL_ERRATA_H */