aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/gpmc.c
diff options
context:
space:
mode:
authorpekon gupta <pekon@ti.com>2014-05-19 03:54:39 -0400
committerBrian Norris <computersforpeace@gmail.com>2014-05-20 20:52:14 -0400
commit27c9fd607587e6c3b517590df4cd35ac85f3d0bd (patch)
tree92fbf32f4f2c3f3b986c2dd0c7a1f2a9b9383d23 /arch/arm/mach-omap2/gpmc.c
parent4007e2d175cc83ea728b757e49155826b32fbff8 (diff)
mtd: nand: omap: add support for BCH16_ECC - GPMC driver updates
This patch add support for BCH16_ECC in GPMC (controller) driver: - extends configuration space to include BCH16 registers - extends parsing of DT binding for selecting BCH16 ecc-scheme Signed-off-by: Pekon Gupta <pekon@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'arch/arm/mach-omap2/gpmc.c')
-rw-r--r--arch/arm/mach-omap2/gpmc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index ab43755364f5..9b27773db040 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -68,6 +68,9 @@
68#define GPMC_ECC_BCH_RESULT_1 0x244 /* not available on OMAP2 */ 68#define GPMC_ECC_BCH_RESULT_1 0x244 /* not available on OMAP2 */
69#define GPMC_ECC_BCH_RESULT_2 0x248 /* not available on OMAP2 */ 69#define GPMC_ECC_BCH_RESULT_2 0x248 /* not available on OMAP2 */
70#define GPMC_ECC_BCH_RESULT_3 0x24c /* not available on OMAP2 */ 70#define GPMC_ECC_BCH_RESULT_3 0x24c /* not available on OMAP2 */
71#define GPMC_ECC_BCH_RESULT_4 0x300 /* not available on OMAP2 */
72#define GPMC_ECC_BCH_RESULT_5 0x304 /* not available on OMAP2 */
73#define GPMC_ECC_BCH_RESULT_6 0x308 /* not available on OMAP2 */
71 74
72/* GPMC ECC control settings */ 75/* GPMC ECC control settings */
73#define GPMC_ECC_CTRL_ECCCLEAR 0x100 76#define GPMC_ECC_CTRL_ECCCLEAR 0x100
@@ -666,6 +669,12 @@ void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
666 GPMC_BCH_SIZE * i; 669 GPMC_BCH_SIZE * i;
667 reg->gpmc_bch_result3[i] = gpmc_base + GPMC_ECC_BCH_RESULT_3 + 670 reg->gpmc_bch_result3[i] = gpmc_base + GPMC_ECC_BCH_RESULT_3 +
668 GPMC_BCH_SIZE * i; 671 GPMC_BCH_SIZE * i;
672 reg->gpmc_bch_result4[i] = gpmc_base + GPMC_ECC_BCH_RESULT_4 +
673 i * GPMC_BCH_SIZE;
674 reg->gpmc_bch_result5[i] = gpmc_base + GPMC_ECC_BCH_RESULT_5 +
675 i * GPMC_BCH_SIZE;
676 reg->gpmc_bch_result6[i] = gpmc_base + GPMC_ECC_BCH_RESULT_6 +
677 i * GPMC_BCH_SIZE;
669 } 678 }
670} 679}
671 680
@@ -1401,6 +1410,12 @@ static int gpmc_probe_nand_child(struct platform_device *pdev,
1401 else 1410 else
1402 gpmc_nand_data->ecc_opt = 1411 gpmc_nand_data->ecc_opt =
1403 OMAP_ECC_BCH8_CODE_HW_DETECTION_SW; 1412 OMAP_ECC_BCH8_CODE_HW_DETECTION_SW;
1413 else if (!strcmp(s, "bch16"))
1414 if (gpmc_nand_data->elm_of_node)
1415 gpmc_nand_data->ecc_opt =
1416 OMAP_ECC_BCH16_CODE_HW;
1417 else
1418 pr_err("%s: BCH16 requires ELM support\n", __func__);
1404 else 1419 else
1405 pr_err("%s: ti,nand-ecc-opt invalid value\n", __func__); 1420 pr_err("%s: ti,nand-ecc-opt invalid value\n", __func__);
1406 1421