summaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/lib/eeprom.c
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-11-22 16:50:14 -0800
committerNick Foster <nick@nerdnetworks.org>2010-11-22 16:50:14 -0800
commita2dfa1988c6f624c3c45bd55ca7a7af9c10eb041 (patch)
treeeca7163356bc9dda13cd9af937d399ff41c6a3f1 /firmware/microblaze/lib/eeprom.c
parente7b98030eb3ea7e42bd8d6fa5f115b0219ae2685 (diff)
downloaduhd-a2dfa1988c6f624c3c45bd55ca7a7af9c10eb041.tar.gz
uhd-a2dfa1988c6f624c3c45bd55ca7a7af9c10eb041.tar.bz2
uhd-a2dfa1988c6f624c3c45bd55ca7a7af9c10eb041.zip
N200 comes up with default IP and MAC when booted in safe mode (button pushed).
Diffstat (limited to 'firmware/microblaze/lib/eeprom.c')
-rw-r--r--firmware/microblaze/lib/eeprom.c12
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)
{