Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/libgfxinit/+/32491
Change subject: gma i2c: Try to clear NAK indicator ......................................................................
gma i2c: Try to clear NAK indicator
Change-Id: I7df80d8757e1d14e288d9424240e873cf5a5fd29 Signed-off-by: Nico Huber nico.h@gmx.de --- M common/hw-gfx-gma-i2c.adb 1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/91/32491/1
diff --git a/common/hw-gfx-gma-i2c.adb b/common/hw-gfx-gma-i2c.adb index d8cdf44..e5cf010 100644 --- a/common/hw-gfx-gma-i2c.adb +++ b/common/hw-gfx-gma-i2c.adb @@ -251,6 +251,10 @@ (Register => GMBUS_Regs (2), Mask => GMBUS2_GMBUS_ACTIVE); end if; + if (GMBUS2 and GMBUS2_NAK_INDICATOR) /= 0 then + Reset_GMBUS (Success); + Success := False; + end if; end if; Length := Transfered;
Matt DeVillier has uploaded a new patch set (#2) to the change originally created by Nico Huber. ( https://review.coreboot.org/c/libgfxinit/+/32491 )
Change subject: gma i2c: Try to clear NAK indicator ......................................................................
gma i2c: Try to clear NAK indicator
Change-Id: I7df80d8757e1d14e288d9424240e873cf5a5fd29 Signed-off-by: Nico Huber nico.h@gmx.de Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M common/hw-gfx-gma-i2c.adb 1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/91/32491/2
Hello Matt DeVillier,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/libgfxinit/+/32491
to look at the new patch set (#3).
Change subject: gma i2c: Try to clear NAK indicator ......................................................................
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 --- M common/hw-gfx-gma-i2c.adb 1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/91/32491/3
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/32491 )
Change subject: gma i2c: Try to clear NAK indicator ......................................................................
Patch Set 3: Verified+1
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/32491 )
Change subject: gma i2c: Try to clear NAK indicator ......................................................................
Patch Set 3: Code-Review+2
Matt DeVillier has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/32491 )
Change subject: gma i2c: Try to clear NAK indicator ......................................................................
Patch Set 3: Code-Review+2
HAOUAS Elyes has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/32491 )
Change subject: gma i2c: Try to clear NAK indicator ......................................................................
Patch Set 3: Code-Review+1
Nico Huber has submitted this change and it was merged. ( https://review.coreboot.org/c/libgfxinit/+/32491 )
Change subject: gma i2c: Try to clear NAK indicator ......................................................................
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(-)
Approvals: Nico Huber: Verified HAOUAS Elyes: Looks good to me, but someone else must approve Matt DeVillier: Looks good to me, approved Arthur Heymans: Looks good to me, approved
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;