[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>
This commit is contained in:
committed by
David Woodhouse
parent
b77d95c78f
commit
47e777e02e
@@ -1628,6 +1628,12 @@ static int onenand_probe(struct mtd_info *mtd)
|
|||||||
int bram_maf_id, bram_dev_id, maf_id, dev_id;
|
int bram_maf_id, bram_dev_id, maf_id, dev_id;
|
||||||
int version_id;
|
int version_id;
|
||||||
int density;
|
int density;
|
||||||
|
int syscfg;
|
||||||
|
|
||||||
|
/* Save system configuration 1 */
|
||||||
|
syscfg = this->read_word(this->base + ONENAND_REG_SYS_CFG1);
|
||||||
|
/* Clear Sync. Burst Read mode to read BootRAM */
|
||||||
|
this->write_word((syscfg & ~ONENAND_SYS_CFG1_SYNC_READ), this->base + ONENAND_REG_SYS_CFG1);
|
||||||
|
|
||||||
/* Send the command for reading device ID from BootRAM */
|
/* Send the command for reading device ID from BootRAM */
|
||||||
this->write_word(ONENAND_CMD_READID, this->base + ONENAND_BOOTRAM);
|
this->write_word(ONENAND_CMD_READID, this->base + ONENAND_BOOTRAM);
|
||||||
@@ -1636,13 +1642,18 @@ static int onenand_probe(struct mtd_info *mtd)
|
|||||||
bram_maf_id = this->read_word(this->base + ONENAND_BOOTRAM + 0x0);
|
bram_maf_id = this->read_word(this->base + ONENAND_BOOTRAM + 0x0);
|
||||||
bram_dev_id = this->read_word(this->base + ONENAND_BOOTRAM + 0x2);
|
bram_dev_id = this->read_word(this->base + ONENAND_BOOTRAM + 0x2);
|
||||||
|
|
||||||
|
/* Reset OneNAND to read default register values */
|
||||||
|
this->write_word(ONENAND_CMD_RESET, this->base + ONENAND_BOOTRAM);
|
||||||
|
/* Wait reset */
|
||||||
|
this->wait(mtd, FL_RESETING);
|
||||||
|
|
||||||
|
/* Restore system configuration 1 */
|
||||||
|
this->write_word(syscfg, this->base + ONENAND_REG_SYS_CFG1);
|
||||||
|
|
||||||
/* Check manufacturer ID */
|
/* Check manufacturer ID */
|
||||||
if (onenand_check_maf(bram_maf_id))
|
if (onenand_check_maf(bram_maf_id))
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
|
|
||||||
/* Reset OneNAND to read default register values */
|
|
||||||
this->write_word(ONENAND_CMD_RESET, this->base + ONENAND_BOOTRAM);
|
|
||||||
|
|
||||||
/* Read manufacturer and device IDs from Register */
|
/* Read manufacturer and device IDs from Register */
|
||||||
maf_id = this->read_word(this->base + ONENAND_REG_MANUFACTURER_ID);
|
maf_id = this->read_word(this->base + ONENAND_REG_MANUFACTURER_ID);
|
||||||
dev_id = this->read_word(this->base + ONENAND_REG_DEVICE_ID);
|
dev_id = this->read_word(this->base + ONENAND_REG_DEVICE_ID);
|
||||||
|
Reference in New Issue
Block a user