diff options
authorBenjamin Herrenschmidt <>2018-06-04 00:27:49 +1000
committerBenjamin Herrenschmidt <>2018-06-04 00:27:49 +1000
commit32260a89442b6e0cc07fab598ad767bad861f065 (patch)
parentff62039f85b68f2b5329d3f3971fbe747e1e47b0 (diff)
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 <>
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 @@
/* 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
+ /* 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
+ */
move.l %DDAT,%a4@(0)
OpenPOWER on IntegriCloud