]> git.sur5r.net Git - openocd/commitdiff
tap post reset event added. Allows omap3530 to send 100 runtest idle tickle's after...
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 11 Sep 2009 18:34:15 +0000 (18:34 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 11 Sep 2009 18:34:15 +0000 (18:34 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@2696 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/flash/str9xpec.c
src/jtag/core.c
src/jtag/jtag.h
src/jtag/tcl.c
tcl/target/omap3530.cfg

index bca3b88fc6ff769b1dc0c3a1131716094c7678fb..33471e6b3a67c4d054701833d8d173f7e1636920 100644 (file)
@@ -1254,7 +1254,8 @@ static int str9xpec_handle_flash_disable_turbo_command(struct command_context_s
                return ERROR_FAIL;
 
        /* exit turbo mode via RESET */
-       str9xpec_set_instr(tap, ISC_NOOP, TAP_RESET);
+       str9xpec_set_instr(tap, ISC_NOOP, TAP_IDLE);
+       jtag_add_tlr();
        jtag_execute_queue();
 
        /* restore previous scan chain */
index e23cbaa2e19db0f11eaa9730a496b30487e81396..acd84e9a8e7c644826a72eb8fedb423979f291d3 100644 (file)
@@ -62,6 +62,7 @@ static const char *jtag_event_strings[] =
 {
        [JTAG_TRST_ASSERTED] = "JTAG controller reset (TLR or TRST)",
        [JTAG_TAP_EVENT_ENABLE] = "TAP enabled",
+       [JTAG_TAP_EVENT_POST_RESET] = "post reset",
        [JTAG_TAP_EVENT_DISABLE] = "TAP disabled",
 };
 
@@ -339,6 +340,8 @@ void jtag_add_ir_scan_noverify(int in_count, const scan_field_t *in_fields,
 
 void jtag_add_ir_scan(int in_num_fields, scan_field_t *in_fields, tap_state_t state)
 {
+       assert(state != TAP_RESET);
+
        if (jtag_verify && jtag_verify_capture_ir)
        {
                /* 8 x 32 bit id's is enough for all invocations */
@@ -361,6 +364,8 @@ void jtag_add_ir_scan(int in_num_fields, scan_field_t *in_fields, tap_state_t st
 void jtag_add_plain_ir_scan(int in_num_fields, const scan_field_t *in_fields,
                tap_state_t state)
 {
+       assert(state != TAP_RESET);
+
        jtag_prelude(state);
 
        int retval = interface_jtag_add_plain_ir_scan(
@@ -439,6 +444,8 @@ void jtag_add_dr_scan_check(int in_num_fields, scan_field_t *in_fields, tap_stat
 void jtag_add_dr_scan(int in_num_fields, const scan_field_t *in_fields,
                tap_state_t state)
 {
+       assert(state != TAP_RESET);
+       
        jtag_prelude(state);
 
        int retval;
@@ -449,6 +456,8 @@ void jtag_add_dr_scan(int in_num_fields, const scan_field_t *in_fields,
 void jtag_add_plain_dr_scan(int in_num_fields, const scan_field_t *in_fields,
                tap_state_t state)
 {
+       assert(state != TAP_RESET);
+       
        jtag_prelude(state);
 
        int retval;
@@ -460,6 +469,8 @@ void jtag_add_dr_out(jtag_tap_t* tap,
                int num_fields, const int* num_bits, const uint32_t* value,
                tap_state_t end_state)
 {
+       assert(end_state != TAP_RESET);
+       
        assert(end_state != TAP_INVALID);
 
        cmd_queue_cur_state = end_state;
@@ -473,6 +484,9 @@ void jtag_add_tlr(void)
 {
        jtag_prelude(TAP_RESET);
        jtag_set_error(interface_jtag_add_tlr());
+
+       jtag_notify_reset();
+
        jtag_call_event_callbacks(JTAG_TRST_ASSERTED);
 }
 
@@ -683,6 +697,8 @@ void jtag_add_reset(int req_tlr_or_trst, int req_srst)
                        LOG_DEBUG("TRST line released");
                        if (jtag_ntrst_delay)
                                jtag_add_sleep(jtag_ntrst_delay * 1000);
+
+                       jtag_notify_reset();
                }
        }
 }
@@ -851,7 +867,8 @@ static int jtag_examine_chain_execute(uint8_t *idcode_buffer, unsigned num_idcod
        for (unsigned i = 0; i < JTAG_MAX_CHAIN_SIZE; i++)
                buf_set_u32(idcode_buffer, i * 32, 32, 0x000000FF);
 
-       jtag_add_plain_dr_scan(1, &field, TAP_RESET);
+       jtag_add_plain_dr_scan(1, &field, TAP_DRPAUSE);
+       jtag_add_tlr();
        return jtag_execute_queue();
 }
 
@@ -1065,7 +1082,9 @@ int jtag_validate_chain(void)
        field.in_value = ir_test;
 
 
-       jtag_add_plain_ir_scan(1, &field, TAP_RESET);
+       jtag_add_plain_ir_scan(1, &field, TAP_IRPAUSE);
+       jtag_add_tlr();
+
        int retval;
        retval = jtag_execute_queue();
        if (retval != ERROR_OK)
index 3e3686b852ea47c300a75a15a57f39bff3e7c1d1..b7bfd4cc9d4b3211061c0e0eba96eccf877bf147 100644 (file)
@@ -208,6 +208,7 @@ enum jtag_event {
        JTAG_TRST_ASSERTED,
        JTAG_TAP_EVENT_ENABLE,
        JTAG_TAP_EVENT_DISABLE,
+       JTAG_TAP_EVENT_POST_RESET,
 };
 
 struct jtag_tap_event_action_s
@@ -635,6 +636,9 @@ extern void jtag_execute_queue_noclear(void);
 /// @returns the number of times the scan queue has been flushed
 int jtag_get_flush_queue_count(void);
 
+/// Notify all TAP's about a TLR reset
+void jtag_notify_reset(void);
+
 
 /* can be implemented by hw + sw */
 extern int jtag_power_dropout(int* dropout);
index f81b68296686e648973546af36bdead73f7b0d61..e6928a2bfaa6b798d18f09c4830480d6fd631398 100644 (file)
@@ -41,6 +41,7 @@
 #endif
 
 static const Jim_Nvp nvp_jtag_tap_event[] = {
+       { .value = JTAG_TAP_EVENT_POST_RESET,   .name = "post-reset" },
        { .value = JTAG_TAP_EVENT_ENABLE,       .name = "tap-enable" },
        { .value = JTAG_TAP_EVENT_DISABLE,      .name = "tap-disable" },
 
@@ -583,6 +584,17 @@ static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
        return JIM_ERR;
 }
 
+
+void jtag_notify_reset(void)
+{
+       jtag_tap_t *tap;
+       for (tap = jtag_all_taps(); tap; tap = tap->next_tap)
+       {
+               jtag_tap_handle_event(tap, JTAG_TAP_EVENT_POST_RESET);
+       }
+}
+
+
 int jtag_register_commands(struct command_context_s *cmd_ctx)
 {
        register_jim(cmd_ctx, "jtag", jim_jtag_command, "perform jtag tap actions");
index 22328a2182f6c11114b8ad01249270035d24cf11..50a3f473424632b3425ae9bd71c22e6823992f23 100644 (file)
@@ -34,6 +34,8 @@ if { [info exists JRC_TAPID ] } {
 jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f \
        -expected-id $_JRC_TAPID
 
+jtag configure $_CHIPNAME.jrc -event post-reset "runtest 100"
+
 # GDB target:  Cortex-A8, using DAP
 target create omap3.cpu cortex_a8 -chain-position $_CHIPNAME.dap