From 73270458ec5e9fc818f6da2a6d031360ad0b6dae Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 11 Jun 2018 21:15:52 +1000 Subject: Use a separate "started" flag Relying on the command-status is dicey, the GPIO arbitration code needs a more reliable way to know we are actually running Signed-off-by: Benjamin Herrenschmidt --- cf-code/cf-fsi-fw.S | 4 ++-- cf-fsi-fw.h | 1 + cf-fsi-test.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cf-code/cf-fsi-fw.S b/cf-code/cf-fsi-fw.S index 000e476..d0d71a6 100644 --- a/cf-code/cf-fsi-fw.S +++ b/cf-code/cf-fsi-fw.S @@ -264,8 +264,8 @@ _start: /* Configure GPIOs to output */ bsr config_gpio_out - /* Mark command complete, indicates we are ready */ - move.b #STAT_COMPLETE,%a1@(CMD_STAT_REG) + /* Indicate that we are started */ + mov3q.l #0xffffffff,%a1@(CF_STARTED) /* * Main command loop diff --git a/cf-fsi-fw.h b/cf-fsi-fw.h index 48c762e..5f6cffd 100644 --- a/cf-fsi-fw.h +++ b/cf-fsi-fw.h @@ -101,6 +101,7 @@ /* Misc */ #define INT_CNT 0x30 /* 32-bit interrupt count */ #define BAD_INT_VEC 0x34 +#define CF_STARTED 0x38 /* byte, set to -1 when copro started */ /* * SRAM layout: GPIO arbitration part diff --git a/cf-fsi-test.c b/cf-fsi-test.c index 5d05051..42bf3a3 100644 --- a/cf-fsi-test.c +++ b/cf-fsi-test.c @@ -755,7 +755,7 @@ int main(int argc, char *argv[]) /* Wait for status register to say command complete */ do { - val = readb(sysreg + SRAM_BASE + CMD_STAT_REG); + val = readl(sysreg + SRAM_BASE + CF_STARTED); } while (val == 0x00); /* Configure echo & send delay */ -- cgit v1.2.1