>
> Committed.
>
> This pulls up verify_captuer_ir one level in the api stack.
>
> -- 
> Øyvind Harboe
> Embedded software and hardware consulting services
> http://consulting.zylin.com
> -------------- next part --------------
> ### Eclipse Workspace Patch 1.0
> #P openocd
> Index: src/target/arm_jtag.h
> ===================================================================
> --- src/target/arm_jtag.h     (revision 1668)
> +++ src/target/arm_jtag.h     (working copy)
> @@ -29,15 +29,15 @@
>  typedef struct arm_jtag_s
>  {
>       jtag_tap_t *tap;
> -     
> +
>       u32 scann_size;
>       u32 scann_instr;
>       u32 cur_scan_chain;
> -     
> +
>       u32 intest_instr;
>  } arm_jtag_t;
>  
> -extern int arm_jtag_set_instr(arm_jtag_t *jtag_info, u32 new_instr, 
> in_handler_t handler);
> +extern int arm_jtag_set_instr(arm_jtag_t *jtag_info, u32 new_instr, void 
> *verify_capture);
>  extern int arm_jtag_scann(arm_jtag_t *jtag_info, u32 new_scan_chain);
>  extern int arm_jtag_setup_connection(arm_jtag_t *jtag_info);
>  
> Index: src/jtag/jtag.h
> ===================================================================
> --- src/jtag/jtag.h   (revision 1664)
> +++ src/jtag/jtag.h   (working copy)
> @@ -559,6 +559,8 @@
>   *
>   */
>  extern void jtag_add_ir_scan(int num_fields, scan_field_t* fields, 
> tap_state_t endstate);
> +/* same as jtag_add_ir_scan except no verify is performed */
> +extern void jtag_add_ir_scan_noverify(int num_fields, scan_field_t *fields, 
> tap_state_t state);
>  extern int  interface_jtag_add_ir_scan(int num_fields, scan_field_t* fields, 
> tap_state_t endstate);
>  extern void jtag_add_dr_scan(int num_fields, scan_field_t* fields, 
> tap_state_t endstate);
>  /* same as jtag_add_dr_scan but the scan is executed immediately. sets 
> jtag_error if there
> @@ -731,7 +733,7 @@
>  /* JTAG support functions */
>  struct invalidstruct
>  {
> -     
> +
>  };
>  
>  extern void           jtag_set_check_value(scan_field_t* field, u8* value, 
> u8* mask, struct invalidstruct *obsolete);
> Index: src/jtag/jtag.c
> ===================================================================
> --- src/jtag/jtag.c   (revision 1664)
> +++ src/jtag/jtag.c   (working copy)
> @@ -521,15 +521,65 @@
>       cmd_queue_cur_state = cmd_queue_end_state;
>  }
>  
> -void jtag_add_ir_scan(int num_fields, scan_field_t *fields, tap_state_t 
> state)
> +void jtag_add_ir_scan_noverify(int num_fields, scan_field_t *fields, 
> tap_state_t state)
>  {
>       int retval;
> -
>       jtag_prelude(state);
>  
>       retval=interface_jtag_add_ir_scan(num_fields, fields, 
> cmd_queue_end_state);
>       if (retval!=ERROR_OK)
>               jtag_error=retval;
> +
> +}
> +
> +
> +void jtag_add_ir_scan(int num_fields, scan_field_t *fields, tap_state_t 
> state)
> +{
> +     /* 8 x 32 bit id's is enough for all invoations */
> +     u32 id[8];
> +     int modified[8];
> +
> +     /* if we are to run a verification of the ir scan, we need to get the 
> input back.
> +      * We may have to allocate space if the caller didn't ask for the input 
> back.
> +      *
> +      */
> +     if (jtag_verify_capture_ir)
> +     {
> +             int j;
> +             for (j = 0; j < num_fields; j++)
> +             {
> +                     modified[j]=0;
> +                     if 
> ((fields[j].in_value==NULL)&&(fields[j].num_bits<=32))
> +                     {
> +                             if (j<8)
> +                             {
> +                                     modified[j]=1;
> +                                     fields[j].in_value=(u8 *)(id+j);
> +                             } else
> +                             {
> +                                     LOG_DEBUG("caller must provide in_value 
> space for verify_capture_ir to work");
> +                             }
> +                     }
> +             }
> +     }
> +
> +     jtag_add_ir_scan_noverify(num_fields, fields, state);
> +
> +     if (jtag_verify_capture_ir)
> +     {
> +             int j;
> +             for (j = 0; j < num_fields; j++)
> +             {
> +                     jtag_tap_t *tap=fields[j].tap;
> +                     jtag_check_value_mask(fields+j, tap->expected, 
> tap->expected_mask);
> +
> +                     if (modified[j])
> +                     {
> +                             fields[j].in_value=NULL;
> +                     }
> +             }
> +     }
> +
>  }
>  
>  int MINIDRIVER(interface_jtag_add_ir_scan)(int num_fields, scan_field_t 
> *fields, tap_state_t state)
> @@ -582,20 +632,6 @@
>                               found = 1;
>                               
> (*last_cmd)->cmd.scan->fields[nth_tap].out_value = 
> buf_cpy(fields[j].out_value, cmd_queue_alloc(CEIL(scan_size, 8)), scan_size);
>  
> -                             if (jtag_verify_capture_ir)
> -                             {
> -                                     if (fields[j].in_handler==NULL)
> -                                     {
> -                                             
> jtag_set_check_value((*last_cmd)->cmd.scan->fields+nth_tap, tap->expected, 
> tap->expected_mask, NULL);
> -                                     } else
> -                                     {
> -                                             
> (*last_cmd)->cmd.scan->fields[nth_tap].in_handler = fields[j].in_handler;
> -                                             
> (*last_cmd)->cmd.scan->fields[nth_tap].in_handler_priv = 
> fields[j].in_handler_priv;
> -                                             
> (*last_cmd)->cmd.scan->fields[nth_tap].in_check_value = tap->expected;
> -                                             
> (*last_cmd)->cmd.scan->fields[nth_tap].in_check_mask = tap->expected_mask;
> -                                     }
> -                             }
> -
>                               tap->bypass = 0;
>                               break;
>                       }
> Index: src/target/arm_jtag.c
> ===================================================================
> --- src/target/arm_jtag.c     (revision 1668)
> +++ src/target/arm_jtag.c     (working copy)
> @@ -36,7 +36,7 @@
>  #define _ARM_JTAG_SCAN_N_CHECK_
>  #endif
>  
> -int arm_jtag_set_instr(arm_jtag_t *jtag_info, u32 new_instr,  in_handler_t 
> handler)
> +int arm_jtag_set_instr(arm_jtag_t *jtag_info, u32 new_instr,  void 
> *no_verify_capture)
>  {
>       jtag_tap_t *tap;
>       tap = jtag_info->tap;
> @@ -52,13 +52,20 @@
>               field.num_bits = tap->ir_length;
>               field.out_value = t;
>               buf_set_u32(field.out_value, 0, field.num_bits, new_instr);
> -
>               field.in_value = NULL;
> +             field.in_handler = NULL;
>  
>  
> -             field.in_handler = handler; /* deprecated! move into calling 
> code */
> -
> -             jtag_add_ir_scan(1, &field, TAP_INVALID);
> +             if (no_verify_capture==NULL)
> +             {
> +                     jtag_add_ir_scan(1, &field, TAP_INVALID);
> +             } else
> +             {
> +                     /* FIX!!!! this is a kludge!!! arm926ejs.c should 
> reimplement this arm_jtag_set_instr to
> +                      * have special verification code.
> +                      */
> +                     jtag_add_ir_scan_noverify(1, &field, TAP_INVALID);
> +             }
>       }
>  
>       return ERROR_OK;


Please STOP immediately to commit code with regression!

It is important to give any CHECK in the JTAG API level .

Instead committing any new code, please make sure to come back to 
in_handler _mask ... concept in the low layer JTAG API.

Regards,
Laurent
  http://www.amontec.com






_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to