This is an automated email from Gerrit.

Andreas Fritiofson (andreas.fritiof...@gmail.com) just uploaded a new patch set 
to Gerrit, which you can find at http://openocd.zylin.com/1953

-- gerrit

commit 04affccfed8c0727ded41812ca064db07651654a
Author: Andreas Fritiofson <andreas.fritiof...@gmail.com>
Date:   Sun Feb 16 02:22:41 2014 +0100

    adi_v5: Remove strange IDCODE check from dap info handler
    
    Otherwise it breaks SWD targets. The check seems really weird anyway since
    it loops through *all* TAPs after the ADIv5 target but doesn't do anything
    at all with the result, other than not setting the return values despite
    returning ERROR_OK.
    
    Remove a bogus initialization that was needed because of the odd
    behaviour of this routine when an IDCODE wasn't found.
    
    Change-Id: Ic086352f6af868b3406b00420291a0a671e3acac
    Signed-off-by: Andreas Fritiofson <andreas.fritiof...@gmail.com>

diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index 1558346..b997143 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -942,11 +942,10 @@ int dap_find_ap(struct adiv5_dap *dap, enum ap_type 
type_to_find, uint8_t *ap_nu
 }
 
 int dap_get_debugbase(struct adiv5_dap *dap, int ap,
-                       uint32_t *out_dbgbase, uint32_t *out_apid)
+                       uint32_t *dbgbase, uint32_t *apid)
 {
        uint32_t ap_old;
        int retval;
-       uint32_t dbgbase, apid;
 
        /* AP address is in bits 31:24 of DP_SELECT */
        if (ap >= 256)
@@ -955,33 +954,18 @@ int dap_get_debugbase(struct adiv5_dap *dap, int ap,
        ap_old = dap->ap_current;
        dap_ap_select(dap, ap);
 
-       retval = dap_queue_ap_read(dap, AP_REG_BASE, &dbgbase);
+       retval = dap_queue_ap_read(dap, AP_REG_BASE, dbgbase);
        if (retval != ERROR_OK)
                return retval;
-       retval = dap_queue_ap_read(dap, AP_REG_IDR, &apid);
+       retval = dap_queue_ap_read(dap, AP_REG_IDR, apid);
        if (retval != ERROR_OK)
                return retval;
        retval = dap_run(dap);
        if (retval != ERROR_OK)
                return retval;
 
-       /* Excavate the device ID code */
-       struct jtag_tap *tap = dap->jtag_info->tap;
-       while (tap != NULL) {
-               if (tap->hasidcode)
-                       break;
-               tap = tap->next_tap;
-       }
-       if (tap == NULL || !tap->hasidcode)
-               return ERROR_OK;
-
        dap_ap_select(dap, ap_old);
 
-       /* The asignment happens only here to prevent modification of these
-        * values before they are certain. */
-       *out_dbgbase = dbgbase;
-       *out_apid = apid;
-
        return ERROR_OK;
 }
 
@@ -1031,7 +1015,7 @@ static int dap_info_command(struct command_context 
*cmd_ctx,
                struct adiv5_dap *dap, int ap)
 {
        int retval;
-       uint32_t dbgbase = 0, apid = 0; /* Silence gcc by initializing */
+       uint32_t dbgbase, apid;
        int romtable_present = 0;
        uint8_t mem_ap;
        uint32_t ap_old;

-- 

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to