+// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2014 Gateworks Corporation
* Author: Tim Harvey <tharvey@gateworks.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <nand.h>
#include <malloc.h>
+#include "mxs_nand.h"
static struct mtd_info *mtd;
static struct nand_chip nand_chip;
}
}
-static int mxs_flash_ident(struct mtd_info *mtd)
+static int mxs_flash_onfi_ident(struct mtd_info *mtd)
{
register struct nand_chip *chip = mtd_to_nand(mtd);
int i;
return 0;
}
+static int mxs_flash_ident(struct mtd_info *mtd)
+{
+ int ret;
+ ret = mxs_flash_onfi_ident(mtd);
+ return ret;
+}
+
static int mxs_read_page_ecc(struct mtd_info *mtd, void *buf, unsigned int page)
{
register struct nand_chip *chip = mtd_to_nand(mtd);
return 0;
/* init mxs nand driver */
- board_nand_init(&nand_chip);
+ mxs_nand_init_spl(&nand_chip);
mtd = nand_to_mtd(&nand_chip);
/* set mtd functions */
nand_chip.cmdfunc = mxs_nand_command;
nand_chip.numchips = 1;
/* identify flash device */
- puts(": ");
if (mxs_flash_ident(mtd)) {
printf("Failed to identify\n");
return -1;
mtd->size = nand_chip.chipsize;
nand_chip.scan_bbt(mtd);
- printf("%llu MiB\n", (mtd->size / (1024 * 1024)));
return 0;
}