From: Reinhard Meyer Date: Tue, 28 Sep 2010 13:02:06 +0200 Subject: [U-Boot] [RFC] [PATCH 0/4] Add support for Freescale's 85xx and P1/P2xxx eSPI controller In-Reply-To: <4CA1BBE0.4050209@locatacorp.com> References: <1281046488-25187-1-git-send-email-john.rigby@linaro.org> <1281046488-25187-2-git-send-email-john.rigby@linaro.org> <7751C735-9B47-496B-87A8-B8201F5FC562@kernel.crashing.org> <4CA1BBE0.4050209@locatacorp.com> Message-ID: <4CA1CB2E.2080501@emk-elektronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Can Aydin, > The reason this is an RFC is that unfortunately the hardware on these > chips does not permit indefinite SPI transactions on a given chip > select. A chip select is asserted only when a 'transaction length' has > been passed to the controller. Once the number of characters specified > in the transaction length have been transmitted, the controller decides > that the 'frame' has ended and de-asserts the chip select after a > defined delay. It is not possible to initiate a second transfer without > re-initialising the command register, and hence clearing and > re-asserting a chip select signal. > > This patch set addresses the issue by defining a read/write function in > the spi_flash_internal API. Subsequent patches add the freescale eSPI > driver and add support for it in the spansion driver and the P1/P2 board > configuration header. > > I'm pretty sure that there are better ways of doing this, especially if > a driver model with support for driver quirks was implemented for > instance. Until then however, I assume having some sort of ability to > use the SPI controller on these boards would be better than not being > able to do anything at all. If anyone has a better solution please feel > free to comment. Can the Chip Select Pins be used as GPIO? It might be simpler to do that than adding a speciality to common code. > mode change 100644 => 100755 drivers/mtd/spi/spansion.c > mode change 100644 => 100755 drivers/mtd/spi/spi_flash.c > mode change 100644 => 100755 drivers/mtd/spi/spi_flash_internal.h > create mode 100755 drivers/spi/fsl_espi.c > create mode 100755 include/fsl_espi.h Having edited from W****** using Samba? Make sure the file modes are and stay 644! Without looking at the functionality I saw several coding style issues in the patch series: + if ( cmd_len&& cmd ) + memcpy(buffer, cmd, cmd_len); should be like "if (cmd_len && cmd)" Similar space issues seem to happen all over your patches, examples: + for ( i = 0; i< size; i++) + return bus == 0&& cs< ESPI_MAX_CS_NUM; +#define ESPI_COM_CS(x) ((x)<< 30) You need to fix that globally... Best Regards, Reinhard PS: you might want to wait and see if that patch in common code to fix a special hardware issue is welcome@all ;)