[PATCH][03/03] nandsim own geometry
Artem B. Bityuckiy
dedekind at infradead.org
Mon May 23 07:09:19 EDT 2005
> diff -Naur mtd-work2/drivers/mtd/nand/nand_ids.c mtd-work3/drivers/mtd/nand/nand_ids.c
> --- mtd-work2/drivers/mtd/nand/nand_ids.c 2005-02-16 10:33:27.000000000 +0100
> +++ mtd-work3/drivers/mtd/nand/nand_ids.c 2005-05-23 08:36:57.000000000 +0200
> @@ -103,6 +103,35 @@
> */
> {"AND 128MiB 3,3V 8-bit", 0x01, 2048, 128, 0x4000, NAND_IS_AND | NAND_NO_AUTOINCR | NAND_4PAGE_ARRAY | BBT_AUTO_REFRESH},
>
> +#ifdef CONFIG_MTD_NAND_GEOM
> +# ifdef CONFIG_MTD_NAND_NANDSIM_8BIT_BUS
> +# define CONFIG_MTD_NAND_NANDSIM_BUSWIDTH 0
> +# elif defined(CONFIG_MTD_NAND_NANDSIM_16BIT_BUS)
> +# define CONFIG_MTD_NAND_NANDSIM_BUSWIDTH NAND_BUSWIDTH_16
> +# endif
> +# ifdef CONFIG_MTD_NAND_NANDSIM_OLD
> +# ifdef CONFIG_MTD_NAND_NANDSIM_256B_PAGE
> +# define CONFIG_MTD_NAND_NANDSIM_PAGESIZE 256
> +# elif defined(CONFIG_MTD_NAND_NANDSIM_512B_PAGE)
> +# define CONFIG_MTD_NAND_NANDSIM_PAGESIZE 512
> +# endif
> +# ifdef CONFIG_MTD_NAND_NANDSIM_4KB_ERASE
> +# define CONFIG_MTD_NAND_NANDSIM_EBSIZE 4096
> +# elif defined(CONFIG_MTD_NAND_NANDSIM_8KB_ERASE)
> +# define CONFIG_MTD_NAND_NANDSIM_EBSIZE 8192
> +# elif defined(CONFIG_MTD_NAND_NANDSIM_16KB_ERASE)
> +# define CONFIG_MTD_NAND_NANDSIM_EBSIZE 16384
> +# endif
> +
> + {"NANDSIM (old)", CONFIG_MTD_NAND_NANDSIM_ID, CONFIG_MTD_NAND_NANDSIM_PAGESIZE, CONFIG_MTD_NAND_NANDSIM_CHIPSIZE, CONFIG_MTD_NAND_NANDSIM_EBSIZE, CONFIG_MTD_NAND_NANDSIM_BUSWIDTH},
> +
> +# elif defined(CONFIG_MTD_NAND_NANDSIM_NEW)
> +
> + {"NANDSIM (new)", CONFIG_MTD_NAND_NANDSIM_ID, 0, CONFIG_MTD_NAND_NANDSIM_CHIPSIZE, 0, CONFIG_MTD_NAND_NANDSIM_BUSWIDTH},
> +
> +# endif
> +#endif
> +
> {NULL,}
> };
Patrik,
is it possible to avoid such a changes in nand_ids.c ?
AFAICS, your patch assumes that one should recompile nand_ids when
nandsim configuration has been changed. It shouldn't be so I think.
I'd better do:
1. initialize all the needed fields in 'struct mtd_info' and 'struct
nand_chip' in case of a custom chip in _nandsim_.
2. Introduce some special option (say, NAND_SKIP_READ_ID for this-
>options) which tells nand_scan not to read NAND chip's ID.
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
More information about the linux-mtd
mailing list