16 #define LSC_ENABLE_X 0x74
17 #define LSC_REFRESH 0x79
18 #define LSC_DEVICE_CTRL 0x7D
32 LOG_ERROR(
"Not supported to write usercode on certus devices");
101 const uint64_t status_done_flag = 0x100;
102 const uint64_t status_fail_flag = 0x2000;
179 const uint64_t status_pwd_protection = 0x20000;
191 const uint64_t status_otp = 0x40;
194 LOG_ERROR(
"NV User Feature Sector OTP is Set");
199 const uint64_t status_write_protected = 0x400;
202 LOG_ERROR(
"NV User Feature Sector OTP is Set");
208 LOG_ERROR(
"failed to enable programming mode");
238 if (!pld_device_info)
273 uint8_t
buffer[2] = {0xfe, 0x68};
284 if (!pld_device_info)
301 if (!pld_device_info)
304 *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.
int lattice_certus_load(struct lattice_pld_device *lattice_device, struct lattice_bit_file *bit_file)
static int lattice_certus_enable_programming(struct jtag_tap *tap)
int lattice_certus_refresh(struct lattice_pld_device *lattice_device)
static int lattice_certus_enable_transparent_mode(struct jtag_tap *tap)
static int lattice_certus_exit_programming_mode(struct jtag_tap *tap)
static int lattice_certus_init_address(struct jtag_tap *tap)
static int lattice_certus_erase_device(struct lattice_pld_device *lattice_device)
int lattice_certus_write_usercode(struct lattice_pld_device *lattice_device, uint32_t usercode)
int lattice_certus_get_facing_read_bits(struct lattice_pld_device *pld_device_info, unsigned int *facing_read_bits)
int lattice_certus_read_usercode(struct jtag_tap *tap, uint32_t *usercode, uint32_t out)
int lattice_certus_read_status(struct jtag_tap *tap, uint64_t *status, uint64_t out)
int lattice_certus_connect_spi_to_jtag(struct lattice_pld_device *pld_device_info)
int lattice_certus_disconnect_spi_from_jtag(struct lattice_pld_device *pld_device_info)
static int lattice_certus_program_config_map(struct jtag_tap *tap, 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_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_u64_register(struct jtag_tap *tap, uint8_t cmd, uint64_t *in_val, uint64_t out_val)
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_status_register_u64(struct lattice_pld_device *lattice_device, uint64_t out, uint64_t expected, uint64_t mask)
#define LSC_BITSTREAM_BURST
#define LOG_ERROR(expr ...)
uint8_t * cur_instr
current instruction
unsigned int ir_length
size of instruction register
uint8_t * expected
Capture-IR expected value.
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.