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.
 
 
 
 
 
 

185 lines
4.1 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, write to the *
  16. * Free Software Foundation, Inc., *
  17. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  18. ***************************************************************************/
  19. #ifdef HAVE_CONFIG_H
  20. #include "config.h"
  21. #endif
  22. #include "embeddedice.h"
  23. #include "minidriver.h"
  24. #include "interface.h"
  25. jtag_interface_t minidummy_interface =
  26. {
  27. .name = "minidummy",
  28. .execute_queue = NULL,
  29. .speed = NULL,
  30. .register_commands = NULL,
  31. .init = NULL,
  32. .quit = NULL,
  33. .khz = NULL,
  34. .speed_div = NULL,
  35. .power_dropout = NULL,
  36. .srst_asserted = NULL,
  37. };
  38. int interface_jtag_execute_queue(void)
  39. {
  40. /* synchronously do the operation here */
  41. return ERROR_OK;
  42. }
  43. extern int jtag_check_value(uint8_t *captured, void *priv);
  44. int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state)
  45. {
  46. /* synchronously do the operation here */
  47. return ERROR_OK;
  48. }
  49. int interface_jtag_add_plain_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state)
  50. {
  51. /* synchronously do the operation here */
  52. return ERROR_OK;
  53. }
  54. /*extern jtag_command_t **jtag_get_last_command_p(void);*/
  55. int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state)
  56. {
  57. /* synchronously do the operation here */
  58. return ERROR_OK;
  59. }
  60. int interface_jtag_add_plain_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state)
  61. {
  62. /* synchronously do the operation here */
  63. return ERROR_OK;
  64. }
  65. int interface_jtag_add_tlr()
  66. {
  67. /* synchronously do the operation here */
  68. return ERROR_OK;
  69. }
  70. int interface_jtag_add_reset(int req_trst, int req_srst)
  71. {
  72. /* synchronously do the operation here */
  73. return ERROR_OK;
  74. }
  75. int interface_jtag_add_runtest(int num_cycles, tap_state_t state)
  76. {
  77. /* synchronously do the operation here */
  78. return ERROR_OK;
  79. }
  80. int interface_jtag_add_clocks(int num_cycles)
  81. {
  82. /* synchronously do the operation here */
  83. return ERROR_OK;
  84. }
  85. int interface_jtag_add_sleep(uint32_t us)
  86. {
  87. jtag_sleep(us);
  88. return ERROR_OK;
  89. }
  90. int interface_jtag_add_pathmove(int num_states, const tap_state_t *path)
  91. {
  92. int state_count;
  93. int tms = 0;
  94. state_count = 0;
  95. tap_state_t cur_state = cmd_queue_cur_state;
  96. while (num_states)
  97. {
  98. if (tap_state_transition(cur_state, false) == path[state_count])
  99. {
  100. tms = 0;
  101. }
  102. else if (tap_state_transition(cur_state, true) == path[state_count])
  103. {
  104. tms = 1;
  105. }
  106. else
  107. {
  108. LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_name(cur_state), tap_state_name(path[state_count]));
  109. exit(-1);
  110. }
  111. /* synchronously do the operation here */
  112. cur_state = path[state_count];
  113. state_count++;
  114. num_states--;
  115. }
  116. /* synchronously do the operation here */
  117. return ERROR_OK;
  118. }
  119. void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, uint8_t *buffer, int little, int count)
  120. {
  121. int i;
  122. for (i = 0; i < count; i++)
  123. {
  124. embeddedice_write_reg_inner(tap, reg_addr, fast_target_buffer_get_u32(buffer, little));
  125. buffer += 4;
  126. }
  127. }