From 2008d02f4d1b4dddf69037118910e7e13bf4cc44 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 7 Aug 2018 10:30:50 +0800 Subject: [PATCH] runtime: use different default IP and MAC for different kinds of boards This helps reduce conflicts when having many boards on a development network. --- artiq/firmware/runtime/main.rs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/artiq/firmware/runtime/main.rs b/artiq/firmware/runtime/main.rs index 7ca63ef31..494c3ff87 100644 --- a/artiq/firmware/runtime/main.rs +++ b/artiq/firmware/runtime/main.rs @@ -207,7 +207,18 @@ fn startup_ethernet() { info!("using MAC address {}", hardware_addr); } _ => { - hardware_addr = EthernetAddress([0x02, 0x00, 0x00, 0x00, 0x00, 0x01]); + #[cfg(soc_platform = "kasli")] + { + hardware_addr = EthernetAddress([0x02, 0x00, 0x00, 0x00, 0x00, 0x21]); + } + #[cfg(soc_platform = "sayma_amc")] + { + hardware_addr = EthernetAddress([0x02, 0x00, 0x00, 0x00, 0x00, 0x11]); + } + #[cfg(soc_platform = "kc705")] + { + hardware_addr = EthernetAddress([0x02, 0x00, 0x00, 0x00, 0x00, 0x01]); + } warn!("using default MAC address {}; consider changing it", hardware_addr); } } @@ -219,7 +230,18 @@ fn startup_ethernet() { info!("using IP address {}", protocol_addr); } _ => { - protocol_addr = IpAddress::v4(192, 168, 1, 50); + #[cfg(soc_platform = "kasli")] + { + protocol_addr = IpAddress::v4(192, 168, 1, 70); + } + #[cfg(soc_platform = "sayma_amc")] + { + protocol_addr = IpAddress::v4(192, 168, 1, 60); + } + #[cfg(soc_platform = "kc705")] + { + protocol_addr = IpAddress::v4(192, 168, 1, 50); + } info!("using default IP address {}", protocol_addr); } }