Nico Huber merged this change.
gma i2c: Try to clear NAK indicator
If we don't clear the NAK indicator, some versions of ChromeOS fail on
the first transfer and don't detect certain I2C devices.
Change-Id: I7df80d8757e1d14e288d9424240e873cf5a5fd29
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/32491
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
---
M common/hw-gfx-gma-i2c.adb
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/common/hw-gfx-gma-i2c.adb b/common/hw-gfx-gma-i2c.adb
index d8cdf44..fe26f1c 100644
--- a/common/hw-gfx-gma-i2c.adb
+++ b/common/hw-gfx-gma-i2c.adb
@@ -1,5 +1,6 @@
--
-- Copyright (C) 2015 secunet Security Networks AG
+-- Copyright (C) 2019 Nico Huber <nico.h@gmx.de>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@@ -199,7 +200,7 @@
Data : out HW.GFX.I2C.Transfer_Data;
Success : out Boolean)
is
- GMBUS2,
+ GMBUS2 : Word32 := 0;
GMBUS3 : Word32;
Current : HW.GFX.I2C.Transfer_Length;
@@ -250,6 +251,12 @@
Registers.Wait_Unset_Mask
(Register => GMBUS_Regs (2),
Mask => GMBUS2_GMBUS_ACTIVE);
+ elsif (GMBUS2 and GMBUS2_NAK_INDICATOR) /= 0 then
+ Registers.Wait_Unset_Mask
+ (Register => GMBUS_Regs (2),
+ Mask => GMBUS2_GMBUS_ACTIVE);
+ Registers.Write (GMBUS_Regs (1), GMBUS1_SOFTWARE_CLEAR_INTERRUPT);
+ Registers.Write (GMBUS_Regs (1), 0);
end if;
end if;
Length := Transfered;
To view, visit change 32491. To unsubscribe, or for help writing mail filters, visit settings.