[PATCH] mtd: OneNAND: Detect the correct NOP when 4KiB pagesize

Artem Bityutskiy dedekind1 at gmail.com
Wed Jun 8 07:03:14 EDT 2011


On Wed, 2011-06-08 at 10:56 +0900, Kyungmin Park wrote:
> From: Kyungmin Park <kyungmin.park at samsung.com>
> 
> There are two different 4KiB pagesize chips
> KFM4G16Q4M series have NOP 4 with version ID 0x0131
> But KFM4G16Q5M has NOP 1 with versoin ID 0x013e
> 
> Note that Q5M means that it has NOP 1.
> 
> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
> ---
> diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
> index ac9e959..2adca63 100644
> --- a/drivers/mtd/onenand/onenand_base.c
> +++ b/drivers/mtd/onenand/onenand_base.c
> @@ -3429,6 +3429,13 @@ static void onenand_check_features(struct mtd_info *mtd)
>  		else if (numbufs == 1) {
>  			this->options |= ONENAND_HAS_4KB_PAGE;
>  			this->options |= ONENAND_HAS_CACHE_PROGRAM;
> +			/*
> +			 * There are two different 4KiB pagesize chips
> +			 * KFM4G16Q4M has NOP 4 with version ID 0x0131
> +			 * KFM4G16Q5M has NOP 1 with versoin ID 0x013e
> +			 */

If you confirm that it is impossible to detect NOP and distinguish
between KFM4G16Q4M and KFM4G16Q5M, then can we take the following steps:

1. Add a comment that this is a hacky quirk to work around HW
   identification flaw, to make it clear for the people who read the
   code.
2. Make sure the default is NOP4 (you already do).
3. Compare _both_ device ID and version ID. This means that we'll end up
   with NOP1 only for your device, all the other will be NOP4. If then
   someone has issues, they'll have to reporte about them and add their
   device ID to this hack.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list