Nico Huber has uploaded this change for review.

View Change

gma panel: Also wait for `power cycle delay active`

It's possible that the `power cycle progress` bits are only valid if no
power-cycle delay is active. So let's check that bit, too.

Also increase the timeouts to the theoretical maximum, including a pos-
sibly ongoing sequence and the power-cycle delay.

Change-Id: I536a094151c5cc5036c2d39a3d8d6e5826f198ac
Signed-off-by: Nico Huber <nico.h@gmx.de>
---
M common/hw-gfx-gma-panel.adb
1 file changed, 7 insertions(+), 4 deletions(-)

git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/70/34470/1
diff --git a/common/hw-gfx-gma-panel.adb b/common/hw-gfx-gma-panel.adb
index 968fbbe..8ccbbb9 100644
--- a/common/hw-gfx-gma-panel.adb
+++ b/common/hw-gfx-gma-panel.adb
@@ -1,5 +1,6 @@
--
-- Copyright (C) 2015-2016 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
@@ -305,8 +306,9 @@
Time.Delay_Until (Power_Up_Timer);
Registers.Wait_Unset_Mask
(Register => Panel_PP_Regs.STATUS,
- Mask => PCH_PP_STATUS_PWR_SEQ_PROGRESS_MASK,
- TOut_MS => 300);
+ Mask => PCH_PP_STATUS_PWR_SEQ_PROGRESS_MASK or
+ PCH_PP_STATUS_PWR_CYC_DELAY_ACTIVE,
+ TOut_MS => 820 + 3_100 + 820); -- theoretical max: off + cycle + on

Registers.Unset_Mask (Panel_PP_Regs.CONTROL, PCH_PP_CONTROL_VDD_OVERRIDE);
end Wait_On;
@@ -327,8 +329,9 @@
end if;
Registers.Wait_Unset_Mask
(Register => Panel_PP_Regs.STATUS,
- Mask => PCH_PP_STATUS_PWR_SEQ_PROGRESS_MASK,
- TOut_MS => 600);
+ Mask => PCH_PP_STATUS_PWR_SEQ_PROGRESS_MASK or
+ PCH_PP_STATUS_PWR_CYC_DELAY_ACTIVE,
+ TOut_MS => 820 + 3_100 + 820); -- theoretical max: on + cycle + off
if Was_On then
Power_Cycle_Timer := Time.US_From_Now (Delays_US (Power_Cycle_Delay));
end if;

To view, visit change 34470. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-Change-Id: I536a094151c5cc5036c2d39a3d8d6e5826f198ac
Gerrit-Change-Number: 34470
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h@gmx.de>
Gerrit-MessageType: newchange