summaryrefslogtreecommitdiffstats
path: root/cf-code/cf-fsi-fw.S
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 /cf-code/cf-fsi-fw.S
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>
Diffstat (limited to 'cf-code/cf-fsi-fw.S')
-rw-r--r--cf-code/cf-fsi-fw.S29
1 files changed, 22 insertions, 7 deletions
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
OpenPOWER on IntegriCloud