changeset 113:816d91739a32

fc-tmsh: rfe, scw, scr and sr commands implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 16 Jan 2017 19:30:40 +0000
parents 2825d79bb151
children eb54195fded6
files rvinterf/tmsh/l1cmd.c rvinterf/tmsh/usercmd.c
diffstat 2 files changed, 70 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/tmsh/l1cmd.c	Mon Jan 16 18:44:24 2017 +0000
+++ b/rvinterf/tmsh/l1cmd.c	Mon Jan 16 19:30:40 2017 +0000
@@ -52,3 +52,65 @@
 	send_etm_cmd(cmdpkt, 3);
 	return(0);
 }
+
+cmd_rfe(argc, argv)
+	char **argv;
+{
+	u16 arg;
+	u_char cmdpkt[5];
+
+	arg = strtoul(argv[1], 0, 0);
+	cmdpkt[1] = RF_ENABLE;
+	cmdpkt[2] = arg;
+	cmdpkt[3] = arg >> 8;
+	send_etm_cmd(cmdpkt, 3);
+	return(0);
+}
+
+cmd_scw(argc, argv)
+	char **argv;
+{
+	u16 index, value;
+	u_char cmdpkt[7];
+
+	index = strtoul(argv[1], 0, 0);
+	value = strtoul(argv[2], 0, 0);
+	cmdpkt[1] = STATS_CONFIG_WRITE;
+	cmdpkt[2] = index;
+	cmdpkt[3] = index >> 8;
+	cmdpkt[4] = value;
+	cmdpkt[5] = value >> 8;
+	send_etm_cmd(cmdpkt, 5);
+	return(0);
+}
+
+cmd_scr(argc, argv)
+	char **argv;
+{
+	u16 index;
+	u_char cmdpkt[5];
+
+	index = strtoul(argv[1], 0, 0);
+	cmdpkt[1] = STATS_CONFIG_READ;
+	cmdpkt[2] = index;
+	cmdpkt[3] = index >> 8;
+	send_etm_cmd(cmdpkt, 3);
+	return(0);
+}
+
+cmd_sr(argc, argv)
+	char **argv;
+{
+	u16 type, bitmask;
+	u_char cmdpkt[7];
+
+	type = strtoul(argv[1], 0, 0);
+	bitmask = strtoul(argv[2], 0, 16);
+	cmdpkt[1] = STATS_READ;
+	cmdpkt[2] = type;
+	cmdpkt[3] = type >> 8;
+	cmdpkt[4] = bitmask;
+	cmdpkt[5] = bitmask >> 8;
+	send_etm_cmd(cmdpkt, 5);
+	return(0);
+}
--- a/rvinterf/tmsh/usercmd.c	Mon Jan 16 18:44:24 2017 +0000
+++ b/rvinterf/tmsh/usercmd.c	Mon Jan 16 19:30:40 2017 +0000
@@ -23,6 +23,10 @@
 extern int cmd_r8();
 extern int cmd_r16();
 extern int cmd_r32();
+extern int cmd_rfe();
+extern int cmd_scr();
+extern int cmd_scw();
+extern int cmd_sr();
 extern int cmd_tgtreset();
 extern int cmd_tm3ver();
 extern int cmd_tminit();
@@ -59,6 +63,10 @@
 	{"r8", 1, 2, cmd_r8},
 	{"r16", 1, 2, cmd_r16},
 	{"r32", 1, 2, cmd_r32},
+	{"rfe", 1, 1, cmd_rfe},
+	{"scr", 1, 1, cmd_scr},
+	{"scw", 2, 2, cmd_scw},
+	{"sr", 2, 2, cmd_sr},
 	{"tgtreset", 0, 0, cmd_tgtreset},
 	{"tm3ver", 1, 1, cmd_tm3ver},
 	{"tminit", 0, 0, cmd_tminit},