[PATCH 2/3] nand_base: add ONFI flash detection

Sascha Hauer s.hauer at pengutronix.de
Thu Jul 5 15:02:40 EDT 2012


On Thu, Jul 05, 2012 at 12:22:46PM +0200, Eric Bénard wrote:
> the code is taken from linux & u-boot implementations
> Validated on an i.MX53 which gives the following log :
> ONFI flash detected ... ONFI param page 0 valid
> NAND device: Manufacturer ID: 0x2c, Chip ID: 0x38 (Micron MT29F8G08ABABAWP), page size: 4096, OOB size: 224
> 
> Signed-off-by: Eric Bénard <eric at eukrea.com>
> ---
>  drivers/mtd/nand/nand_base.c |  174 ++++++++++++++++++++++++++++++++++++------
>  include/linux/mtd/mtd-abi.h  |    7 +-
>  include/linux/mtd/nand.h     |   74 ++++++++++++++++++-
>  3 files changed, 226 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
>  #ifdef CONFIG_MTD_WRITE
>  	/* Check for AND chips with 4 page planes */
>  	if (chip->options & NAND_4PAGE_ARRAY)
> @@ -1179,9 +1301,11 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
>  	if (mtd->writesize > 512 && chip->cmdfunc == nand_command)
>  		chip->cmdfunc = nand_command_lp;
>  
> -	printk(KERN_INFO "NAND device: Manufacturer ID:"
> -	       " 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, dev_id,
> -	       nand_manuf_ids[maf_idx].name, type->name);
> +	printk("NAND device: Manufacturer ID: 0x%02x, Chip ID: 0x%02x (%s %s),"
> +		" page size: %d, OOB size: %d\n",
> +		*maf_id, dev_id, nand_manuf_ids[maf_idx].name,
> +		chip->onfi_version ? chip->onfi_params.model : type->name,
> +		mtd->writesize, mtd->oobsize);

Do we need to output writesize and oobsize here? 'devinfo nand0' will
give the same information.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list