diff options
author | Kyungmin Park <kyungmin.park@samsung.com> | 2006-09-25 19:53:28 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-09-26 04:16:06 -0400 |
commit | 47e777e02e7b21eaa4686a70069c9583c126aea8 (patch) | |
tree | cddb443020bec7625029d75030504bf5d295a924 /drivers/mtd/onenand | |
parent | b77d95c78fb0ec330cd53e0d297ffa4fd2975e32 (diff) |
[MTD ONENAND] Fix OneNAND probe
- fix OneNAND probe whether OneNAND Sync. Burst read mode or not
- fix OneNAND reset wait problem
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/onenand')
-rw-r--r-- | drivers/mtd/onenand/onenand_base.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 84ec40d25438..09aefe2164aa 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c | |||
@@ -1628,6 +1628,12 @@ static int onenand_probe(struct mtd_info *mtd) | |||
1628 | int bram_maf_id, bram_dev_id, maf_id, dev_id; | 1628 | int bram_maf_id, bram_dev_id, maf_id, dev_id; |
1629 | int version_id; | 1629 | int version_id; |
1630 | int density; | 1630 | int density; |
1631 | int syscfg; | ||
1632 | |||
1633 | /* Save system configuration 1 */ | ||
1634 | syscfg = this->read_word(this->base + ONENAND_REG_SYS_CFG1); | ||
1635 | /* Clear Sync. Burst Read mode to read BootRAM */ | ||
1636 | this->write_word((syscfg & ~ONENAND_SYS_CFG1_SYNC_READ), this->base + ONENAND_REG_SYS_CFG1); | ||
1631 | 1637 | ||
1632 | /* Send the command for reading device ID from BootRAM */ | 1638 | /* Send the command for reading device ID from BootRAM */ |
1633 | this->write_word(ONENAND_CMD_READID, this->base + ONENAND_BOOTRAM); | 1639 | this->write_word(ONENAND_CMD_READID, this->base + ONENAND_BOOTRAM); |
@@ -1636,13 +1642,18 @@ static int onenand_probe(struct mtd_info *mtd) | |||
1636 | bram_maf_id = this->read_word(this->base + ONENAND_BOOTRAM + 0x0); | 1642 | bram_maf_id = this->read_word(this->base + ONENAND_BOOTRAM + 0x0); |
1637 | bram_dev_id = this->read_word(this->base + ONENAND_BOOTRAM + 0x2); | 1643 | bram_dev_id = this->read_word(this->base + ONENAND_BOOTRAM + 0x2); |
1638 | 1644 | ||
1645 | /* Reset OneNAND to read default register values */ | ||
1646 | this->write_word(ONENAND_CMD_RESET, this->base + ONENAND_BOOTRAM); | ||
1647 | /* Wait reset */ | ||
1648 | this->wait(mtd, FL_RESETING); | ||
1649 | |||
1650 | /* Restore system configuration 1 */ | ||
1651 | this->write_word(syscfg, this->base + ONENAND_REG_SYS_CFG1); | ||
1652 | |||
1639 | /* Check manufacturer ID */ | 1653 | /* Check manufacturer ID */ |
1640 | if (onenand_check_maf(bram_maf_id)) | 1654 | if (onenand_check_maf(bram_maf_id)) |
1641 | return -ENXIO; | 1655 | return -ENXIO; |
1642 | 1656 | ||
1643 | /* Reset OneNAND to read default register values */ | ||
1644 | this->write_word(ONENAND_CMD_RESET, this->base + ONENAND_BOOTRAM); | ||
1645 | |||
1646 | /* Read manufacturer and device IDs from Register */ | 1657 | /* Read manufacturer and device IDs from Register */ |
1647 | maf_id = this->read_word(this->base + ONENAND_REG_MANUFACTURER_ID); | 1658 | maf_id = this->read_word(this->base + ONENAND_REG_MANUFACTURER_ID); |
1648 | dev_id = this->read_word(this->base + ONENAND_REG_DEVICE_ID); | 1659 | dev_id = this->read_word(this->base + ONENAND_REG_DEVICE_ID); |