aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common/lpss_i2c.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-11-09 23:20:30 -0600
committerAaron Durbin <adurbin@chromium.org>2016-11-12 00:19:22 +0100
commit2b3e0cdfc4ddefb85e779fa789ba21406a5f76a3 (patch)
treef28ff6229c6b6378747fc11b122d0f4c48b89880 /src/soc/intel/common/lpss_i2c.h
parent8b5d04e1abd1d7c3b9447385b043b0d902d22a54 (diff)
soc/intel/common/lpss_i2c: configure buses by rise/fall times
The default register count calculations are leading to higher frequencies than expected. Provide an alternative method for calculating the register counts by utilizing the rise and fall times of the bus. If the rise time is supplied the rise/fall time values are used, but the register overrides take precedence over the rise/fall time calculation. This allows platforms to choose whichever method works the best. BUG=chrome-os-partner:58889 Change-Id: I7747613ce51d8151848acd916c09ae97bfc4b86a Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/17350 Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/soc/intel/common/lpss_i2c.h')
-rw-r--r--src/soc/intel/common/lpss_i2c.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/soc/intel/common/lpss_i2c.h b/src/soc/intel/common/lpss_i2c.h
index f4a48bddef..956697356d 100644
--- a/src/soc/intel/common/lpss_i2c.h
+++ b/src/soc/intel/common/lpss_i2c.h
@@ -55,6 +55,12 @@ struct lpss_i2c_bus_config {
int early_init;
/* Bus speed in Hz, default is I2C_SPEED_FAST (400 KHz) */
enum i2c_speed speed;
+ /* If rise_time_ns is non-zero the calculations for lcnt and hcnt
+ * registers take into account the times of the bus. However, if
+ * there is a match in speed_config those register values take
+ * precedence. */
+ int rise_time_ns;
+ int fall_time_ns;
/* Specific bus speed configuration */
struct lpss_i2c_speed_config speed_config[LPSS_I2C_SPEED_CONFIG_COUNT];
};
@@ -79,7 +85,8 @@ uintptr_t lpss_i2c_base_address(unsigned bus);
* Generate I2C timing information into the SSDT for the OS driver to consume,
* optionally applying override values provided by the caller.
*/
-void lpss_i2c_acpi_fill_ssdt(const struct lpss_i2c_bus_config *bcfg);
+void lpss_i2c_acpi_fill_ssdt(unsigned bus,
+ const struct lpss_i2c_bus_config *bcfg);
/*
* Initialize this bus controller and set the speed.