add no_i2c feature for szl to fit in ocm

This commit is contained in:
mwojcik 2022-03-07 15:56:23 +08:00
parent ce6589c017
commit c52de6b2d7
3 changed files with 6 additions and 3 deletions

View File

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

View File

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

View File

@ -9,7 +9,7 @@ edition = "2018"
target_zc706 = ["libboard_zynq/target_zc706", "libsupport_zynq/target_zc706", "libconfig/target_zc706"]
target_coraz7 = ["libboard_zynq/target_coraz7", "libsupport_zynq/target_coraz7", "libconfig/target_coraz7"]
target_redpitaya = ["libboard_zynq/target_redpitaya", "libsupport_zynq/target_redpitaya", "libconfig/target_redpitaya"]
target_kasli_soc = ["libboard_zynq/target_kasli_soc", "libsupport_zynq/target_kasli_soc", "libconfig/target_kasli_soc"]
target_kasli_soc = ["libboard_zynq/target_kasli_soc", "libsupport_zynq/target_kasli_soc", "libconfig/target_kasli_soc", "libconfig/no_i2c"]
default = ["target_zc706"]
[dependencies]