Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion make.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def main():
if "sdcard" in board.soc_capabilities:
soc.add_sdcard()
if "ethernet" in board.soc_capabilities:
soc.configure_ethernet(remote_ip=args.remote_ip)
soc.configure_ethernet(remote_ip=args.remote_ip, local_ip=args.local_ip)
#if "leds" in board.soc_capabilities:
# soc.add_leds()
if "rgb_led" in board.soc_capabilities:
Expand Down
17 changes: 4 additions & 13 deletions soc_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from litex.soc.cores.pwm import PWM

from litex.tools.litex_json2dts_linux import generate_dts
from litex.soc.integration.soc import add_ip_address_constants

# SoCLinux -----------------------------------------------------------------------------------------

Expand Down Expand Up @@ -57,19 +58,9 @@ def add_i2c(self):

# Ethernet configuration -------------------------------------------------------------------

def configure_ethernet(self, remote_ip):
remote_ip = remote_ip.split(".")
try: # FIXME: Improve.
self.constants.pop("REMOTEIP1")
self.constants.pop("REMOTEIP2")
self.constants.pop("REMOTEIP3")
self.constants.pop("REMOTEIP4")
except:
pass
self.add_constant("REMOTEIP1", int(remote_ip[0]))
self.add_constant("REMOTEIP2", int(remote_ip[1]))
self.add_constant("REMOTEIP3", int(remote_ip[2]))
self.add_constant("REMOTEIP4", int(remote_ip[3]))
def configure_ethernet(self, remote_ip, local_ip):
add_ip_address_constants(self, "REMOTEIP", remote_ip, check_duplicate=False)
add_ip_address_constants(self, "LOCALIP", local_ip, check_duplicate=False)

# DTS generation ---------------------------------------------------------------------------

Expand Down