York Sun | b195425 | 2013-09-16 12:49:31 -0700 | [diff] [blame] | 1 | /* |
| 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 |
| 14 | static 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 Liu | 64ca4b4 | 2014-01-06 13:23:21 +0800 | [diff] [blame] | 18 | ((SVR_SOC_VER(svr) == SVR_T4160) && SVR_MAJ(svr) <= 1) || |
Shengzhou Liu | 26ed2d0 | 2014-04-25 16:31:22 +0800 | [diff] [blame] | 19 | ((SVR_SOC_VER(svr) == SVR_T4080) && SVR_MAJ(svr) <= 1) || |
Shengzhou Liu | 64ca4b4 | 2014-01-06 13:23:21 +0800 | [diff] [blame] | 20 | ((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 Sun | b195425 | 2013-09-16 12:49:31 -0700 | [diff] [blame] | 24 | return true; |
| 25 | |
| 26 | return false; |
| 27 | } |
| 28 | #endif |
| 29 | |
Suresh Gupta | 086f0a7 | 2014-02-26 14:29:12 +0530 | [diff] [blame] | 30 | #ifdef CONFIG_SYS_FSL_ERRATUM_A006261 |
| 31 | static 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 Liu | 26ed2d0 | 2014-04-25 16:31:22 +0800 | [diff] [blame] | 53 | case SVR_T4080: |
Suresh Gupta | 086f0a7 | 2014-02-26 14:29:12 +0530 | [diff] [blame] | 54 | 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 Liu | bd70f3a | 2014-04-24 11:10:09 +0800 | [diff] [blame] | 57 | case SVR_T2080: |
| 58 | case SVR_T2081: |
| 59 | return IS_SVR_REV(svr, 1, 0); |
Suresh Gupta | 086f0a7 | 2014-02-26 14:29:12 +0530 | [diff] [blame] | 60 | case SVR_P5040: |
| 61 | return IS_SVR_REV(svr, 1, 0); |
| 62 | } |
| 63 | |
| 64 | return false; |
| 65 | } |
| 66 | #endif |
| 67 | |
Nikhil Badola | 2613cfc | 2014-02-26 17:43:15 +0530 | [diff] [blame] | 68 | static 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 Sun | b195425 | 2013-09-16 12:49:31 -0700 | [diff] [blame] | 84 | #endif |