blob: c15f9a0484874e1564b7fe273e6e865ec4c838b4 [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)
Tom Rinidec7ea02024-05-20 13:35:03 -060010#include <asm/ppc.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#ifdef CONFIG_SYS_FSL_ERRATUM_A006379
18static inline bool has_erratum_a006379(void)
19{
20 u32 svr = get_svr();
21 if (((SVR_SOC_VER(svr) == SVR_T4240) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu64ca4b42014-01-06 13:23:21 +080022 ((SVR_SOC_VER(svr) == SVR_T4160) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu26ed2d02014-04-25 16:31:22 +080023 ((SVR_SOC_VER(svr) == SVR_T4080) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu64ca4b42014-01-06 13:23:21 +080024 ((SVR_SOC_VER(svr) == SVR_B4860) && SVR_MAJ(svr) <= 2) ||
25 ((SVR_SOC_VER(svr) == SVR_B4420) && SVR_MAJ(svr) <= 2) ||
26 ((SVR_SOC_VER(svr) == SVR_T2080) && SVR_MAJ(svr) <= 1) ||
27 ((SVR_SOC_VER(svr) == SVR_T2081) && SVR_MAJ(svr) <= 1))
York Sunb1954252013-09-16 12:49:31 -070028 return true;
29
30 return false;
31}
32#endif
Zhao Qiang440914d2014-10-30 14:07:39 +080033
34#ifdef CONFIG_SYS_FSL_ERRATUM_A007186
35static inline bool has_erratum_a007186(void)
36{
37 u32 svr = get_svr();
38 u32 soc = SVR_SOC_VER(svr);
39
40 switch (soc) {
41 case SVR_T4240:
42 return IS_SVR_REV(svr, 2, 0);
43 case SVR_T4160:
44 return IS_SVR_REV(svr, 2, 0);
45 case SVR_B4860:
46 return IS_SVR_REV(svr, 2, 0);
47 case SVR_B4420:
48 return IS_SVR_REV(svr, 2, 0);
49 case SVR_T2081:
50 case SVR_T2080:
Shengzhou Liu24e37d92015-03-09 17:12:22 +080051 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
Zhao Qiang440914d2014-10-30 14:07:39 +080052 }
53
54 return false;
55}
56#endif
Shengzhou Liu7d8dfb82015-11-20 15:52:03 +080057
Shengzhou Liu5a46e432015-11-20 15:52:04 +080058#ifdef CONFIG_SYS_FSL_ERRATUM_A008378
59static inline bool has_erratum_a008378(void)
60{
61 u32 svr = get_svr();
62 u32 soc = SVR_SOC_VER(svr);
63
Shengzhou Liu5a46e432015-11-20 15:52:04 +080064 switch (soc) {
York Sunc4f047c2017-03-27 11:41:03 -070065#ifdef CONFIG_ARCH_LS1021A
Shengzhou Liu5a46e432015-11-20 15:52:04 +080066 case SOC_VER_LS1020:
67 case SOC_VER_LS1021:
68 case SOC_VER_LS1022:
69 case SOC_VER_SLS1020:
70 return IS_SVR_REV(svr, 1, 0);
71#endif
72#ifdef CONFIG_PPC
73 case SVR_T1023:
74 case SVR_T1024:
75 return IS_SVR_REV(svr, 1, 0);
76 case SVR_T1020:
77 case SVR_T1022:
78 case SVR_T1040:
79 case SVR_T1042:
80 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
81#endif
82 default:
83 return false;
84 }
85}
86#endif
87
Shengzhou Liu7d8dfb82015-11-20 15:52:03 +080088#endif /* _FSL_ERRATA_H */