blob: 44547645df8793dbce5e1db3d13059e204600480 [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
Shengzhou Liu7d8dfb82015-11-20 15:52:03 +08009#if defined(CONFIG_PPC)
York Sunb1954252013-09-16 12:49:31 -070010#include <asm/processor.h>
York Sunc4f047c2017-03-27 11:41:03 -070011#elif defined(CONFIG_ARCH_LS1021A)
Shengzhou Liu7d8dfb82015-11-20 15:52:03 +080012#include <asm/arch-ls102xa/immap_ls102xa.h>
13#elif defined(CONFIG_FSL_LAYERSCAPE)
14#include <asm/arch/soc.h>
15#endif
16
York Sunb1954252013-09-16 12:49:31 -070017
18#ifdef CONFIG_SYS_FSL_ERRATUM_A006379
19static inline bool has_erratum_a006379(void)
20{
21 u32 svr = get_svr();
22 if (((SVR_SOC_VER(svr) == SVR_T4240) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu64ca4b42014-01-06 13:23:21 +080023 ((SVR_SOC_VER(svr) == SVR_T4160) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu26ed2d02014-04-25 16:31:22 +080024 ((SVR_SOC_VER(svr) == SVR_T4080) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu64ca4b42014-01-06 13:23:21 +080025 ((SVR_SOC_VER(svr) == SVR_B4860) && SVR_MAJ(svr) <= 2) ||
26 ((SVR_SOC_VER(svr) == SVR_B4420) && SVR_MAJ(svr) <= 2) ||
27 ((SVR_SOC_VER(svr) == SVR_T2080) && SVR_MAJ(svr) <= 1) ||
28 ((SVR_SOC_VER(svr) == SVR_T2081) && SVR_MAJ(svr) <= 1))
York Sunb1954252013-09-16 12:49:31 -070029 return true;
30
31 return false;
32}
33#endif
Zhao Qiang440914d2014-10-30 14:07:39 +080034
35#ifdef CONFIG_SYS_FSL_ERRATUM_A007186
36static inline bool has_erratum_a007186(void)
37{
38 u32 svr = get_svr();
39 u32 soc = SVR_SOC_VER(svr);
40
41 switch (soc) {
42 case SVR_T4240:
43 return IS_SVR_REV(svr, 2, 0);
44 case SVR_T4160:
45 return IS_SVR_REV(svr, 2, 0);
46 case SVR_B4860:
47 return IS_SVR_REV(svr, 2, 0);
48 case SVR_B4420:
49 return IS_SVR_REV(svr, 2, 0);
50 case SVR_T2081:
51 case SVR_T2080:
Shengzhou Liu24e37d92015-03-09 17:12:22 +080052 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
Zhao Qiang440914d2014-10-30 14:07:39 +080053 }
54
55 return false;
56}
57#endif
Shengzhou Liu7d8dfb82015-11-20 15:52:03 +080058
Shengzhou Liu5a46e432015-11-20 15:52:04 +080059#ifdef CONFIG_SYS_FSL_ERRATUM_A008378
60static inline bool has_erratum_a008378(void)
61{
62 u32 svr = get_svr();
63 u32 soc = SVR_SOC_VER(svr);
64
65
66 switch (soc) {
York Sunc4f047c2017-03-27 11:41:03 -070067#ifdef CONFIG_ARCH_LS1021A
Shengzhou Liu5a46e432015-11-20 15:52:04 +080068 case SOC_VER_LS1020:
69 case SOC_VER_LS1021:
70 case SOC_VER_LS1022:
71 case SOC_VER_SLS1020:
72 return IS_SVR_REV(svr, 1, 0);
73#endif
74#ifdef CONFIG_PPC
75 case SVR_T1023:
76 case SVR_T1024:
77 return IS_SVR_REV(svr, 1, 0);
78 case SVR_T1020:
79 case SVR_T1022:
80 case SVR_T1040:
81 case SVR_T1042:
82 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
83#endif
84 default:
85 return false;
86 }
87}
88#endif
89
Shengzhou Liu7d8dfb82015-11-20 15:52:03 +080090#endif /* _FSL_ERRATA_H */