diff options
author | Kyungmin Park <kyungmin.park@samsung.com> | 2010-04-28 11:46:48 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-05-13 20:50:21 -0400 |
commit | c37cb56fb15d0f8e4180b19eed20f52fe8641b54 (patch) | |
tree | 1eacdb56d59ca81e8e45562f0bbc5d64ceb1b467 /drivers/mtd | |
parent | 3328dc315914aa6db486da2ceb021b6f0b36b877 (diff) |
mtd: onenand: add workaround for SYNC_WRITE mode
Some chips fails to identify properly when SYNC_WRITE mode is enabled
(the example is OneNAND on S5PC110 SoC). This patch adds a workaround
for such chips.
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 9827ab779c08..26caf2590dae 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c | |||
@@ -3763,6 +3763,12 @@ static int onenand_probe(struct mtd_info *mtd) | |||
3763 | /* Restore system configuration 1 */ | 3763 | /* Restore system configuration 1 */ |
3764 | this->write_word(syscfg, this->base + ONENAND_REG_SYS_CFG1); | 3764 | this->write_word(syscfg, this->base + ONENAND_REG_SYS_CFG1); |
3765 | 3765 | ||
3766 | /* Workaround */ | ||
3767 | if (syscfg & ONENAND_SYS_CFG1_SYNC_WRITE) { | ||
3768 | bram_maf_id = this->read_word(this->base + ONENAND_REG_MANUFACTURER_ID); | ||
3769 | bram_dev_id = this->read_word(this->base + ONENAND_REG_DEVICE_ID); | ||
3770 | } | ||
3771 | |||
3766 | /* Check manufacturer ID */ | 3772 | /* Check manufacturer ID */ |
3767 | if (onenand_check_maf(bram_maf_id)) | 3773 | if (onenand_check_maf(bram_maf_id)) |
3768 | return -ENXIO; | 3774 | return -ENXIO; |
@@ -3782,6 +3788,9 @@ static int onenand_probe(struct mtd_info *mtd) | |||
3782 | this->device_id = dev_id; | 3788 | this->device_id = dev_id; |
3783 | this->version_id = ver_id; | 3789 | this->version_id = ver_id; |
3784 | 3790 | ||
3791 | /* Check OneNAND features */ | ||
3792 | onenand_check_features(mtd); | ||
3793 | |||
3785 | density = onenand_get_density(dev_id); | 3794 | density = onenand_get_density(dev_id); |
3786 | if (FLEXONENAND(this)) { | 3795 | if (FLEXONENAND(this)) { |
3787 | this->dies = ONENAND_IS_DDP(this) ? 2 : 1; | 3796 | this->dies = ONENAND_IS_DDP(this) ? 2 : 1; |
@@ -3833,9 +3842,6 @@ static int onenand_probe(struct mtd_info *mtd) | |||
3833 | else | 3842 | else |
3834 | mtd->size = this->chipsize; | 3843 | mtd->size = this->chipsize; |
3835 | 3844 | ||
3836 | /* Check OneNAND features */ | ||
3837 | onenand_check_features(mtd); | ||
3838 | |||
3839 | /* | 3845 | /* |
3840 | * We emulate the 4KiB page and 256KiB erase block size | 3846 | * We emulate the 4KiB page and 256KiB erase block size |
3841 | * But oobsize is still 64 bytes. | 3847 | * But oobsize is still 64 bytes. |