Jonas Hörberg wrote on 2009-08-10 13:28:27:

> 
> Hi, 
> 
> The jtag_rclk command should fallback to a fixed frequency for 
> interfaces without support for RCLK. 
> This is not the present behavior when the command is called in the 
> configuration stage (running board config files). 
> The reason is that the interface can not be checked for RCLK support
> before it is initialized. 
> The kHz to speed value calculation is also done before the interface
> is initialized. This will result in the wrong speed 
> setting when the calculation is dependent on data initialized by the
> init function of the interface. 
> Example: ft2232_max_tck for  FT2232H and FT4232H based interfaces. 
> 
> The attached patch contains an attempt to fix these issues by 
> placing the config state speed setting after 
> the initialization of the interface. 
> 
> Best regards
> Jonas Hörberg 
> _______________________________________________
> Openocd-development mailing list
> Openocd-development@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/openocd-development

Attached is an new patch that replace the previous one that had
some problems.
* I was not aware of that some interfaces operate on the JTAG
  bus in the initialization routine (the j-link issue a TLR).
  The clock must be configured by the initialization routine
  before the operation in this case.
* The interface initialization functions is expected to configure
  the clock speed by using the return value from a call to the
  jtag_get_speed function (although this convention is not followed
  by some of the interfaces, examples: arm-jtag-ew.c and vsllink.c).

This patch changes the jtag_get_speed function. Previously it
only returned the value set by the latest call to jtag_set_speed.
Now it calculate the speed value based on the latest speed, khz
or rclk setting. The correct value will now be returned when it
is called from the interface initialization function.

The name of the jtag_set_speed function is changed to
jtag_config_speed to be aligned with jtag_config_khz and
jtag_config_rclk.

The global jtag_set_khz function is merged into jtag_khz_to_speed
because external access do not seem to be sane.

Best regards
Jonas Hörberg

 

Attachment: rclk.patch
Description: Binary data

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to