From 2481f1e7b5a14baef45aa044776f750be58ca35d Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Fri, 4 Feb 2022 16:06:17 -0600 Subject: [PATCH] mb/google/reef/coral: Sync mainboard.c with Chromium fork Several commits were made to the Chromium coral branch (firmware-coral-10068.B) which were not committed upstream first. Pull them in here: 486ce56 mainboard/google/coral: Override VBT selection for babymako c1d7720 Babymako: add touchpad i2c speed config 911d547 mainboard/google/coral: Override VBT selection for babytiger 730a5af Babytiger: add touchpad i2c speed config 724711e rabbid: add the touchpad i2c speed config 80c5d16 mainboard/google/coral: Override VBT selection for babymega e8931a4 Babymega: add touchpad i2c speed config These add support for additional coral sub-variants. The I2C speed config changes were adapted to account for upstream changes not present in the coral Chromium branch. Change-Id: Idf2a53a351138aff310385f4026197d74ab6848b Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/61683 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- .../google/reef/variants/coral/mainboard.c | 66 ++++++++++++++++--- 1 file changed, 57 insertions(+), 9 deletions(-) diff --git a/src/mainboard/google/reef/variants/coral/mainboard.c b/src/mainboard/google/reef/variants/coral/mainboard.c index 683624ca65..ec7041d1ac 100644 --- a/src/mainboard/google/reef/variants/coral/mainboard.c +++ b/src/mainboard/google/reef/variants/coral/mainboard.c @@ -21,6 +21,13 @@ enum { SKU_14_EPAULETTE = 14, SKU_15_EPAULETTE = 15, SKU_16_EPAULETTE = 16, + SKU_28_RABBID_RUGGED = 28, + SKU_30_BABYTIGER = 30, + SKU_31_RABBID = 31, + SKU_32_RABBID = 32, + SKU_33_BABYTIGER = 33, + SKU_52_BABYMEGA = 52, + SKU_53_BABYMEGA = 53, SKU_61_ASTRONAUT = 61, SKU_62_ASTRONAUT = 62, SKU_160_NASHER = 160, @@ -51,6 +58,23 @@ void variant_nhlt_oem_overrides(const char **oem_id, *oem_revision = variant_board_sku(); } +#define DW_I2C_SPEED_CONFIG(speedval, lcnt, hcnt, hold) \ + { \ + .speed = I2C_SPEED_ ## speedval, \ + .scl_lcnt = (lcnt), \ + .scl_hcnt = (hcnt), \ + .sda_hold = (hold), \ + } + +static const struct dw_i2c_speed_config +rabbid_i2c_speed_config = DW_I2C_SPEED_CONFIG(FAST, 210, 107, 47); + +static const struct dw_i2c_speed_config +babymega_i2c_speed_config = DW_I2C_SPEED_CONFIG(FAST, 210, 107, 47); + +static const struct dw_i2c_speed_config +babytiger_i2c_speed_config = DW_I2C_SPEED_CONFIG(FAST, 210, 107, 47); + void mainboard_devtree_update(struct device *dev) { /* Override dev tree settings per board */ @@ -60,8 +84,8 @@ void mainboard_devtree_update(struct device *dev) sku_id = variant_board_sku(); switch (sku_id) { - case SKU_0_ASTRONAUT: - case SKU_1_ASTRONAUT: + case SKU_0_ASTRONAUT: + case SKU_1_ASTRONAUT: cfg->usb2eye[1].Usb20PerPortPeTxiSet = 7; cfg->usb2eye[1].Usb20PerPortTxiSet = 2; break; @@ -77,23 +101,36 @@ void mainboard_devtree_update(struct device *dev) cfg->usb2eye[1].Usb20PerPortPeTxiSet = 7; cfg->usb2eye[1].Usb20PerPortTxiSet = 2; break; - case SKU_61_ASTRONAUT: - case SKU_62_ASTRONAUT: + case SKU_28_RABBID_RUGGED: + case SKU_31_RABBID: + case SKU_32_RABBID: + cfg->common_soc_config.i2c[3].speed_config[0] = rabbid_i2c_speed_config; + cfg->common_soc_config.i2c[4].speed_config[0] = rabbid_i2c_speed_config; + break; + case SKU_30_BABYTIGER: + case SKU_33_BABYTIGER: + cfg->common_soc_config.i2c[3].speed_config[0] = babytiger_i2c_speed_config; + cfg->common_soc_config.i2c[4].speed_config[0] = babytiger_i2c_speed_config; + break; + case SKU_52_BABYMEGA: + case SKU_53_BABYMEGA: + cfg->common_soc_config.i2c[4].speed_config[0] = babymega_i2c_speed_config; + break; + case SKU_61_ASTRONAUT: + case SKU_62_ASTRONAUT: cfg->usb2eye[1].Usb20PerPortPeTxiSet = 7; cfg->usb2eye[1].Usb20PerPortTxiSet = 5; - break; + break; default: break; } } - const char *mainboard_vbt_filename(void) { int sku_id = variant_board_sku(); - switch (sku_id) { - case SKU_0_ASTRONAUT: - case SKU_1_ASTRONAUT: + case SKU_0_ASTRONAUT: + case SKU_1_ASTRONAUT: return "vbt-astronaut.bin"; break; case SKU_2_SANTA: @@ -106,6 +143,17 @@ const char *mainboard_vbt_filename(void) case SKU_16_EPAULETTE: return "vbt-epaulette.bin"; break; + case SKU_28_RABBID_RUGGED: + return "vbt-rabbid_rugged.bin"; + break; + case SKU_30_BABYTIGER: + case SKU_33_BABYTIGER: + return "vbt-babytiger.bin"; + break; + case SKU_52_BABYMEGA: + case SKU_53_BABYMEGA: + return "vbt-babymega.bin"; + break; case SKU_160_NASHER: case SKU_161_NASHER: case SKU_162_NASHER: