From 551e4be7301eca04104c8f0d4379b906dfb07c1b Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Tue, 10 Apr 2018 09:24:54 -0600 Subject: soc/intel/common: prepare for lpss clock split Apparently Intel had decided to use different clock speeds for some of its IP blocks in some of its designs. The i2c designware driver has already been moved into common code allowing for its own Kconfig value. That currently leaves SPI (UART isn't using the clock currently). Therefore, remove SOC_INTEL_COMMON_LPSS_CLOCK_MHZ and add SOC_INTEL_COMMON_BLOCK_GSPI_CLOCK_MHZ to allow for the different clock speeds present in the system for the various IP blocks. BUG=b:75306520 Change-Id: I6cb8c2de0ff446b6006bc37645fca64f2b70bf17 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/25608 Reviewed-by: Furquan Shaikh Reviewed-by: Hannah Williams Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) --- src/soc/intel/common/block/gspi/Kconfig | 8 ++++++++ src/soc/intel/common/block/gspi/gspi.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/soc/intel/common/block/gspi') diff --git a/src/soc/intel/common/block/gspi/Kconfig b/src/soc/intel/common/block/gspi/Kconfig index 8fa847a1b8..d2776ca1a4 100644 --- a/src/soc/intel/common/block/gspi/Kconfig +++ b/src/soc/intel/common/block/gspi/Kconfig @@ -3,6 +3,14 @@ config SOC_INTEL_COMMON_BLOCK_GSPI help Intel Processor Common GSPI support +config SOC_INTEL_COMMON_BLOCK_GSPI_CLOCK_MHZ + int + depends on SOC_INTEL_COMMON_BLOCK_GSPI + help + The input clock speed into the SPI controller IP block, in MHz. + No default is set here as this is an SOC-specific value + and must be provided by the SOC. + config SOC_INTEL_COMMON_BLOCK_GSPI_MAX int depends on SOC_INTEL_COMMON_BLOCK_GSPI diff --git a/src/soc/intel/common/block/gspi/gspi.c b/src/soc/intel/common/block/gspi/gspi.c index 60c7391ad0..e4e44c22bb 100644 --- a/src/soc/intel/common/block/gspi/gspi.c +++ b/src/soc/intel/common/block/gspi/gspi.c @@ -380,7 +380,8 @@ static void gspi_cs_deassert(const struct spi_slave *dev) static uint32_t gspi_get_clk_div(unsigned int gspi_bus) { - const uint32_t ref_clk_mhz = CONFIG_SOC_INTEL_COMMON_LPSS_CLOCK_MHZ; + const uint32_t ref_clk_mhz = + CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_CLOCK_MHZ; const uint32_t gspi_clk_mhz = gspi_get_bus_clk_mhz(gspi_bus); assert(gspi_clk_mhz != 0); -- cgit v1.2.3