This is an automated email from Gerrit.

Brad Riensche ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/1518

-- gerrit

commit ec6478242342553d0052f09e3206c926fe26b006
Author: Brad Riensche <[email protected]>
Date:   Mon Jul 22 10:22:08 2013 -0500

    dap info command changes for nested dap tables (cortex-a9 support)
    
    This patch is a fusion of two patches:
    http://openocd.zylin.com/#/c/1493/ (Brad Riensche, Last activity: Jul 10th 
2013)
    and
    http://openocd.zylin.com/#/c/1427/ (Chris Johns, Last activity: Jun 3rd 
2013)
    
    This makes the listing easier to read, imho.  The tab indentation technique 
causes the base address to precess as the parser proceeds through the 
subtables, and can easily wrap.  I have also addressed the source comments 
raised in 1427 submission.
    
    Change-Id: Iea5e678255e6314a9d532e4b222a2572b5394390
    Signed-off-by: Brad Riensche <[email protected]>

diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index 4d6b746..791461d 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -1330,17 +1330,17 @@ static int dap_rom_display(struct command_context 
*cmd_ctx,
        int retval;
        uint32_t cid0, cid1, cid2, cid3, memtype, romentry;
        uint16_t entry_offset;
-       int i;
-       char tabs[16 + 1];
+       char tabs[20];
 
        if (depth > 16) {
                command_print(cmd_ctx, "\tTables too deep");
                return ERROR_FAIL;
        }
 
-       for (i = 0; i < depth; ++i)
-               tabs[i] = '\t';
-       tabs[i] = '\0';
+       if (depth == 0)
+               tabs[0] = '\0';
+       else
+               snprintf(tabs, sizeof(tabs)-1, "[L%02i] ", depth);
 
        /* bit 16 of apid indicates a memory access port */
        if (dbgbase & 0x02)
@@ -1374,7 +1374,7 @@ static int dap_rom_display(struct command_context 
*cmd_ctx,
                                ", CID1 0x%2.2x"
                                ", CID0 0x%2.2x",
                                tabs,
-                               (unsigned) cid3, (unsigned)cid2,
+                               (unsigned) cid3, (unsigned) cid2,
                                (unsigned) cid1, (unsigned) cid0);
        if (memtype & 0x01)
                command_print(cmd_ctx, "\t%sEMTYPE system memory present on 
bus", tabs);
@@ -1438,12 +1438,12 @@ static int dap_rom_display(struct command_context 
*cmd_ctx,
                                return retval;
                        c_cid3 &= 0xff;
 
-                       command_print(cmd_ctx, "\t%s\tComponent base address 
0x%" PRIx32 ","
-                                       "start address 0x%" PRIx32, tabs, 
component_base,
+                       command_print(cmd_ctx, "\t\tComponent base address 0x%" 
PRIx32 ","
+                                       "start address 0x%" PRIx32, 
component_base,
                        /* component may take multiple 4K pages */
                        component_base - 0x1000*(c_pid4 >> 4));
-                       command_print(cmd_ctx, "\t%s\tComponent class is 0x%x, 
%s",
-                                       tabs, (int) (c_cid1 >> 4) & 0xf,
+                       command_print(cmd_ctx, "\t\tComponent class is 0x%x, 
%s",
+                                       (int) (c_cid1 >> 4) & 0xf,
                                        /* See ARM IHI 0029B Table 3-3 */
                                        class_description[(c_cid1 >> 4) & 0xf]);
 
@@ -1554,26 +1554,25 @@ static int dap_rom_display(struct command_context 
*cmd_ctx,
                                        }
                                        break;
                                }
-                               command_print(cmd_ctx, "\t%s\tType is 0x%2.2x, 
%s, %s",
-                                               tabs, (unsigned) (devtype & 
0xff),
+                               command_print(cmd_ctx, "\t\tType is 0x%2.2x, 
%s, %s",
+                                               (unsigned) (devtype & 0xff),
                                                major, subtype);
                                /* REVISIT also show 0xfc8 DevId */
                        }
 
                        if (!is_dap_cid_ok(cid3, cid2, cid1, cid0))
                                command_print(cmd_ctx,
-                                               "\t%s\tCID3 0%2.2x"
+                                               "\t\tCID3 0%2.2x"
                                                ", CID2 0%2.2x"
                                                ", CID1 0%2.2x"
                                                ", CID0 0%2.2x",
-                                               tabs,
-                                               (int) c_cid3,
-                                               (int) c_cid2,
-                                               (int)c_cid1,
-                                               (int)c_cid0);
+                                               (unsigned) c_cid3,
+                                               (unsigned) c_cid2,
+                                               (unsigned) c_cid1,
+                                               (unsigned) c_cid0);
                        command_print(cmd_ctx,
-                       "\t%s\tPeripheral ID[4..0] = hex "
-                       "%2.2x %2.2x %2.2x %2.2x %2.2x", tabs,
+                       "\t\tPeripheral ID[4..0] = hex "
+                       "%2.2x %2.2x %2.2x %2.2x %2.2x",
                        (int) c_pid4, (int) c_pid3, (int) c_pid2,
                        (int) c_pid1, (int) c_pid0);
 
@@ -1667,6 +1666,14 @@ static int dap_rom_display(struct command_context 
*cmd_ctx,
                                type = "Cortex-R4 ETM";
                                full = "(Embedded Trace)";
                                break;
+                       case 0x950:
+                               type = "CoreSight Component";
+                               full = "(unidentified Cortex-A9 component)";
+                               break;
+                       case 0x9a0:
+                               type = "CoreSight PMU";
+                               full = "(Performance Monitoring Unit)";
+                               break;
                        case 0x9a1:
                                type = "Cortex-M4 TPUI";
                                full = "(Trace Port Interface Unit)";
@@ -1684,8 +1691,8 @@ static int dap_rom_display(struct command_context 
*cmd_ctx,
                                full = "";
                                break;
                        }
-                       command_print(cmd_ctx, "\t%s\tPart is %s %s",
-                                       tabs, type, full);
+                       command_print(cmd_ctx, "\t\tPart is %s %s",
+                                       type, full);
 
                        /* ROM Table? */
                        if (((c_cid1 >> 4) & 0x0f) == 1) {

-- 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to