From 3cca9b869028a3c2ccbb4915fbb64c5746b55081 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 18 Jun 2018 13:24:25 +1000 Subject: 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 --- cf-code/cf-fsi-fw.S | 29 ++++++++++++++++++++++------- cf-code/cf-fsi-palmetto.h | 1 + 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'cf-code') 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,8 +308,10 @@ main_loop: #ifdef CONTINUOUS_CLOCKING clock_toggle #else +#ifndef NO_SW_IRQ stop #0x2000 move.w #0x2007,%sr +#endif #endif bra 1b @@ -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 -- cgit v1.2.1