comparison rvinterf/tmsh/tmcore.c @ 811:4c7f3778dc24

fc-tmsh: add simple commands carried via ETM debug opcode
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 10 May 2021 00:59:15 +0000
parents 2159f260ed13
children
comparison
equal deleted inserted replaced
810:c535e7438c25 811:4c7f3778dc24
149 return; 149 return;
150 } 150 }
151 sprintf(buf, "version resp: %02X%02X%02X%02X", rvi_msg[8], rvi_msg[7], 151 sprintf(buf, "version resp: %02X%02X%02X%02X", rvi_msg[8], rvi_msg[7],
152 rvi_msg[6], rvi_msg[5]); 152 rvi_msg[6], rvi_msg[5]);
153 async_msg_output(buf); 153 async_msg_output(buf);
154 }
155
156 static void
157 etm_debug_response()
158 {
159 char buf[80];
160
161 if (rvi_msg[3]) {
162 print_etm_pkt_raw("ETM debug command error");
163 return;
164 }
165 switch (rvi_msg_len) {
166 case 6:
167 async_msg_output("ETM debug command successful");
168 return;
169 case 10:
170 sprintf(buf, "ETM debug command response: %02X%02X%02X%02X",
171 rvi_msg[8], rvi_msg[7], rvi_msg[6], rvi_msg[5]);
172 async_msg_output(buf);
173 return;
174 default:
175 print_etm_pkt_raw("ETM debug response wrong length");
176 }
154 } 177 }
155 178
156 void 179 void
157 tmcore_msg_rx() 180 tmcore_msg_rx()
158 { 181 {
187 abbw_response(); 210 abbw_response();
188 return; 211 return;
189 case TMCORE_OPC_DIEID: 212 case TMCORE_OPC_DIEID:
190 dieid_response(); 213 dieid_response();
191 return; 214 return;
215 case TMCORE_OPC_DEBUG:
216 etm_debug_response();
217 return;
192 default: 218 default:
193 unknown: 219 unknown:
194 print_etm_pkt_raw("ETM_CORE resp"); 220 print_etm_pkt_raw("ETM_CORE resp");
195 } 221 }
196 } 222 }
445 cmdpkt[5] = arg >> 16; 471 cmdpkt[5] = arg >> 16;
446 cmdpkt[6] = arg >> 24; 472 cmdpkt[6] = arg >> 24;
447 send_etm_cmd(cmdpkt, 6); 473 send_etm_cmd(cmdpkt, 6);
448 return(0); 474 return(0);
449 } 475 }
476
477 cmd_rvf_dump(argc, argv)
478 char **argv;
479 {
480 u_char cmdpkt[5];
481
482 cmdpkt[1] = ETM_CORE;
483 cmdpkt[2] = TMCORE_OPC_DEBUG;
484 cmdpkt[3] = TMDBG_OPC_RVF_DUMP;
485 send_etm_cmd(cmdpkt, 3);
486 return(0);
487 }
488
489 /* the following commands are FreeCalypso additions */
490
491 cmd_pwr_key(argc, argv)
492 char **argv;
493 {
494 u_char cmdpkt[5];
495
496 cmdpkt[1] = ETM_CORE;
497 cmdpkt[2] = TMCORE_OPC_DEBUG;
498 cmdpkt[3] = TMDBG_OPC_PWR_CYCLE;
499 send_etm_cmd(cmdpkt, 3);
500 return(0);
501 }
502
503 cmd_phone_on(argc, argv)
504 char **argv;
505 {
506 u_char cmdpkt[5];
507
508 cmdpkt[1] = ETM_CORE;
509 cmdpkt[2] = TMCORE_OPC_DEBUG;
510 cmdpkt[3] = TMDBG_OPC_PHONE_ON;
511 send_etm_cmd(cmdpkt, 3);
512 return(0);
513 }