1 // SPDX-License-Identifier: GPL-2.0-or-later
3 /***************************************************************************
4 * Copyright (C) 2013 by Franck Jullien *
6 ***************************************************************************/
15 #include <jtag/jtag.h>
17 #define OR1K_TAP_INST_DEBUG 0x8
19 static int or1k_tap_mohor_init(struct or1k_jtag
*jtag_info
)
21 LOG_DEBUG("Initialising OpenCores JTAG TAP");
23 /* Put TAP into state where it can talk to the debug interface
24 * by shifting in correct value to IR.
27 /* Ensure TAP is reset - maybe not necessary*/
30 struct jtag_tap
*tap
= jtag_info
->tap
;
31 struct scan_field field
;
32 uint8_t ir_value
= OR1K_TAP_INST_DEBUG
;
34 field
.num_bits
= tap
->ir_length
;
35 field
.out_value
= &ir_value
;
36 field
.in_value
= NULL
;
38 jtag_add_ir_scan(tap
, &field
, TAP_IDLE
);
40 return jtag_execute_queue();
43 static struct or1k_tap_ip mohor_tap
= {
45 .init
= or1k_tap_mohor_init
,
48 int or1k_tap_mohor_register(void)
50 list_add_tail(&mohor_tap
.list
, &tap_list
);