Skip to content

Commit

Permalink
#248: Minor cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Jul 28, 2021
1 parent a41fbea commit 54cee05
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions litex_boards/targets/kosagi_fomu.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self, platform, sys_clk_freq):

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()
Expand Down Expand Up @@ -104,14 +104,13 @@ def __init__(self, bios_flash_offset, spi_chip='AT25SF161', sys_clk_freq=int(12e
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 --------------------------------------------------------------------
Expand Down

0 comments on commit 54cee05

Please sign in to comment.