[U-Boot] [PATCH 2/4] nand: lpc32xx: add SLC NAND controller support

Scott Wood scottwood at freescale.com
Thu Jul 16 22:20:52 CEST 2015


On Thu, 2015-07-16 at 02:33 +0300, Vladimir Zapolskiy wrote:
> +static void lpc32xx_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
> +{
> +     while (len-- > 0)
> +             *buf++ = (uint8_t)readl(&lpc32xx_nand_slc_registers->data);
> +}
> +
> +static uint8_t lpc32xx_read_byte(struct mtd_info *mtd)
> +{
> +     return (uint8_t)readl(&lpc32xx_nand_slc_registers->data);
> +}
> +
> +static void lpc32xx_write_buf(struct mtd_info *mtd, const uint8_t *buf, 
> int len)
> +{
> +     while (len-- > 0)
> +             writel((uint32_t)*buf++, &lpc32xx_nand_slc_registers->data);
> +}
> +
> +static void lpc32xx_write_byte(struct mtd_info *mtd, uint8_t byte)
> +{
> +     writel((uint32_t)byte, &lpc32xx_nand_slc_registers->data);
> +}

Unnecessary casts.

> +     /*
> +      * Hardware ECC calculation is not supported by the driver, because it
> +      * requires DMA support, see Note after SLC_ECC register description
> +      */
> +     lpc32xx_chip->ecc.mode  = NAND_ECC_SOFT;

Where can I find this note?  I don't see any  "SLC_ECC register description".

> +#if defined(CONFIG_SPL_BUILD)
> +     lpc32xx_chip->options           |= NAND_SKIP_BBTSCAN;
> +#endif

Does this make any difference?  nand_spl_simple will not do a bbt scan in any 
case.

-Scott



More information about the U-Boot mailing list