void part_execute_instructions (urj_chain_t *chain, int n, struct bfin_insn *insns) { while (insns) { if (insns->type == BFIN_INSN_NORMAL) part_emuir_set (chain, n, insns->i, URJ_CHAIN_EXITMODE_IDLE); else /* insns->type == BFIN_INSN_SET_EMUDAT */ part_emudat_set (chain, n, insns->i, URJ_CHAIN_EXITMODE_UPDATE); insns = insns->next; } return; }
void part_mmr_write_clobber_r0 (urj_chain_t *chain, int n, int32_t offset, uint32_t data, int size) { assert (size == 2 || size == 4); part_emudat_set (chain, n, data, URJ_CHAIN_EXITMODE_UPDATE); if (offset == 0) { part_scan_select (chain, n, DBGCTL_SCAN); part_dbgctl_bit_set_emuirlpsz_2 (chain, n); urj_tap_chain_shift_data_registers_mode (chain, 0, 1, URJ_CHAIN_EXITMODE_UPDATE); if (size == 2) part_emuir_set_2 (chain, n, gen_move (REG_R0, REG_EMUDAT), gen_store16 (REG_P0, REG_R0), URJ_CHAIN_EXITMODE_IDLE); else part_emuir_set_2 (chain, n, gen_move (REG_R0, REG_EMUDAT), gen_store32 (REG_P0, REG_R0), URJ_CHAIN_EXITMODE_IDLE); } else { part_emuir_set (chain, n, gen_move (REG_R0, REG_EMUDAT), URJ_CHAIN_EXITMODE_IDLE); if (size == 2) part_emuir_set (chain, n, gen_store16_offset (REG_P0, offset, REG_R0), URJ_CHAIN_EXITMODE_IDLE); else part_emuir_set (chain, n, gen_store32_offset (REG_P0, offset, REG_R0), URJ_CHAIN_EXITMODE_IDLE); } if (offset == 0) { part_scan_select (chain, n, DBGCTL_SCAN); part_dbgctl_bit_clear_emuirlpsz_2 (chain, n); urj_tap_chain_shift_data_registers_mode (chain, 0, 1, URJ_CHAIN_EXITMODE_UPDATE); } }