Daisuke Nojiri has uploaded this change for review. ( https://review.coreboot.org/23745
Change subject: chromeec: Add google_chromeec_wait_for_display ......................................................................
chromeec: Add google_chromeec_wait_for_display
The google_chromeec_wait_for_displa API checks whether a display is ready or not. It waits in a loop until EC says it entered DisplayPort alternative mode or times out in 2 seconds.
BUG=b:72387533 BRANCH=none TEST=Boot Fizz in manual recovery mode. Verify recovery screen is displayed.
Change-Id: Ieee5db77bd6e147936ea8fc735dcbeffec98c0f8 Signed-off-by: Daisuke Nojiri dnojiri@chromium.org --- M src/ec/google/chromeec/ec.c M src/ec/google/chromeec/ec.h 2 files changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/23745/1
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index 229a710..156357a 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -953,3 +953,19 @@
return 0; } + +#define USB_SID_DISPLAYPORT 0xff01 +void google_chromeec_wait_for_display(void) +{ + int count = 0; + printk(BIOS_INFO, "Waiting for display."); + while (google_chromeec_get_alternate_mode(USB_SID_DISPLAYPORT) != 1) { + if (count++ > 10) { + printk(BIOS_WARNING, " Not ready\n"); + return; + } + udelay(200000); + printk(BIOS_INFO, "."); + } + printk(BIOS_INFO, " Ready\n"); +} diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index dde23c1..45d6f55 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -37,6 +37,7 @@ int google_ec_running_ro(void); void google_chromeec_init(void); int google_chromeec_get_alternate_mode(uint16_t svid); +void google_chromeec_wait_for_display(void);
/* Device events */ uint64_t google_chromeec_get_device_enabled_events(void);