]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: img-scb: enable fencing for all versions of the ip
authorSifan Naeem <sifan.naeem@imgtec.com>
Thu, 10 Sep 2015 14:50:01 +0000 (15:50 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Sat, 10 Oct 2015 07:37:41 +0000 (08:37 +0100)
commit4456863e7fa0dc92f0010eafc8a36642741508a3
treebaf0346158efc044c868cb5e37436d3d0233745c
parentfc1f471954b832595e0667bc07549068366847b9
i2c: img-scb: enable fencing for all versions of the ip

The code to read from the master read fifo, and write to the master
write fifo, checks a bit in an SCB register before every byte to
ensure that the fifo is not full (write fifo) or empty (read fifo).
Due to clock domain crossing inside the SCB block the updated value
of this bit is only visible after 2 cycles.

The scb_wr_rd_fence() function does 2 dummy writes (to the read-only
revision register), and it's called before reading from or writing to the
fifos to ensure that subsequent reads of the fifo status bits do not read
stale values.

As the 2 dummy writes are required in all versions of the ip, the version
check is dropped.

Fixes: commit 868b09c46ef8 ("i2c: img-scb: Add Imagination Technologies I2C SCB driver")
Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: James Hartley <james.hartley@imgtec.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-img-scb.c