aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/usrp2p/bootloader/init_bootloader.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/microblaze/usrp2p/bootloader/init_bootloader.c')
-rw-r--r--firmware/microblaze/usrp2p/bootloader/init_bootloader.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/microblaze/usrp2p/bootloader/init_bootloader.c b/firmware/microblaze/usrp2p/bootloader/init_bootloader.c
index 3571313ff..e6c808f37 100644
--- a/firmware/microblaze/usrp2p/bootloader/init_bootloader.c
+++ b/firmware/microblaze/usrp2p/bootloader/init_bootloader.c
@@ -15,7 +15,8 @@
#include <bootloader_utils.h>
#include <string.h>
#include <hal_uart.h>
-#include "i2c_sync.h"
+#include <i2c.h>
+#include "usrp2/fw_common.h"
#define SAFE_FLAG_LOCATION 247
@@ -31,14 +32,13 @@ void pic_interrupt_handler()
bool find_safe_booted_flag(void) {
unsigned char flag_byte;
- i2c_read(SAFE_FLAG_LOCATION, &flag_byte, 1);
-
+ eeprom_read(USRP2_I2C_ADDR_MBOARD, SAFE_FLAG_LOCATION, &flag_byte, 1);
return (flag_byte == 0x5E);
}
void set_safe_booted_flag(bool flag) {
unsigned char flag_byte = flag ? 0x5E : 0xDC;
- i2c_write(SAFE_FLAG_LOCATION, &flag_byte, 1);
+ eeprom_write(USRP2_I2C_ADDR_MBOARD, SAFE_FLAG_LOCATION, &flag_byte, 1);
}
@@ -102,7 +102,7 @@ int main(int argc, char *argv[]) {
if(is_valid_fpga_image(PROD_FPGA_IMAGE_LOCATION_ADDR)) {
puts("Valid production FPGA image found. Attempting to boot.");
set_safe_booted_flag(1);
- delay(10000);
+ delay(30000); //so serial output can finish
icap_reload_fpga(PROD_FPGA_IMAGE_LOCATION_ADDR);
}
puts("No valid production FPGA image found.\nAttempting to load production firmware...");