I am working on 8 bit BCH support using GPMC on Mistral DM814x EVM. Nand flash with software ECC is already working. I have implemented GPMC support without ELM. I have couple of queries regarding GPMCs BCH support.My flash has 2k page size, 64bytes spare and 512 bytes of sector with
1. TRM says that ECC is calculated on the fly and can be inserted in spare region on the fly too. But i was unable to find any info of how it is inserted on the fly? Consequently, I had to fetch these results from result register in a buffer and write on spare as a separate process. Any suggestion to insert it on the fly?
2. TRM says that ECC result register contains result for complete page. I first implemented this in a scheme in which I write complete page followed by fetching of ECC and insert them to spare region. However, my reads contains just results of last sector which was written. The rest of registers are empty. It looks results of all the sectors are placed in first set (i=0) registers. Am I missing something in configuration?
3. During read operation, ECC result register is supposed to contain syndrome only (if there are errors) and should contain zero if no errors are found. If errors are found, ELM module is used to detect the location and number of errors with the information of syndrome. Is this perception correct? My normal reads (test data) always contain non zero syndrome. Is there something problematic in my configuration?
I am using wrap mode 1. Is there some reference implementation of GPMC for BCH8?