From: oharboe at B. <oh...@ma...> - 2009-08-26 21:20:26
|
Author: oharboe Date: 2009-08-26 21:20:25 +0200 (Wed, 26 Aug 2009) New Revision: 2633 Modified: trunk/src/target/cortex_a8.c Log: Matt Hsu <ma...@0x...> Wait for the DTRRX to be full before reading it. Remove the trans_mode change as it is done in the mem_ap_read_atomic_u32 function. Modified: trunk/src/target/cortex_a8.c =================================================================== --- trunk/src/target/cortex_a8.c 2009-08-26 19:16:08 UTC (rev 2632) +++ trunk/src/target/cortex_a8.c 2009-08-26 19:20:25 UTC (rev 2633) @@ -259,14 +259,13 @@ { int retval = ERROR_OK; uint8_t reg = regnum&0xFF; + uint32_t dscr; /* get pointers to arch-specific information */ armv4_5_common_t *armv4_5 = target->arch_info; armv7a_common_t *armv7a = armv4_5->arch_info; swjdp_common_t *swjdp = &armv7a->swjdp_info; - swjdp->trans_mode = TRANS_MODE_COMPOSITE; - if (reg > 16) return retval; @@ -286,10 +285,16 @@ cortex_a8_exec_opcode(target, ARMV4_5_MCR(14, 0, 0, 0, 5, 0)); } - /* Read DCCTX */ + /* Read DTRRTX */ + do + { + retval = mem_ap_read_atomic_u32(swjdp, + OMAP3530_DEBUG_BASE + CPUDBG_DSCR, &dscr); + } + while ((dscr & (1 << 29)) == 0); /* Wait for DTRRXfull */ + retval = mem_ap_read_atomic_u32(swjdp, OMAP3530_DEBUG_BASE + CPUDBG_DTRTX, value); -// retval = mem_ap_read_u32(swjdp, OMAP3530_DEBUG_BASE + CPUDBG_DTRTX, value); return retval; } |