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 ----------------------------------------------------------------------------------------------
|
||||
|
||||
_io = [
|
||||
# Clk/Rst.
|
||||
("clk60", 0, Pins("C16"), IOStandard("LVCMOS25")),
|
||||
|
||||
# Leds.
|
||||
("user_led", 0, Pins("N18"), IOStandard("LVCMOS25")),
|
||||
|
||||
|
@ -51,3 +54,4 @@ class Platform(XilinxPlatform):
|
|||
|
||||
def 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):
|
||||
def __init__(self, platform, sys_clk_freq, with_pcie=False):
|
||||
assert sys_clk_freq == int(125e6)
|
||||
self.clock_domains.cd_sys = ClockDomain()
|
||||
|
||||
# # #
|
||||
|
||||
self.comb += [
|
||||
self.cd_sys.clk.eq(ClockSignal("pcie")),
|
||||
self.cd_sys.rst.eq(ResetSignal("pcie")),
|
||||
|
||||
]
|
||||
if with_pcie:
|
||||
assert sys_clk_freq == int(125e6)
|
||||
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 -----------------------------------------------------------------------------------------
|
||||
|
||||
class BaseSoC(SoCCore):
|
||||
def __init__(self, sys_clk_freq=int(125e6), with_pcie=False, with_led_chaser=True, **kwargs):
|
||||
assert with_pcie
|
||||
platform = fairwaves_xtrx.Platform()
|
||||
|
||||
# SoCCore ----------------------------------------------------------------------------------
|
||||
if kwargs["uart_name"] == "serial":
|
||||
kwargs["uart_name"] = "crossover"
|
||||
SoCCore.__init__(self, platform, sys_clk_freq,
|
||||
ident = "LiteX SoC on Fairwaves XTRX",
|
||||
ident_version = True,
|
||||
**kwargs)
|
||||
|
||||
# CRG --------------------------------------------------------------------------------------
|
||||
self.submodules.crg = CRG(platform, sys_clk_freq)
|
||||
self.submodules.crg = CRG(platform, sys_clk_freq, with_pcie)
|
||||
|
||||
# PCIe -------------------------------------------------------------------------------------
|
||||
if with_pcie:
|
||||
|
|
Loading…
Reference in New Issue