+static int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap,
+ uint32_t opcode,
+ uint32_t *data,
+ size_t count)
+{
+ struct scan_field chain5_fields[3];
+
+ chain5_fields[0].num_bits = 32;
+ chain5_fields[0].out_value = NULL; /*&Data*/
+ chain5_fields[0].in_value = NULL;
+
+ chain5_fields[1].num_bits = 1;
+ chain5_fields[1].out_value = NULL;
+ chain5_fields[1].in_value = NULL; /*&Ready*/
+
+ chain5_fields[2].num_bits = 1;
+ chain5_fields[2].out_value = NULL;
+ chain5_fields[2].in_value = NULL;
+
+ uint8_t *readies;
+ unsigned readies_num = count;
+ unsigned bytes = sizeof(*readies)*readies_num;
+
+ readies = malloc(bytes);
+ if (!readies) {
+ LOG_ERROR("Out of memory allocating %u bytes", bytes);
+ return ERROR_FAIL;
+ }
+
+ uint8_t *ready_pos = readies;
+ while (count--) {
+ chain5_fields[0].out_value = (uint8_t *)(data++);
+ chain5_fields[1].in_value = ready_pos++;
+
+ if (count > 0) {
+ jtag_add_dr_scan(tap, ARRAY_SIZE(chain5_fields), chain5_fields,
+ TAP_DRPAUSE);
+ jtag_add_pathmove(ARRAY_SIZE(arm11_move_drpause_idle_drpause_with_delay),
+ arm11_move_drpause_idle_drpause_with_delay);
+ } else
+ jtag_add_dr_scan(tap, ARRAY_SIZE(chain5_fields), chain5_fields, TAP_IDLE);
+ }
+
+ int retval = jtag_execute_queue();
+ if (retval == ERROR_OK) {
+ unsigned error_count = 0;
+
+ for (size_t i = 0; i < readies_num; i++) {
+ if (readies[i] != 1)
+ error_count++;
+ }
+
+ if (error_count > 0) {
+ LOG_ERROR("%u words out of %u not transferred",
+ error_count, readies_num);
+ retval = ERROR_FAIL;
+ }
+ }
+ free(readies);