#248: Minor cleanup.

This commit is contained in:
Florent Kermarrec 2021-07-28 18:20:42 +02:00
parent a41fbea5e6
commit 54cee05986
1 changed files with 7 additions and 8 deletions

View File

@ -69,7 +69,7 @@ class _CRG(Module):
class BaseSoC(SoCCore):
mem_map = {**SoCCore.mem_map, **{"spiflash": 0x80000000}}
def __init__(self, bios_flash_offset, spi_chip='AT25SF161', sys_clk_freq=int(12e6),
def __init__(self, bios_flash_offset, spi_flash_module="AT25SF161", sys_clk_freq=int(12e6),
with_led_chaser=True, **kwargs):
kwargs["uart_name"] = "usb_acm" # Enforce UART to USB-ACM
platform = fomu_pvt.Platform()
@ -104,14 +104,13 @@ class BaseSoC(SoCCore):
from litespi.opcodes import SpiNorFlashOpCodes as Codes
# lambdas for lazy module instantiation.
spi_provider = {
'AT25SF161': lambda: AT25SF161(Codes.READ_1_1_4),
'GD25Q16C': lambda: GD25Q16C(Codes.READ_1_1_1),
'MX25R1635F': lambda: MX25R1635F(Codes.READ_1_1_4),
'W25Q128JV': lambda: W25Q128JV(Codes.READ_1_1_4),
spi_flash_modules = {
"AT25SF161": lambda: AT25SF161( Codes.READ_1_1_4),
"GD25Q16C": lambda: GD25Q16C( Codes.READ_1_1_1),
"MX25R1635F": lambda: MX25R1635F(Codes.READ_1_1_4),
"W25Q128JV": lambda: W25Q128JV( Codes.READ_1_1_4),
}
self.add_spi_flash(mode="4x", module=spi_provider[spi_chip](), with_master=False)
self.add_spi_flash(mode="4x", module=spi_flash_modules[spi_flash_module](), with_master=False)
#self.add_spi_flash(mode="1x", dummy_cycles=8) # LiteX SPI Flash Core.
# Add ROM linker region --------------------------------------------------------------------