[U-Boot-Users] [PATCH 6/7 v3] NAND: add NAND driver for s3c64xx
Scott Wood
scottwood at freescale.com
Tue Aug 5 00:38:11 CEST 2008
On Mon, Aug 04, 2008 at 02:46:15PM +0200, Guennadi Liakhovetski wrote:
> +#ifdef CONFIG_NAND_SPL
> +static u_char nand_read_byte(struct mtd_info *mtd)
> +{
> + struct nand_chip *this = mtd->priv;
> + return readb(this->IO_ADDR_R);
> +}
> +
> +static void nand_write_byte(struct mtd_info *mtd, u_char byte)
> +{
> + struct nand_chip *this = mtd->priv;
> + writeb(byte, this->IO_ADDR_W);
> +}
> +
> +static void nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
> +{
> + int i;
> + struct nand_chip *this = mtd->priv;
> +
> + for (i = 0; i < len; i++)
> + buf[i] = readb(this->IO_ADDR_R);
> +}
> +#endif
We should probably move this under nand_spl/, and let boards select it
if they need it.
> +/*
> + * Hardware specific access to control-lines function
> + * Written by jsgood
> + */
> +static void s3c_nand_hwcontrol(struct mtd_info *mtd, int cmd)
> +{
> + struct nand_chip *this = mtd->priv;
> +
> + switch (cmd) {
> + case NAND_CTL_SETCLE:
> + this->IO_ADDR_W = (void __iomem *)NFCMMD;
> + break;
> + case NAND_CTL_CLRCLE:
> + this->IO_ADDR_W = (void __iomem *)NFDATA;
> + break;
> + case NAND_CTL_SETALE:
> + this->IO_ADDR_W = (void __iomem *)NFADDR;
> + break;
> + case NAND_CTL_CLRALE:
> + this->IO_ADDR_W = (void __iomem *)NFDATA;
> + break;
> + case NAND_CTL_SETNCE:
> + s3c_nand_select_chip(mtd, 0);
> + break;
> + case NAND_CTL_CLRNCE:
> + s3c_nand_select_chip(mtd, -1);
> + break;
> + }
> +}
This interface has changed in u-boot-nand-flash/testing. Can you rebase
against it?
-Scott
More information about the U-Boot
mailing list