JTAG: Add functions to check EEPROM, load SRAM of HackRF CPLD.

This commit is contained in:
Jared Boone 2016-07-17 15:52:58 -07:00
parent 1d58f05163
commit c8b1a8fbf6
2 changed files with 34 additions and 0 deletions

View File

@ -21,11 +21,14 @@
#include "cpld_update.hpp" #include "cpld_update.hpp"
#include "hackrf_gpio.hpp"
#include "portapack_hal.hpp" #include "portapack_hal.hpp"
#include "jtag_target_gpio.hpp" #include "jtag_target_gpio.hpp"
#include "cpld_max5.hpp" #include "cpld_max5.hpp"
#include "cpld_xilinx.hpp"
#include "portapack_cpld_data.hpp" #include "portapack_cpld_data.hpp"
#include "hackrf_cpld_data.hpp"
bool cpld_update_if_necessary() { bool cpld_update_if_necessary() {
jtag::GPIOTarget target { jtag::GPIOTarget target {
@ -82,3 +85,31 @@ bool cpld_update_if_necessary() {
return ok; return ok;
} }
static jtag::GPIOTarget jtag_target_hackrf() {
return {
hackrf::one::gpio_cpld_tck,
hackrf::one::gpio_cpld_tms,
hackrf::one::gpio_cpld_tdi,
hackrf::one::gpio_cpld_tdo,
};
}
bool cpld_hackrf_load_sram() {
auto jtag_target_hackrf_cpld = jtag_target_hackrf();
cpld::xilinx::XC2C64A hackrf_cpld { jtag_target_hackrf_cpld };
hackrf_cpld.write_sram(hackrf::one::cpld::verify_blocks);
const auto ok = hackrf_cpld.verify_sram(hackrf::one::cpld::verify_blocks);
return ok;
}
bool cpld_hackrf_verify_eeprom() {
auto jtag_target_hackrf_cpld = jtag_target_hackrf();
cpld::xilinx::XC2C64A hackrf_cpld { jtag_target_hackrf_cpld };
const auto ok = hackrf_cpld.verify_eeprom(hackrf::one::cpld::verify_blocks);
return ok;
}

View File

@ -24,4 +24,7 @@
bool cpld_update_if_necessary(); bool cpld_update_if_necessary();
bool cpld_hackrf_load_sram();
bool cpld_hackrf_verify_eeprom();
#endif/*__CPLD_UPDATE_H__*/ #endif/*__CPLD_UPDATE_H__*/