Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

target/digilent_arty.py: Add eth_dhcp switch #206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions litex_boards/targets/digilent_arty.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, platform, sys_clk_freq, with_mapped_flash):
# BaseSoC ------------------------------------------------------------------------------------------

class BaseSoC(SoCCore):
def __init__(self, variant="a7-35", toolchain="vivado", sys_clk_freq=int(100e6), with_ethernet=False, with_etherbone=False, eth_ip="192.168.1.50", eth_dynamic_ip=False, ident_version=True, with_jtagbone=True, with_mapped_flash=False, **kwargs):
def __init__(self, variant="a7-35", toolchain="vivado", sys_clk_freq=int(100e6), with_ethernet=False, with_etherbone=False, eth_ip="192.168.1.50", eth_dynamic_ip=False, eth_dhcp=False, ident_version=True, with_jtagbone=True, with_mapped_flash=False, **kwargs):
platform = arty.Platform(variant=variant, toolchain=toolchain)

# SoCCore ----------------------------------------------------------------------------------
Expand Down Expand Up @@ -91,7 +91,7 @@ def __init__(self, variant="a7-35", toolchain="vivado", sys_clk_freq=int(100e6),
clock_pads = self.platform.request("eth_clocks"),
pads = self.platform.request("eth"))
if with_ethernet:
self.add_ethernet(phy=self.ethphy, dynamic_ip=eth_dynamic_ip)
self.add_ethernet(phy=self.ethphy, dynamic_ip=eth_dynamic_ip, with_dhcp=eth_dhcp)
if with_etherbone:
self.add_etherbone(phy=self.ethphy, ip_address=eth_ip)

Expand Down Expand Up @@ -125,6 +125,7 @@ def main():
ethopts.add_argument("--with-etherbone", action="store_true", help="Enable Etherbone support")
parser.add_argument("--eth-ip", default="192.168.1.50", type=str, help="Ethernet/Etherbone IP address")
parser.add_argument("--eth-dynamic-ip", action="store_true", help="Enable dynamic Ethernet IP addresses setting")
parser.add_argument("--eth-dhcp", action="store_true", help="Obtain an IP address from DHCP server")
sdopts = parser.add_mutually_exclusive_group()
sdopts.add_argument("--with-spi-sdcard", action="store_true", help="Enable SPI-mode SDCard support")
sdopts.add_argument("--with-sdcard", action="store_true", help="Enable SDCard support")
Expand All @@ -147,6 +148,7 @@ def main():
with_etherbone = args.with_etherbone,
eth_ip = args.eth_ip,
eth_dynamic_ip = args.eth_dynamic_ip,
eth_dhcp = args.eth_dhcp,
ident_version = args.no_ident_version,
with_jtagbone = args.with_jtagbone,
with_mapped_flash = args.with_mapped_flash,
Expand Down