summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2018-06-13 21:49:31 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2018-06-13 21:49:31 +1000
commitef2334e5c677868c249e61cdaf6ae205185750e3 (patch)
treedd6de5ae561103fd1ab5a0d6d35427a192872cd1
parentea064f5405f1539356dcb6355f7c432b36979261 (diff)
downloadcf-fsi-ef2334e5c677868c249e61cdaf6ae205185750e3.tar.gz
cf-fsi-ef2334e5c677868c249e61cdaf6ae205185750e3.zip
Add clock count in debug mode
Allows to verify that continuous clocking is working Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--cf-code/cf-fsi-fw.S7
-rw-r--r--cf-fsi-fw.h3
2 files changed, 9 insertions, 1 deletions
diff --git a/cf-code/cf-fsi-fw.S b/cf-code/cf-fsi-fw.S
index e897eaa..6af7e25 100644
--- a/cf-code/cf-fsi-fw.S
+++ b/cf-code/cf-fsi-fw.S
@@ -67,9 +67,14 @@
.macro trace op:req
move.b \op,%a3@+
.endm
+ .macro count_clock
+ addq.l #1,%a1@(CLK_CNT)
+ .endm
#else
.macro trace op:req
.endm
+ .macro count_clock
+ .endm
#endif
/*
@@ -82,6 +87,7 @@
move.l %DCLK,%a5@(0)
bset.l %d5,%DCLK /* clock high */
move.l %DCLK,%a5@(0)
+ count_clock
.endm
/* clock_out_bit reg: Clock out bit 31 of reg */
@@ -131,6 +137,7 @@
move.l %a4@(0),\tmp /* actual read */
bset.l %d5,%DCLK /* clock high */
move.l %DCLK,%a5@(0)
+ count_clock
moveq.l #DATA_GPIO_BIT,\tmp2
lsr.l \tmp2,\tmp
moveq.l #1,\tmp2
diff --git a/cf-fsi-fw.h b/cf-fsi-fw.h
index ac89eba..5d80bf5 100644
--- a/cf-fsi-fw.h
+++ b/cf-fsi-fw.h
@@ -103,8 +103,9 @@
/* Misc */
#define INT_CNT 0x30 /* 32-bit interrupt count */
-#define BAD_INT_VEC 0x34
+#define BAD_INT_VEC 0x34 /* 32-bit bad interrupt vector # */
#define CF_STARTED 0x38 /* byte, set to -1 when copro started */
+#define CLK_CNT 0x3c /* 32-bit, clock count (debug only) */
/*
* SRAM layout: GPIO arbitration part
OpenPOWER on IntegriCloud