diff options
author | Nick Foster <nick@nerdnetworks.org> | 2010-12-15 11:58:02 -0800 |
---|---|---|
committer | Nick Foster <nick@nerdnetworks.org> | 2010-12-15 11:58:02 -0800 |
commit | 62338938a07123841f9622d69f0f07e4ab9cfcdb (patch) | |
tree | ea9d486f4d4a6a441513ae07e606df80a5233b20 /firmware/microblaze/usrp2p/bootloader_utils.c | |
parent | 5afdc004a7a1d489af81c5d035aa84a16ac1a353 (diff) | |
download | uhd-62338938a07123841f9622d69f0f07e4ab9cfcdb.tar.gz uhd-62338938a07123841f9622d69f0f07e4ab9cfcdb.tar.bz2 uhd-62338938a07123841f9622d69f0f07e4ab9cfcdb.zip |
ZPU: bootloader for 210 mods
Diffstat (limited to 'firmware/microblaze/usrp2p/bootloader_utils.c')
-rw-r--r-- | firmware/microblaze/usrp2p/bootloader_utils.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/firmware/microblaze/usrp2p/bootloader_utils.c b/firmware/microblaze/usrp2p/bootloader_utils.c index d68fafcb3..d04cffcf6 100644 --- a/firmware/microblaze/usrp2p/bootloader_utils.c +++ b/firmware/microblaze/usrp2p/bootloader_utils.c @@ -10,6 +10,7 @@ #include <string.h> #include <bootloader_utils.h> #include <spi_flash.h> +#include <memory_map.h> int is_valid_fpga_image(uint32_t addr) { uint8_t imgbuf[64]; @@ -25,15 +26,15 @@ int is_valid_fpga_image(uint32_t addr) { } int is_valid_fw_image(uint32_t addr) { - static const uint8_t fwheader[] = {0x0b 0x0b 0x0b 0x0b 0x80 0x70}; //just lookin for a jump to anywhere located at the reset vector + static const uint8_t fwheader[] = {0x0b, 0x0b, 0x0b, 0x0b, 0x80, 0x70}; //just lookin for a jump to anywhere located at the reset vector uint8_t buf[12]; spi_flash_read(addr, 6, buf); return memcmp(buf, fwheader, 6) == 0; } -void start_program(uint32_t addr) +void start_program(void) { - memcpy(0x00000000, addr+0x00000000, 0x3f); //copy the reset vector and interrupt vector - typedef void (*fptr_t)(void); - (*(fptr_t) 0x00000000)(); // most likely no return + //ignoring the addr now + //all this does is tap that register + *((volatile uint32_t *) SR_ADDR_BLDRDONE) = 1; } |