soc/intel/common: Add error print in common i2c

Print error message when using common i2c without default clock defined.

TEST=Do not define default clock in Kconfig, compile will stop for
assertion.

Change-Id: I803f97698b3928e6b64df0010e71a6ded1400f87
Signed-off-by: Lijian Zhao <lijian.zhao@intel.com>
Reviewed-on: https://review.coreboot.org/22405
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
Lijian Zhao 2017-11-09 15:52:16 -08:00 committed by Aaron Durbin
parent f3885618d9
commit e1f4d790e4
1 changed files with 2 additions and 3 deletions

View File

@ -540,9 +540,8 @@ int lpss_i2c_gen_speed_config(struct lpss_i2c_regs *regs,
uint16_t hcnt_min, lcnt_min;
int i;
/* Clock must be provided by Kconfig */
if (!ic_clk)
return -1;
_Static_assert(CONFIG_SOC_INTEL_COMMON_LPSS_CLOCK_MHZ != 0,
"SOC_INTEL_COMMON_LPSS_CLOCK_MHZ can't be zero!");
/* Apply board specific override for this speed if found */
for (i = 0; i < LPSS_I2C_SPEED_CONFIG_COUNT; i++) {