]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: ocores: add polling mode workaround for Sifive FU540-C000 SoC
authorSagar Shrikant Kadam <sagar.kadam@sifive.com>
Sat, 1 Jun 2019 06:11:15 +0000 (11:41 +0530)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 14 Jun 2019 21:24:33 +0000 (23:24 +0200)
commit01c534df5c4276e75cab0d9252365eafd50f0a15
treefb4aaabcee960f0f3799e26834a918fb89d09339
parente5526025e624bccf482ccd3dcca23d27baeb783d
i2c: ocores: add polling mode workaround for Sifive FU540-C000 SoC

The i2c-ocore driver already has a polling mode interface.But it needs
a workaround for FU540 Chipset on HiFive unleashed board (RevA00).
There is an erratum in FU540 chip that prevents interrupt driven i2c
transfers from working, and also the I2C controller's interrupt bit
cannot be cleared if set, due to this the existing i2c polling mode
interface added in mainline earlier doesn't work, and CPU stall's
infinitely, when-ever i2c transfer is initiated.

Ref:
commit b8aa65d3d2ff ("i2c: ocores: refactor setup for polling")

The workaround / fix under OCORES_FLAG_BROKEN_IRQ is particularly for
FU540-COOO SoC.

The polling function identifies a SiFive device based on the device node
and enables the workaround.

Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-ocores.c