diff --git a/src/mainboard/google/rush_ryu/mainboard.c b/src/mainboard/google/rush_ryu/mainboard.c index 1a78e02478..9ad7f778c8 100644 --- a/src/mainboard/google/rush_ryu/mainboard.c +++ b/src/mainboard/google/rush_ryu/mainboard.c @@ -18,7 +18,9 @@ */ #include +#include #include +#include #include #include #include @@ -29,6 +31,13 @@ #include #include #include +#if IS_ENABLED(CONFIG_CHROMEOS) +#include +#include +#include +#endif + +#include "gpio.h" static const struct pad_config mmcpads[] = { /* MMC4 (eMMC) */ @@ -58,6 +67,27 @@ static const struct funit_cfg funits[] = { FUNIT_CFG_USB(USBD), }; +/* HACK: For proto boards before proto3, we want to disable ec sw sync */ +static void fix_ec_sw_sync(void) +{ +#if IS_ENABLED(CONFIG_CHROMEOS) + struct vboot_handoff *vh; + + if (board_id() >= BOARD_ID_PROTO_3) + return; + + vh = cbmem_find(CBMEM_ID_VBOOT_HANDOFF); + + if (vh == NULL) { + printk(BIOS_ERR, "No vboot handoff struct found\n"); + return; + } + + VbSharedDataHeader *vb_sd = (VbSharedDataHeader *)vh->shared_data; + vb_sd->flags &= ~VBSD_EC_SOFTWARE_SYNC; +#endif +} + static void mainboard_init(device_t dev) { /* PLLD should be 2 * pixel clock (301620khz). */ @@ -76,6 +106,8 @@ static void mainboard_init(device_t dev) i2c_init(I2C6_BUS); elog_init(); elog_add_boot_reason(); + + fix_ec_sw_sync(); } static void mainboard_enable(device_t dev)