aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/usrp2p/bootloader_utils.c
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-19 22:23:46 -0800
committerJosh Blum <josh@joshknows.com>2011-01-19 22:23:46 -0800
commit9239878b0b81c3a368bf11cfc2fe48bfb05ff902 (patch)
treef41a5e58eac89b35cb99537a0a0b64662384a9f2 /firmware/microblaze/usrp2p/bootloader_utils.c
parentfc138381ee4bd8d191795230b7447071a85e1f28 (diff)
parent7d918c5f6acc9a5d2c8ae03e2e67b403f7efd5ff (diff)
downloaduhd-9239878b0b81c3a368bf11cfc2fe48bfb05ff902.tar.gz
uhd-9239878b0b81c3a368bf11cfc2fe48bfb05ff902.tar.bz2
uhd-9239878b0b81c3a368bf11cfc2fe48bfb05ff902.zip
Merge branch 'next'
Conflicts: host/lib/usrp/usrp2/codec_impl.cpp
Diffstat (limited to 'firmware/microblaze/usrp2p/bootloader_utils.c')
-rw-r--r--firmware/microblaze/usrp2p/bootloader_utils.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/firmware/microblaze/usrp2p/bootloader_utils.c b/firmware/microblaze/usrp2p/bootloader_utils.c
deleted file mode 100644
index fadd225bb..000000000
--- a/firmware/microblaze/usrp2p/bootloader_utils.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2010 Ettus Research LLC
- *
- */
-
-//contains routines for loading programs from Flash. depends on Flash libraries.
-//also contains routines for reading / writing EEPROM flags for the bootloader
-#include <stdbool.h>
-#include <string.h>
-#include <bootloader_utils.h>
-#include <spi_flash.h>
-
-int is_valid_fpga_image(uint32_t addr) {
- uint8_t imgbuf[64];
- spi_flash_read(addr, 64, imgbuf);
- //we're just looking for leading 0xFF padding, followed by the sync bytes 0xAA 0x99
- int i = 0;
- for(i; i<63; i++) {
- if(imgbuf[i] == 0xFF) continue;
- if(imgbuf[i] == 0xAA && imgbuf[i+1] == 0x99) return 1;
- }
-
- return 0;
-}
-
-int is_valid_fw_image(uint32_t addr) {
- static const uint8_t fwheader[] = {0xB0, 0x00, 0x00, 0x00, 0xB8, 0x08}; //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)
-{
- memcpy(0x00000000, addr+0x00000000, 36); //copy the whole vector table, with the reset vector, into boot RAM
- typedef void (*fptr_t)(void);
- (*(fptr_t) 0x00000000)(); // most likely no return
-}