blob: 64da4bb3bae185ae180908332f5033b2b2b701ea [file] [log] [blame]
York Sunb1954252013-09-16 12:49:31 -07001/*
2 * Copyright 2013 Freescale Semiconductor, Inc.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#ifndef _ASM_FSL_ERRATA_H
8#define _ASM_FSL_ERRATA_H
9
10#include <common.h>
11#include <asm/processor.h>
12
13#ifdef CONFIG_SYS_FSL_ERRATUM_A006379
14static inline bool has_erratum_a006379(void)
15{
16 u32 svr = get_svr();
17 if (((SVR_SOC_VER(svr) == SVR_T4240) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu64ca4b42014-01-06 13:23:21 +080018 ((SVR_SOC_VER(svr) == SVR_T4160) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu26ed2d02014-04-25 16:31:22 +080019 ((SVR_SOC_VER(svr) == SVR_T4080) && SVR_MAJ(svr) <= 1) ||
Shengzhou Liu64ca4b42014-01-06 13:23:21 +080020 ((SVR_SOC_VER(svr) == SVR_B4860) && SVR_MAJ(svr) <= 2) ||
21 ((SVR_SOC_VER(svr) == SVR_B4420) && SVR_MAJ(svr) <= 2) ||
22 ((SVR_SOC_VER(svr) == SVR_T2080) && SVR_MAJ(svr) <= 1) ||
23 ((SVR_SOC_VER(svr) == SVR_T2081) && SVR_MAJ(svr) <= 1))
York Sunb1954252013-09-16 12:49:31 -070024 return true;
25
26 return false;
27}
28#endif
29
Suresh Gupta086f0a72014-02-26 14:29:12 +053030#ifdef CONFIG_SYS_FSL_ERRATUM_A006261
31static inline bool has_erratum_a006261(void)
32{
33 u32 svr = get_svr();
34 u32 soc = SVR_SOC_VER(svr);
35
36 switch (soc) {
37 case SVR_P1010:
38 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
39 case SVR_P2041:
40 case SVR_P2040:
41 return IS_SVR_REV(svr, 1, 0) ||
42 IS_SVR_REV(svr, 1, 1) || IS_SVR_REV(svr, 2, 1);
43 case SVR_P3041:
44 return IS_SVR_REV(svr, 1, 0) ||
45 IS_SVR_REV(svr, 1, 1) ||
46 IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1);
47 case SVR_P5010:
48 case SVR_P5020:
49 case SVR_P5021:
50 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
51 case SVR_T4240:
52 case SVR_T4160:
Shengzhou Liu26ed2d02014-04-25 16:31:22 +080053 case SVR_T4080:
Suresh Gupta086f0a72014-02-26 14:29:12 +053054 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
55 case SVR_T1040:
56 return IS_SVR_REV(svr, 1, 0);
Shengzhou Liubd70f3a2014-04-24 11:10:09 +080057 case SVR_T2080:
58 case SVR_T2081:
59 return IS_SVR_REV(svr, 1, 0);
Suresh Gupta086f0a72014-02-26 14:29:12 +053060 case SVR_P5040:
61 return IS_SVR_REV(svr, 1, 0);
62 }
63
64 return false;
65}
66#endif
67
Nikhil Badola2613cfc2014-02-26 17:43:15 +053068static inline bool has_erratum_a007075(void)
69{
70 u32 svr = get_svr();
71 u32 soc = SVR_SOC_VER(svr);
72
73 switch (soc) {
74 case SVR_B4860:
75 case SVR_B4420:
76 return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
77 case SVR_P1010:
78 return IS_SVR_REV(svr, 1, 0);
79 case SVR_P4080:
80 return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
81 }
82 return false;
83}
York Sunb1954252013-09-16 12:49:31 -070084#endif