misoc icon indicating copy to clipboard operation
misoc copied to clipboard

Create a "spi settings" type thing (in same vein as the SDRAM settings)

Open mithro opened this issue 9 years ago • 2 comments

It would be nice to have a "spi settings" thing for different SPI flash chips following the same vian at https://github.com/m-labs/misoc/blob/master/misoc/cores/sdram_settings.py#L60 for the SDRAM ICs.

mithro avatar Dec 20 '16 09:12 mithro

We have been using a hack like this;

  • https://github.com/mithro/HDMI2USB-litex-firmware/blob/nextgen/platforms/atlys.py#L619
  • https://github.com/mithro/HDMI2USB-litex-firmware/blob/nextgen/platforms/mimasv2.py#L121
  • https://github.com/mithro/HDMI2USB-litex-firmware/blob/nextgen/platforms/minispartan6.py#L159

OpenOCD has a pretty nice table at http://repo.or.cz/openocd.git/blob/HEAD:/src/flash/nor/spi.c#l32

mithro avatar Dec 20 '16 09:12 mithro

These seem to be the settings needed?

    spiflash_read_dummy_bits = 8
    spiflash_clock_div = 4
    spiflash_total_size = int((16/8)*1024*1024) # 16Mbit
    spiflash_page_size = 256
    spiflash_sector_size = 0x10000

mithro avatar Dec 20 '16 09:12 mithro