Skip to content

Commit 33753cd

Browse files
ch-ftmlind
authored andcommitted
ARM: OMAP2+: gpmc: fix gpmc_hwecc_bch_capable()
This patch adds bch8 ecc software fallback which is mostly used by omap3s because they lack hardware elm support. Fixes: 0611c41 (ARM: OMAP2+: gpmc: update gpmc_hwecc_bch_capable() for new platforms and ECC schemes) Cc: <[email protected]> # 3.15.x+ Signed-off-by: Christoph Fritz <[email protected]> Reviewed-by: Pekon Gupta <[email protected]> Signed-off-by: Tony Lindgren <[email protected]>
1 parent 23d9cec commit 33753cd

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

arch/arm/mach-omap2/gpmc-nand.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,23 @@ static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt)
5050
soc_is_omap54xx() || soc_is_dra7xx())
5151
return 1;
5252

53+
if (ecc_opt == OMAP_ECC_BCH4_CODE_HW_DETECTION_SW ||
54+
ecc_opt == OMAP_ECC_BCH8_CODE_HW_DETECTION_SW) {
55+
if (cpu_is_omap24xx())
56+
return 0;
57+
else if (cpu_is_omap3630() && (GET_OMAP_REVISION() == 0))
58+
return 0;
59+
else
60+
return 1;
61+
}
62+
5363
/* OMAP3xxx do not have ELM engine, so cannot support ECC schemes
5464
* which require H/W based ECC error detection */
5565
if ((cpu_is_omap34xx() || cpu_is_omap3630()) &&
5666
((ecc_opt == OMAP_ECC_BCH4_CODE_HW) ||
5767
(ecc_opt == OMAP_ECC_BCH8_CODE_HW)))
5868
return 0;
5969

60-
/*
61-
* For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1
62-
* and AM33xx derivates. Other chips may be added if confirmed to work.
63-
*/
64-
if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW_DETECTION_SW) &&
65-
(!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0)))
66-
return 0;
67-
6870
/* legacy platforms support only HAM1 (1-bit Hamming) ECC scheme */
6971
if (ecc_opt == OMAP_ECC_HAM1_CODE_HW)
7072
return 1;

0 commit comments

Comments
 (0)