Kasli-SoC: Get MAC address from EEPROM #90

Merged
sb10q merged 5 commits from mwojcik/zynq-rs:mac_from_eeprom into master 2022-03-07 18:01:44 +08:00
4 changed files with 4 additions and 7 deletions
Showing only changes of commit 20bb50931c - Show all commits

View File

@ -14,7 +14,7 @@ members = [
panic = "abort" panic = "abort"
debug = true debug = true
codegen-units = 1 codegen-units = 1
opt-level = 'z' opt-level = 's'
lto = true lto = true
debug-assertions = false debug-assertions = false
overflow-checks = false overflow-checks = false

View File

@ -15,5 +15,4 @@ target_zc706 = []
target_coraz7 = [] target_coraz7 = []
target_redpitaya = [] target_redpitaya = []
target_kasli_soc = [] target_kasli_soc = []
no_i2c = []
ipv6 = [] ipv6 = []

View File

@ -30,7 +30,7 @@ impl fmt::Display for NetAddresses {
} }
} }
#[cfg(all(feature = "target_kasli_soc", not(feature = "no_i2c")))] #[cfg(feature = "target_kasli_soc")]
fn get_address_from_eeprom() -> EthernetAddress { fn get_address_from_eeprom() -> EthernetAddress {
use libboard_zynq::i2c::{I2c, eeprom}; use libboard_zynq::i2c::{I2c, eeprom};
@ -55,10 +55,8 @@ pub fn get_addresses(cfg: &Config) -> NetAddresses {
let mut hardware_addr = EthernetAddress([0x02, 0x00, 0x00, 0x00, 0x00, 0x55]); let mut hardware_addr = EthernetAddress([0x02, 0x00, 0x00, 0x00, 0x00, 0x55]);
#[cfg(feature = "target_redpitaya")] #[cfg(feature = "target_redpitaya")]
let mut ipv4_addr = IpAddress::v4(192, 168, 1, 55); let mut ipv4_addr = IpAddress::v4(192, 168, 1, 55);
#[cfg(all(feature = "target_kasli_soc", not(feature = "no_i2c")))] #[cfg(feature = "target_kasli_soc")]
let mut hardware_addr = get_address_from_eeprom(); let mut hardware_addr = get_address_from_eeprom();
#[cfg(all(feature = "target_kasli_soc", feature = "no_i2c"))]
let mut hardware_addr = EthernetAddress([0x02, 0x00, 0x00, 0x00, 0x00, 0x56]);
#[cfg(feature = "target_kasli_soc")] #[cfg(feature = "target_kasli_soc")]
let mut ipv4_addr = IpAddress::v4(192, 168, 1, 56); let mut ipv4_addr = IpAddress::v4(192, 168, 1, 56);

View File

@ -21,4 +21,4 @@ libboard_zynq = { path = "../libboard_zynq" }
libsupport_zynq = { path = "../libsupport_zynq" } libsupport_zynq = { path = "../libsupport_zynq" }
libcortex_a9 = { path = "../libcortex_a9" } libcortex_a9 = { path = "../libcortex_a9" }
libregister = { path = "../libregister" } libregister = { path = "../libregister" }
libconfig = { path = "../libconfig", features = ["no_i2c"] } libconfig = { path = "../libconfig" }