diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2018-06-03 17:59:38 +1000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2018-06-03 18:07:24 +1000 |
commit | 6cf507262e860be571f33a7448e5dba4aa6f430d (patch) | |
tree | b11e464696a6ee7c458519670a96119fabeb3466 /cf-code | |
parent | 01de60eca45e112134b7a49e452225194bfd8efb (diff) | |
download | cf-fsi-6cf507262e860be571f33a7448e5dba4aa6f430d.tar.gz cf-fsi-6cf507262e860be571f33a7448e5dba4aa6f430d.zip |
Deal with bank collision between clk/data and trans GPIOs
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'cf-code')
-rw-r--r-- | cf-code/cf-fsi-fw.S | 26 |
1 files changed, 19 insertions, 7 deletions
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 |