Commit b392a6d4b05b7409283cd75b4ac6bd12018d187a
Committed by
York Sun
1 parent
664b652058
Exists in
v2017.01-smarct4x
and in
25 other branches
fsl-layerscape: Add workaround for PCIe erratum A010315
As the access to serders protocol unselected PCIe controller will hang. So disable the R/W permission to unselected PCIe controller including its CCSR, IO space and memory space according to the serders protocol field of RCW. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
Showing 12 changed files with 65 additions and 0 deletions Side-by-side Diff
- arch/arm/cpu/armv7/ls102xa/soc.c
- arch/arm/cpu/armv8/fsl-layerscape/soc.c
- arch/arm/include/asm/arch-fsl-layerscape/config.h
- arch/arm/include/asm/arch-fsl-layerscape/soc.h
- arch/arm/include/asm/arch-ls102xa/config.h
- arch/arm/include/asm/arch-ls102xa/ls102xa_soc.h
- board/freescale/ls1012aqds/ls1012aqds.c
- board/freescale/ls1012ardb/ls1012ardb.c
- board/freescale/ls1021aqds/ls1021aqds.c
- board/freescale/ls1021atwr/ls1021atwr.c
- board/freescale/ls1043aqds/ls1043aqds.c
- board/freescale/ls1043ardb/ls1043ardb.c
arch/arm/cpu/armv7/ls102xa/soc.c
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | #include <common.h> |
8 | 8 | #include <asm/arch/clock.h> |
9 | 9 | #include <asm/io.h> |
10 | +#include <asm/arch/fsl_serdes.h> | |
10 | 11 | #include <asm/arch/immap_ls102xa.h> |
11 | 12 | #include <asm/arch/ls102xa_soc.h> |
12 | 13 | #include <asm/arch/ls102xa_stream_id.h> |
... | ... | @@ -58,6 +59,19 @@ |
58 | 59 | |
59 | 60 | return major; |
60 | 61 | } |
62 | + | |
63 | +#ifdef CONFIG_SYS_FSL_ERRATUM_A010315 | |
64 | +void erratum_a010315(void) | |
65 | +{ | |
66 | + int i; | |
67 | + | |
68 | + for (i = PCIE1; i <= PCIE2; i++) | |
69 | + if (!is_serdes_configured(i)) { | |
70 | + debug("PCIe%d: disabled all R/W permission!\n", i); | |
71 | + set_pcie_ns_access(i, 0); | |
72 | + } | |
73 | +} | |
74 | +#endif | |
61 | 75 | |
62 | 76 | int arch_soc_init(void) |
63 | 77 | { |
arch/arm/cpu/armv8/fsl-layerscape/soc.c
... | ... | @@ -8,11 +8,14 @@ |
8 | 8 | #include <fsl_ifc.h> |
9 | 9 | #include <ahci.h> |
10 | 10 | #include <scsi.h> |
11 | +#include <asm/arch/fsl_serdes.h> | |
11 | 12 | #include <asm/arch/soc.h> |
12 | 13 | #include <asm/io.h> |
13 | 14 | #include <asm/global_data.h> |
14 | 15 | #include <asm/arch-fsl-layerscape/config.h> |
16 | +#ifdef CONFIG_LAYERSCAPE_NS_ACCESS | |
15 | 17 | #include <fsl_csu.h> |
18 | +#endif | |
16 | 19 | #ifdef CONFIG_SYS_FSL_DDR |
17 | 20 | #include <fsl_ddr_sdram.h> |
18 | 21 | #include <fsl_ddr.h> |
... | ... | @@ -300,6 +303,19 @@ |
300 | 303 | ddr_out32(&ddr->eor, tmp); |
301 | 304 | #endif |
302 | 305 | } |
306 | + | |
307 | +#ifdef CONFIG_SYS_FSL_ERRATUM_A010315 | |
308 | +void erratum_a010315(void) | |
309 | +{ | |
310 | + int i; | |
311 | + | |
312 | + for (i = PCIE1; i <= PCIE4; i++) | |
313 | + if (!is_serdes_configured(i)) { | |
314 | + debug("PCIe%d: disabled all R/W permission!\n", i); | |
315 | + set_pcie_ns_access(i, 0); | |
316 | + } | |
317 | +} | |
318 | +#endif | |
303 | 319 | |
304 | 320 | void fsl_lsch2_early_init_f(void) |
305 | 321 | { |
arch/arm/include/asm/arch-fsl-layerscape/config.h
arch/arm/include/asm/arch-fsl-layerscape/soc.h
... | ... | @@ -100,6 +100,10 @@ |
100 | 100 | void erratum_a009635(void); |
101 | 101 | #endif |
102 | 102 | |
103 | +#ifdef CONFIG_SYS_FSL_ERRATUM_A010315 | |
104 | +void erratum_a010315(void); | |
105 | +#endif | |
106 | + | |
103 | 107 | bool soc_has_dp_ddr(void); |
104 | 108 | bool soc_has_aiop(void); |
105 | 109 | #endif /* _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ */ |
arch/arm/include/asm/arch-ls102xa/config.h
... | ... | @@ -129,6 +129,7 @@ |
129 | 129 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 |
130 | 130 | #define CONFIG_SYS_FSL_ERRATUM_A008378 |
131 | 131 | #define CONFIG_SYS_FSL_ERRATUM_A009663 |
132 | +#define CONFIG_SYS_FSL_ERRATUM_A010315 | |
132 | 133 | #define CONFIG_SYS_FSL_MAX_NUM_OF_SEC 1 |
133 | 134 | #else |
134 | 135 | #error SoC not defined |
arch/arm/include/asm/arch-ls102xa/ls102xa_soc.h
board/freescale/ls1012aqds/ls1012aqds.c
board/freescale/ls1012ardb/ls1012ardb.c
... | ... | @@ -202,6 +202,10 @@ |
202 | 202 | */ |
203 | 203 | out_le32(&cci->ctrl_ord, CCI400_CTRLORD_EN_BARRIER); |
204 | 204 | |
205 | +#ifdef CONFIG_SYS_FSL_ERRATUM_A010315 | |
206 | + erratum_a010315(); | |
207 | +#endif | |
208 | + | |
205 | 209 | #ifdef CONFIG_ENV_IS_NOWHERE |
206 | 210 | gd->env_addr = (ulong)&default_environment[0]; |
207 | 211 | #endif |
board/freescale/ls1021aqds/ls1021aqds.c
... | ... | @@ -430,6 +430,10 @@ |
430 | 430 | struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR; |
431 | 431 | unsigned int major; |
432 | 432 | |
433 | +#ifdef CONFIG_SYS_FSL_ERRATUM_A010315 | |
434 | + erratum_a010315(); | |
435 | +#endif | |
436 | + | |
433 | 437 | major = get_soc_major_rev(); |
434 | 438 | if (major == SOC_MAJOR_VER_1_0) { |
435 | 439 | /* Set CCI-400 control override register to |
board/freescale/ls1021atwr/ls1021atwr.c
... | ... | @@ -480,6 +480,10 @@ |
480 | 480 | |
481 | 481 | int board_init(void) |
482 | 482 | { |
483 | +#ifdef CONFIG_SYS_FSL_ERRATUM_A010315 | |
484 | + erratum_a010315(); | |
485 | +#endif | |
486 | + | |
483 | 487 | #ifndef CONFIG_SYS_FSL_NO_SERDES |
484 | 488 | fsl_serdes_init(); |
485 | 489 | #if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI) |
board/freescale/ls1043aqds/ls1043aqds.c
board/freescale/ls1043ardb/ls1043ardb.c