From 6cf507262e860be571f33a7448e5dba4aa6f430d Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Sun, 3 Jun 2018 17:59:38 +1000 Subject: Deal with bank collision between clk/data and trans GPIOs Signed-off-by: Benjamin Herrenschmidt --- cf-code/cf-fsi-fw.S | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'cf-code') diff --git a/cf-code/cf-fsi-fw.S b/cf-code/cf-fsi-fw.S index 1066f92..6e713c5 100644 --- a/cf-code/cf-fsi-fw.S +++ b/cf-code/cf-fsi-fw.S @@ -91,13 +91,25 @@ * D0 : scratch/temp */ + /* + * Define clock/data GPIO cache registers and which + * register to use for trans GPIO in order to deal with + * potential overlaps + */ #define DCLK d7 #if CLOCK_GPIO_REG == DATA_GPIO_REG #define DDAT d7 #else #define DDAT d6 #endif - /* Useful macros */ +#if TRANS_GPIO_REG == CLOCK_GPIO_REG +#define DTRA d7 +#elif TRANS_GPIO_REG == DATA_GPIO_REG +#define DTRA d6 +#else +#define DTRA d0 +#endif + #ifdef ENABLE_TRACE .macro trace op:req @@ -419,16 +431,16 @@ config_gpio_out: move.l %d0,%a4@(4) /* Set transceivers to output */ - move.l %a5@(TRANS_GPIO_REG-CLOCK_GPIO_REG),%d0 - bset.l #TRANS_GPIO_BIT,%d0 - move.l %d0,%a5@(TRANS_GPIO_REG-CLOCK_GPIO_REG) + move.l %a5@(TRANS_GPIO_REG-CLOCK_GPIO_REG),%DTRA + bset.l #TRANS_GPIO_BIT,%DTRA + move.l %DTRA,%a5@(TRANS_GPIO_REG-CLOCK_GPIO_REG) rts config_gpio_in: /* Set transceiver to input */ - move.l %a5@(TRANS_GPIO_REG-CLOCK_GPIO_REG),%d0 - bclr.l #TRANS_GPIO_BIT,%d0 - move.l %d0,%a5@(TRANS_GPIO_REG-CLOCK_GPIO_REG) + move.l %a5@(TRANS_GPIO_REG-CLOCK_GPIO_REG),%DTRA + bclr.l #TRANS_GPIO_BIT,%DTRA + move.l %DTRA,%a5@(TRANS_GPIO_REG-CLOCK_GPIO_REG) /* Configure data GPIO as input */ move.l %a4@(4),%d0 -- cgit v1.2.1