Merge pull request #70 from ilya-epifanov/ecp5-evn-spi1x-and-flash-params

ECP5-EVN SpiFlash parameters
This commit is contained in:
enjoy-digital 2020-05-19 15:16:25 +02:00 committed by GitHub
commit 3f0f12011b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -4,6 +4,7 @@
from litex.build.generic_platform import * from litex.build.generic_platform import *
from litex.build.lattice import LatticePlatform from litex.build.lattice import LatticePlatform
from litex.build.lattice.programmer import OpenOCDJTAGProgrammer from litex.build.lattice.programmer import OpenOCDJTAGProgrammer
from litex.soc.cores.spi_flash import SpiFlash
import os import os
@ -43,6 +44,14 @@ _io = [
Subsignal("dq", Pins("W2 V2 Y2 W1"), IOStandard("LVCMOS33")), Subsignal("dq", Pins("W2 V2 Y2 W1"), IOStandard("LVCMOS33")),
), ),
("spiflash1x", 0,
Subsignal("cs_n", Pins("R2"), IOStandard("LVCMOS33")),
Subsignal("mosi", Pins("W2"), IOStandard("LVCMOS33")),
Subsignal("miso", Pins("V2"), IOStandard("LVCMOS33")),
Subsignal("wp", Pins("Y2"), IOStandard("LVCMOS33")),
Subsignal("hold", Pins("W1"), IOStandard("LVCMOS33")),
),
("clk200", 0, ("clk200", 0,
Subsignal("p", Pins("Y19")), Subsignal("p", Pins("Y19")),
Subsignal("n", Pins("W20")), Subsignal("n", Pins("W20")),
@ -125,11 +134,20 @@ class Platform(LatticePlatform):
def __init__(self, **kwargs): def __init__(self, **kwargs):
LatticePlatform.__init__(self, "LFE5UM5G-85F-8BG381", _io, _connectors, **kwargs) LatticePlatform.__init__(self, "LFE5UM5G-85F-8BG381", _io, _connectors, **kwargs)
def make_spiflash(self):
flash_pads = self.request("spiflash1x")
spiflash = SpiFlash(flash_pads, endianness="little", div=2, dummy=8)
spiflash.add_clk_primitive(self.device)
return spiflash
def request(self, *args, **kwargs): def request(self, *args, **kwargs):
if "serial" in args: if "serial" in args:
print("R22 and R23 should be removed, two 0 Ω resistors shoud be " print("R22 and R23 should be removed, two 0 Ω resistors shoud be "
"populated on R34 and R35 and the FT2232H should be configured to " "populated on R34 and R35 and the FT2232H should be configured to "
"UART with virtual COM on port B") "UART with virtual COM on port B")
print("Make sure your on-board FT2232H can properly talk UART.")
print("Follow instructions here: https://github.com/trabucayre/fixFT2232_ecp5evn")
if "ext_clk50" in args: if "ext_clk50" in args:
print("an oscillator must be populated on X5") print("an oscillator must be populated on X5")