Merge tag 'for-linus-20140610' of git://git.infradead.org/linux-mtd
[sfrench/cifs-2.6.git] / arch / arm / mach-omap2 / gpmc.c
index 852b19a367f06d74e549b7b674d057ee193b508c..2c0c2816900ffc3ae1e7b1a75b9db6f559399957 100644 (file)
@@ -68,6 +68,9 @@
 #define        GPMC_ECC_BCH_RESULT_1   0x244   /* not available on OMAP2 */
 #define        GPMC_ECC_BCH_RESULT_2   0x248   /* not available on OMAP2 */
 #define        GPMC_ECC_BCH_RESULT_3   0x24c   /* not available on OMAP2 */
+#define        GPMC_ECC_BCH_RESULT_4   0x300   /* not available on OMAP2 */
+#define        GPMC_ECC_BCH_RESULT_5   0x304   /* not available on OMAP2 */
+#define        GPMC_ECC_BCH_RESULT_6   0x308   /* not available on OMAP2 */
 
 /* GPMC ECC control settings */
 #define GPMC_ECC_CTRL_ECCCLEAR         0x100
@@ -677,6 +680,12 @@ void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
                                           GPMC_BCH_SIZE * i;
                reg->gpmc_bch_result3[i] = gpmc_base + GPMC_ECC_BCH_RESULT_3 +
                                           GPMC_BCH_SIZE * i;
+               reg->gpmc_bch_result4[i] = gpmc_base + GPMC_ECC_BCH_RESULT_4 +
+                                          i * GPMC_BCH_SIZE;
+               reg->gpmc_bch_result5[i] = gpmc_base + GPMC_ECC_BCH_RESULT_5 +
+                                          i * GPMC_BCH_SIZE;
+               reg->gpmc_bch_result6[i] = gpmc_base + GPMC_ECC_BCH_RESULT_6 +
+                                          i * GPMC_BCH_SIZE;
        }
 }
 
@@ -1412,6 +1421,12 @@ static int gpmc_probe_nand_child(struct platform_device *pdev,
                else
                        gpmc_nand_data->ecc_opt =
                                OMAP_ECC_BCH8_CODE_HW_DETECTION_SW;
+       else if (!strcmp(s, "bch16"))
+               if (gpmc_nand_data->elm_of_node)
+                       gpmc_nand_data->ecc_opt =
+                               OMAP_ECC_BCH16_CODE_HW;
+               else
+                       pr_err("%s: BCH16 requires ELM support\n", __func__);
        else
                pr_err("%s: ti,nand-ecc-opt invalid value\n", __func__);