Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 49143
b: refs/heads/master
c: cde36b3
h: refs/heads/master
i:
  49141: b0fe02e
  49139: 5a9238c
  49135: 050fce3
v: v3
  • Loading branch information
Adrian Hunter authored and Kyungmin Park committed Feb 9, 2007
1 parent 9f8f940 commit 0f96f40
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 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: 211ac75f5e867ab7a54811a514814149caca42c3
refs/heads/master: cde36b37d6fa5ebc8c95461a972c379185626b2c
24 changes: 16 additions & 8 deletions trunk/drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,24 +577,32 @@ static int onenand_write_bufferram(struct mtd_info *mtd, int area,
static int onenand_check_bufferram(struct mtd_info *mtd, loff_t addr)
{
struct onenand_chip *this = mtd->priv;
int blockpage;
int blockpage, found = 0;
unsigned int i;

blockpage = (int) (addr >> this->page_shift);

/* Is there valid data? */
i = ONENAND_CURRENT_BUFFERRAM(this);
if (this->bufferram[i].blockpage == blockpage)
return 1;
found = 1;
else {
/* Check another BufferRAM */
i = ONENAND_NEXT_BUFFERRAM(this);
if (this->bufferram[i].blockpage == blockpage) {
ONENAND_SET_NEXT_BUFFERRAM(this);
found = 1;
}
}

/* Check another BufferRAM */
i = ONENAND_NEXT_BUFFERRAM(this);
if (this->bufferram[i].blockpage == blockpage) {
ONENAND_SET_NEXT_BUFFERRAM(this);
return 1;
if (found && ONENAND_IS_DDP(this)) {
/* Select DataRAM for DDP */
int block = (int) (addr >> this->erase_shift);
int value = onenand_bufferram_address(this, block);
this->write_word(value, this->base + ONENAND_REG_START_ADDRESS2);
}

return 0;
return found;
}

/**
Expand Down

0 comments on commit 0f96f40

Please sign in to comment.