ipdbg: fix double free of virtual-ir data
[openocd.git] / src / target / openrisc / or1k_tap_mohor.c
blob0dedb3e7542a993e5da5f055d1afcf916bb91f47
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 /***************************************************************************
4 * Copyright (C) 2013 by Franck Jullien *
5 * elec4fun@gmail.com *
6 ***************************************************************************/
8 #ifdef HAVE_CONFIG_H
9 #include "config.h"
10 #endif
12 #include "or1k_tap.h"
13 #include "or1k.h"
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*/
28 jtag_add_tlr();
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 = {
44 .name = "mohor",
45 .init = or1k_tap_mohor_init,
48 int or1k_tap_mohor_register(void)
50 list_add_tail(&mohor_tap.list, &tap_list);
51 return 0;