15 #define LSCC_REFRESH 0x23
16 #define ISC_ENABLE 0x15
17 #define LSCC_RESET_ADDRESS 0x21
18 #define ISC_PROGRAM_USERCODE 0x1A
19 #define ISC_ERASE 0x03
20 #define READ_USERCODE 0x17
21 #define ISC_DISABLE 0x1E
22 #define LSCC_READ_STATUS 0x53
23 #define LSCC_BITSTREAM_BURST 0x02
24 #define PROGRAM_SPI 0x3A
26 #define STATUS_DONE_BIT 0x00020000
27 #define STATUS_ERROR_BITS_ECP2 0x00040003
28 #define STATUS_ERROR_BITS_ECP3 0x00040007
29 #define REGISTER_ALL_BITS_1 0xffffffff
30 #define REGISTER_ALL_BITS_0 0x00000000
91 uint8_t
buffer[4] = {0xff, 0xff, 0xff, 0xff};
256 if (!pld_device_info)
284 if (!pld_device_info)
300 if (!pld_device_info)
303 *facing_read_bits = 1;
310 if (!lattice_device || !lattice_device->
tap)
int lattice_ecp2_3_read_status(struct jtag_tap *tap, uint32_t *status, uint32_t out, bool do_idle)
int lattice_ecp2_3_disconnect_spi_from_jtag(struct lattice_pld_device *pld_device_info)
static int lattice_ecp2_3_erase_device(struct lattice_pld_device *lattice_device)
#define ISC_PROGRAM_USERCODE
int lattice_ecp2_3_read_usercode(struct jtag_tap *tap, uint32_t *usercode, uint32_t out)
static int lattice_ecp2_3_program_config_map(struct lattice_pld_device *lattice_device, struct lattice_bit_file *bit_file)
int lattice_ecp2_3_get_facing_read_bits(struct lattice_pld_device *pld_device_info, unsigned int *facing_read_bits)
int lattice_ecp3_load(struct lattice_pld_device *lattice_device, struct lattice_bit_file *bit_file)
static int lattice_ecp2_3_exit_programming_mode(struct lattice_pld_device *lattice_device)
#define LSCC_BITSTREAM_BURST
#define LSCC_RESET_ADDRESS
int lattice_ecp2_3_write_usercode(struct lattice_pld_device *lattice_device, uint32_t usercode)
int lattice_ecp2_3_refresh(struct lattice_pld_device *lattice_device)
#define REGISTER_ALL_BITS_0
int lattice_ecp2_3_connect_spi_to_jtag(struct lattice_pld_device *pld_device_info)
#define STATUS_ERROR_BITS_ECP2
#define REGISTER_ALL_BITS_1
#define STATUS_ERROR_BITS_ECP3
int lattice_ecp2_load(struct lattice_pld_device *lattice_device, struct lattice_bit_file *bit_file)
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)
uint8_t * expected
Capture-IR expected value.
struct raw_bit_file raw_bit
enum lattice_family_e family
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)