summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2018-06-18 13:24:25 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2018-06-18 14:07:21 +1000
commit3cca9b869028a3c2ccbb4915fbb64c5746b55081 (patch)
tree7ac3e3ba72e438de8a3835b4a1fb8c14c6f9a009
parent42593be0cb5cd6bf133ce3897866319f18050bed (diff)
downloadcf-fsi-3cca9b869028a3c2ccbb4915fbb64c5746b55081.tar.gz
cf-fsi-3cca9b869028a3c2ccbb4915fbb64c5746b55081.zip
Do not rely on interrupts on AST2400
It doesn't have the SW interrupt triggers. Use NOP loops instead to pace ourselves when waiting for arbitration Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--Makefile2
-rw-r--r--cf-code/cf-fsi-fw.S29
-rw-r--r--cf-code/cf-fsi-palmetto.h1
3 files changed, 24 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 26eab9c..d1a5ade 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
DEBUG ?= 0
# FW version
-FW_VERSION = 1
+FW_VERSION = 2
# ARM compiler for userspace test code
CROSS_COMPILE ?= arm-linux-
diff --git a/cf-code/cf-fsi-fw.S b/cf-code/cf-fsi-fw.S
index 6af7e25..c0ca927 100644
--- a/cf-code/cf-fsi-fw.S
+++ b/cf-code/cf-fsi-fw.S
@@ -308,9 +308,11 @@ main_loop:
#ifdef CONTINUOUS_CLOCKING
clock_toggle
#else
+#ifndef NO_SW_IRQ
stop #0x2000
move.w #0x2007,%sr
#endif
+#endif
bra 1b
arbitration_request:
@@ -318,9 +320,27 @@ arbitration_request:
move.b #ARB_ARM_ACK,%a1@(ARB_REG)
/* Wait until it's cleared by the host */
-0: move.b %a1@(ARB_REG),%d1
- bne 1f
+arb_wait:
+ move.b %a1@(ARB_REG),%d1
+ beq arb_done
+
+#ifdef NO_SW_IRQ
+ /* In absence of SW irq, just loop with some NOPs to avoid
+ * hammering the bus too hard
+ */
+ moveq.l #32,%d0
+0: nop
+ subq.l #1,%d0
+ bne 0b
+ bra arb_wait
+#else
+ /* Wait, we'll get an interrupt when the host clears it */
+ stop #0x2000
+ move.w #0x2007,%sr
+ bra arb_wait
+#endif
+arb_done:
/* Got it, re-load the GPIO caches */
move.l %a5@(0),%DCLK
move.l %a4@(0),%DDAT
@@ -333,11 +353,6 @@ arbitration_request:
/* Back to main loop */
bra main_loop
- /* Wait, we'll get an interrupt when the host clears it */
-1: stop #0x2000
- move.w #0x2007,%sr
- bra 0b
-
command_request:
/* Clear the command/status register */
moveq.l #0,%d0
diff --git a/cf-code/cf-fsi-palmetto.h b/cf-code/cf-fsi-palmetto.h
index 1fb1f30..c11b116 100644
--- a/cf-code/cf-fsi-palmetto.h
+++ b/cf-code/cf-fsi-palmetto.h
@@ -11,5 +11,6 @@
#define SYS_SIG SYS_SIG_PALMETTO
+#define NO_SW_IRQ
#define CONTINUOUS_CLOCKING
#define EXTRA_DUMMY_READ
OpenPOWER on IntegriCloud