From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Niebel Date: Fri, 13 Mar 2015 10:05:48 +0100 Subject: [U-Boot] [PATCH 2/3] arm: mx6: tqma6: Update to optionally configure an alternative SPI setup In-Reply-To: <5501AE61.2060603@denx.de> References: <1426163671-23297-1-git-send-email-sr@denx.de> <1426163671-23297-2-git-send-email-sr@denx.de> <5501A1CE.7090902@tqsc.de> <5501AE61.2060603@denx.de> Message-ID: <5502A86C.6010504@tqsc.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Stefan, Am 12.03.2015 um 16:18 schrieb Stefan Roese: > Hi Markus, > > On 12.03.2015 15:25, Markus Niebel wrote: >> Am 12.03.2015 um 13:34 schrieb Stefan Roese: >>> By making the tqma6_iomuxc_spi() weak, this patch adds the possibility to >>> add a different function for this SPI configuration. This can be used >>> by other baseboards, that might have a different SPI setup. >>> >>> This patch will be used by the upcoming WRU-IV board support which also >>> uses the TQMa6 SoM. >>> >>> Signed-off-by: Stefan Roese >>> --- >>> board/tqc/tqma6/tqma6.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c >>> index c9e163e..29db838 100644 >>> --- a/board/tqc/tqma6/tqma6.c >>> +++ b/board/tqc/tqma6/tqma6.c >>> @@ -145,7 +145,7 @@ static unsigned const tqma6_ecspi1_cs[] = { >>> TQMA6_SF_CS_GPIO, >>> }; >>> >>> -static void tqma6_iomuxc_spi(void) >>> +__weak void tqma6_iomuxc_spi(void) >>> { >>> unsigned i; >>> >> When implementing an baseboard specific init handler, we will get >> a warning about unused >> tqma6_ecspi1_pads and tqma6_ecspi1_cs, or did I miss something? > > I'm not getting one with the current (unfinished) WRU4 baseboard. Which has no SPI. > Oops, not understand the weak mechanism completely - compiler sees usage of data in weak function but linker selects function from baseboard - correct? If this is the case, we have only the duplication of IOMUX and CS gpio. >> Just as a thought (not ready): Could we supply CS initialisation >> data via defines in the >> baseboard config header and append it to the tables if needed? > > Not sure if I understand this correctly. Could you give an example? Again, my current baseboard has no SPI at all. > tqma6_iomux_spi is for the SPI controller the serial nor is connected, so baseboard specific data are additional CS. You could solve the data duplication using #define TQMA6_BB_ECSPI1_CS_GPIO IMX_GPIO_NR(n, mm), #define TQMA6_BB_CS_PAD_CTRL NEW_PAD_CTRL(MX6_PAD_bla__GPIOn, IOmm, Thanks, > Stefan >