Added spiflash1x pins, a method to create an SpiFlash instance and a note on a second UART channel of FT2232H

This commit is contained in:
Ilya Epifanov 2020-04-28 21:56:33 +02:00
parent 2213d73b89
commit 0ba8045789
1 changed files with 18 additions and 0 deletions

View File

@ -4,6 +4,7 @@
from litex.build.generic_platform import *
from litex.build.lattice import LatticePlatform
from litex.build.lattice.programmer import OpenOCDJTAGProgrammer
from litex.soc.cores.spi_flash import SpiFlash
import os
@ -43,6 +44,14 @@ _io = [
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,
Subsignal("p", Pins("Y19")),
Subsignal("n", Pins("W20")),
@ -125,11 +134,20 @@ class Platform(LatticePlatform):
def __init__(self, **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):
if "serial" in args:
print("R22 and R23 should be removed, two 0 Ω resistors shoud be "
"populated on R34 and R35 and the FT2232H should be configured to "
"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:
print("an oscillator must be populated on X5")