summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2018-06-11 20:59:24 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2018-06-11 20:59:24 +1000
commitea4e9490301b774cfc01ed92d7566d899ba7e7eb (patch)
treeeee45b10a76d77ea1883020778cd09e70572175a
parent1b05374650ed9da9eb14154490b490caf62b99bc (diff)
downloadcf-fsi-ea4e9490301b774cfc01ed92d7566d899ba7e7eb.tar.gz
cf-fsi-ea4e9490301b774cfc01ed92d7566d899ba7e7eb.zip
Add marker at end of traces
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--cf-code/cf-fsi-fw.S11
-rw-r--r--cf-fsi-fw.h3
-rw-r--r--cf-fsi-test.c7
3 files changed, 19 insertions, 2 deletions
diff --git a/cf-code/cf-fsi-fw.S b/cf-code/cf-fsi-fw.S
index 914159f..000e476 100644
--- a/cf-code/cf-fsi-fw.S
+++ b/cf-code/cf-fsi-fw.S
@@ -332,6 +332,7 @@ command_request:
beq start_idle_clocks
/* Error */
+ trace #TR_END
move.b #STAT_ERR_INVAL_CMD,%a1@(CMD_STAT_REG)
bra main_loop
@@ -401,6 +402,7 @@ start_command:
beq 1f
subq.l #1,%d3
bne 0b
+ trace #TR_END
move.b #STAT_ERR_MTOE,%a1@(CMD_STAT_REG)
bra send_delay
@@ -465,6 +467,9 @@ start_command:
and.l %d0,%d4
move.b %d4,%a1@(STAT_RCRC)
+ /* End trace */
+ trace #TR_END
+
/* Mark command complete */
moveq.l #STAT_COMPLETE,%d0
byterev %d0
@@ -499,6 +504,9 @@ start_break:
move.l #FSI_POST_BREAK_CLOCKS,%d3
clock_out_zeros %d3
+ /* End trace */
+ trace #TR_END
+
/* Mark command complete */
moveq.l #STAT_COMPLETE,%d0
byterev %d0
@@ -515,6 +523,9 @@ start_idle_clocks:
move.b %d2,%d3
clock_out_zeros %d3
+ /* End trace */
+ trace #TR_END
+
/* Mark command complete */
moveq.l #STAT_COMPLETE,%d0
byterev %d0
diff --git a/cf-fsi-fw.h b/cf-fsi-fw.h
index 0c4453f..48c762e 100644
--- a/cf-fsi-fw.h
+++ b/cf-fsi-fw.h
@@ -116,7 +116,7 @@
#define TR_CLKOBIT0 0xc0
#define TR_CLKOBIT1 0xc1
#define TR_CLKOSTART 0x82
-#define TR_OLEN 0x83/* + len */
+#define TR_OLEN 0x83 /* + len */
#define TR_CLKZ 0x84 /* + count */
#define TR_CLKWSTART 0x85
#define TR_CLKTAG 0x86 /* + tag */
@@ -124,6 +124,7 @@
#define TR_CLKCRC 0x88 /* + raw crc */
#define TR_CLKIBIT0 0x90
#define TR_CLKIBIT1 0x91
+#define TR_END 0xff
#endif /* __CF_FSI_FW_H */
diff --git a/cf-fsi-test.c b/cf-fsi-test.c
index bf209f3..5d05051 100644
--- a/cf-fsi-test.c
+++ b/cf-fsi-test.c
@@ -566,10 +566,15 @@ static void dump_stuff(void)
ntohl(readl(sysreg + SRAM_BASE + INT_CNT)));
for (i = 0; trace_enabled && i < 128; i++) {
- printf("%02x ", readb(sysreg + SRAM_BASE + TRACEBUF + i));
+ uint8_t v = readb(sysreg + SRAM_BASE + TRACEBUF + i);
+ printf("%02x ", v);
if ((i % 16) == 15)
printf("\n");
+ if (v == TR_END)
+ break;
}
+ if (i % 16)
+ printf("\n");
}
static int do_command(uint32_t op)
OpenPOWER on IntegriCloud