Merge pull request #1752 from martinling/move-cpld-load

Move `cpld_jtag_sram_load` into `cpld_jtag.c`
This commit is contained in:
Michael Ossmann 2026-05-18 11:52:49 -04:00 committed by GitHub
commit 76dd5916a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 15 deletions

View file

@ -21,6 +21,7 @@
#include "cpld_jtag.h"
#include "cpld_xc2c.h"
#include "platform_detect.h"
#ifdef IS_NOT_PRALINE
#include <stdint.h>
@ -138,4 +139,16 @@ unsigned char cpld_jtag_get_next_byte(void)
xsvf_pos++;
return byte;
}
bool cpld_jtag_sram_load(jtag_t* const jtag)
{
cpld_jtag_take(jtag);
cpld_xc2c64a_jtag_sram_write(jtag, &cpld_hackrf_program_sram);
const bool success = cpld_xc2c64a_jtag_sram_verify(
jtag,
&cpld_hackrf_program_sram,
&cpld_hackrf_verify);
cpld_jtag_release(jtag);
return success;
}
#endif

View file

@ -58,6 +58,7 @@ int cpld_jtag_program(
unsigned char* const buffer,
refill_buffer_cb refill);
unsigned char cpld_jtag_get_next_byte(void);
bool cpld_jtag_sram_load(jtag_t* const jtag);
/* Driver instance. */
extern jtag_gpio_t jtag_gpio_cpld;

View file

@ -69,7 +69,6 @@
#endif
#ifdef IS_NOT_PRALINE
#include <cpld_jtag.h>
#include <cpld_xc2c.h>
#endif
#include "usb_api_adc.h"
@ -261,20 +260,6 @@ void usb_set_descriptor_by_serial_number(void)
}
}
#ifdef IS_NOT_PRALINE
static bool cpld_jtag_sram_load(jtag_t* const jtag)
{
cpld_jtag_take(jtag);
cpld_xc2c64a_jtag_sram_write(jtag, &cpld_hackrf_program_sram);
const bool success = cpld_xc2c64a_jtag_sram_verify(
jtag,
&cpld_hackrf_program_sram,
&cpld_hackrf_verify);
cpld_jtag_release(jtag);
return success;
}
#endif
static void m0_rom_to_ram(void)
{
uint32_t* dest = &__ram_m0_start__;