From 6aba4e94522c34d3416235ae9242a82fcf2951a6 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Fri, 8 Jun 2018 14:59:57 +1000 Subject: Deal with arbitration at startup Signed-off-by: Benjamin Herrenschmidt --- cf-code/cf-fsi-fw.S | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'cf-code') diff --git a/cf-code/cf-fsi-fw.S b/cf-code/cf-fsi-fw.S index 0ac7375..90e1248 100644 --- a/cf-code/cf-fsi-fw.S +++ b/cf-code/cf-fsi-fw.S @@ -173,6 +173,21 @@ _start: moveq.l #CLOCK_GPIO_BIT,%d5 /* + * Check arbitration register early. There's a case where an arbitration request + * might have occurred right as we were starting the coprocessor. In that case, + * wait until we get back ownership + */ + move.b %a1@(ARB_REG),%d2 + beq 1f + + /* Ack it */ + move.b #ARB_ARM_ACK,%a1@(ARB_REG) + + /* Wait until it's cleared by the host */ +0: move.b %a1@(ARB_REG),%d1 + bne 0b + +1: /* * Load GPIO values into caches and set initial values * * Note: We load from the "Data Read" register which @@ -220,9 +235,6 @@ _start: /* Configure GPIOs to output */ bsr config_gpio_out - /* Clear arbitration register */ - move.b #0,%a1@(ARB_REG) - /* Populate version & signature */ move.w #SYS_SIG,%a1@(SYS_SIG_REG) move.b #FW_VERSION,%a1@(FW_VERS_REG) -- cgit v1.2.1