How we can use catch read page in NAND driver, do it faster of this normal read page:
static U32 PageRead (U32 row, U8 *buf, NAND_DRV_CFG *cfg) { U32 i, sz; /* Write command 1 */ WrCmd (0x00);
/* Set address */ SetPgAddr (cfg->AddrCycles, row, cfg->PageSize);
/* Write command 2 */ WrCmd (0x30);
/* Wait until NAND ready */ if (WaitReady() == NAND_BUSY) { return ERR_NAND_HW_TOUT; }
/* Read page from NAND chip */ sz = cfg->PageSize; for (i = 0; i < sz; i += 8) { buf[i] = EMC_DATA8; buf[i+1] = EMC_DATA8; buf[i+2] = EMC_DATA8; buf[i+3] = EMC_DATA8; buf[i+4] = EMC_DATA8; buf[i+5] = EMC_DATA8; buf[i+6] = EMC_DATA8; buf[i+7] = EMC_DATA8; }
return RTV_NOERR; }
A hash table of block addresses, and a cache of blocks? Figure out how much memory you have spare, and if your file system can identify blocks related to file system data, vs transient data. You could also weight the system based on hits on particular blocks.