Skip to content

Commit c8a128a

Browse files
committed
targets/vivaldi_ml1: Fix dual Ethernet build
Update the target to use the current CSR handler API for the two RMII PHYs. Only attach BIOS/libliteeth network constants to the primary ethmac instance. The secondary ethmac1 instance is still instantiated and memory mapped for hardware/custom software use, but the current LiteX BIOS Ethernet stack is tied to CSR_ETHMAC_BASE and should not receive duplicate LOCALIP/REMOTEIP constants. With the corresponding LiteX bus allocation fix, --with-ethernet now generates non-overlapping ethmac/ethmac1 SRAM windows.
1 parent b1946df commit c8a128a

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

litex_boards/targets/machdyne_vivaldi_ml1.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,25 @@ def __init__(self, revision="v2", device="45F", sdram_rate="1:2", sys_clk_freq=i
159159
pads = platform.request("eth", 0),
160160
with_hw_init_reset=True,
161161
refclk_cd="eth")
162-
self.add_csr("ethphy")
163-
self.add_ethernet(name="ethmac", phy=self.ethphy,
164-
phy_cd="ethphy_eth", dynamic_ip=eth_dynamic_ip, local_ip=eth_ip, remote_ip=remote_ip)
162+
self.csr.add("ethphy")
163+
self.add_ethernet(
164+
name = "ethmac",
165+
phy = self.ethphy,
166+
phy_cd = "ethphy_eth",
167+
dynamic_ip = eth_dynamic_ip,
168+
local_ip = None if eth_dynamic_ip else eth_ip,
169+
remote_ip = remote_ip)
165170

166171
self.ethphy1 = LiteEthPHYRMII(
167172
clock_pads=None,
168173
pads = platform.request("eth", 1),
169174
with_hw_init_reset=True,
170175
refclk_cd="eth")
171-
self.add_csr("ethphy1")
172-
self.add_ethernet(name="ethmac1", phy=self.ethphy1,
173-
phy_cd="ethphy1_eth", dynamic_ip=eth_dynamic_ip, local_ip=eth_ip, remote_ip=remote_ip)
176+
self.csr.add("ethphy1")
177+
self.add_ethernet(
178+
name = "ethmac1",
179+
phy = self.ethphy1,
180+
phy_cd = "ethphy1_eth")
174181

175182
# Build --------------------------------------------------------------------------------------------
176183

0 commit comments

Comments
 (0)