Skip to content

Commit

Permalink
integration/soc/add_ethernet: add phy_cd parameter to allow and demon…
Browse files Browse the repository at this point in the history
…strate multiple PHYs support.
  • Loading branch information
enjoy-digital committed Dec 22, 2020
1 parent c79135c commit 12dabde
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions litex/soc/integration/soc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,17 +1327,20 @@ def add_sdram(self, name, phy, module, origin, size=None, with_bist=False, with_
port = port,
base_address = self.bus.regions["main_ram"].origin)


# Add Ethernet ---------------------------------------------------------------------------------
def add_ethernet(self, name="ethmac", phy=None):
def add_ethernet(self, name="ethmac", phy=None, phy_cd="eth"):
# Imports
from liteeth.mac import LiteEthMAC

# MAC
ethmac = LiteEthMAC(
phy = phy,
dw = 32,
interface = "wishbone",
endianness = self.cpu.endianness)
ethmac = ClockDomainsRenamer({
"eth_tx": phy_cd + "_tx",
"eth_rx": phy_cd + "_rx"})(ethmac)
setattr(self.submodules, name, ethmac)
ethmac_region = SoCRegion(origin=self.mem_map.get(name, None), size=0x2000, cached=False)
self.bus.add_slave(name=name, slave=ethmac.bus, region=ethmac_region)
Expand Down

0 comments on commit 12dabde

Please sign in to comment.