diff options
author | Dinesh Maniyam <dinesh.maniyam@intel.com> | 2023-12-07 15:46:02 +0800 |
---|---|---|
committer | Tien Fong Chee <tien.fong.chee@intel.com> | 2024-01-22 16:50:55 +0800 |
commit | 158d648d9f02c9ee0f432bbafeea38aaa55dd943 (patch) | |
tree | e4aa931cbae05f18196fce8ecd2277f0fc3b16d6 /arch/arm/mach-socfpga | |
parent | 3c04fcf3137d5f694d52b8f355373e4baabe5f78 (diff) | |
download | u-boot-158d648d9f02c9ee0f432bbafeea38aaa55dd943.zip u-boot-158d648d9f02c9ee0f432bbafeea38aaa55dd943.tar.gz u-boot-158d648d9f02c9ee0f432bbafeea38aaa55dd943.tar.bz2 |
arm: socfpga: stratix10: SPI clock support
This patch is to add SPI clock support for stratix10. Get clock rate
function always returning 0 because the DW-SPI driver get the rate
from clock node in dts but Stratix10 does not support device tree
clock node.To overcome this spi will get the clock_rate directly
from spi clock controller override the weaker function.
Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
Diffstat (limited to 'arch/arm/mach-socfpga')
-rw-r--r-- | arch/arm/mach-socfpga/clock_manager_s10.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/mach-socfpga/clock_manager_s10.c b/arch/arm/mach-socfpga/clock_manager_s10.c index 4b4f074..4530033 100644 --- a/arch/arm/mach-socfpga/clock_manager_s10.c +++ b/arch/arm/mach-socfpga/clock_manager_s10.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright (C) 2016-2018 Intel Corporation <www.intel.com> + * Copyright (C) 2016-2023 Intel Corporation <www.intel.com> * */ @@ -399,6 +399,21 @@ unsigned int cm_get_l4_sys_free_clk_hz(void) return cm_get_l3_main_clk_hz() / 4; } +/* + * Override weak dw_spi_get_clk implementation in designware_spi.c driver + */ + +int dw_spi_get_clk(struct udevice *bus, ulong *rate) +{ + *rate = cm_get_spi_controller_clk_hz(); + if (!*rate) { + printf("SPI: clock rate is zero"); + return -EINVAL; + } + + return 0; +} + void cm_print_clock_quick_summary(void) { printf("MPU %d kHz\n", (u32)(cm_get_mpu_clk_hz() / 1000)); |