1 /***************************************************************************
2 * Copyright (C) 2013 by Sergio Chico *
3 * sergio.chico@gmail.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 ***************************************************************************/
23 #include <jtag/jtag.h>
25 #define OR1K_XILINX_TAP_INST_USER1 0x02
27 static int or1k_tap_xilinx_bscan_init(struct or1k_jtag *jtag_info)
29 LOG_DEBUG("Initialising Xilinx Internal JTAG TAP");
31 /* Put TAP into state where it can talk to the debug interface
32 * by shifting in correct value to IR.
35 /* Ensure TAP is reset - maybe not necessary*/
38 struct jtag_tap *tap = jtag_info->tap;
39 struct scan_field field;
40 uint8_t ir_value = OR1K_XILINX_TAP_INST_USER1;
42 field.num_bits = tap->ir_length;
43 field.out_value = &ir_value;
44 field.in_value = NULL;
46 jtag_add_ir_scan(tap, &field, TAP_IDLE);
48 return jtag_execute_queue();
51 static struct or1k_tap_ip xilinx_bscan_tap = {
52 .name = "xilinx_bscan",
53 .init = or1k_tap_xilinx_bscan_init,
56 int or1k_tap_xilinx_bscan_register(void)
58 list_add_tail(&xilinx_bscan_tap.list, &tap_list);