arm11: improve performance using minidriver hook
authorØyvind Harboe <oyvind.harboe@zylin.com>
Tue, 9 Feb 2010 13:26:57 +0000 (14:26 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Mon, 22 Feb 2010 09:15:51 +0000 (10:15 +0100)
zy1000 performance for GDB load went from 100kBytes/s
to 300kBytes/s @ 8 MHz by implementing the inner loop
of unack arm11 memory writes directly on top of the hw
fifo.

Profiling info:

 78.57      0.77     0.77                             arm11_run_instr_data_to_core_noack_inner
  5.10      0.82     0.05                             memcpy
  4.08      0.86     0.04                             jtag_tap_next_enabled
  3.06      0.89     0.03                             gdb_input

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
src/jtag/zy1000/zy1000.c

index da5aa3665edad6d385bf51e495f1c490a9a27f9c..d920c30b29ca95aee3d7cecd917dd7cb1deef6a3 100644 (file)
@@ -845,11 +845,73 @@ void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, uint8_t *buffer,
 }
 
 
-int arm11_run_instr_data_to_core_noack_inner_default(struct arm11_common * arm11, uint32_t opcode, uint32_t * data, size_t count);
 
-int arm11_run_instr_data_to_core_noack_inner(struct arm11_common * arm11, uint32_t opcode, uint32_t * data, size_t count)
+int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap * tap, uint32_t opcode, uint32_t * data, size_t count)
 {
-       return arm11_run_instr_data_to_core_noack_inner_default(arm11, opcode, data, count);
+#if 0
+       int arm11_run_instr_data_to_core_noack_inner_default(struct jtag_tap * tap, uint32_t opcode, uint32_t * data, size_t count);
+       return arm11_run_instr_data_to_core_noack_inner_default(tap, opcode, data, count);
+#else
+       static const int bits[] = {32, 2};
+       uint32_t values[] = {0, 0};
+
+       /* FIX!!!!!! the target_write_memory() API started this nasty problem
+        * with unaligned uint32_t * pointers... */
+       const uint8_t *t = (const uint8_t *)data;
+
+       while (count--)
+       {
+               values[0] = *t++;
+               values[0] |= (*t++<<8);
+               values[0] |= (*t++<<16);
+               values[0] |= (*t++<<24);
+
+               if (count > 0)
+               {
+                       jtag_add_dr_out(tap,
+                               2,
+                               bits,
+                               values,
+                               TAP_DRPAUSE);
+
+#if 1
+                       /* copy & paste from arm11_dbgtap.c */
+                       //TAP_DREXIT2, TAP_DRUPDATE, TAP_IDLE, TAP_IDLE, TAP_IDLE, TAP_DRSELECT, TAP_DRCAPTURE, TAP_DRSHIFT
+
+                       waitIdle();
+                       ZY1000_POKE(ZY1000_JTAG_BASE + 0x28, 1);
+                       ZY1000_POKE(ZY1000_JTAG_BASE + 0x28, 1);
+                       ZY1000_POKE(ZY1000_JTAG_BASE + 0x28, 0);
+                       ZY1000_POKE(ZY1000_JTAG_BASE + 0x28, 0);
+                       ZY1000_POKE(ZY1000_JTAG_BASE + 0x28, 0);
+                       ZY1000_POKE(ZY1000_JTAG_BASE + 0x28, 1);
+                       ZY1000_POKE(ZY1000_JTAG_BASE + 0x28, 0);
+                       ZY1000_POKE(ZY1000_JTAG_BASE + 0x28, 0);
+                       waitIdle();
+                       ZY1000_POKE(ZY1000_JTAG_BASE + 0x20, TAP_DRSHIFT);
+#else
+                       static const tap_state_t arm11_MOVE_DRPAUSE_IDLE_DRPAUSE_with_delay[] =
+                       {
+                               TAP_DREXIT2, TAP_DRUPDATE, TAP_IDLE, TAP_IDLE, TAP_IDLE, TAP_DRSELECT, TAP_DRCAPTURE, TAP_DRSHIFT
+                       };
+
+                       jtag_add_pathmove(ARRAY_SIZE(arm11_MOVE_DRPAUSE_IDLE_DRPAUSE_with_delay),
+                               arm11_MOVE_DRPAUSE_IDLE_DRPAUSE_with_delay);
+#endif
+               } else
+               {
+                       /* This will happen on the last iteration updating the current tap state
+                        * so we don't have to track it during the common code path */
+                       jtag_add_dr_out(tap,
+                               2,
+                               bits,
+                               values,
+                               TAP_IDLE);
+               }
+       }
+
+       return jtag_execute_queue();
+#endif
 }
 
 

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)