mirror of
https://github.com/saymrwulf/litex-boards.git
synced 2026-11-21 09:54:20 +00:00
stlv7325: make VCCIO configurable
This commit is contained in:
parent
566a753dd3
commit
2f13decc49
2 changed files with 261 additions and 255 deletions
|
|
@ -13,11 +13,14 @@ from litex.build.openocd import OpenOCD
|
|||
|
||||
# IOs ----------------------------------------------------------------------------------------------
|
||||
|
||||
_io = [
|
||||
def _get_io(voltage="2.5V"):
|
||||
assert voltage in ["2.5V", "3.3V"]
|
||||
VCCIO = str(25 if voltage == "2.5V" else 33)
|
||||
_io = [
|
||||
# Clk / Rst
|
||||
("cpu_reset_n", 0, Pins("AC16"), IOStandard("LVCMOS15")),
|
||||
|
||||
("clk100", 0, Pins("F17"), IOStandard("LVCMOS25")),
|
||||
("clk100", 0, Pins("F17"), IOStandard("LVCMOS" + VCCIO)),
|
||||
("clk200", 0,
|
||||
Subsignal("p", Pins("AB11"), IOStandard("DIFF_SSTL15")),
|
||||
Subsignal("n", Pins("AC11"), IOStandard("DIFF_SSTL15"))
|
||||
|
|
@ -49,14 +52,14 @@ _io = [
|
|||
("i2c", 0,
|
||||
Subsignal("scl", Pins("U19")),
|
||||
Subsignal("sda", Pins("U20")),
|
||||
IOStandard("LVCMOS25")
|
||||
IOStandard("LVCMOS" + VCCIO)
|
||||
),
|
||||
|
||||
# Serial
|
||||
("serial", 0,
|
||||
Subsignal("tx", Pins("M25")), # CH340_TX
|
||||
Subsignal("rx", Pins("L25")), # CH340_RX
|
||||
IOStandard("LVCMOS25")
|
||||
IOStandard("LVCMOS" + VCCIO)
|
||||
),
|
||||
|
||||
# DDR3 SDRAM
|
||||
|
|
@ -119,14 +122,12 @@ _io = [
|
|||
Subsignal("rx_n", Pins("R3")),
|
||||
Subsignal("tx_p", Pins("P2")),
|
||||
Subsignal("tx_n", Pins("P1")),
|
||||
IOStandard("LVCMOS33"),
|
||||
),
|
||||
("sata", 1,
|
||||
Subsignal("rx_p", Pins("N4")),
|
||||
Subsignal("rx_n", Pins("N3")),
|
||||
Subsignal("tx_p", Pins("M2")),
|
||||
Subsignal("tx_n", Pins("M1")),
|
||||
IOStandard("LVCMOS33"),
|
||||
),
|
||||
|
||||
# SDCard
|
||||
|
|
@ -136,14 +137,14 @@ _io = [
|
|||
Subsignal("mosi", Pins("U21"), Misc("PULLUP True")),
|
||||
Subsignal("miso", Pins("N16"), Misc("PULLUP True")),
|
||||
Misc("SLEW=FAST"),
|
||||
IOStandard("LVCMOS25")
|
||||
IOStandard("LVCMOS" + VCCIO)
|
||||
),
|
||||
("sdcard", 0,
|
||||
Subsignal("clk", Pins("N21")),
|
||||
Subsignal("cmd", Pins("U21"), Misc("PULLUP True")),
|
||||
Subsignal("data", Pins("N16 U16 N22 P19"), Misc("PULLUP True")),
|
||||
Misc("SLEW=FAST"),
|
||||
IOStandard("LVCMOS25")
|
||||
IOStandard("LVCMOS" + VCCIO)
|
||||
),
|
||||
|
||||
# GMII Ethernet
|
||||
|
|
@ -186,18 +187,18 @@ _io = [
|
|||
|
||||
# HDMI out
|
||||
("hdmi_out", 0,
|
||||
Subsignal("clk_p", Pins("R21"), IOStandard("TMDS_33")),
|
||||
Subsignal("clk_n", Pins("P21"), IOStandard("TMDS_33")),
|
||||
Subsignal("data0_p", Pins("N18"), IOStandard("TMDS_33")),
|
||||
Subsignal("data0_n", Pins("M19"), IOStandard("TMDS_33")),
|
||||
Subsignal("data1_p", Pins("M21"), IOStandard("TMDS_33")),
|
||||
Subsignal("data1_n", Pins("M22"), IOStandard("TMDS_33")),
|
||||
Subsignal("data2_p", Pins("K25"), IOStandard("TMDS_33")),
|
||||
Subsignal("data2_n", Pins("K26"), IOStandard("TMDS_33")),
|
||||
Subsignal("scl", Pins("K21"), IOStandard("LVCMOS33")),
|
||||
Subsignal("sda", Pins("L23"), IOStandard("LVCMOS33")),
|
||||
Subsignal("hdp", Pins("N26"), IOStandard("LVCMOS33")),
|
||||
Subsignal("cec", Pins("M26"), IOStandard("LVCMOS33")),
|
||||
Subsignal("clk_p", Pins("R21"), IOStandard("TMDS_" + VCCIO)),
|
||||
Subsignal("clk_n", Pins("P21"), IOStandard("TMDS_" + VCCIO)),
|
||||
Subsignal("data0_p", Pins("N18"), IOStandard("TMDS_" + VCCIO)),
|
||||
Subsignal("data0_n", Pins("M19"), IOStandard("TMDS_" + VCCIO)),
|
||||
Subsignal("data1_p", Pins("M21"), IOStandard("TMDS_" + VCCIO)),
|
||||
Subsignal("data1_n", Pins("M22"), IOStandard("TMDS_" + VCCIO)),
|
||||
Subsignal("data2_p", Pins("K25"), IOStandard("TMDS_" + VCCIO)),
|
||||
Subsignal("data2_n", Pins("K26"), IOStandard("TMDS_" + VCCIO)),
|
||||
Subsignal("scl", Pins("K21"), IOStandard("LVCMOS" + VCCIO)),
|
||||
Subsignal("sda", Pins("L23"), IOStandard("LVCMOS" + VCCIO)),
|
||||
Subsignal("hdp", Pins("N26"), IOStandard("LVCMOS" + VCCIO)),
|
||||
Subsignal("cec", Pins("M26"), IOStandard("LVCMOS" + VCCIO)),
|
||||
),
|
||||
|
||||
# PCIe
|
||||
|
|
@ -272,14 +273,16 @@ _io = [
|
|||
|
||||
# SI5338 (optional part per seller?)
|
||||
("si5338_i2c", 0,
|
||||
Subsignal("sck", Pins("U19"), IOStandard("LVCMOS25")),
|
||||
Subsignal("sda", Pins("U20"), IOStandard("LVCMOS25"))
|
||||
Subsignal("sck", Pins("U19"), IOStandard("LVCMOS" + VCCIO)),
|
||||
Subsignal("sda", Pins("U20"), IOStandard("LVCMOS" + VCCIO))
|
||||
),
|
||||
("si5338_clkin", 0, # CLK2A/B
|
||||
Subsignal("p", Pins("K6"), IOStandard("LVDS_25")),
|
||||
Subsignal("n", Pins("K5"), IOStandard("LVDS_25"))
|
||||
),
|
||||
]
|
||||
]
|
||||
|
||||
return _io
|
||||
|
||||
# Connectors ---------------------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -463,8 +466,8 @@ class Platform(Xilinx7SeriesPlatform):
|
|||
default_clk_name = "clk200"
|
||||
default_clk_period = 1e9/200e6
|
||||
|
||||
def __init__(self):
|
||||
Xilinx7SeriesPlatform.__init__(self, "xc7k325t-ffg676-2", _io, _connectors, toolchain="vivado")
|
||||
def __init__(self, vccio="2.5V"):
|
||||
Xilinx7SeriesPlatform.__init__(self, "xc7k325t-ffg676-2", _get_io(vccio), _connectors, toolchain="vivado")
|
||||
self.add_platform_command("""
|
||||
set_property CFGBVS VCCO [current_design]
|
||||
set_property CONFIG_VOLTAGE 2.5 [current_design]
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ class _CRG(LiteXModule):
|
|||
|
||||
class BaseSoC(SoCCore):
|
||||
def __init__(self, sys_clk_freq=100e6,
|
||||
vccio = "2.5V",
|
||||
with_ethernet = False,
|
||||
with_etherbone = False,
|
||||
local_ip = "192.168.1.50",
|
||||
|
|
@ -84,7 +85,7 @@ class BaseSoC(SoCCore):
|
|||
with_video_framebuffer = False,
|
||||
with_video_terminal = False,
|
||||
**kwargs):
|
||||
platform = sitlinv_stlv7325.Platform()
|
||||
platform = sitlinv_stlv7325.Platform(vccio)
|
||||
|
||||
# CRG --------------------------------------------------------------------------------------
|
||||
self.crg = _CRG(platform, sys_clk_freq)
|
||||
|
|
@ -189,6 +190,7 @@ def main():
|
|||
from litex.build.parser import LiteXArgumentParser
|
||||
parser = LiteXArgumentParser(platform=sitlinv_stlv7325.Platform, description="LiteX SoC on AliExpress STLV7325.")
|
||||
parser.add_target_argument("--sys-clk-freq", default=100e6, type=float, help="System clock frequency.")
|
||||
parser.add_target_argument("--vccio", default="2.5V", type=str, help="IO Voltage (set by J4), can be 2.5V or 3.3V")
|
||||
ethopts = parser.target_group.add_mutually_exclusive_group()
|
||||
ethopts.add_argument("--with-ethernet", action="store_true", help="Enable Ethernet support.")
|
||||
ethopts.add_argument("--with-etherbone", action="store_true", help="Enable Etherbone support.")
|
||||
|
|
@ -212,6 +214,7 @@ def main():
|
|||
|
||||
soc = BaseSoC(
|
||||
sys_clk_freq = args.sys_clk_freq,
|
||||
vccio = args.vccio,
|
||||
with_ethernet = args.with_ethernet,
|
||||
with_etherbone = args.with_etherbone,
|
||||
local_ip = args.local_ip,
|
||||
|
|
|
|||
Loading…
Reference in a new issue