spi flash: remove initialization and move erase to software
Using the volatile configuration register to configure a flash chip is a bad idea. The problem is that if the FPGA is reset, the flash may be in a state inconsistent with what the FPGA requires to boot. The correct solution is to configure the non-volatile configuration register on the chip to what the FPGA expects on power-on. Then use these same settings inside the flash core. Going this route makes it necessary for software to be able to set the non-volatile configuration register. Rather than making the core even more complicated than it is, I have elected to add a FIFO which software can fill to issue custom SPI commands. Since erase can only be done from software anyway, I removed this code and let erase use the custom command FIFO.
Showing
- modules/wishbone/wb_spi_flash/wb_spi_flash.vhd 60 additions, 174 deletionsmodules/wishbone/wb_spi_flash/wb_spi_flash.vhd
- modules/wishbone/wishbone_pkg.vhd 4 additions, 5 deletionsmodules/wishbone/wishbone_pkg.vhd
- platform/altera/flash/altera_flash_pkg.vhd 0 additions, 1 deletionplatform/altera/flash/altera_flash_pkg.vhd
- platform/altera/flash/flash_top.vhd 0 additions, 2 deletionsplatform/altera/flash/flash_top.vhd
Please register or sign in to comment