soc/add_spi_flash: fix bios 1x mode support

require both phy and flash support to enable QUAD/QPI capability.

Many flash devices support 4x read but may be on a 1x phy
This commit is contained in:
Andrew Dennison 2024-01-30 17:15:45 +11:00
parent 4dae3a9f4d
commit 08189663ba
1 changed files with 5 additions and 4 deletions

View File

@ -1909,10 +1909,11 @@ class LiteXSoC(SoC):
self.add_constant(f"{name}_MODULE_NAME", module.name.upper())
self.add_constant(f"{name}_MODULE_TOTAL_SIZE", module.total_size)
self.add_constant(f"{name}_MODULE_PAGE_SIZE", module.page_size)
if SpiNorFlashOpCodes.READ_1_1_4 in module.supported_opcodes:
self.add_constant(f"{name}_MODULE_QUAD_CAPABLE")
if SpiNorFlashOpCodes.READ_4_4_4 in module.supported_opcodes:
self.add_constant(f"{name}_MODULE_QPI_CAPABLE")
if mode in [ "4x" ]:
if SpiNorFlashOpCodes.READ_1_1_4 in module.supported_opcodes:
self.add_constant(f"{name}_MODULE_QUAD_CAPABLE")
if SpiNorFlashOpCodes.READ_4_4_4 in module.supported_opcodes:
self.add_constant(f"{name}_MODULE_QPI_CAPABLE")
if software_debug:
self.add_constant(f"{name}_DEBUG")