remote: Implemented support for using the new jtagtap_cycle call
This commit is contained in:
parent
1b39173780
commit
2bfd84d1b2
15
src/remote.c
15
src/remote.c
|
@ -184,7 +184,7 @@ static void remotePacketProcessJTAG(unsigned i, char *packet)
|
||||||
{
|
{
|
||||||
uint32_t MS;
|
uint32_t MS;
|
||||||
uint64_t DO;
|
uint64_t DO;
|
||||||
uint8_t ticks;
|
size_t ticks;
|
||||||
uint64_t DI;
|
uint64_t DI;
|
||||||
jtag_dev_t jtag_dev;
|
jtag_dev_t jtag_dev;
|
||||||
switch (packet[1]) {
|
switch (packet[1]) {
|
||||||
|
@ -213,6 +213,15 @@ static void remotePacketProcessJTAG(unsigned i, char *packet)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case REMOTE_CYCLE: { /* JC = clock cycle ============================ */
|
||||||
|
ticks = remotehston(8, &packet[4]);
|
||||||
|
const bool tms = packet[2] != '0';
|
||||||
|
const bool tdi = packet[3] != '0';
|
||||||
|
jtag_proc.jtagtap_cycle(tms, tdi, ticks);
|
||||||
|
remote_respond(REMOTE_RESP_OK, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case REMOTE_TDITDO_TMS: /* JD = TDI/TDO ========================================= */
|
case REMOTE_TDITDO_TMS: /* JD = TDI/TDO ========================================= */
|
||||||
case REMOTE_TDITDO_NOTMS:
|
case REMOTE_TDITDO_NOTMS:
|
||||||
|
|
||||||
|
@ -235,8 +244,8 @@ static void remotePacketProcessJTAG(unsigned i, char *packet)
|
||||||
if (i != 4)
|
if (i != 4)
|
||||||
remote_respond(REMOTE_RESP_ERR, REMOTE_ERROR_WRONGLEN);
|
remote_respond(REMOTE_RESP_ERR, REMOTE_ERROR_WRONGLEN);
|
||||||
else {
|
else {
|
||||||
uint32_t dat = jtag_proc.jtagtap_next(packet[2] == '1', packet[3] == '1');
|
const bool tdo = jtag_proc.jtagtap_next(packet[2] == '1', packet[3] == '1');
|
||||||
remote_respond(REMOTE_RESP_OK, dat);
|
remote_respond(REMOTE_RESP_OK, tdo ? 1U : 0U);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
|
|
||||||
#define REMOTE_HL_VERSION 1
|
#define REMOTE_HL_VERSION 2
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Commands to remote end, and responses
|
* Commands to remote end, and responses
|
||||||
|
@ -65,6 +65,7 @@
|
||||||
#define REMOTE_START 'A'
|
#define REMOTE_START 'A'
|
||||||
#define REMOTE_TDITDO_TMS 'D'
|
#define REMOTE_TDITDO_TMS 'D'
|
||||||
#define REMOTE_TDITDO_NOTMS 'd'
|
#define REMOTE_TDITDO_NOTMS 'd'
|
||||||
|
#define REMOTE_CYCLE 'c'
|
||||||
#define REMOTE_IN_PAR 'I'
|
#define REMOTE_IN_PAR 'I'
|
||||||
#define REMOTE_FREQ_SET 'F'
|
#define REMOTE_FREQ_SET 'F'
|
||||||
#define REMOTE_FREQ_GET 'f'
|
#define REMOTE_FREQ_GET 'f'
|
||||||
|
@ -142,6 +143,9 @@
|
||||||
#define REMOTE_JTAG_TDIDO_STR (char []){ REMOTE_SOM, REMOTE_JTAG_PACKET, '%', 'c', \
|
#define REMOTE_JTAG_TDIDO_STR (char []){ REMOTE_SOM, REMOTE_JTAG_PACKET, '%', 'c', \
|
||||||
'%','0','2','x','%','l', 'x', REMOTE_EOM, 0 }
|
'%','0','2','x','%','l', 'x', REMOTE_EOM, 0 }
|
||||||
|
|
||||||
|
#define REMOTE_JTAG_CYCLE_STR (char []){ REMOTE_SOM, REMOTE_JTAG_PACKET, REMOTE_CYCLE, '%', 'u', '%', 'u', \
|
||||||
|
'%', '0', '8', 'x', REMOTE_EOM, 0 }
|
||||||
|
|
||||||
#define REMOTE_JTAG_NEXT (char []){ REMOTE_SOM, REMOTE_JTAG_PACKET, REMOTE_NEXT, \
|
#define REMOTE_JTAG_NEXT (char []){ REMOTE_SOM, REMOTE_JTAG_PACKET, REMOTE_NEXT, \
|
||||||
'%','c','%','c',REMOTE_EOM, 0 }
|
'%','c','%','c',REMOTE_EOM, 0 }
|
||||||
/* HL protocol elements */
|
/* HL protocol elements */
|
||||||
|
|
Loading…
Reference in New Issue