nand->options &= ~NAND_OWN_BUFFERS;
return;
}
-#endif
-#ifdef CONFIG_SPL_BUILD
+static int am33xx_scan_bbt(struct mtd_info *mtd)
+{
+ int ret;
+
+ am33xx_nand_switch_ecc(NAND_ECC_HW, 0);
+ ret = nand_default_bbt(mtd);
+ am33xx_nand_switch_ecc(NAND_ECC_HW, 2);
+ return ret;
+}
+#else /* CONFIG_SPL_BUILD */
/* Check wait pin as dev ready indicator */
static int am33xx_spl_dev_ready(struct mtd_info *mtd)
{
return gpmc_cfg->status & (1 << 8);
}
+
+static int am33xx_scan_bbt(struct mtd_info *mtd)
+{
+ return 0;
+}
#endif
/*
nand->cmd_ctrl = am33xx_nand_hwcontrol;
nand->options = NAND_NO_PADDING | NAND_CACHEPRG | NAND_NO_AUTOINCR;
+ nand->scan_bbt = am33xx_scan_bbt;
+
/* If we are 16 bit dev, our gpmc config tells us that */
if ((readl(&gpmc_cfg->cs[cs].config1) & 0x3000) == 0x1000) {
nand->options |= NAND_BUSWIDTH_16;
/* For undocumented reasons we need to currently keep our environment
* in 1-bit ECC so we configure ourself thusly. */
nand_curr_device = 0;
- am33xx_nand_switch_ecc(NAND_ECC_HW, 0);
+ am33xx_nand_switch_ecc(NAND_ECC_HW, 2);
#else
/* The NAND chip present requires that we have written data in with
* at least 4-bit ECC so we configure outself for that in SPL.