arm_adi_v5: describe Class 0x9 Device Architecture register 63/6463/5
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 16 Aug 2021 13:24:52 +0000 (15:24 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 14 May 2022 08:43:51 +0000 (08:43 +0000)
Use the list of values from ARM IHI0029E to decode and print the
Device Architecture register.
Add attribute 'unused' to the function, not used yet.

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

index 2848671db5efc028934881d4c5216d744aef0674..d886a765f92420672cd5d7c547417715adc93ca5 100644 (file)
@@ -893,6 +893,55 @@ static const char *class_description[16] = {
        [0xF] = "CoreLink, PrimeCell or System component",
 };
 
        [0xF] = "CoreLink, PrimeCell or System component",
 };
 
+#define ARCH_ID(architect, archid) ( \
+       (((architect) << ARM_CS_C9_DEVARCH_ARCHITECT_SHIFT) & ARM_CS_C9_DEVARCH_ARCHITECT_MASK) | \
+       (((archid) << ARM_CS_C9_DEVARCH_ARCHID_SHIFT) & ARM_CS_C9_DEVARCH_ARCHID_MASK) \
+)
+
+static const struct {
+       uint32_t arch_id;
+       const char *description;
+} class0x9_devarch[] = {
+       /* keep same unsorted order as in ARM IHI0029E */
+       { ARCH_ID(ARM_ID, 0x0A00), "RAS architecture" },
+       { ARCH_ID(ARM_ID, 0x1A01), "Instrumentation Trace Macrocell (ITM) architecture" },
+       { ARCH_ID(ARM_ID, 0x1A02), "DWT architecture" },
+       { ARCH_ID(ARM_ID, 0x1A03), "Flash Patch and Breakpoint unit (FPB) architecture" },
+       { ARCH_ID(ARM_ID, 0x2A04), "Processor debug architecture (ARMv8-M)" },
+       { ARCH_ID(ARM_ID, 0x6A05), "Processor debug architecture (ARMv8-R)" },
+       { ARCH_ID(ARM_ID, 0x0A10), "PC sample-based profiling" },
+       { ARCH_ID(ARM_ID, 0x4A13), "Embedded Trace Macrocell (ETM) architecture" },
+       { ARCH_ID(ARM_ID, 0x1A14), "Cross Trigger Interface (CTI) architecture" },
+       { ARCH_ID(ARM_ID, 0x6A15), "Processor debug architecture (v8.0-A)" },
+       { ARCH_ID(ARM_ID, 0x7A15), "Processor debug architecture (v8.1-A)" },
+       { ARCH_ID(ARM_ID, 0x8A15), "Processor debug architecture (v8.2-A)" },
+       { ARCH_ID(ARM_ID, 0x2A16), "Processor Performance Monitor (PMU) architecture" },
+       { ARCH_ID(ARM_ID, 0x0A17), "Memory Access Port v2 architecture" },
+       { ARCH_ID(ARM_ID, 0x0A27), "JTAG Access Port v2 architecture" },
+       { ARCH_ID(ARM_ID, 0x0A31), "Basic trace router" },
+       { ARCH_ID(ARM_ID, 0x0A37), "Power requestor" },
+       { ARCH_ID(ARM_ID, 0x0A47), "Unknown Access Port v2 architecture" },
+       { ARCH_ID(ARM_ID, 0x0A50), "HSSTP architecture" },
+       { ARCH_ID(ARM_ID, 0x0A63), "System Trace Macrocell (STM) architecture" },
+       { ARCH_ID(ARM_ID, 0x0A75), "CoreSight ELA architecture" },
+       { ARCH_ID(ARM_ID, 0x0AF7), "CoreSight ROM architecture" },
+};
+
+#define DEVARCH_ID_MASK         (ARM_CS_C9_DEVARCH_ARCHITECT_MASK | ARM_CS_C9_DEVARCH_ARCHID_MASK)
+
+__attribute__((unused))
+static const char *class0x9_devarch_description(uint32_t devarch)
+{
+       if (!(devarch & ARM_CS_C9_DEVARCH_PRESENT))
+               return "not present";
+
+       for (unsigned int i = 0; i < ARRAY_SIZE(class0x9_devarch); i++)
+               if ((devarch & DEVARCH_ID_MASK) == class0x9_devarch[i].arch_id)
+                       return class0x9_devarch[i].description;
+
+       return "unknown";
+}
+
 static const struct {
        enum ap_type type;
        const char *description;
 static const struct {
        enum ap_type type;
        const char *description;

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)