From a2dfa1988c6f624c3c45bd55ca7a7af9c10eb041 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Mon, 22 Nov 2010 16:50:14 -0800 Subject: N200 comes up with default IP and MAC when booted in safe mode (button pushed). --- firmware/microblaze/lib/eeprom.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'firmware/microblaze/lib/eeprom.c') 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) { -- cgit v1.2.3