[PATCH/RFC] OneNAND simulator support
Kyungmin Park
kmpark at infradead.org
Thu Mar 22 20:14:31 EDT 2007
> > On Thu, 2007-03-22 at 09:51 +0900, Kyungmin Park wrote:
> > > Hi,
> > >
> > > This patch simulate various OneNAND flash chips for the MTD
> > onenand layer.
> > > It's simple implementation, only basic operations.
> > > It don't support the recent changes in NANDSIM such as lazy
> > block allocation,
> > > bitflip, and so on.
> > >
> > > Any comments are welcome.
> >
> > Did you run our nand-tests to make sure it is OK?
> >
>
> oobtest => passed (with revert patch, see below)
> pagetest=> passed
> subpagetest=> failed
>
> At this time. it doesn't support subpage. I will check it.
subpagetest => passed
with small changes it can pass the subpagetest.
Before
+ case ONENAND_CMD_PROG:
+ src = ONENAND_MAIN_AREA(this, main_offset);
+ dest = ONENAND_CORE(flash) + offset;
+ if (memcmp(dest, ffchars, info->mtd.writesize) &&
+ onenand_check_overwrite(dest, src, info->mtd.writesize))
+ printk(KERN_ERR "over-write happend at 0x%08x\n",
+ offset);
+ memcpy(dest, src, info->mtd.writesize);
+ /* Fall through */
After
case ONENAND_CMD_PROG:
src = ONENAND_MAIN_AREA(this, main_offset);
dest = ONENAND_CORE(flash) + offset;
/* To handle partial write */
for (i = 0; i < (1 << info->mtd.subpage_sft); i++) {
int off = i * this->subpagesize;
if (!memcmp(src + off, ffchars, this->subpagesize))
continue;
if (memcmp(dest + off, ffchars, this->subpagesize) &&
onenand_check_overwrite(dest + off, src + off, this-
>subpagesize))
printk(KERN_ERR "over-write happend at
0x%08x\n", offset);
memcpy(dest + off, src + off, this->subpagesize);
}
/* Fall through */
Thank you,
Kyungmin Park
More information about the linux-mtd
mailing list