We have an issue with accessing the NAND flash and the ASP (running at 8 or 16 Mbps) simultaneously.
The default value for MEWC is 0x80 (which equates to (0x80 + 1) * 16 * 10ns = 20.6 us [*10ns since we use a 99Mhz clock]
The ASP (running at 8.192 Mbps) has a 122 ns time period for each bit. Thus it [the ASP buffer] will fill up in 32*122ns = 3.9us
Since some NAND accesses can take a relatively long time to execute (especially when the flash has to switch to another page) it will hog the Central Switch Resource [?] and starve the ASP unless we lower the MEWC timeout to a value that would equate to something less than 3.9us (32 bits worth at 8Mbps). So In order to give priority to the ASP (which can only buffer 32 bits at a time before he needs to be emptied/refilled by the EDMA) we have to reduce the MEWC timeout in the AWCCR. We have reduced it to the value of 0x10 which equates to 2.72 us.
(16 + 1) * 16 * 10ns = 2.72 us
So when we run with this lower MEWC timeout value the ASP/EDMA will get proper attention and it will never fail. However, the NAND flash accesses will fail if we have an access that takes longer then 2.72 us, and the timeout kicks in, and the central resource is given to the ASP (instead of the NAND flash). It appears like the NAND (MTD) driver in the DVSDK does not handle this situation in a correct manner. It appears like the MTD driver is coded with the assumption that the NAND flash access will never be aborted by an MEWC timeout. We use the JFFS2 file system and it gets corrupted when the MEWC timeout kicks in.
So, my question is now the following:
Does anybody know of anybody that have modified the MTD driver to that it would do a retry on a timeout? Or does anybody have another idea of how we can sucessfully access the NAND flash and the ASP port simultaneously?
Any ideas will be greatly appreciated.
/Hanz