Robert Jarzmik <[email protected]> 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

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to