linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] fix i2c polling mode workaround for FU540-C000 SoC
@ 2020-10-06 17:53 Sagar Shrikant Kadam
  2020-10-06 17:53 ` [PATCH 1/1] i2c: ocores: fix polling mode workaround on " Sagar Shrikant Kadam
  0 siblings, 1 reply; 5+ messages in thread
From: Sagar Shrikant Kadam @ 2020-10-06 17:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: andrew, peter, aou, palmer, linux-i2c, paul.walmsley,
	linux-riscv, Sagar Shrikant Kadam

The polling mode workaround for the FU540-C000 on HiFive Unleashed A00
board was added earlier. The logic for this seems to work only in case
the interrupt property was missing/not added into the i2c0 device node.

Here we address this issue by identifying the SOC based on compatibility
string and set the master xfer's to polling mode if it's the FU540-C000
SoC.

The fix has been tested on Linux 5.9.0-rc8 with a PMOD based RTCC sensor
connected to I2C pins J1 header of the board. Log for reference

# uname -a
Linux buildroot 5.9.0-rc8-00001-gf806864 #2 SMP Tue Oct 6 09:51:24 PDT 2020 riscv64 GNU/Linux
#
# i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- 57 -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 6f
70: -- -- -- -- -- -- -- --
# i2cget  0 0x57 0 b -y
0xa9
# i2cset  0 0x57 0 0xa5 b -y
# i2cget  0 0x57 0 b -y
0xa5
# i2cset  0 0x57 0 0x5a b -y
# i2cget  0 0x57 0 b -y
0x5a
# i2cget  0 0x6f 0 b -y
0x00
# i2cset  0 0x6f 0 0x5a b -y
# i2cget  0 0x6f 0 b -y
0x5a

Without the fix here, it's observed that "i2cdetect -y 0" turns the 
system unresponsive, with CPU stall messages.

Sagar Shrikant Kadam (1):
  i2c: ocores: fix polling mode workaround on FU540-C000 SoC

 drivers/i2c/busses/i2c-ocores.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

-- 
2.7.4


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-08 16:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 17:53 [PATCH 0/1] fix i2c polling mode workaround for FU540-C000 SoC Sagar Shrikant Kadam
2020-10-06 17:53 ` [PATCH 1/1] i2c: ocores: fix polling mode workaround on " Sagar Shrikant Kadam
2020-10-07 11:40   ` Peter Korsgaard
2020-10-08 13:53     ` Sagar Kadam
2020-10-08 16:05       ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).