[U-Boot] [PATCH] mxc_nand: add nand driver for MX2/MX3

Scott Wood scottwood at freescale.com
Wed Jul 29 00:37:36 CEST 2009


On Fri, Jul 17, 2009 at 02:53:55PM +0400, Ilya Yanok wrote:
> +/* OOB placement block for use with hardware ecc generation */
> +static struct nand_ecclayout nand_hw_eccoob = {
> +	.eccbytes = 5,
> +	.eccpos = {6, 7, 8, 9, 10},
> +	.oobfree = {{0, 5}, {11, 5}, }
> +};
> +
> +#ifndef CONFIG_MXC_NAND_HWECC
> +static struct nand_ecclayout nand_hw_eccoob_soft = {
> +	.eccbytes = 6,
> +	.eccpos = {6, 7, 8, 9, 10, 11},
> +	.oobfree = {{0, 5}, {12, 4}, }
> +};
> +#endif

Why is one struct #ifndef, but the other isn't #ifdef?

> +/*
> + * This function requests the NANDFC to initate the transfer
> + * of data currently in the NANDFC RAM buffer to the NAND device.
> + */
> +static void send_prog_page(struct mxc_nand_host *host, uint8_t buf_id,
> +			int spare_only)
> +{
> +	MTDDEBUG(MTD_DEBUG_LEVEL3, "send_prog_page (%d)\n", spare_only);
> +
> +	/* NANDFC buffer 0 is used for page read/write */
> +	writew(buf_id, &host->regs->nfc_buf_addr);

Comment does not match code.

> +	/*
> +	 * NANDFC buffer 1 is used for device status to prevent
> +	 * corruption of read/write buffer on status requests.
> +	 */
> +	writew(1, &host->regs->nfc_buf_addr);



More information about the U-Boot mailing list