[PATCH] mtd: nand: auto-detection of NAND bus-width from ONFI param or nand_id[]

Gupta, Pekon pekon at ti.com
Tue Nov 26 02:49:57 EST 2013


> From: Huang Shijie [mailto:b32955 at freescale.com]
[...]
> > @@ -3033,6 +3028,12 @@ static int nand_flash_detect_onfi(struct
> mtd_info *mtd, struct nand_chip *chip,
> >   	}
> If it is 16bit bus, could we reconfigure the bus width in here?
> it's better to limit the influence only in the ONFI code.
> 

Yes I too wanted same, but then once a device is found in
nand_flash_id[] table, ONFI probe is not done ..
Refer below code in nand_base.c
	@@ nand_get_flash_type()
	if (!type->name || !type->pagesize) {
			/* Check is chip is ONFI compliant */
			if (nand_flash_detect_onfi(mtd, chip, &busw))

Thus, if we want to truly auto-detection, then we need to
set bus-width in both cases
(1) when NAND device is detected based on nand_flash_id[] table
(2) when NAND device is detected based on ONFI probe

Again need more thoughts.. ?

with regards, pekon


More information about the linux-mtd mailing list