York Sun | 133fbfa | 2013-09-16 12:49:31 -0700 | [diff] [blame] | 1 | /* |
Shengzhou Liu | a07bdad | 2015-11-20 15:52:03 +0800 | [diff] [blame] | 2 | * Copyright 2013 - 2015 Freescale Semiconductor, Inc. |
York Sun | 133fbfa | 2013-09-16 12:49:31 -0700 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
Shengzhou Liu | a07bdad | 2015-11-20 15:52:03 +0800 | [diff] [blame] | 7 | #ifndef _FSL_ERRATA_H |
| 8 | #define _FSL_ERRATA_H |
York Sun | 133fbfa | 2013-09-16 12:49:31 -0700 | [diff] [blame] | 9 | |
| 10 | #include <common.h> |
Shengzhou Liu | a07bdad | 2015-11-20 15:52:03 +0800 | [diff] [blame] | 11 | #if defined(CONFIG_PPC) |
York Sun | 133fbfa | 2013-09-16 12:49:31 -0700 | [diff] [blame] | 12 | #include <asm/processor.h> |
York Sun | 73fb583 | 2017-03-27 11:41:03 -0700 | [diff] [blame] | 13 | #elif defined(CONFIG_ARCH_LS1021A) |
Shengzhou Liu | a07bdad | 2015-11-20 15:52:03 +0800 | [diff] [blame] | 14 | #include <asm/arch-ls102xa/immap_ls102xa.h> |
| 15 | #elif defined(CONFIG_FSL_LAYERSCAPE) |
| 16 | #include <asm/arch/soc.h> |
| 17 | #endif |
| 18 | |
York Sun | 133fbfa | 2013-09-16 12:49:31 -0700 | [diff] [blame] | 19 | |
| 20 | #ifdef CONFIG_SYS_FSL_ERRATUM_A006379 |
| 21 | static inline bool has_erratum_a006379(void) |
| 22 | { |
| 23 | u32 svr = get_svr(); |
| 24 | if (((SVR_SOC_VER(svr) == SVR_T4240) && SVR_MAJ(svr) <= 1) || |
Shengzhou Liu | 842eaa1 | 2014-01-06 13:23:21 +0800 | [diff] [blame] | 25 | ((SVR_SOC_VER(svr) == SVR_T4160) && SVR_MAJ(svr) <= 1) || |
Shengzhou Liu | 5122dfa | 2014-04-25 16:31:22 +0800 | [diff] [blame] | 26 | ((SVR_SOC_VER(svr) == SVR_T4080) && SVR_MAJ(svr) <= 1) || |
Shengzhou Liu | 842eaa1 | 2014-01-06 13:23:21 +0800 | [diff] [blame] | 27 | ((SVR_SOC_VER(svr) == SVR_B4860) && SVR_MAJ(svr) <= 2) || |
| 28 | ((SVR_SOC_VER(svr) == SVR_B4420) && SVR_MAJ(svr) <= 2) || |
| 29 | ((SVR_SOC_VER(svr) == SVR_T2080) && SVR_MAJ(svr) <= 1) || |
| 30 | ((SVR_SOC_VER(svr) == SVR_T2081) && SVR_MAJ(svr) <= 1)) |
York Sun | 133fbfa | 2013-09-16 12:49:31 -0700 | [diff] [blame] | 31 | return true; |
| 32 | |
| 33 | return false; |
| 34 | } |
| 35 | #endif |
Zhao Qiang | e7f533c | 2014-10-30 14:07:39 +0800 | [diff] [blame] | 36 | |
| 37 | #ifdef CONFIG_SYS_FSL_ERRATUM_A007186 |
| 38 | static inline bool has_erratum_a007186(void) |
| 39 | { |
| 40 | u32 svr = get_svr(); |
| 41 | u32 soc = SVR_SOC_VER(svr); |
| 42 | |
| 43 | switch (soc) { |
| 44 | case SVR_T4240: |
| 45 | return IS_SVR_REV(svr, 2, 0); |
| 46 | case SVR_T4160: |
| 47 | return IS_SVR_REV(svr, 2, 0); |
| 48 | case SVR_B4860: |
| 49 | return IS_SVR_REV(svr, 2, 0); |
| 50 | case SVR_B4420: |
| 51 | return IS_SVR_REV(svr, 2, 0); |
| 52 | case SVR_T2081: |
| 53 | case SVR_T2080: |
Shengzhou Liu | 9ca0d35 | 2015-03-09 17:12:22 +0800 | [diff] [blame] | 54 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); |
Zhao Qiang | e7f533c | 2014-10-30 14:07:39 +0800 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | return false; |
| 58 | } |
| 59 | #endif |
Shengzhou Liu | a07bdad | 2015-11-20 15:52:03 +0800 | [diff] [blame] | 60 | |
Shengzhou Liu | a46b185 | 2015-11-20 15:52:04 +0800 | [diff] [blame] | 61 | #ifdef CONFIG_SYS_FSL_ERRATUM_A008378 |
| 62 | static inline bool has_erratum_a008378(void) |
| 63 | { |
| 64 | u32 svr = get_svr(); |
| 65 | u32 soc = SVR_SOC_VER(svr); |
| 66 | |
| 67 | |
| 68 | switch (soc) { |
York Sun | 73fb583 | 2017-03-27 11:41:03 -0700 | [diff] [blame] | 69 | #ifdef CONFIG_ARCH_LS1021A |
Shengzhou Liu | a46b185 | 2015-11-20 15:52:04 +0800 | [diff] [blame] | 70 | case SOC_VER_LS1020: |
| 71 | case SOC_VER_LS1021: |
| 72 | case SOC_VER_LS1022: |
| 73 | case SOC_VER_SLS1020: |
| 74 | return IS_SVR_REV(svr, 1, 0); |
| 75 | #endif |
| 76 | #ifdef CONFIG_PPC |
| 77 | case SVR_T1023: |
| 78 | case SVR_T1024: |
| 79 | return IS_SVR_REV(svr, 1, 0); |
| 80 | case SVR_T1020: |
| 81 | case SVR_T1022: |
| 82 | case SVR_T1040: |
| 83 | case SVR_T1042: |
| 84 | return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); |
| 85 | #endif |
| 86 | default: |
| 87 | return false; |
| 88 | } |
| 89 | } |
| 90 | #endif |
| 91 | |
Shengzhou Liu | a07bdad | 2015-11-20 15:52:03 +0800 | [diff] [blame] | 92 | #endif /* _FSL_ERRATA_H */ |