From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Mon, 26 May 2008 09:40:30 -0700 Subject: [U-Boot-Users] [PATCH] Move conditional compilation of MPC8XXX SPI driver to Makefile In-Reply-To: <20080526152602.48B9B2430A@gemini.denx.de> References: <20080526152602.48B9B2430A@gemini.denx.de> Message-ID: <483AE7FE.6040508@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: > In message <483AD1FC.7040805@gmail.com> you wrote: > >> If CONFIG_MPC8XXX_SPI is defined but CONFIG_HARD_SPI is not, compilation >> will fail, since CONFIG_HARD_SPI activates the common SPI code on >> > > How would I configure a system to use CONFIG_SOFT_SPI on a MPC8XXX > system? > > That's actually pretty easy: 1. #define CONFIG_SOFT_SPI in board config 2. define bit-bang parameters in board code 3. Call spi_init() from board code The CONFIG_HARD_SPI define doesn't actually do anything hardware-related. The only place it's used is in lib_ppc/board.c to initialize a SPI controller, but the code could equally-well start a soft SPI controller. I would have used CONFIG_SPI, but that was already taken by SPI EEPROM stuff. Maybe it's time to refactor a bit more... >> PowerPC. I guess I figured Kconfig would eventually manage the >> dependencies of these options, but I will put the #ifdef back in if you >> want. >> > > At the moment it seems logical to me to leave this test as it was. > > Best regards, > > Wolfgang Denk > > regards, Ben