diff options
Diffstat (limited to 'firmware/microblaze/lib/eeprom.c')
-rw-r--r-- | firmware/microblaze/lib/eeprom.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/microblaze/lib/eeprom.c b/firmware/microblaze/lib/eeprom.c index b12ffe082..d4e170046 100644 --- a/firmware/microblaze/lib/eeprom.c +++ b/firmware/microblaze/lib/eeprom.c @@ -17,9 +17,21 @@ #include "i2c.h" #include "mdelay.h" +#include "usrp2/fw_common.h" static const int EEPROM_PAGESIZE = 16; +bool find_safe_booted_flag(void) { + unsigned char flag_byte; + eeprom_read(USRP2_I2C_ADDR_MBOARD, USRP2_EE_MBOARD_BOOTLOADER_FLAGS, &flag_byte, 1); + return (flag_byte == 0x5E); +} + +void set_safe_booted_flag(bool flag) { + unsigned char flag_byte = flag ? 0x5E : 0xDC; + eeprom_write(USRP2_I2C_ADDR_MBOARD, USRP2_EE_MBOARD_BOOTLOADER_FLAGS, &flag_byte, 1); +} + bool eeprom_write (int i2c_addr, int eeprom_offset, const void *buf, int len) { |