From: oharboe at B. <oh...@ma...> - 2009-08-26 21:21:27
|
Author: oharboe Date: 2009-08-26 21:21:26 +0200 (Wed, 26 Aug 2009) New Revision: 2634 Modified: trunk/src/target/cortex_a8.c Log: Matt Hsu <ma...@0x...> cortex_a8_exec_opcode is writing the ARM instruction into the ITR register but it will only be executed when the DSCR[13] bit is set. The documentation is a bit weird as it classifies the DSCR as read-only but the pseudo code is writing to it as well. This is working on a beagleboard. Modified: trunk/src/target/cortex_a8.c =================================================================== --- trunk/src/target/cortex_a8.c 2009-08-26 19:20:25 UTC (rev 2633) +++ trunk/src/target/cortex_a8.c 2009-08-26 19:21:26 UTC (rev 2634) @@ -546,7 +546,7 @@ int cortex_a8_debug_entry(target_t *target) { int i; - uint32_t regfile[16], pc, cpsr; + uint32_t regfile[16], pc, cpsr, dscr; int retval = ERROR_OK; working_area_t *regfile_working_area = NULL; @@ -561,6 +561,14 @@ LOG_DEBUG("dscr = 0x%08" PRIx32, cortex_a8->cpudbg_dscr); + /* Enable the ITR execution once we are in debug mode */ + mem_ap_read_atomic_u32(swjdp, + OMAP3530_DEBUG_BASE + CPUDBG_DSCR, &dscr); + dscr |= (1 << 13); + retval = mem_ap_write_atomic_u32(swjdp, + OMAP3530_DEBUG_BASE + CPUDBG_DSCR, dscr); + + /* Examine debug reason */ switch ((cortex_a8->cpudbg_dscr >> 2)&0xF) { |