1
2
3
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
47
48
/* ... */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "or1k_tap.h"
#include "or1k.h"
#include <jtag/jtag.h>
#define OR1K_TAP_INST_DEBUG 0x8
static int or1k_tap_mohor_init(struct or1k_jtag *jtag_info)
{
LOG_DEBUG("Initialising OpenCores JTAG TAP");
/* ... */
jtag_add_tlr();
struct jtag_tap *tap = jtag_info->tap;
struct scan_field field;
uint8_t ir_value = OR1K_TAP_INST_DEBUG;
field.num_bits = tap->ir_length;
field.out_value = &ir_value;
field.in_value = NULL;
jtag_add_ir_scan(tap, &field, TAP_IDLE);
return jtag_execute_queue();
}{ ... }
static struct or1k_tap_ip mohor_tap = {
.name = "mohor",
.init = or1k_tap_mohor_init,
...};
int or1k_tap_mohor_register(void)
{
list_add_tail(&mohor_tap.list, &tap_list);
return 0;
}{ ... }