From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Wed, 05 Aug 2015 10:36:33 +0200 Subject: [U-Boot] [PATCH] Do not mux and setup SPI if disabled in the config In-Reply-To: <20150805081700.GA25206@pqgruber.com> References: <1438709320-18454-1-git-send-email-clemens.gruber@pqgruber.com> <55C19CC6.5040506@denx.de> <20150805072822.GA22422@pqgruber.com> <55C1C3B6.6040606@denx.de> <20150805081700.GA25206@pqgruber.com> Message-ID: <55C1CB11.30702@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 Hi Clemens, On 05.08.2015 10:17, Clemens Gruber wrote: > On Wed, Aug 05, 2015 at 10:05:10AM +0200, Stefan Roese wrote: >> How about this patch: >> >> diff --git a/board/tqc/tqma6/tqma6.c b/board/tqc/tqma6/tqma6.c >> index 29db838..345930f 100644 >> --- a/board/tqc/tqma6/tqma6.c >> +++ b/board/tqc/tqma6/tqma6.c >> @@ -28,6 +28,13 @@ >> >> #include "tqma6_bb.h" >> >> +#ifndef CONFIG_SF_DEFAULT_BUS >> +#define CONFIG_SF_DEFAULT_BUS 0 >> +#endif >> +#ifndef CONFIG_SF_DEFAULT_CS >> +#define CONFIG_SF_DEFAULT_CS 0 >> +#endif >> >> Does this work for you? > > This should work, but wouldn't it be cleaner to just exclude the SPI parts? > Why add 7 LOC when 4 LOC are enough to exclude the SPI parts? Besides that, it > reduces the binary size. The binary size should be the same (I didn't check this). The linker should remove the not referenced functions / variables. As for the added 7 LOC, Jagans suggestion to include "spi_flash.h" should also work instead. This seems to be a nice solution for me that doesn't add any new #ifdef's to the code. Thanks, Stefan