diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2018-06-04 00:27:49 +1000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2018-06-04 00:27:49 +1000 |
commit | 32260a89442b6e0cc07fab598ad767bad861f065 (patch) | |
tree | 1c81bd03263bf71946962bcb13c591c54c48fb47 /cf-code/cf-fsi-fw.S | |
parent | ff62039f85b68f2b5329d3f3971fbe747e1e47b0 (diff) | |
download | cf-fsi-32260a89442b6e0cc07fab598ad767bad861f065.tar.gz cf-fsi-32260a89442b6e0cc07fab598ad767bad861f065.zip |
Remove TODO comments in clock_out_bit and document optimisation
The send path isn't the most critical and optimizing here
is hard for little return. Also on systems like Romulus where
both clk and data are in the same GPIO register, we already
don't need the test for value change since we use a single
write to write both value and clock.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'cf-code/cf-fsi-fw.S')
-rw-r--r-- | cf-code/cf-fsi-fw.S | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cf-code/cf-fsi-fw.S b/cf-code/cf-fsi-fw.S index 32f6aa8..60affc7 100644 --- a/cf-code/cf-fsi-fw.S +++ b/cf-code/cf-fsi-fw.S @@ -76,8 +76,6 @@ .endm /* clock_out_bit reg: Clock out bit 31 of reg */ - /* XXX TODO: only write to GPIO if value changes */ - /* XXX TODO: can probably optimize further using shifts & logical ops rather than branches */ .macro clock_out_bit reg:req btst.l #31,\reg beq 98f @@ -87,6 +85,11 @@ 98: bclr.l #DATA_GPIO_BIT,%DDAT trace #TR_CLKOBIT0 99: + /* If data and clock GPIO share the same register, such as on + * Romulus, the write done by clock_toggle will set the new data + * value along with the low clock edge. Thus we don't need to + * set it here, thus saving a PCLK + */ #if DATA_GPIO_REG != CLOCK_GPIO_REG move.l %DDAT,%a4@(0) #endif |