mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
rk3399: kevin: coreboot read recovery event
Enable reading of keyboard recovery host event from coreboot. BUG=None BRANCH=None TEST=esc+refresh+power combo and make sure you see recovery fw screen. Change-Id: Id980c77c8d7695b2c1b3343d968ad2a302d42aaa Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/357841 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
parent
0deb0e1c69
commit
f9279c8c06
1 changed files with 8 additions and 1 deletions
|
@ -15,6 +15,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <boot/coreboot_tables.h>
|
#include <boot/coreboot_tables.h>
|
||||||
|
#include <ec/google/chromeec/ec.h>
|
||||||
|
#include <ec/google/chromeec/ec_commands.h>
|
||||||
#include <gpio.h>
|
#include <gpio.h>
|
||||||
#include <vendorcode/google/chromeos/chromeos.h>
|
#include <vendorcode/google/chromeos/chromeos.h>
|
||||||
|
|
||||||
|
@ -24,6 +26,7 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
||||||
{
|
{
|
||||||
struct lb_gpio chromeos_gpios[] = {
|
struct lb_gpio chromeos_gpios[] = {
|
||||||
{GPIO_WP.raw, ACTIVE_LOW, gpio_get(GPIO_WP), "write protect"},
|
{GPIO_WP.raw, ACTIVE_LOW, gpio_get(GPIO_WP), "write protect"},
|
||||||
|
{-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"},
|
||||||
{GPIO_BACKLIGHT.raw, ACTIVE_HIGH, -1, "backlight"},
|
{GPIO_BACKLIGHT.raw, ACTIVE_HIGH, -1, "backlight"},
|
||||||
{GPIO_EC_IN_RW.raw, ACTIVE_HIGH, -1, "EC in RW"},
|
{GPIO_EC_IN_RW.raw, ACTIVE_HIGH, -1, "EC in RW"},
|
||||||
{GPIO_EC_IRQ.raw, ACTIVE_LOW, -1, "EC interrupt"},
|
{GPIO_EC_IRQ.raw, ACTIVE_LOW, -1, "EC interrupt"},
|
||||||
|
@ -40,7 +43,11 @@ int get_developer_mode_switch(void)
|
||||||
|
|
||||||
int get_recovery_mode_switch(void)
|
int get_recovery_mode_switch(void)
|
||||||
{
|
{
|
||||||
return 0;
|
uint32_t ec_events;
|
||||||
|
|
||||||
|
ec_events = google_chromeec_get_events_b();
|
||||||
|
return !!(ec_events &
|
||||||
|
EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY));
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_write_protect_state(void)
|
int get_write_protect_state(void)
|
||||||
|
|
Loading…
Add table
Reference in a new issue