Browse Source

hosted/bmp_remote: Implemented support for the new remote protocol target clock tristating

pull/1108/merge
dragonmux 2 years ago
committed by Piotr Esden-Tempski
parent
commit
450581cc0a
  1. 11
      src/platforms/hosted/bmp_remote.c
  2. 14
      src/platforms/hosted/bmp_remote.h

11
src/platforms/hosted/bmp_remote.c

@ -180,6 +180,17 @@ const char *remote_target_voltage(void)
return (char *)&construct[1]; return (char *)&construct[1];
} }
void remote_target_clk_output_enable(const bool enable)
{
char buffer[REMOTE_MAX_MSG_SIZE];
int length = snprintf(buffer, REMOTE_MAX_MSG_SIZE, REMOTE_TARGET_CLK_OE_STR, enable ? '1' : '0');
platform_buffer_write((uint8_t *)buffer, length);
length = platform_buffer_read((uint8_t *)buffer, REMOTE_MAX_MSG_SIZE);
if (length < 1 || buffer[0] == REMOTE_RESP_ERR)
DEBUG_WARN("remote_target_clk_output_enable failed, error %s\n", length ? buffer + 1 : "unknown");
}
static uint32_t remote_adiv5_dp_read(ADIv5_DP_t *dp, uint16_t addr) static uint32_t remote_adiv5_dp_read(ADIv5_DP_t *dp, uint16_t addr)
{ {
(void)dp; (void)dp;

14
src/platforms/hosted/bmp_remote.h

@ -16,8 +16,9 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#if !defined(__BMP_REMOTE_H_) #ifndef __BMP_REMOTE_H_
#define __BMP_REMOTE_H_ #define __BMP_REMOTE_H_
#include "jtagtap.h" #include "jtagtap.h"
#include "adiv5.h" #include "adiv5.h"
#include "target.h" #include "target.h"
@ -33,13 +34,14 @@ int remote_swdptap_init(ADIv5_DP_t *dp);
int remote_jtagtap_init(jtag_proc_t *jtag_proc); int remote_jtagtap_init(jtag_proc_t *jtag_proc);
bool remote_target_get_power(void); bool remote_target_get_power(void);
const char *remote_target_voltage(void); const char *remote_target_voltage(void);
bool remote_target_set_power(const bool power); bool remote_target_set_power(bool power);
void remote_nrst_set_val(bool assert); void remote_nrst_set_val(bool assert);
bool remote_nrst_get_val(void); bool remote_nrst_get_val(void);
void remote_max_frequency_set(uint32_t freq); void remote_max_frequency_set(uint32_t freq);
uint32_t remote_max_frequency_get(void); uint32_t remote_max_frequency_get(void);
const char *platform_target_voltage(void); void remote_target_clk_output_enable(bool enable);
void remote_adiv5_dp_defaults(ADIv5_DP_t *dp); void remote_adiv5_dp_defaults(ADIv5_DP_t *dp);
void remote_add_jtag_dev(uint32_t i, const jtag_dev_t *jtag_dev); void remote_add_jtag_dev(uint32_t i, const jtag_dev_t *jtag_dev);
#define __BMP_REMOTE_H_
#endif #endif /*__BMP_REMOTE_H_*/

Loading…
Cancel
Save