From 4094ae369d1b6f62b4e608c583723353664e3b3d Mon Sep 17 00:00:00 2001 From: Sean Rhodes Date: Mon, 12 Aug 2024 10:19:34 +0100 Subject: mb/starlabs/starlite_adl: Make I2C speed configurable Make the I2C speed user configurable from CMOS. Both the touchscreen and accelerometer support running at 100MHz or 400MHz. They perform better at 400MHz but use more power - this patch lets the user choose. Change-Id: Ia1b08d7ec6212418bb95d0a52077f01c930f8830 Signed-off-by: Sean Rhodes Reviewed-on: https://review.coreboot.org/c/coreboot/+/83882 Tested-by: build bot (Jenkins) Reviewed-by: Maxim Polyakov --- src/mainboard/starlabs/starlite_adl/variants/mk_v/devicetree.cb | 9 --------- src/mainboard/starlabs/starlite_adl/variants/mk_v/devtree.c | 6 ++++++ 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src/mainboard/starlabs') diff --git a/src/mainboard/starlabs/starlite_adl/variants/mk_v/devicetree.cb b/src/mainboard/starlabs/starlite_adl/variants/mk_v/devicetree.cb index fc21f18d74..c1af6475b4 100644 --- a/src/mainboard/starlabs/starlite_adl/variants/mk_v/devicetree.cb +++ b/src/mainboard/starlabs/starlite_adl/variants/mk_v/devicetree.cb @@ -1,13 +1,4 @@ chip soc/intel/alderlake - register "common_soc_config" = "{ - .i2c[0] = { - .speed = I2C_SPEED_FAST, - }, - .i2c[2] = { - .speed = I2C_SPEED_FAST, - }, - }" - # FSP UPDs register "cnvi_bt_audio_offload" = "true" register "cnvi_bt_core" = "true" diff --git a/src/mainboard/starlabs/starlite_adl/variants/mk_v/devtree.c b/src/mainboard/starlabs/starlite_adl/variants/mk_v/devtree.c index 7184cdbc4c..331bc7f25b 100644 --- a/src/mainboard/starlabs/starlite_adl/variants/mk_v/devtree.c +++ b/src/mainboard/starlabs/starlite_adl/variants/mk_v/devtree.c @@ -63,4 +63,10 @@ void devtree_update(void) /* Enable/Disable Accelerometer based on CMOS settings */ if (get_uint_option("accelerometer", 1) == 0) accelerometer_dev->enabled = 0; + + /* Set I2C devices speed to fast based on CMOS settings */ + if (get_uint_option("i2c_speed_fast", 0) == 1) { + common_config->i2c[0].speed = I2C_SPEED_FAST; + common_config->i2c[2].speed = I2C_SPEED_FAST; + } } -- cgit v1.2.3