You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

177 lines
4.5 KiB

  1. /***************************************************************************
  2. * Copyright (C) 2007-2008 by Øyvind Harboe *
  3. * *
  4. * This program is free software; you can redistribute it and/or modify *
  5. * it under the terms of the GNU General Public License as published by *
  6. * the Free Software Foundation; either version 2 of the License, or *
  7. * (at your option) any later version. *
  8. * *
  9. * This program is distributed in the hope that it will be useful, *
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  12. * GNU General Public License for more details. *
  13. * *
  14. * You should have received a copy of the GNU General Public License *
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>. *
  16. ***************************************************************************/
  17. #ifdef HAVE_CONFIG_H
  18. #include "config.h"
  19. #endif
  20. #include <jtag/jtag.h>
  21. #include <target/embeddedice.h>
  22. #include <jtag/minidriver.h>
  23. #include <jtag/interface.h>
  24. static struct jtag_interface minidummy_interface = {
  25. .execute_queue = NULL,
  26. };
  27. struct adapter_driver minidummy_adapter_driver = {
  28. .name = "minidummy",
  29. .transports = jtag_only,
  30. .commands = NULL,
  31. .init = NULL,
  32. .quit = NULL,
  33. .speed = NULL,
  34. .khz = NULL,
  35. .speed_div = NULL,
  36. .power_dropout = NULL,
  37. .srst_asserted = NULL,
  38. .jtag_ops = &minidummy_interface,
  39. };
  40. int interface_jtag_execute_queue(void)
  41. {
  42. /* synchronously do the operation here */
  43. return ERROR_OK;
  44. }
  45. int interface_jtag_add_ir_scan(struct jtag_tap *active, const struct scan_field *fields,
  46. tap_state_t state)
  47. {
  48. /* synchronously do the operation here */
  49. return ERROR_OK;
  50. }
  51. int interface_jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits,
  52. uint8_t *in_bits, tap_state_t state)
  53. {
  54. /* synchronously do the operation here */
  55. return ERROR_OK;
  56. }
  57. int interface_jtag_add_dr_scan(struct jtag_tap *active, int num_fields,
  58. const struct scan_field *fields, tap_state_t state)
  59. {
  60. /* synchronously do the operation here */
  61. return ERROR_OK;
  62. }
  63. int interface_jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits,
  64. uint8_t *in_bits, tap_state_t state)
  65. {
  66. /* synchronously do the operation here */
  67. return ERROR_OK;
  68. }
  69. int interface_jtag_add_tlr(void)
  70. {
  71. /* synchronously do the operation here */
  72. return ERROR_OK;
  73. }
  74. int interface_jtag_add_reset(int req_trst, int req_srst)
  75. {
  76. /* synchronously do the operation here */
  77. return ERROR_OK;
  78. }
  79. int interface_jtag_add_runtest(int num_cycles, tap_state_t state)
  80. {
  81. /* synchronously do the operation here */
  82. return ERROR_OK;
  83. }
  84. int interface_jtag_add_clocks(int num_cycles)
  85. {
  86. /* synchronously do the operation here */
  87. return ERROR_OK;
  88. }
  89. int interface_jtag_add_sleep(uint32_t us)
  90. {
  91. jtag_sleep(us);
  92. return ERROR_OK;
  93. }
  94. int interface_jtag_add_pathmove(int num_states, const tap_state_t *path)
  95. {
  96. int state_count;
  97. int tms = 0;
  98. state_count = 0;
  99. tap_state_t cur_state = cmd_queue_cur_state;
  100. while (num_states) {
  101. if (tap_state_transition(cur_state, false) == path[state_count])
  102. tms = 0;
  103. else if (tap_state_transition(cur_state, true) == path[state_count])
  104. tms = 1;
  105. else {
  106. LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition",
  107. tap_state_name(cur_state), tap_state_name(path[state_count]));
  108. exit(-1);
  109. }
  110. /* synchronously do the operation here */
  111. cur_state = path[state_count];
  112. state_count++;
  113. num_states--;
  114. }
  115. /* synchronously do the operation here */
  116. return ERROR_OK;
  117. }
  118. int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq, enum tap_state state)
  119. {
  120. /* synchronously do the operation here */
  121. return ERROR_OK;
  122. }
  123. void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, const uint8_t *buffer,
  124. int little, int count)
  125. {
  126. int i;
  127. for (i = 0; i < count; i++) {
  128. embeddedice_write_reg_inner(tap, reg_addr, fast_target_buffer_get_u32(buffer, little));
  129. buffer += 4;
  130. }
  131. }
  132. int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap, uint32_t opcode,
  133. uint32_t *data, size_t count)
  134. {
  135. int arm11_run_instr_data_to_core_noack_inner_default(struct jtag_tap *tap,
  136. uint32_t opcode, uint32_t *data, size_t count);
  137. return arm11_run_instr_data_to_core_noack_inner_default(tap, opcode, data, count);
  138. }