Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37921
b: refs/heads/master
c: 47e777e
h: refs/heads/master
i:
  37919: 6fdbf11
v: v3
  • Loading branch information
Kyungmin Park authored and David Woodhouse committed Sep 26, 2006
1 parent d5cee99 commit ac102d0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b77d95c78fb0ec330cd53e0d297ffa4fd2975e32
refs/heads/master: 47e777e02e7b21eaa4686a70069c9583c126aea8
17 changes: 14 additions & 3 deletions trunk/drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,12 @@ static int onenand_probe(struct mtd_info *mtd)
int bram_maf_id, bram_dev_id, maf_id, dev_id;
int version_id;
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 */
this->write_word(ONENAND_CMD_READID, this->base + ONENAND_BOOTRAM);
Expand All @@ -1636,13 +1642,18 @@ static int onenand_probe(struct mtd_info *mtd)
bram_maf_id = this->read_word(this->base + ONENAND_BOOTRAM + 0x0);
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 */
if (onenand_check_maf(bram_maf_id))
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 */
maf_id = this->read_word(this->base + ONENAND_REG_MANUFACTURER_ID);
dev_id = this->read_word(this->base + ONENAND_REG_DEVICE_ID);
Expand Down

0 comments on commit ac102d0

Please sign in to comment.