diff options
author | Kyungmin Park <kyungmin.park@samsung.com> | 2011-06-22 01:16:49 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:13 -0400 |
commit | e1c10243df92822954b9b5e04d12dd2f23a39652 (patch) | |
tree | d2b263c3da7174396d336641f4545acc8d31be22 /drivers/mtd/onenand/onenand_base.c | |
parent | b2a5a4878e97119e3b64d4646fd138820d513c28 (diff) |
mtd: OneNAND: Detect the correct NOP when 4KiB pagesize
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@samsung.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/onenand/onenand_base.c')
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index ac9e959802a7..51800a7ef7f8 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c | |||
@@ -3429,6 +3429,19 @@ static void onenand_check_features(struct mtd_info *mtd) | |||
3429 | else if (numbufs == 1) { | 3429 | else if (numbufs == 1) { |
3430 | this->options |= ONENAND_HAS_4KB_PAGE; | 3430 | this->options |= ONENAND_HAS_4KB_PAGE; |
3431 | this->options |= ONENAND_HAS_CACHE_PROGRAM; | 3431 | this->options |= ONENAND_HAS_CACHE_PROGRAM; |
3432 | /* | ||
3433 | * There are two different 4KiB pagesize chips | ||
3434 | * and no way to detect it by H/W config values. | ||
3435 | * | ||
3436 | * To detect the correct NOP for each chips, | ||
3437 | * It should check the version ID as workaround. | ||
3438 | * | ||
3439 | * Now it has as following | ||
3440 | * KFM4G16Q4M has NOP 4 with version ID 0x0131 | ||
3441 | * KFM4G16Q5M has NOP 1 with versoin ID 0x013e | ||
3442 | */ | ||
3443 | if ((this->version_id & 0xf) == 0xe) | ||
3444 | this->options |= ONENAND_HAS_NOP_1; | ||
3432 | } | 3445 | } |
3433 | 3446 | ||
3434 | case ONENAND_DEVICE_DENSITY_2Gb: | 3447 | case ONENAND_DEVICE_DENSITY_2Gb: |
@@ -4054,6 +4067,8 @@ int onenand_scan(struct mtd_info *mtd, int maxchips) | |||
4054 | this->ecclayout = &onenand_oob_128; | 4067 | this->ecclayout = &onenand_oob_128; |
4055 | mtd->subpage_sft = 2; | 4068 | mtd->subpage_sft = 2; |
4056 | } | 4069 | } |
4070 | if (ONENAND_IS_NOP_1(this)) | ||
4071 | mtd->subpage_sft = 0; | ||
4057 | break; | 4072 | break; |
4058 | case 64: | 4073 | case 64: |
4059 | this->ecclayout = &onenand_oob_64; | 4074 | this->ecclayout = &onenand_oob_64; |