From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Jander Date: Fri, 20 Aug 2010 12:30:54 +0200 Subject: [U-Boot] [PATCH] Use common function to set GPIOs for MX3 and MX5 In-Reply-To: <4C6E56E9.1050807@denx.de> References: <1282292411-6087-1-git-send-email-sbabic@denx.de> <201008201207.44578.david.jander@protonic.nl> <4C6E56E9.1050807@denx.de> Message-ID: <201008201230.54304.david.jander@protonic.nl> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Friday 20 August 2010 12:20:25 pm Stefano Babic wrote: > David Jander wrote: > > Great. I'll wait. > > In the meantime I have just done this to get it working: > > > > #ifdef CONFIG_MX31 > > void spi_cs_activate(struct spi_slave *slave) > > { > > struct mxc_spi_slave *mxcs = to_mxc_spi_slave(slave); > > if (mxcs->gpio > 0) > > mxc_gpio_set(mxcs->gpio, mxcs->ctrl_reg & MXC_CSPICTRL_SSPOL); > > } > > Ok, but one goal I have is to get rid of nasty #ifdef CONFIG_MX*. I > introduce general gpio functions to make code more common, and I do not > want to fall back adding processor switches. Absolutely right. I just posted it as reference for your patch eventually, not because I thought it was good that way. > > Seems to work, but never mind... > > Ok, I will resend my patch, I hope you can give a chance a test it on > your target. Will do. Btw, do you have any idea why spi_xchg_single() hangs while transmitting the second word without claiming the bus again? Also, I don't know if you already fixed mxc_spi.c, to use the correct byte- ordering when sending u8 buffers. I have a fix, but it is not yet ready. I essentially renamed spi_xfer() to spi_xfer_fsl(), to be used in the (broken) pmic driver, and wrote a new spi_xfer() function which works correcly for u8 buffers. Best regards, -- David Jander Protonic Holland.