From: Marek Vasut Date: Mon, 13 Nov 2017 17:52:09 +0100 Subject: [U-Boot] [PATCH v4 1/2] SOCFPGA: clock manager: implement dw_spi_get_clk function In-Reply-To: <20171113094745.7506-2-Eugeniy.Paltsev@synopsys.com> References: <20171113094745.7506-1-Eugeniy.Paltsev@synopsys.com> <20171113094745.7506-2-Eugeniy.Paltsev@synopsys.com> Message-ID: <23a5fcac-14fa-630c-0037-fa4e7f884794@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/13/2017 10:47 AM, Eugeniy Paltsev wrote: > Implement dw_spi_get_clk function to override its weak > implementation in designware_spi.c driver. > > We need this change to get rid of cm_get_spi_controller_clk_hz > function and clock_manager.h include in designware_spi.c driver. > > Signed-off-by: Eugeniy Paltsev Reviewed-by: Marek Vasut > --- > arch/arm/mach-socfpga/clock_manager_arria10.c | 9 +++++++++ > arch/arm/mach-socfpga/clock_manager_gen5.c | 9 +++++++++ > 2 files changed, 18 insertions(+) > > diff --git a/arch/arm/mach-socfpga/clock_manager_arria10.c b/arch/arm/mach-socfpga/clock_manager_arria10.c > index 482b854..623a266 100644 > --- a/arch/arm/mach-socfpga/clock_manager_arria10.c > +++ b/arch/arm/mach-socfpga/clock_manager_arria10.c > @@ -7,6 +7,7 @@ > #include > #include > #include > +#include > #include > > DECLARE_GLOBAL_DATA_PTR; > @@ -1076,6 +1077,14 @@ unsigned int cm_get_qspi_controller_clk_hz(void) > return cm_get_l4_noc_hz(CLKMGR_MAINPLL_NOCDIV_L4MAINCLK_LSB); > } > > +/* 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(); > + > + return 0; > +} > + > void cm_print_clock_quick_summary(void) > { > printf("MPU %10ld kHz\n", cm_get_mpu_clk_hz() / 1000); > diff --git a/arch/arm/mach-socfpga/clock_manager_gen5.c b/arch/arm/mach-socfpga/clock_manager_gen5.c > index 31fd510..a371d83 100644 > --- a/arch/arm/mach-socfpga/clock_manager_gen5.c > +++ b/arch/arm/mach-socfpga/clock_manager_gen5.c > @@ -6,6 +6,7 @@ > > #include > #include > +#include > #include > #include > > @@ -509,6 +510,14 @@ unsigned int cm_get_spi_controller_clk_hz(void) > return clock; > } > > +/* 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(); > + > + return 0; > +} > + > void cm_print_clock_quick_summary(void) > { > printf("MPU %10ld kHz\n", cm_get_mpu_clk_hz() / 1000); > -- Best regards, Marek Vasut