comparison rvinterf/etmsync/memops.c @ 912:f50c71442d50

etmsync: die ID read implemented
author Space Falcon <falcon@ivan.Harhan.ORG>
date Tue, 08 Sep 2015 08:18:42 +0000
parents 42719fa3e6af
children 38c7078712ab
comparison
equal deleted inserted replaced
911:42719fa3e6af 912:f50c71442d50
52 return(ERROR_TARGET); 52 return(ERROR_TARGET);
53 } 53 }
54 bcopy(rvi_msg + 6, databuf, nbytes); 54 bcopy(rvi_msg + 6, databuf, nbytes);
55 return(0); 55 return(0);
56 } 56 }
57
58 do_dieid_read(databuf)
59 u_char *databuf;
60 {
61 u_char cmdpkt[4];
62 int rc;
63
64 cmdpkt[1] = ETM_CORE;
65 cmdpkt[2] = TMCORE_OPC_DIEID;
66 rc = etm_pkt_exch(cmdpkt, 2);
67 if (rc)
68 return(rc);
69 if (rvi_msg[3]) {
70 printf("ETM error response to die ID read request: 0x%02X\n",
71 rvi_msg[3]);
72 return(ERROR_TARGET);
73 }
74 if (rvi_msg_len != 14) {
75 printf("error: die ID read response has wrong length\n");
76 return(ERROR_TARGET);
77 }
78 if (rvi_msg[4] != TMCORE_OPC_DIEID) {
79 printf("error: die ID read response has wrong opcode\n");
80 return(ERROR_TARGET);
81 }
82 bcopy(rvi_msg + 5, databuf, 8);
83 return(0);
84 }