diff options
| author | Timur Tabi <timur@freescale.com> | 2012-10-25 12:40:00 +0000 | 
|---|---|---|
| committer | Andy Fleming <afleming@freescale.com> | 2012-11-27 18:28:06 -0600 | 
| commit | 0118033b6700fc96a84a8c0593af3cbe2f10a6dc (patch) | |
| tree | c8d8e3e5b7484a8bcb11f0f3f2cdc9834ed711b1 /arch/powerpc/cpu/mpc85xx/cmd_errata.c | |
| parent | d31e53b42c35a9285c1e688733ceaa995689418b (diff) | |
| download | olio-uboot-2014.01-0118033b6700fc96a84a8c0593af3cbe2f10a6dc.tar.xz olio-uboot-2014.01-0118033b6700fc96a84a8c0593af3cbe2f10a6dc.zip | |
powerpc/85xx: implement check for erratum A-004849 work-around
The work-around for erratum A-004849 ("CoreNet fabric (CCF) can exhibit a
deadlock under certain traffic patterns causing the system to hang") is
implemented via the PBI (pre-boot initialization code, typically attached
to the RCW binary).  This is because the work-around is easier to implement
in PBI than in U-Boot itself.
It is still useful, however, for the 'errata' command to tell us whether
the work-around has been applied.  For A-004849, we can do this by verifying
that the values in the specific registers that the work-around says to
update.
Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'arch/powerpc/cpu/mpc85xx/cmd_errata.c')
| -rw-r--r-- | arch/powerpc/cpu/mpc85xx/cmd_errata.c | 63 | 
1 files changed, 63 insertions, 0 deletions
| diff --git a/arch/powerpc/cpu/mpc85xx/cmd_errata.c b/arch/powerpc/cpu/mpc85xx/cmd_errata.c index 2be192d57..ccfad56ca 100644 --- a/arch/powerpc/cpu/mpc85xx/cmd_errata.c +++ b/arch/powerpc/cpu/mpc85xx/cmd_errata.c @@ -25,6 +25,65 @@  #include <linux/compiler.h>  #include <asm/processor.h> +#ifdef CONFIG_SYS_FSL_ERRATUM_A004849 +/* + * This work-around is implemented in PBI, so just check to see if the + * work-around was actually applied.  To do this, we check for specific data + * at specific addresses in DCSR. + * + * Array offsets[] contains a list of offsets within DCSR.  According to the + * erratum document, the value at each offset should be 2. + */ +static void check_erratum_a4849(uint32_t svr) +{ +	void __iomem *dcsr = (void *)CONFIG_SYS_DCSRBAR + 0xb0000; +	unsigned int i; + +#if defined(CONFIG_PPC_P2041) || defined(CONFIG_PPC_P3041) +	static const uint8_t offsets[] = { +		0x50, 0x54, 0x58, 0x90, 0x94, 0x98 +	}; +#endif +#ifdef CONFIG_PPC_P4080 +	static const uint8_t offsets[] = { +		0x60, 0x64, 0x68, 0x6c, 0xa0, 0xa4, 0xa8, 0xac +	}; +#endif +	uint32_t x108; /* The value that should be at offset 0x108 */ + +	for (i = 0; i < ARRAY_SIZE(offsets); i++) { +		if (in_be32(dcsr + offsets[i]) != 2) { +			printf("Work-around for Erratum A004849 is not enabled\n"); +			return; +		} +	} + +#if defined(CONFIG_PPC_P2041) || defined(CONFIG_PPC_P3041) +	x108 = 0x12; +#endif + +#ifdef CONFIG_PPC_P4080 +	/* +	 * For P4080, the erratum document says that the value at offset 0x108 +	 * should be 0x12 on rev2, or 0x1c on rev3. +	 */ +	if (SVR_MAJ(svr) == 2) +		x108 = 0x12; +	if (SVR_MAJ(svr) == 3) +		x108 = 0x1c; +#endif + +	if (in_be32(dcsr + 0x108) != x108) { +		printf("Work-around for Erratum A004849 is not enabled\n"); +		return; +	} + +	/* Everything matches, so the erratum work-around was applied */ + +	printf("Work-around for Erratum A004849 enabled\n"); +} +#endif +  static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])  {  #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_CPU_A011 @@ -137,6 +196,10 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])  #ifdef CONFIG_SYS_FSL_ERRATUM_A_004934  	puts("Work-around for Erratum A004934 enabled\n");  #endif +#ifdef CONFIG_SYS_FSL_ERRATUM_A004849 +	/* This work-around is implemented in PBI, so just check for it */ +	check_erratum_a4849(svr); +#endif  	return 0;  } |