[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1603291814-240377-1-git-send-email-sagar.kadam@sifive.com>
Date: Wed, 21 Oct 2020 07:50:13 -0700
From: Sagar Shrikant Kadam <sagar.kadam@...ive.com>
To: linux-kernel@...r.kernel.org
Cc: linux-riscv@...ts.infradead.org, linux-i2c@...r.kernel.org,
peter@...sgaard.com, andrew@...n.ch, paul.walmsley@...ive.com,
palmer@...belt.com, aou@...s.berkeley.edu,
Sagar Shrikant Kadam <sagar.kadam@...ive.com>
Subject: [PATCH v4 0/1] fix i2c polling mode workaround for FU540-C000 SoC
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 mainline Linux 5.9 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-00001-ge092bd7 #1 SMP Wed Oct 21 06:19:31 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
0xf9
# i2cset 0 0x57 0 0xa5 b -y
# i2cget 0 0x57 0 b -y
0xa5
# i2cget 0 0x57 1 b -y
0xa9
# i2cset 0 0x57 1 0x9a b -y
# i2cget 0 0x57 1 b -y
0x9a
# i2cget 0 0x6f 0x20 b -y
0x98
# i2cset 0 0x6f 0x20 0x5a b -y
# i2cget 0 0x6f 0x20 b -y
0x5a
# i2cget 0 0x6f 0x5f b -y
0x55
# i2cset 0 0x6f 0x5f 0xa5 b -y
# i2cget 0 0x6f 0x5f b -y
0xa5
#
Without the fix here, it's observed that "i2cdetect -y 0"
turns the system unresponsive, with CPU stall messages.
Patch History:
===============================
V4:
-Used alternate implementation as suggested here:
https://lkml.org/lkml/2020/10/15/513
-Removed TYPE_SIFIVE_REV0 field as it is no longer needed to set the polling mode
and OCORES_FLAG_BROKEN_IRQ flag.
V3:
-Rectified typo as suggested here:
https://lkml.org/lkml/2020/10/9/902
V2:
-Incorporated changes as suggested by Peter Kosgaard
https://lkml.org/lkml/2020/10/8/663
V1: Base version
Sagar Shrikant Kadam (1):
i2c: ocores: fix polling mode workaround on FU540-C000 SoC
drivers/i2c/busses/i2c-ocores.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
--
2.7.4
Powered by blists - more mailing lists