aboutsummaryrefslogtreecommitdiff
path: root/spiflash_n25q128.c
AgeCommit message (Collapse)Author
2016-11-02Wait for WIP to clear before returning from erase operations too.Rob Austein
Wrong-block-type race condition errors went away after adding the WIP check after flash write operations, then came back once (isolated incident) while running a series of tests which had written enough flash blocks that ks_flash may have finally had to erase something rather than just zeroing. Code inspection confirmed that the erase code was not waiting for WIP to clear before exiting. Difficult to prove that this was the cause of an unreproducible failure, but seems like a likely candidate given previous behavior and change should be harmless, so adding it. Timeout for this flag check is 2000 ms, which is what other erase-related WIP flag checks were already using.
2016-11-01Don't return from flash write calls until WIP flag clears.Rob Austein
Absence of this check created a nasty race condition in sw/libhal/ks_flash.c, which didn't show up until we had test code which attempted to delete a long series of keys in quick succession. I'm not aware of any sane reason why we would ever want to skip this check, so it's unconditional and applies to all of the SPI flash code, not just the keystore flash code.
2016-09-23Use subsectors instead of sectors in keystore.Rob Austein
2016-09-16Revised ks_flash. Compiles, not yet tested.Rob Austein
2016-05-21Add code to test reading, writing and erasing keystore data.Fredrik Thulin
2016-05-20Add code to reset FPGA using FPGA_PROGRAM_B and FPGA_INIT_B.Fredrik Thulin
Also add code to erase FPGA config memory and check status of FPGA_DONE.
2016-05-19Refactor FPGA bitstream upload code.Fredrik Thulin
Move the N25Q128 code to it's own file in order to be able to reuse it for the keystore memory code.