+#if defined(MXC_NFC_V1_1)
+ int ecc_per_page = CONFIG_SYS_NAND_PAGE_SIZE / 512;
+ int config1;
+
+ writew(CONFIG_SYS_NAND_SPARE_SIZE / 2, &nfc->spare_area_size);
+
+ /* unlocking RAM Buff */
+ writew(0x2, &nfc->configuration);
+
+ /* hardware ECC checking and correct */
+ config1 = readw(&nfc->nand_flash_config1) | NFC_ECC_EN | 0x800;
+ /*
+ * if spare size is larger that 16 bytes per 512 byte hunk
+ * then use 8 symbol correction instead of 4
+ */
+ if ((CONFIG_SYS_NAND_SPARE_SIZE / ecc_per_page) > 16)
+ config1 &= ~NFC_4_8N_ECC;
+ else
+ config1 |= NFC_4_8N_ECC;
+ writew(config1, &nfc->nand_flash_config1);
+#elif defined(MXC_NFC_V1)