Skip to content

Commit 5d896c4

Browse files
committed
make.py,soc_linux.py: Use --local-ip argument in SoC configuration
1 parent 55c2f4a commit 5d896c4

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def main():
159159
if "sdcard" in board.soc_capabilities:
160160
soc.add_sdcard()
161161
if "ethernet" in board.soc_capabilities:
162-
soc.configure_ethernet(remote_ip=args.remote_ip)
162+
soc.configure_ethernet(remote_ip=args.remote_ip, local_ip=args.local_ip)
163163
#if "leds" in board.soc_capabilities:
164164
# soc.add_leds()
165165
if "rgb_led" in board.soc_capabilities:

soc_linux.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ def add_i2c(self):
5757

5858
# Ethernet configuration -------------------------------------------------------------------
5959

60-
def configure_ethernet(self, remote_ip):
60+
def configure_ethernet(self, remote_ip, local_ip):
6161
remote_ip = remote_ip.split(".")
62+
local_ip = local_ip.split(".")
63+
6264
try: # FIXME: Improve.
6365
self.constants.pop("REMOTEIP1")
6466
self.constants.pop("REMOTEIP2")
@@ -71,6 +73,18 @@ def configure_ethernet(self, remote_ip):
7173
self.add_constant("REMOTEIP3", int(remote_ip[2]))
7274
self.add_constant("REMOTEIP4", int(remote_ip[3]))
7375

76+
try: # FIXME: Improve.
77+
self.constants.pop("LOCALIP1")
78+
self.constants.pop("LOCALIP2")
79+
self.constants.pop("LOCALIP3")
80+
self.constants.pop("LOCALIP4")
81+
except:
82+
pass
83+
self.add_constant("LOCALIP1", int(local_ip[0]))
84+
self.add_constant("LOCALIP2", int(local_ip[1]))
85+
self.add_constant("LOCALIP3", int(local_ip[2]))
86+
self.add_constant("LOCALIP4", int(local_ip[3]))
87+
7488
# DTS generation ---------------------------------------------------------------------------
7589

7690
def generate_dts(self, board_name, rootfs="ram0"):

0 commit comments

Comments
 (0)