Skip to content

Commit

Permalink
Merge pull request #69 from motec-research/no_mmap
Browse files Browse the repository at this point in the history
SDRPHY: support flash=None
  • Loading branch information
enjoy-digital committed Feb 1, 2024
2 parents a18df94 + fa4f662 commit 3a0651d
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions litespi/phy/generic_sdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,20 @@ def __init__(self, pads, flash, device, clock_domain, default_divisor, cs_delay)
bus_width = len(pads.dq)
assert bus_width in [1, 2, 4, 8]

# Check if number of pads matches configured mode.
assert flash.check_bus_width(bus_width)
if flash:
# Check if number of pads matches configured mode.
assert flash.check_bus_width(bus_width)

self.addr_bits = addr_bits = flash.addr_bits
self.cmd_width = cmd_width = flash.cmd_width
self.addr_width = addr_width = flash.addr_width
self.data_width = data_width = flash.bus_width
self.ddr = ddr = flash.ddr
self.addr_bits = addr_bits = flash.addr_bits
self.cmd_width = cmd_width = flash.cmd_width
self.addr_width = addr_width = flash.addr_width
self.data_width = data_width = flash.bus_width
self.ddr = ddr = flash.ddr

self.command = command = flash.read_opcode.code
self.command = command = flash.read_opcode.code
else:
# master only
self.ddr = ddr = False

# Clock Generator.
self.submodules.clkgen = clkgen = LiteSPIClkGen(pads, device, with_ddr=ddr)
Expand Down

0 comments on commit 3a0651d

Please sign in to comment.