arm_adi_v5: report sysmem on class 0x9 ROM tables 17/6817/3
authorAntonio Borneo <borneo.antonio@gmail.com>
Sat, 15 Jan 2022 14:44:20 +0000 (15:44 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 14 May 2022 08:52:30 +0000 (08:52 +0000)
As Class 0x1 ROM table, also Class 0x9 ROM tables encodes a flag
for system memory access.

Detect the flag in rtp_cs_component() and dump the same message
for both type of ROM tables.
Extend rtp_read_cs_regs() to read ARM_CS_C9_DEVID.

Change-Id: Ic85d1ea068ed706ceedfd65076ff4c96d04e9792
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6817
Tested-by: jenkins
Reviewed-by: Daniel Goehring <dgoehrin@os.amperecomputing.com>
src/target/arm_adi_v5.c

index 4176dcaddebcd7319c5f7ca307509b23a7da70dc..5c3941b3fe0d19d12961a0530f29a47a3bdcc4bd 100644 (file)
@@ -1099,6 +1099,7 @@ struct cs_component_vals {
        uint64_t pid;
        uint32_t cid;
        uint32_t devarch;
+       uint32_t devid;
        uint32_t devtype_memtype;
 };
 
@@ -1124,13 +1125,16 @@ static int rtp_read_cs_regs(struct adiv5_ap *ap, target_addr_t component_base,
        /* sort by offset to gain speed */
 
        /*
-        * Registers DEVARCH and DEVTYPE are valid on Class 0x9 devices
+        * Registers DEVARCH, DEVID and DEVTYPE are valid on Class 0x9 devices
         * only, but are at offset above 0xf00, so can be read on any device
         * without triggering error. Read them for eventual use on Class 0x9.
         */
        if (retval == ERROR_OK)
                retval = mem_ap_read_u32(ap, component_base + ARM_CS_C9_DEVARCH, &v->devarch);
 
+       if (retval == ERROR_OK)
+               retval = mem_ap_read_u32(ap, component_base + ARM_CS_C9_DEVID, &v->devid);
+
        /* Same address as ARM_CS_C1_MEMTYPE */
        if (retval == ERROR_OK)
                retval = mem_ap_read_u32(ap, component_base + ARM_CS_C9_DEVTYPE, &v->devtype_memtype);
@@ -1609,6 +1613,11 @@ static int rtp_cs_component(struct command_invocation *cmd,
                if ((v.devarch & DEVARCH_ID_MASK) != DEVARCH_ROM_C_0X9)
                        return ERROR_OK;
 
+               if (v.devid & ARM_CS_C9_DEVID_SYSMEM_MASK)
+                       command_print(cmd, "\t\tMEMTYPE system memory present on bus");
+               else
+                       command_print(cmd, "\t\tMEMTYPE system memory not present: dedicated debug bus");
+
                return rtp_rom_loop(cmd, ap, base_address, depth, 512);
        }
 

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)