[PATCH] mtd: nand: auto-detection of NAND bus-width from ONFI param or nand_id[]
Huang Shijie
b32955 at freescale.com
Tue Nov 26 04:22:03 EST 2013
于 2013年11月26日 15:49, Gupta, Pekon 写道:
>> 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
If the bus-width is not the same. we'd better return with -EINVAL to tell
the user that he has a wrong configuration.
so i do not suggest we remove the -EINVAL code of nand_get_flash_type().
(I am not sure whether we should remove the NAND_BUSWIDTH_AUTO, let
Brian judge it)
> (2) when NAND device is detected based on ONFI probe
>
Just as suspend/resume, if we do the same thing in the ONFI probe,
we do not need to remove the -EINVAL code of the nand_get_flash_type().
thanks
Huang Shijie
More information about the linux-mtd
mailing list