fairwaves_xtrx: Add clk60 (from USB PHY) as default Clk when no PCIe.
Fixes CI.
This commit is contained in:
parent
ceaaf67dfd
commit
11c3f1ae48
|
@ -13,6 +13,9 @@ from litex.build.openocd import OpenOCD
|
||||||
# IOs ----------------------------------------------------------------------------------------------
|
# IOs ----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
_io = [
|
_io = [
|
||||||
|
# Clk/Rst.
|
||||||
|
("clk60", 0, Pins("C16"), IOStandard("LVCMOS25")),
|
||||||
|
|
||||||
# Leds.
|
# Leds.
|
||||||
("user_led", 0, Pins("N18"), IOStandard("LVCMOS25")),
|
("user_led", 0, Pins("N18"), IOStandard("LVCMOS25")),
|
||||||
|
|
||||||
|
@ -51,3 +54,4 @@ class Platform(XilinxPlatform):
|
||||||
|
|
||||||
def do_finalize(self, fragment):
|
def do_finalize(self, fragment):
|
||||||
XilinxPlatform.do_finalize(self, fragment)
|
XilinxPlatform.do_finalize(self, fragment)
|
||||||
|
self.add_period_constraint(self.lookup_request("clk60", loose=True), 1e9/60e6)
|
||||||
|
|
|
@ -45,32 +45,37 @@ from litepcie.software import generate_litepcie_software
|
||||||
|
|
||||||
class CRG(Module):
|
class CRG(Module):
|
||||||
def __init__(self, platform, sys_clk_freq, with_pcie=False):
|
def __init__(self, platform, sys_clk_freq, with_pcie=False):
|
||||||
assert sys_clk_freq == int(125e6)
|
|
||||||
self.clock_domains.cd_sys = ClockDomain()
|
self.clock_domains.cd_sys = ClockDomain()
|
||||||
|
|
||||||
# # #
|
# # #
|
||||||
|
|
||||||
self.comb += [
|
if with_pcie:
|
||||||
self.cd_sys.clk.eq(ClockSignal("pcie")),
|
assert sys_clk_freq == int(125e6)
|
||||||
self.cd_sys.rst.eq(ResetSignal("pcie")),
|
self.comb += [
|
||||||
|
self.cd_sys.clk.eq(ClockSignal("pcie")),
|
||||||
]
|
self.cd_sys.rst.eq(ResetSignal("pcie")),
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
self.submodules.pll = pll = S7PLL(speedgrade=-2)
|
||||||
|
pll.register_clkin(platform.request("clk60"), 60e6)
|
||||||
|
pll.create_clkout(self.cd_sys, sys_clk_freq)
|
||||||
|
|
||||||
# BaseSoC -----------------------------------------------------------------------------------------
|
# BaseSoC -----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class BaseSoC(SoCCore):
|
class BaseSoC(SoCCore):
|
||||||
def __init__(self, sys_clk_freq=int(125e6), with_pcie=False, with_led_chaser=True, **kwargs):
|
def __init__(self, sys_clk_freq=int(125e6), with_pcie=False, with_led_chaser=True, **kwargs):
|
||||||
assert with_pcie
|
|
||||||
platform = fairwaves_xtrx.Platform()
|
platform = fairwaves_xtrx.Platform()
|
||||||
|
|
||||||
# SoCCore ----------------------------------------------------------------------------------
|
# SoCCore ----------------------------------------------------------------------------------
|
||||||
|
if kwargs["uart_name"] == "serial":
|
||||||
|
kwargs["uart_name"] = "crossover"
|
||||||
SoCCore.__init__(self, platform, sys_clk_freq,
|
SoCCore.__init__(self, platform, sys_clk_freq,
|
||||||
ident = "LiteX SoC on Fairwaves XTRX",
|
ident = "LiteX SoC on Fairwaves XTRX",
|
||||||
ident_version = True,
|
ident_version = True,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
# CRG --------------------------------------------------------------------------------------
|
# CRG --------------------------------------------------------------------------------------
|
||||||
self.submodules.crg = CRG(platform, sys_clk_freq)
|
self.submodules.crg = CRG(platform, sys_clk_freq, with_pcie)
|
||||||
|
|
||||||
# PCIe -------------------------------------------------------------------------------------
|
# PCIe -------------------------------------------------------------------------------------
|
||||||
if with_pcie:
|
if with_pcie:
|
||||||
|
|
Loading…
Reference in New Issue