mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-25 11:18:27 +08:00
kasli: support EEPROM on v2
This commit is contained in:
parent
77e6fdb7a7
commit
9bc43b2dbf
@ -13,7 +13,7 @@ pub struct EEPROM {
|
||||
}
|
||||
|
||||
impl EEPROM {
|
||||
pub fn kasli_eeprom() -> Self {
|
||||
pub fn kasli1_eeprom() -> Self {
|
||||
EEPROM {
|
||||
busno: 0,
|
||||
/// Same port as Si5324
|
||||
@ -22,6 +22,15 @@ impl EEPROM {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn kasli2_eeprom() -> Self {
|
||||
EEPROM {
|
||||
busno: 0,
|
||||
/// SHARED I2C bus
|
||||
port: 11,
|
||||
address: 0xae,
|
||||
}
|
||||
}
|
||||
|
||||
fn select(&self) -> Result<(), &'static str> {
|
||||
let mask: u16 = 1 << self.port;
|
||||
i2c::pca9548_select(self.busno, I2C_SWITCH0, mask as u8)?;
|
||||
|
@ -33,7 +33,10 @@ pub fn get_adresses() -> NetAddresses {
|
||||
_ => {
|
||||
#[cfg(soc_platform = "kasli")]
|
||||
{
|
||||
let eeprom = i2c_eeprom::EEPROM::kasli_eeprom();
|
||||
#[cfg(any(hw_rev = "v1.0", hw_rev = "v1.1"))]
|
||||
let eeprom = i2c_eeprom::EEPROM::kasli1_eeprom();
|
||||
#[cfg(hw_rev = "v2.0")]
|
||||
let eeprom = i2c_eeprom::EEPROM::kasli2_eeprom();
|
||||
hardware_addr =
|
||||
eeprom.read_eui48()
|
||||
.map(|addr_buf| EthernetAddress(addr_buf))
|
||||
|
Loading…
Reference in New Issue
Block a user