Skip to content

Commit

Permalink
liteeth_gen: Remove _eth suffix from PHY pads (not useful in case of …
Browse files Browse the repository at this point in the history
…a standalone core).

Will however require an update from design using the standalone core.
  • Loading branch information
enjoy-digital committed Jun 22, 2023
1 parent 0d59ea1 commit 52e94c0
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions liteeth/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
("interrupt", 0, Pins(1)),

# MII PHY Pads
("mii_eth_clocks", 0,
("mii_clocks", 0,
Subsignal("tx", Pins(1)),
Subsignal("rx", Pins(1)),
),
("mii_eth", 0,
("mii", 0,
Subsignal("rst_n", Pins(1)),
Subsignal("mdio", Pins(1)),
Subsignal("mdc", Pins(1)),
Expand All @@ -82,10 +82,10 @@
),

# RMII PHY Pads
("rmii_eth_clocks", 0,
("rmii_clocks", 0,
Subsignal("ref_clk", Pins(1))
),
("rmii_eth", 0,
("rmii", 0,
Subsignal("rst_n", Pins(1)),
Subsignal("rx_data", Pins(2)),
Subsignal("crs_dv", Pins(1)),
Expand All @@ -96,12 +96,12 @@
),

# GMII PHY Pads
("gmii_eth_clocks", 0,
("gmii_clocks", 0,
Subsignal("tx", Pins(1)),
Subsignal("gtx", Pins(1)),
Subsignal("rx", Pins(1))
),
("gmii_eth", 0,
("gmii", 0,
Subsignal("rst_n", Pins(1)),
Subsignal("int_n", Pins(1)),
Subsignal("mdio", Pins(1)),
Expand All @@ -117,11 +117,11 @@
),

# RGMII PHY Pads
("rgmii_eth_clocks", 0,
("rgmii_clocks", 0,
Subsignal("tx", Pins(1)),
Subsignal("rx", Pins(1))
),
("rgmii_eth", 0,
("rgmii", 0,
Subsignal("rst_n", Pins(1)),
Subsignal("int_n", Pins(1)),
Subsignal("mdio", Pins(1)),
Expand All @@ -133,7 +133,7 @@
),

# SGMII PHY Pads
("sgmii_eth", 0,
("sgmii", 0,
Subsignal("refclk200", Pins(1)),
Subsignal("txp", Pins(1)),
Subsignal("txn", Pins(1)),
Expand Down Expand Up @@ -201,33 +201,33 @@ def __init__(self, platform, core_config):
# MII.
if phy in [liteeth_phys.LiteEthPHYMII]:
ethphy = phy(
clock_pads = platform.request("mii_eth_clocks"),
pads = platform.request("mii_eth"))
clock_pads = platform.request("mii_clocks"),
pads = platform.request("mii"))
# RMII.
elif phy in [liteeth_phys.LiteEthPHYRMII]:
ethphy = phy(
refclk_cd = None,
clock_pads = platform.request("rmii_eth_clocks"),
pads = platform.request("rmii_eth"))
clock_pads = platform.request("rmii_clocks"),
pads = platform.request("rmii"))
# GMII.
elif phy in [liteeth_phys.LiteEthPHYGMII]:
ethphy = phy(
clock_pads = platform.request("gmii_eth_clocks"),
pads = platform.request("gmii_eth"))
clock_pads = platform.request("gmii_clocks"),
pads = platform.request("gmii"))
# GMII / MII.
elif phy in [liteeth_phys.LiteEthPHYGMIIMII]:
ethphy = phy(
clock_pads = platform.request("gmii_eth_clocks"),
pads = platform.request("gmii_eth"),
clock_pads = platform.request("gmii_clocks"),
pads = platform.request("gmii"),
clk_freq = self.clk_freq)
# RGMII.
elif phy in [
liteeth_phys.LiteEthS7PHYRGMII,
liteeth_phys.LiteEthECP5PHYRGMII,
]:
ethphy = phy(
clock_pads = platform.request("rgmii_eth_clocks"),
pads = platform.request("rgmii_eth"),
clock_pads = platform.request("rgmii_clocks"),
pads = platform.request("rgmii"),
tx_delay = core_config.get("phy_tx_delay", 2e-9),
rx_delay = core_config.get("phy_rx_delay", 2e-9),
with_hw_init_reset = False) # FIXME: required since sys_clk = eth_rx_clk.
Expand All @@ -239,7 +239,7 @@ def __init__(self, platform, core_config):
liteeth_phys.USP_GTH_1000BASEX,
liteeth_phys.USP_GTY_1000BASEX,
]:
ethphy_pads = platform.request("sgmii_eth")
ethphy_pads = platform.request("sgmii")
ethphy = phy(
refclk_or_clk_pads = ethphy_pads.refclk200,
data_pads = ethphy_pads,
Expand Down

0 comments on commit 52e94c0

Please sign in to comment.