[PATCH v3] mtd: nand: add mrvl-nand driver
Robert Jarzmik
robert.jarzmik at free.fr
Fri Jan 9 14:07:46 PST 2015
Robert Jarzmik <robert.jarzmik at free.fr> writes:
> +static int mrvl_nand_ready(struct mtd_info *mtd)
> +{
> + struct mrvl_nand_host *host = mtd_info_to_host(mtd);
> + u32 ndcr;
> +
> + ndcr = nand_readl(host, NDSR);
> + if (host->cmd_ongoing == NAND_CMD_RESET)
> + if (host->cs == 0)
> + return ndcr & NDSR_FLASH_RDY;
> + if (host->cs == 1)
> + return ndcr & NDSR_RDY;
> + if (host->cs == 0)
> + return ndcr & NDSR_CS0_CMDD;
> + if (host->cs == 1)
> + return ndcr & NDSR_CS1_CMDD;
> + return 1;
> +}
This function should be purified, and the NAND_CMD_RESET test thrown away. In a
multiple write or erase case, this function should really wait for the NAND to
be ready. For v4.
Cheers.
--
Robert
More information about the barebox
mailing list