nds32: modify nds commands implementation 79/1579/7
authorHsiangkai Wang <hsiangkai@gmail.com>
Fri, 31 May 2013 03:45:17 +0000 (11:45 +0800)
committerSpencer Oliver <spen@spen-soft.co.uk>
Fri, 13 Sep 2013 19:37:49 +0000 (19:37 +0000)
Modify handle_nds32_memory_access_command: do not use DCache
setting to block user's setting.

Change-Id: I2d33f893773e2a2e3e2f26edde5938ef5902609d
Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com>
Reviewed-on: http://openocd.zylin.com/1579
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/target/nds32_cmd.c

index 3f243700f0cedaee746fb821c73b80e68bab827d..08923643c3c1bd5da5ef9ae9152181b5e5b85bff 100644 (file)
@@ -69,6 +69,7 @@ COMMAND_HANDLER(handle_nds32_memory_access_command)
        struct target *target = get_current_target(CMD_CTX);
        struct nds32 *nds32 = target_to_nds32(target);
        struct aice_port_s *aice = target_to_aice(target);
+       struct nds32_memory *memory = &(nds32->memory);
 
        if (!is_nds32(nds32)) {
                command_print(CMD_CTX, "current target isn't an Andes core");
@@ -76,33 +77,22 @@ COMMAND_HANDLER(handle_nds32_memory_access_command)
        }
 
        if (CMD_ARGC > 0) {
-
-               /* If target has no cache, always use BUS mode
-                * to access memory. */
-               struct nds32_memory *memory = &(nds32->memory);
-
-               if (memory->dcache.line_size == 0) {
-                       /* There is no Dcache. */
-                       nds32->memory.access_channel = NDS_MEMORY_ACC_BUS;
-               } else if (memory->dcache.enable == false) {
-                       /* Dcache is disabled. */
-                       nds32->memory.access_channel = NDS_MEMORY_ACC_BUS;
-               } else {
-                       /* There is Dcache and Dcache is enabled. */
-                       if (strcmp(CMD_ARGV[0], "bus") == 0)
-                               nds32->memory.access_channel = NDS_MEMORY_ACC_BUS;
-                       else if (strcmp(CMD_ARGV[0], "cpu") == 0)
-                               nds32->memory.access_channel = NDS_MEMORY_ACC_CPU;
-                       else /* default access channel is NDS_MEMORY_ACC_CPU */
-                               nds32->memory.access_channel = NDS_MEMORY_ACC_CPU;
-               }
-
-               aice_memory_access(aice, nds32->memory.access_channel);
+               if (strcmp(CMD_ARGV[0], "bus") == 0)
+                       memory->access_channel = NDS_MEMORY_ACC_BUS;
+               else if (strcmp(CMD_ARGV[0], "cpu") == 0)
+                       memory->access_channel = NDS_MEMORY_ACC_CPU;
+               else /* default access channel is NDS_MEMORY_ACC_CPU */
+                       memory->access_channel = NDS_MEMORY_ACC_CPU;
+
+               LOG_DEBUG("memory access channel is changed to %s",
+                               NDS_MEMORY_ACCESS_NAME[memory->access_channel]);
+
+               aice_memory_access(aice, memory->access_channel);
+       } else {
+               command_print(CMD_CTX, "memory access channel: %s",
+                               NDS_MEMORY_ACCESS_NAME[memory->access_channel]);
        }
 
-       command_print(CMD_CTX, "memory access channel: %s",
-                       NDS_MEMORY_ACCESS_NAME[nds32->memory.access_channel]);
-
        return ERROR_OK;
 }
 

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)