16 #define ISC_PROGRAM_USERCODE 0xC2
18 #define STATUS_DONE_BIT 0x00000100
19 #define STATUS_ERROR_BITS 0x00020040
20 #define STATUS_FEA_OTP 0x00004000
21 #define STATUS_FAIL_FLAG 0x00002000
22 #define STATUS_BUSY_FLAG 0x00001000
23 #define REGISTER_ALL_BITS_1 0xffffffff
176 const uint32_t out = 0x0;
177 const uint32_t expected1 = 0x0;
211 if (!pld_device_info)
244 uint8_t
buffer[2] = {0xfe, 0x68};
255 if (!pld_device_info)
272 if (!pld_device_info)
275 *facing_read_bits = 0;
static uint32_t buf_get_u32(const uint8_t *_buffer, unsigned int first, unsigned int num)
Retrieves num bits from _buffer, starting at the first bit, returning the bits in a 32-bit word.
static int lattice_ecp5_program_config_map(struct jtag_tap *tap, struct lattice_bit_file *bit_file)
int lattice_ecp5_refresh(struct lattice_pld_device *lattice_device)
int lattice_ecp5_connect_spi_to_jtag(struct lattice_pld_device *pld_device_info)
#define ISC_PROGRAM_USERCODE
int lattice_ecp5_load(struct lattice_pld_device *lattice_device, struct lattice_bit_file *bit_file)
int lattice_ecp5_disconnect_spi_from_jtag(struct lattice_pld_device *pld_device_info)
#define STATUS_ERROR_BITS
int lattice_ecp5_write_usercode(struct lattice_pld_device *lattice_device, uint32_t usercode)
int lattice_ecp5_read_usercode(struct jtag_tap *tap, uint32_t *usercode, uint32_t out)
int lattice_ecp5_read_status(struct jtag_tap *tap, uint32_t *status, uint32_t out, bool do_idle)
static int lattice_ecp5_init_address(struct jtag_tap *tap)
int lattice_ecp5_get_facing_read_bits(struct lattice_pld_device *pld_device_info, unsigned int *facing_read_bits)
static int lattice_ecp5_erase_sram(struct jtag_tap *tap)
static int lattice_ecp5_exit_programming_mode(struct jtag_tap *tap)
#define REGISTER_ALL_BITS_1
static int lattice_ecp5_enable_sram_programming(struct jtag_tap *tap)
void jtag_add_runtest(unsigned int num_cycles, tap_state_t state)
Goes to TAP_IDLE (if we're not already there), cycle precisely num_cycles in the TAP_IDLE state,...
int jtag_execute_queue(void)
For software FIFO implementations, the queued commands can be executed during this call or earlier.
void jtag_add_sleep(uint32_t us)
void jtag_add_dr_scan(struct jtag_tap *active, int in_num_fields, const struct scan_field *in_fields, tap_state_t state)
Generate a DR SCAN using the fields passed to the function.
int lattice_verify_status_register_u32(struct lattice_pld_device *lattice_device, uint32_t out, uint32_t expected, uint32_t mask, bool do_idle)
int lattice_set_instr(struct jtag_tap *tap, uint8_t new_instr, tap_state_t endstate)
int lattice_preload(struct lattice_pld_device *lattice_device)
int lattice_read_u32_register(struct jtag_tap *tap, uint8_t cmd, uint32_t *in_val, uint32_t out_val, bool do_idle)
int lattice_verify_usercode(struct lattice_pld_device *lattice_device, uint32_t out, uint32_t expected, uint32_t mask)
#define LSC_BITSTREAM_BURST
uint8_t * cur_instr
current instruction
unsigned int ir_length
size of instruction register
struct raw_bit_file raw_bit
This structure defines a single scan field in the scan.
uint8_t * in_value
A pointer to a 32-bit memory location for data scanned out.
const uint8_t * out_value
A pointer to value to be scanned into the device.
unsigned int num_bits
The number of bits this field specifies.
static void h_u32_to_le(uint8_t *buf, uint32_t val)