43 LOG_ERROR(
"unknown boundary scan length. Please specify with 'intel set_bscan'.");
48 LOG_ERROR(
"checkpos has to be smaller than scan length %d < %u",
58 if (!filename || !bit_file)
62 const char *file_ending_pos = strrchr(filename,
'.');
63 if (!file_ending_pos) {
64 LOG_ERROR(
"Unable to detect filename suffix");
68 if (strcasecmp(file_ending_pos,
".rbf") == 0)
107 if (!intel_info || !intel_info->
tap)
170 retval = ((buf[intel_info->
checkpos / 8] & (1 << (intel_info->
checkpos % 8)))) ?
178 LOG_INFO(
"unable to check. Please specify with position 'intel set_check_pos'.");
184 switch (intel_info->
family) {
217 if (!pld_device_info || !pld_device_info->
tap)
220 hub->
tap = pld_device_info->
tap;
224 }
else if (user_num == 1) {
227 LOG_ERROR(
"intel devices only have user register 0 & 1");
294 if (strcmp(
CMD_ARGV[2],
"-chain-position") != 0)
305 if (strcmp(
CMD_ARGV[4],
"-family") != 0)
308 if (strcmp(
CMD_ARGV[5],
"cycloneiii") == 0) {
310 }
else if (strcmp(
CMD_ARGV[5],
"cycloneiv") == 0) {
312 }
else if (strcmp(
CMD_ARGV[5],
"cyclonev") == 0) {
314 }
else if (strcmp(
CMD_ARGV[5],
"cyclone10") == 0) {
316 }
else if (strcmp(
CMD_ARGV[5],
"arriaii") == 0) {
334 pld->driver_priv = intel_info;
343 .handler = intel_set_bscan_command_handler,
344 .help =
"set boundary scan register length of FPGA",
345 .usage =
"pld_name len",
347 .name =
"set_check_pos",
349 .handler = intel_set_check_pos_command_handler,
350 .help =
"set check_pos of FPGA",
351 .usage =
"pld_name pos",
360 .help =
"intel specific commands",
370 .pld_create_command = &intel_pld_create_command,
unsigned int adapter_get_speed_khz(void)
Retrieves the clock speed of the adapter in kHz.
static void buf_set_u32(uint8_t *_buffer, unsigned int first, unsigned int num, uint32_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
void command_print(struct command_invocation *cmd, const char *format,...)
#define CMD
Use this macro to access the command being handled, rather than accessing the variable directly.
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
#define ERROR_COMMAND_SYNTAX_ERROR
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define COMMAND_PARSE_NUMBER(type, in, out)
parses the string in into out as a type, or prints a command error and passes the error code to the c...
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
struct pld_driver intel_pld
static int intel_load(struct pld_device *pld_device, const char *filename)
static const struct command_registration intel_exec_command_handlers[]
static int intel_get_jtagspi_userircode(struct pld_device *pld_device, unsigned int *ir)
PLD_CREATE_COMMAND_HANDLER(intel_pld_create_command)
static int intel_read_file(struct raw_bit_file *bit_file, const char *filename)
static int intel_set_instr(struct jtag_tap *tap, uint16_t new_instr)
static const struct command_registration intel_command_handler[]
COMMAND_HANDLER(intel_set_bscan_command_handler)
static int intel_get_ipdbg_hub(int user_num, struct pld_device *pld_device, struct pld_ipdbg_hub *hub)
static int intel_check_config(struct intel_pld_device *intel_info)
struct jtag_tap * jtag_tap_by_string(const char *s)
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_ir_scan(struct jtag_tap *active, struct scan_field *in_fields, tap_state_t state)
Generate an IR SCAN with a list of scan fields with one entry for each enabled TAP.
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.
The JTAG interface can be implemented with a software or hardware fifo.
#define LOG_ERROR(expr ...)
#define LOG_INFO(expr ...)
struct pld_device * get_pld_device_by_name_or_numstr(const char *str)
#define ERROR_PLD_FILE_LOAD_FAILED
int cpld_read_raw_bit_file(struct raw_bit_file *bit_file, const char *filename)
unsigned int boundary_scan_length
enum intel_family_e family
unsigned int ir_length
size of instruction register
unsigned int user_ir_code
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.
#define DIV_ROUND_UP(m, n)
Rounds m up to the nearest multiple of n using division.