From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sat, 15 Nov 2014 15:40:10 +0100 Subject: [U-Boot] [PATCH 6/6] arm: socfpga: Add Designware (DW) SPI support to config header In-Reply-To: <54675687.6080702@denx.de> References: <1415364634-8290-1-git-send-email-sr@denx.de> <201411142118.04113.marex@denx.de> <54675687.6080702@denx.de> Message-ID: <201411151540.10207.marex@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 Saturday, November 15, 2014 at 02:35:03 PM, Stefan Roese wrote: > On 14.11.2014 21:18, Marek Vasut wrote: > > On Wednesday, November 12, 2014 at 06:53:54 PM, Pavel Machek wrote: > >> On Fri 2014-11-07 13:50:34, Stefan Roese wrote: > >>> Enable support for the DW master SPI controller in the config header > >>> for the SoCFPGA. This controller can only be enabled, if DT support > >>> is enabled. > >>> > >>> Signed-off-by: Stefan Roese > >>> Cc: Chin Liang See > >>> Cc: Dinh Nguyen > >>> Cc: Vince Bridgers > >>> Cc: Marek Vasut > >>> Cc: Pavel Machek > >>> --- > >>> > >>> include/configs/socfpga_common.h | 12 ++++++++++++ > >>> 1 file changed, 12 insertions(+) > >>> > >>> diff --git a/include/configs/socfpga_common.h > >>> b/include/configs/socfpga_common.h index 9fc4212..830b956 100644 > >>> --- a/include/configs/socfpga_common.h > >>> +++ b/include/configs/socfpga_common.h > >>> @@ -191,6 +191,18 @@ unsigned int cm_get_qspi_controller_clk_hz(void); > >>> > >>> #define CONFIG_CMD_SF > >>> #endif > >>> > >>> +#ifdef CONFIG_OF_CONTROL /* DW SPI is controlled via DT */ > >>> +#define CONFIG_CMD_DM > >>> +#define CONFIG_DM > >>> +#define CONFIG_DM_SPI > >>> +#define CONFIG_DESIGNWARE_SPI > >>> +#ifndef __ASSEMBLY__ > >>> +unsigned int cm_get_spi_controller_clk_hz(void); > >>> +#define CONFIG_DW_SPI_REF_CLK cm_get_spi_controller_clk_hz() > >> > >> Putting prototypes into configuration file is ugly. Hiding function > >> call into macro so that it looks like constant is evil. Is there > >> better solution? > > > > The SPI driver should call this function directly. Or is there a reason > > why such a macro is used ? > > Historically. I'll check it again and will implement it differently in > the next version. Tomorrow or on Monday. Roger. Thank you! Best regards, Marek Vasut