diff options
author | Nick Foster <nick@nerdnetworks.org> | 2010-10-08 12:50:00 -0700 |
---|---|---|
committer | Nick Foster <nick@nerdnetworks.org> | 2010-10-08 12:50:00 -0700 |
commit | 7db726e9b45b972c8fcb0c1dc366919e11256cc1 (patch) | |
tree | c72611b070710783b8013071b3673659cb8242e0 /firmware/microblaze/usrp2p/bootloader | |
parent | 4ed75835c8c1b7b633223cd7ad11269e84c41701 (diff) | |
download | uhd-7db726e9b45b972c8fcb0c1dc366919e11256cc1.tar.gz uhd-7db726e9b45b972c8fcb0c1dc366919e11256cc1.tar.bz2 uhd-7db726e9b45b972c8fcb0c1dc366919e11256cc1.zip |
U2P: Bootloader works, successfully loads production image.
Split I2C into async and sync halves to keep the size of the bootloader small.
Diffstat (limited to 'firmware/microblaze/usrp2p/bootloader')
-rw-r--r-- | firmware/microblaze/usrp2p/bootloader/Makefile.am | 2 | ||||
-rw-r--r-- | firmware/microblaze/usrp2p/bootloader/init_bootloader.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/firmware/microblaze/usrp2p/bootloader/Makefile.am b/firmware/microblaze/usrp2p/bootloader/Makefile.am index eb72d937d..1fc5daf9c 100644 --- a/firmware/microblaze/usrp2p/bootloader/Makefile.am +++ b/firmware/microblaze/usrp2p/bootloader/Makefile.am @@ -30,7 +30,7 @@ LDADD = $(top_srcdir)/usrp2p/libusrp2p.a noinst_PROGRAMS = \ init_bootloader.elf -init_bootloader_elf_SOURCES = init_bootloader.c i2c_sync.c +init_bootloader_elf_SOURCES = init_bootloader.c .bin.rmi: $(top_srcdir)/bin/bin_to_ram_macro_init.py $< $@ 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..."); |