From 32260a89442b6e0cc07fab598ad767bad861f065 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 4 Jun 2018 00:27:49 +1000 Subject: 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 --- cf-code/cf-fsi-fw.S | 7 +++++-- 1 file 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 -- cgit v1.2.1