]> git.sur5r.net Git - openocd/commitdiff
mips: Added #define for scan_delay legacy mode default value
authorKent Brinkley <jkbrinkley.imgtec@gmail.com>
Tue, 21 Oct 2014 14:46:30 +0000 (07:46 -0700)
committerSpencer Oliver <spen@spen-soft.co.uk>
Tue, 4 Oct 2016 10:41:34 +0000 (11:41 +0100)
Believe in using defines to make maintenance easier.

Change-Id: I8edf151352131bbf2b884dfcd67ca5764b11b13c
Signed-off-by: Kent Brinkley <jkbrinkley.imgtec@gmail.com>
Reviewed-on: http://openocd.zylin.com/2350
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
src/target/mips32.c
src/target/mips32.h
src/target/mips_m4k.c

index 329244655c75ad35fb22a254e47087038d52c429..8c77986496fc4554586837fa3be23ad3fe4f1533 100644 (file)
@@ -384,7 +384,7 @@ int mips32_init_arch_info(struct target *target, struct mips32_common *mips32, s
        mips32->read_core_reg = mips32_read_core_reg;
        mips32->write_core_reg = mips32_write_core_reg;
 
-       mips32->ejtag_info.scan_delay = 2000000;        /* Initial default value */
+       mips32->ejtag_info.scan_delay = MIPS32_SCAN_DELAY_LEGACY_MODE;  /* Initial default value */
        mips32->ejtag_info.mode = 0;                    /* Initial default value */
 
        return ERROR_OK;
@@ -911,7 +911,7 @@ COMMAND_HANDLER(mips32_handle_scan_delay_command)
                        return ERROR_COMMAND_SYNTAX_ERROR;
 
        command_print(CMD_CTX, "scan delay: %d nsec", ejtag_info->scan_delay);
-       if (ejtag_info->scan_delay >= 2000000) {
+       if (ejtag_info->scan_delay >= MIPS32_SCAN_DELAY_LEGACY_MODE) {
                ejtag_info->mode = 0;
                command_print(CMD_CTX, "running in legacy mode");
        } else {
index bfd2cf56e7c29b1849a97377bbb92e2250386ba3..8362f5e6b1323dee77d6d16427f398dbe508df06 100644 (file)
@@ -61,6 +61,8 @@
 #define MIPS32_ARCH_REL1 0x0
 #define MIPS32_ARCH_REL2 0x1
 
+#define MIPS32_SCAN_DELAY_LEGACY_MODE 2000000
+
 /* offsets into mips32 core register cache */
 enum {
        MIPS32_PC = 37,
index 0daa71c52d8c4cd7c864b206fbfec42b64c4c232..db69b95b162b2dd261c2705609b85f599de9eb32 100644 (file)
@@ -1339,7 +1339,7 @@ COMMAND_HANDLER(mips_m4k_handle_scan_delay_command)
                        return ERROR_COMMAND_SYNTAX_ERROR;
 
        command_print(CMD_CTX, "scan delay: %d nsec", ejtag_info->scan_delay);
-       if (ejtag_info->scan_delay >= 2000000) {
+       if (ejtag_info->scan_delay >= MIPS32_SCAN_DELAY_LEGACY_MODE) {
                ejtag_info->mode = 0;
                command_print(CMD_CTX, "running in legacy mode");
        } else {