[PATCH] OneNAND: Sync. Burst Read support
Add OneNAND Sync. Burst Read support Tested with OMAP platform Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
committed by
Thomas Gleixner
parent
cd5f6346bc
commit
52b0eea73d
@@ -378,6 +378,35 @@ static int onenand_read_bufferram(struct mtd_info *mtd, int area,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* onenand_sync_read_bufferram - [OneNAND Interface] Read the bufferram area with Sync. Burst mode
|
||||
* @param mtd MTD data structure
|
||||
* @param area BufferRAM area
|
||||
* @param buffer the databuffer to put/get data
|
||||
* @param offset offset to read from or write to
|
||||
* @param count number of bytes to read/write
|
||||
*
|
||||
* Read the BufferRAM area with Sync. Burst Mode
|
||||
*/
|
||||
static int onenand_sync_read_bufferram(struct mtd_info *mtd, int area,
|
||||
unsigned char *buffer, int offset, size_t count)
|
||||
{
|
||||
struct onenand_chip *this = mtd->priv;
|
||||
void __iomem *bufferram;
|
||||
|
||||
bufferram = this->base + area;
|
||||
|
||||
bufferram += onenand_bufferram_offset(mtd, area);
|
||||
|
||||
this->mmcontrol(mtd, ONENAND_SYS_CFG1_SYNC_READ);
|
||||
|
||||
memcpy(buffer, bufferram + offset, count);
|
||||
|
||||
this->mmcontrol(mtd, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* onenand_write_bufferram - [OneNAND Interface] Write the bufferram area
|
||||
* @param mtd MTD data structure
|
||||
@@ -1273,8 +1302,8 @@ static int onenand_check_maf(int manuf)
|
||||
break;
|
||||
}
|
||||
|
||||
printk(KERN_DEBUG "OneNAND Manufacturer: %s\n",
|
||||
onenand_manuf_ids[i].name);
|
||||
printk(KERN_DEBUG "OneNAND Manufacturer: %s (0x%0x)\n",
|
||||
onenand_manuf_ids[i].name, manuf);
|
||||
|
||||
return (i != ONENAND_MFR_UNKNOWN);
|
||||
}
|
||||
@@ -1385,6 +1414,12 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
|
||||
if (onenand_probe(mtd))
|
||||
return -ENXIO;
|
||||
|
||||
/* Set Sync. Burst Read after probing */
|
||||
if (this->mmcontrol) {
|
||||
printk(KERN_INFO "OneNAND Sync. Burst Read support\n");
|
||||
this->read_bufferram = onenand_sync_read_bufferram;
|
||||
}
|
||||
|
||||
this->state = FL_READY;
|
||||
init_waitqueue_head(&this->wq);
|
||||
spin_lock_init(&this->chip_lock);
|
||||
|
Reference in New Issue
Block a user