spi-imx race condition

2013-11-24 Thread Marek Vasut
ideas please? Thank you! Best regards, Marek Vasut -- Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic

Re: [PATCH 01/13] spi: spi-mxs: Always set LOCK_CS

2013-10-18 Thread Marek Vasut
Dear Mark Brown, > On Fri, Oct 18, 2013 at 04:38:52PM +0200, Marek Vasut wrote: > > I don't quite understand this, is it OK to merge untested patches? I have > > them in my review queue, but I was simply busy so I didn't get to them > > for a while. Fabio is unfortu

Re: [PATCH 01/13] spi: spi-mxs: Always set LOCK_CS

2013-10-18 Thread Marek Vasut
Dear Trent Piepho, > On Thu, Oct 17, 2013 at 11:23 PM, Marek Vasut wrote: > > Dear Trent Piepho, > > > >> On Thu, Oct 17, 2013 at 9:33 PM, Marek Vasut wrote: > >> > Dear Mark Brown, > >> > > >> >> On Tue, Oct 01, 2013 at 01:14:25P

Re: [PATCH 01/13] spi: spi-mxs: Always set LOCK_CS

2013-10-18 Thread Marek Vasut
Hi Mark, > On Fri, Oct 18, 2013 at 08:23:21AM +0200, Marek Vasut wrote: > > SPI flashes are the most significant users of this IP block on the > > MX23/MX28, that's why I'm unhappy patches that might break them were > > pulled in without any Tested-by/Reviewed-by

Re: [PATCH 01/13] spi: spi-mxs: Always set LOCK_CS

2013-10-17 Thread Marek Vasut
Dear Trent Piepho, > On Thu, Oct 17, 2013 at 9:33 PM, Marek Vasut wrote: > > Dear Mark Brown, > > > >> On Tue, Oct 01, 2013 at 01:14:25PM -0700, Trent Piepho wrote: > >> > There are two bits which control the CS line in the CTRL0 register: > >> &

Re: [PATCH 01/13] spi: spi-mxs: Always set LOCK_CS

2013-10-17 Thread Marek Vasut
s. Did the patches undergo any kind of testing? I was busy so I couldn't even review them yet, sorry. Best regards, Marek Vasut -- October Webinars: Code for Performance Free Intel webinars can help you accelerate

Re: [PATCH 01/13] spi: spi-mxs: Always set LOCK_CS

2013-10-03 Thread Marek Vasut
#x27;t appear to do > this in any sane manner. It appears to be related to the hardware > FIFO fill level. > > The code can be simplified by just setting LOCK_CS once and then not > needing to deal with it at all in the PIO and DMA transfer functions. > > Signed-off-by: Tre

Re: [PATCH] mxs/spi: Add SPI slave mode operation DT prop

2013-04-14 Thread Marek Vasut
Dear Trent Piepho, > On Wed, Mar 20, 2013 at 4:35 PM, Marek Vasut wrote: > >> On Thu, Aug 23, 2012 at 7:42 PM, Marek Vasut > >> > >> > + - The DMA has to wait indefinitelly for the arriving > >> > data. > >> > >> Is t

Re: [PATCH V2 01/12] spi/mxs: Always set LOCK_CS

2013-04-14 Thread Marek Vasut
between each word. Though don't get your > hopes up if you want to do this, as the hardware doesn't appear to do > this in any sane manner. > > The code can be simplified by just setting LOCK_CS once and then not > needing to deal with it in the PIO and DMA transfer functio

Re: [PATCH V2 08/12] spi/mxs: Fix race in setup method

2013-04-02 Thread Marek Vasut
Dear Trent Piepho, > On Apr 2, 2013 7:27 PM, "Marek Vasut" wrote: > > > The only useful thing mxs_spi_setup_transfer() (which > > > is no longer called) did in this instance was make that check. > > > > > > > btw. I was under the impression th

Re: [PATCH V2 08/12] spi/mxs: Fix race in setup method

2013-04-02 Thread Marek Vasut
Dear Trent Piepho, > On Tue, Apr 2, 2013 at 4:31 PM, Marek Vasut wrote: > >> static int mxs_spi_setup(struct spi_device *dev) > >> { > >> > >> - int err = 0; > >> - > >> > >> if (!dev->bits_per_word) > >&g

Re: [PATCH 1/5] spi/mxs: Fix extra CS pulses and read mode in multi-transfer messages

2013-04-02 Thread Marek Vasut
Dear Trent Piepho, > On Tue, Apr 2, 2013 at 3:32 AM, Marek Vasut wrote: > >> Don't see anything in CodingStyle that one should be preferred over > >> the other. > > > > There ain't any I'm aware of, but to paraphrase you, let's

Re: [PATCH V2 11/12] spi/mxs: Don't set clock for each xfer

2013-04-02 Thread Marek Vasut
ubles from about 290 KB/sec to 600 > KB/sec. > > Signed-off-by: Trent Piepho > Cc: Marek Vasut > Cc: Fabio Estevam > Cc: Shawn Guo > --- > drivers/spi/spi-mxs.c | 15 ++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/d

Re: [PATCH V2 10/12] spi/mxs: Clean up setup_transfer function

2013-04-02 Thread Marek Vasut
It's not necessary to check if the spi_transfer's speed_hz is zero, as > the spi core also fills it in from the spi_device. However, the spi > core does not check if spi_device's speed is zero so we have to do > that still. > > Signed-off-by: Trent Piepho > Cc: Ma

Re: [PATCH V2 08/12] spi/mxs: Fix race in setup method

2013-04-02 Thread Marek Vasut
er shared state will corrupt those > transfers. > > So fix mxs_spi_setup() to not call mxs_spi_setup_transfer(). > > Signed-off-by: Trent Piepho > Cc: Marek Vasut > Cc: Fabio Estevam > Cc: Shawn Guo > --- > drivers/spi/spi-mxs.c | 11 +++ > 1 file ch

Re: [PATCH V2 05/12] spi/mxs: Fix chip select control bits in DMA mode

2013-04-02 Thread Marek Vasut
selecting the CS, one for PIO that worked and one for DMA that didn't. > > Change the code to set the CS bits in the message transfer function > once. Now the DMA and PIO txrx functions don't need to care about CS > at all. > > Signed-off-by: Trent Pieph

Re: [PATCH V2 03/12] spi/mxs: Change flag arguments in txrx functions to bit flags

2013-04-02 Thread Marek Vasut
which is not last and not de-assert on the > last transfer, so it is not which transfer is the last we need to know > but rather the transfers which after which CS should be de-asserted. > > This also extends the driver to not ignore cs_change when setting the > DEASSERT_CS nee &qu

Re: [PATCH V2 01/12] spi/mxs: Always set LOCK_CS

2013-04-02 Thread Marek Vasut
be simplified by just setting LOCK_CS once and then not > needing to deal with it in the PIO and DMA transfer functions. > > Signed-off-by: Trent Piepho > Cc: Marek Vasut > Cc: Fabio Estevam > Cc: Shawn Guo > --- > drivers/spi/spi-mxs.c |8 ++-- > 1 file

Re: [PATCH 1/5] spi/mxs: Fix extra CS pulses and read mode in multi-transfer messages

2013-04-02 Thread Marek Vasut
Dear Trent Piepho, > On Mon, Apr 1, 2013 at 9:22 PM, Marek Vasut wrote: > >> On Mon, Apr 1, 2013 at 4:11 PM, Marek Vasut wrote: > >> >> +#define TXRX_WRITE 1 /* This is a write */ > >> >> +#define TXRX_DEASSERT_CS

Re: [PATCH 1/5] spi/mxs: Fix extra CS pulses and read mode in multi-transfer messages

2013-04-01 Thread Marek Vasut
Dear Trent Piepho, > On Mon, Apr 1, 2013 at 4:11 PM, Marek Vasut wrote: > >> +#define TXRX_WRITE 1 /* This is a write */ > >> +#define TXRX_DEASSERT_CS 2 /* De-assert CS at end of txrx */ > > > > New flags? I'm sure the GCC can op

Re: [PATCH 4/5] spi/mxs: Remove bogus setting of ssp clk rate field

2013-04-01 Thread Marek Vasut
Dear Trent Piepho, > On Mon, Apr 1, 2013 at 4:37 PM, Marek Vasut wrote: > >> On Mon, Apr 1, 2013 at 4:16 PM, Marek Vasut wrote: > >> >> The ssp struct has a clock rate field, to provide the actual value, > >> >> in Hz, of the SS

Re: [PATCH 2/5] spi/mxs: Fix chip select control bits in DMA mode

2013-04-01 Thread Marek Vasut
Dear Trent Piepho, > On Mon, Apr 1, 2013 at 4:30 PM, Marek Vasut wrote: > >> >> -static uint32_t mxs_spi_cs_to_reg(unsigned cs) > >> >> +static u32 mxs_spi_cs_to_reg(unsigned cs) > >> >> > >> >> { > >> >> > >&

Re: [PATCH 4/5] spi/mxs: Remove bogus setting of ssp clk rate field

2013-04-01 Thread Marek Vasut
Dear Trent Piepho, > On Mon, Apr 1, 2013 at 4:16 PM, Marek Vasut wrote: > >> The ssp struct has a clock rate field, to provide the actual value, in > >> Hz, of the SSP output clock (the rate of SSP_SCK) after > >> mxs_ssp_set_clk_rate() is called. It s

Re: [PATCH 2/5] spi/mxs: Fix chip select control bits in DMA mode

2013-04-01 Thread Marek Vasut
Dear Trent Piepho, > On Mon, Apr 1, 2013 at 4:13 PM, Marek Vasut wrote: > >> Change the code to set the CS bits in the message transfer function > >> once. Now the DMA and PIO txrx functions don't need to care about CS > >> at all. > > > > Ok, le

Re: [PATCH 5/5] spi/mxs: Fix multiple slave bug and don't set clock for each xfer

2013-04-01 Thread Marek Vasut
ut 290 KB/sec to 600 > KB/sec. This patch is full of unrelated changes, the relevant parts are not clear. Please clean up and resubmit with only the relevant changes. > Signed-off-by: Trent Piepho > Cc: Marek Vasut > Cc: Fabio Estevam > Cc: Shawn Guo > --- > dr

Re: [PATCH 4/5] spi/mxs: Remove bogus setting of ssp clk rate field

2013-04-01 Thread Marek Vasut
ch should also fix drivers/clk/mxs/clk-ssp.c then? > Signed-off-by: Trent Piepho > Cc: Marek Vasut > Cc: Fabio Estevam > Cc: Shawn Guo > --- > drivers/spi/spi-mxs.c |1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-

Re: [PATCH 2/5] spi/mxs: Fix chip select control bits in DMA mode

2013-04-01 Thread Marek Vasut
MA work with long transfers where the CTRL0 will be overwritten on each turn? Did you actually test this? > Signed-off-by: Trent Piepho > Cc: Marek Vasut > Cc: Fabio Estevam > Cc: Shawn Guo > --- > drivers/spi/spi-mxs.c | 40 +++- > 1

Re: [PATCH 1/5] spi/mxs: Fix extra CS pulses and read mode in multi-transfer messages

2013-04-01 Thread Marek Vasut
mode, > eliminates the flags being passed as separate pointers, and adds > support for the cs_change flag. > > Note that while using the cs_change flag to leave CS asserted after > the final transfer works, getting the CS to automatically turn off > when a

Re: [PATCH] mxs/spi: Add SPI slave mode operation DT prop

2013-03-20 Thread Marek Vasut
Dear Trent Piepho, > On Thu, Aug 23, 2012 at 7:42 PM, Marek Vasut > > wrote: > > This allows user to select the slave mode of operation of the controller. > > This is by no means standard, see the binding documentation for details, > > there is plenty of them. S

Re: [PATCH V2] mxs: spi: clear XFER_COUNT in ctrl0 field in DMA descriptor

2013-01-07 Thread Marek Vasut
; This caused a timeout (SSP_TIMEOUT) to happen in the processing of the last > DMA descriptor, and thus reads and writes were failing. > This is a fix for the problem, by clearing XFER_COUNT bytes in ctrl0 before > setting the new XFER_COUNT for DMA descriptor. > > Cc: Marek Vasut

Re: [PATCH] mxs: spi: clear XFER_LEN in CTRL0 register during DMA

2012-12-25 Thread Marek Vasut
This is actually a correct fix for the issue. > , by clearing the XFER_LEN bytes always > before reading the new size for XFER_LEN. before setting new XFER_COUNT into the ctrl0 field of DMA control transfer. > Cc: Marek Vasut > Cc: Fabio Estevam > Cc: Shawn Guo Signed-off-by:

Re: [PATCH 1/2] spi: mxs: Assign message status after transfer finished

2012-10-26 Thread Marek Vasut
Dear Mark Brown, > On Fri, Oct 26, 2012 at 02:31:53PM +0200, Marek Vasut wrote: > > Dear Mark Brown, > > > > > Applied both, thanks. > > > > Will they hit 3.7 please? > > I hadn't been going to do that, no - nothing about them seemed > esp

Re: [PATCH 1/2] spi: mxs: Assign message status after transfer finished

2012-10-26 Thread Marek Vasut
Dear Mark Brown, > On Sun, Oct 14, 2012 at 04:32:55AM +0200, Marek Vasut wrote: > > In the current code implementing the MXS SPI driver, every transferred > > message had assigned status = 0, which is not correct. Properly assign > > status returned from the I/O functio

[PATCH 2/2] spi: mxs: Terminate DMA in case of DMA timeout

2012-10-13 Thread Marek Vasut
In case the SPI DMA times out, the DMA might still be in some kind of inconsistent state. Issue dmaengine_terminate_all() on the particular channel to kill off all operations before continuing. Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Fabio Estevam Cc: Grant Likely Cc: Mark Brown Cc

[PATCH 1/2] spi: mxs: Assign message status after transfer finished

2012-10-13 Thread Marek Vasut
In the current code implementing the MXS SPI driver, every transferred message had assigned status = 0, which is not correct. Properly assign status returned from the I/O functions. Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Fabio Estevam Cc: Grant Likely Cc: Mark Brown Cc: Shawn Guo

Re: [PATCH V4] MXS: Implement DMA support into mxs-i2c

2012-10-08 Thread Marek Vasut
Dear Wolfram Sang, > On Fri, Aug 24, 2012 at 05:44:31AM +0200, Marek Vasut wrote: > > This patch implements DMA support into mxs-i2c. DMA transfers are now > > enabled via DT. The DMA operation is enabled by default. > > > > Signed-off-by: Marek Vasut > > Th

Re: [PATCH V4] MXS: Implement DMA support into mxs-i2c

2012-09-26 Thread Marek Vasut
Dear Wolfram Sang, [...] Didn't you claim you're adding this DMA patch into next some time ago finally? ;-) Subject: Re: I2C_FUNC_SMBUS_QUICK on i2c-mxs Message-ID: <20120830135612.gj27...@pengutronix.de> Best rega

Re: [PATCH V4] MXS: Implement DMA support into mxs-i2c

2012-09-16 Thread Marek Vasut
Please give reasons. It's abuse of proper configuration of hardware property. > > Besides, someone might simply forget to add the binding, you'd need to > > print a warning. > > ? It is "on" by default because of the entry in the dtsi. And the status > of D

Re: [PATCH V4] MXS: Implement DMA support into mxs-i2c

2012-09-16 Thread Marek Vasut
Dear Wolfram Sang, > On Fri, Aug 24, 2012 at 05:44:31AM +0200, Marek Vasut wrote: > > This patch implements DMA support into mxs-i2c. DMA transfers are now > > enabled via DT. The DMA operation is enabled by default. > > > > Signed-off-by: Marek Vasut > > Un

Re: [PATCH 0/4] mxs/spi: Fixes and improvements

2012-09-05 Thread Marek Vasut
Dear Mark Brown, > On Tue, Sep 04, 2012 at 04:40:14AM +0200, Marek Vasut wrote: > > I humbly present fixes for further issues found in the SPI driver > > for i.MX23/i.MX28. > > Applied all, thanks. Thanks Mark, sorry for pulling the bugs in. Best

[PATCH 2/4] mxs/spi: Increment the transfer length only if transfer succeeded

2012-09-03 Thread Marek Vasut
The transfer function incremented (struct spi_message)->actual_length unconditionally, even if the transfer failed. Rectify this by incrementing this only if transfer succeeded. Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Fabio Estevam Cc: Grant Likely Cc: Mark Brown Cc: Shawn

[PATCH 1/4] mxs/spi: Fix issues when doing long continuous transfer

2012-09-03 Thread Marek Vasut
/mtdblockX interface again. Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Fabio Estevam Cc: Grant Likely Cc: Mark Brown Cc: Shawn Guo --- drivers/spi/spi-mxs.c | 141 ++--- 1 file changed, 88 insertions(+), 53 deletions(-) diff --git a/drivers/spi

[PATCH 0/4] mxs/spi: Fixes and improvements

2012-09-03 Thread Marek Vasut
anups and fixes for minor details. Marek Vasut (4): mxs/spi: Fix issues when doing long continuous transfer mxs/spi: Increment the transfer length only if transfer succeeded mxs/spi: Decrement the DMA/PIO border mxs/spi: Rework the mxs_ssp_timeout to be more readable drivers/spi/spi-

[PATCH 3/4] mxs/spi: Decrement the DMA/PIO border

2012-09-03 Thread Marek Vasut
flash clocked at 40MHz. Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Fabio Estevam Cc: Grant Likely Cc: Mark Brown Cc: Shawn Guo --- drivers/spi/spi-mxs.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c index 282bdd7

[PATCH 4/4] mxs/spi: Rework the mxs_ssp_timeout to be more readable

2012-09-03 Thread Marek Vasut
x27;s pointless. Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Fabio Estevam Cc: Grant Likely Cc: Mark Brown Cc: Shawn Guo --- drivers/spi/spi-mxs.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c index 66

Re: SLAVE Side SPI kernel driver development

2012-08-25 Thread Marek Vasut
coming days :) Good luck with that. > Thanks to all of you who provided suggestions. > Carlo Bastelli > > - Original Message - > From: "Ned Forrester" > To: "Marek Vasut" > Cc: "Fabio Estevam" ; > ; "Bastelli Carlo (yahoo)"

Re: [PATCH] spi/mxs: Fix device remove function

2012-08-24 Thread Marek Vasut
Dear Guenter Roeck, > On Fri, Aug 24, 2012 at 10:10:12PM +0200, Marek Vasut wrote: > > Dear Guenter Roeck, > > > > > The call sequence > > > spi_alloc_master/spi_register_master/spi_unregister_master is complete; > > > it reduces the device refere

Re: [PATCH] spi/mxs: Fix device remove function

2012-08-24 Thread Marek Vasut
nction is only called > once, and resets device driver data to NULL. Remove the unnecessaary calls > to platform_set_drvdata(). > > Cc: Marek Vasut > Signed-off-by: Guenter Roeck Damn, I thought this was fixed, apparently not. Thanks! Reviewed-by: Marek Vasut > --- > Applies

Re: SLAVE Side SPI kernel driver development

2012-08-24 Thread Marek Vasut
was tested (and developed) on this board: http://www.denx-cs.de/?q=M28 The userland code is really easy too, simply pump it into spidev or read from it. But all that is only possible because of the SPI IP in the mx28 is nice. > Regards, > > Fabio Estevam Best regards, Marek Vasut -

[PATCH V4] MXS: Implement DMA support into mxs-i2c

2012-08-23 Thread Marek Vasut
This patch implements DMA support into mxs-i2c. DMA transfers are now enabled via DT. The DMA operation is enabled by default. Signed-off-by: Marek Vasut CC: Fabio Estevam Cc: linux-...@vger.kernel.org CC: Shawn Guo Cc: Wolfram Sang --- Documentation/devicetree/bindings/i2c/i2c-mxs.txt

[PATCH 2/2] ARM: mxs: Update DENX M28 machine and dts file

2012-08-23 Thread Marek Vasut
Update the mach-mxs machine by removing the enet_clkout(). The new revision of the board doesn't need that. Also, update the DTS file with all the new drivers pulled in the mainline recently, that is, SPI, LRADC, USB. Also, remove bogus AUART3. Signed-off-by: Marek Vasut Cc: Chris Bal

[PATCH 1/2] ARM: mx28: Add SPI pinmux into imx28.dtsi

2012-08-23 Thread Marek Vasut
Add this SSP pin multiplexing configuration into the imx28.dtsi file. This covers pinmux for all four SSP ports available on the i.MX28. Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Fabio Estevam Cc: Mark Brown Cc: Shawn Guo --- arch/arm/boot/dts/imx28.dtsi | 61

[PATCH V3] mxs/spi: Fix misuse of init_completion

2012-08-23 Thread Marek Vasut
mxs_spi_txrx_dma(), since whole this section is protected by mutex in SPI core. This by no means allows this issue to exit though. Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Shawn Guo Cc: Mark Brown Cc: Fabio Estevam --- drivers/spi/spi-mxs.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion

Re: [PATCH V2] mxs/spi: Fix misuse of init_completion

2012-08-23 Thread Marek Vasut
Dear Chris Ball, > Hi Marek, > > On Thu, Aug 23 2012, Marek Vasut wrote: > > The init_completion() call does reinit not only the variable carrying > > the flag that the completion finished, but also initialized the > > waitqueue associated with the compl

[PATCH] mxs/spi: Add SPI slave mode operation DT prop

2012-08-23 Thread Marek Vasut
people who do know very well what they are doing, otherwise this should never be touched. Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Shawn Guo Cc: Mark Brown Cc: Fabio Estevam --- Documentation/devicetree/bindings/spi/mxs-spi.txt | 16 + drivers/spi/spi-mxs.c

[PATCH] mxs/spi: Restart the block after unsuccessful transfer

2012-08-23 Thread Marek Vasut
Restart the SSP block in case the SSP transfer failed in any way. The block hung in some cases otherwise. Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Shawn Guo Cc: Mark Brown Cc: Fabio Estevam --- drivers/spi/spi-mxs.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH V2] mxs/spi: Fix misuse of init_completion

2012-08-23 Thread Marek Vasut
mxs_spi_txrx_dma(), since whole this section is protected by mutex in SPI core. This by no means allows this issue to exit though. Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Shawn Guo Cc: Mark Brown Cc: Fabio Estevam --- drivers/spi/spi-mxs.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion

Re: [PATCH] mxs/spi: Fix misuse of init_completion

2012-08-22 Thread Marek Vasut
Dear Chris Ball, > Hi, > > On Wed, Aug 22 2012, Marek Vasut wrote: > > Signed-off-by: Marek Vasut > > Cc: Chris Ball > > Cc: Shawn Guo > > Cc: Mark Brown > > Cc: Fabio Estevam > > --- > > > > drivers/spi/spi-mxs.c |

[PATCH] mxs/spi: Fix misuse of init_completion

2012-08-22 Thread Marek Vasut
Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Shawn Guo Cc: Mark Brown Cc: Fabio Estevam --- drivers/spi/spi-mxs.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c index 331f600..c965cc6 100644 --- a/drivers/spi/spi-mxs.c

[PATCH] spi/mxs: Make the SPI block clock speed configurable via DT

2012-08-22 Thread Marek Vasut
Add "clock-frequency" property, which allows configuring the SPI block's base speed. Signed-off-by: Marek Vasut Cc: Chris Ball Cc: Shawn Guo Cc: Mark Brown --- Documentation/devicetree/bindings/spi/mxs-spi.txt |4 drivers/spi/spi-mxs.c

[PATCH 10/10] ARM: mx28: Add SPI pinmux into imx28.dtsi

2012-08-03 Thread Marek Vasut
Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Fabio Estevam Cc: Grant Likely Cc: Linux ARM kernel Cc: Mark Brown CC: Shawn Guo --- arch/arm/boot/dts/imx28.dtsi | 39 +++ 1 file changed, 39 insertions(+) diff --git

[PATCH 07/10] mmc: spi: Pull out common DMA parts from MXS MMC

2012-08-03 Thread Marek Vasut
These parts will be used by the MXS SPI driver too. Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Fabio Estevam Cc: Grant Likely Cc: Linux ARM kernel Cc: Mark Brown CC: Shawn Guo --- drivers/mmc/host/mxs-mmc.c | 88

[PATCH 04/10] mmc: spi: Pull out parts shared between MMC and SPI

2012-08-03 Thread Marek Vasut
Abstract out the common part of private data shared between MMC and SPI. These shall later allow to use common clock configuration function. Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Fabio Estevam Cc: Grant Likely Cc: Linux ARM kernel Cc: Mark Brown

[PATCH 09/10 V2] spi: Add SSP/SPI device tree documentation

2012-08-03 Thread Marek Vasut
Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Fabio Estevam Cc: Grant Likely Cc: Linux ARM kernel Cc: Mark Brown CC: Shawn Guo --- Documentation/devicetree/bindings/spi/mxs-spi.txt | 18 ++ 1 file changed, 18 insertions(+) create mode

[PATCH 05/10] mmc: spi: Pull out the SSP clock configuration function

2012-08-03 Thread Marek Vasut
Pull out the MMC clock configuration function and make it into SSP clock configuration function, so it can be used by the SPI driver too. Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Fabio Estevam Cc: Grant Likely Cc: Linux ARM kernel Cc: Mark Brown CC

[PATCH 02/10] mmc: spi: Rename IMX2[38]_MMC to IMX2[38]_SSP

2012-08-03 Thread Marek Vasut
Since the SSP controller can act as both SPI and MMC host, renaming the enum to properly reflect the naming seems appropriate. Based on previous attempt by: Fabio Estevam Signed-off-by: Fabio Estevam Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Grant

[PATCH 03/10] mmc: spi: Add necessary bits into mxs-spi.h

2012-08-03 Thread Marek Vasut
Add missing register bits and registers into mxs-spi.h . These will be used by the SPI driver. Based on previous attempt by: Fabio Estevam Signed-off-by: Fabio Estevam Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Grant Likely Cc: Linux ARM kernel Cc

[PATCH 06/10 V3] spi: Add SPI driver for mx233/mx28

2012-08-03 Thread Marek Vasut
This is slightly reworked version of the SPI driver. Support for DT has been added and it's been converted to queued API. Based on previous attempt by: Fabio Estevam Signed-off-by: Fabio Estevam Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Grant L

[PATCH 01/10] mmc: spi: Move SSP register definitions into separate file

2012-08-03 Thread Marek Vasut
Move the definitions into separate file so separate SPI driver can be implemented. The SSP controller in MXS can act both as a MMC host and as a SPI host. Based on previous attempt by: Fabio Estevam Signed-off-by: Fabio Estevam Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC

[PATCH 08/10 V2] spi: Add DMA support into SPI driver

2012-08-03 Thread Marek Vasut
Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Fabio Estevam Cc: Grant Likely Cc: Linux ARM kernel Cc: Mark Brown CC: Shawn Guo --- drivers/spi/spi-mxs.c | 231 + 1 file changed, 216 insertions(+), 15

[PATCH 00/10 V3] MXS SPI driver

2012-08-03 Thread Marek Vasut
This patchset adds SPI master support for Freescale i.MX233/i.MX28. This is rebased on top of next-20120713. Please consider applying, bugs shall now be squashed during the previous two review rounds. Marek Vasut (10): mmc: spi: Move SSP register definitions into separate file mmc: spi

Re: [PATCH 06/10 V2] spi: Add SPI driver for mx233/mx28

2012-08-03 Thread Marek Vasut
SP_CTRL0_WAIT_FOR_CMD and BM_SSP_CTRL0_WAIT_FOR_IRQ * in HW_SSP_CTRL0 register do have multiple usage, please refer to * the datasheet for further details. In SPI mode, they are used to * toggle the chip-select lines (nCS pins). */ I hope it'll suffice.

Re: [PATCH 06/10 V2] spi: Add SPI driver for mx233/mx28

2012-08-03 Thread Marek Vasut
in order to be able to select the > different chip selects: > http://git.denx.de/?p=u-boot.git;a=commitdiff;h=148ca64f327a89ef77e84756f5d > 351af33e59b64 Good thing I waited with submission :) I'll fix it in a bit and resubmit in the evening. > Thanks, > > Fabio Estevam

Re: [PATCH 06/10 V2] spi: Add SPI driver for mx233/mx28

2012-08-02 Thread Marek Vasut
Dear Mark Brown, > On Thu, Aug 02, 2012 at 04:58:38PM +0200, Marek Vasut wrote: > > > It'd be nice to only keep the clocks enabled while doing transfers but > > > again totally non-essential. > > > > Hm, this is spread across mxs. Shawn, is there any

Re: [PATCH 08/10 RESEND] spi: Add DMA support into SPI driver

2012-08-02 Thread Marek Vasut
Dear Mark Brown, > On Mon, Jul 23, 2012 at 10:40:50PM +0200, Marek Vasut wrote: > > + /* > > +* Small blocks can be transfered via PIO. > > +* Measured by empiric means: > > +* > > +* dd if=/dev/mtdblo

Re: [PATCH 06/10 V2] spi: Add SPI driver for mx233/mx28

2012-08-02 Thread Marek Vasut
Dear Mark Brown, Thanks for the review! > On Mon, Jul 23, 2012 at 10:40:48PM +0200, Marek Vasut wrote: > > This is slightly reworked version of the SPI driver. > > Support for DT has been added and it's been converted > > to queued API. > > Looks reasonable o

Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-07-31 Thread Marek Vasut
Dear Guenter Roeck, > On Wed, Aug 01, 2012 at 08:10:37AM +0200, Marek Vasut wrote: > > Dear Shawn Guo, > > > > > On Tue, Jul 31, 2012 at 10:42:28PM -0700, Guenter Roeck wrote: > > > > On Wed, Aug 01, 2012 at 01:58:56PM +0800, Shawn Guo wrote: > > >

Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-07-31 Thread Marek Vasut
Dear Guenter Roeck, > On Wed, Aug 01, 2012 at 11:16:15AM +0530, Shubhrajyoti Datta wrote: > > On Wed, Aug 1, 2012 at 10:59 AM, Guenter Roeck wrote: > > > On Wed, Aug 01, 2012 at 07:00:54AM +0200, Marek Vasut wrote: > > >> Dear Shawn Guo, > > >> > &g

Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-07-31 Thread Marek Vasut
ys called, meaning there is either a > memory leak or I am completely confused. I'll poke through the stuff later if you won't get your answers (later == around tomorrow) > Thanks, > Guenter Best regards, Marek Vasut -

Re: [PATCH 08/10 V2] spi: Add DMA support into SPI driver

2012-07-31 Thread Marek Vasut
Dear Marek Vasut, [...] > -out_host_free: > +out_free_dma: > + dma_release_channel(ssp->dmach); > clk_disable_unprepare(ssp->clk); > +out_host_free: > spi_master_put(host); > kfree(host); > + Please remove this newline. >

Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-07-31 Thread Marek Vasut
kfree). > > Hmm, are you saying that there must be a spi_master_put call matching > spi_alloc_master? I think we only need to have spi_master_get and > spi_master_put matched. Naw, spi_master_get() does refcounting, spi_alloc_master() doesnt. You don't ne

Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-07-31 Thread Marek Vasut
vers calling kfree in probe. Looks like that to me ... > Regards, > Shawn Best regards, Marek Vasut -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and t

Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-07-31 Thread Marek Vasut
Dear Shawn Guo, > On Wed, Aug 01, 2012 at 04:31:04AM +0200, Marek Vasut wrote: > > > Couple of reasons for asking: No other SPI master driver calls it in > > > the remove function (unless I missed it), most drivers don't call it > > > in the probe function

Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-07-31 Thread Marek Vasut
call it in the > probe function error path, and if I call it in the remove function in a > SPI master driver I am working on, and load/unload the module several > times in a row, I get a nasty kernel crash. It seem

Re: [PATCH 09/10 RESEND] spi: Add SSP/SPI device tree documentation

2012-07-28 Thread Marek Vasut
Dear Shawn Guo, > On Tue, Jul 24, 2012 at 09:43:48PM +0200, Marek Vasut wrote: > > This is actually not the first place I was curious about in the imx28 DTS > > ... yes, the size is 0x2000, but "2000" as is is used in multiple places > > across imx28. Shawn? >

Re: [PATCH 09/10 RESEND] spi: Add SSP/SPI device tree documentation

2012-07-24 Thread Marek Vasut
Dear Sergei Shtylyov, > Hello. > > On 07/24/2012 12:40 AM, Marek Vasut wrote: > > Signed-off-by: Marek Vasut > > Cc: Attila Kinali > > Cc: Chris Ball > > CC: Dong Aisheng > > Cc: Fabio Estevam > > Cc: Grant Likely > > Cc: Linu

[PATCH 09/10 RESEND] spi: Add SSP/SPI device tree documentation

2012-07-23 Thread Marek Vasut
Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Fabio Estevam Cc: Grant Likely Cc: Linux ARM kernel Cc: Mark Brown CC: Shawn Guo --- Documentation/devicetree/bindings/spi/mxs-spi.txt | 18 ++ 1 file changed, 18 insertions(+) create mode

[PATCH 08/10 RESEND] spi: Add DMA support into SPI driver

2012-07-23 Thread Marek Vasut
Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Fabio Estevam Cc: Grant Likely Cc: Linux ARM kernel Cc: Mark Brown CC: Shawn Guo --- drivers/spi/spi-mxs.c | 229 + 1 file changed, 214 insertions(+), 15

[PATCH 10/10 RESEND] ARM: mx28: Add SPI pinmux into imx28.dtsi

2012-07-23 Thread Marek Vasut
Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Fabio Estevam Cc: Grant Likely Cc: Linux ARM kernel Cc: Mark Brown CC: Shawn Guo --- arch/arm/boot/dts/imx28.dtsi | 39 +++ 1 file changed, 39 insertions(+) diff --git

[PATCH 07/10 RESEND] mmc: spi: Pull out common DMA parts from MXS MMC

2012-07-23 Thread Marek Vasut
These parts will be used by the MXS SPI driver too. Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Fabio Estevam Cc: Grant Likely Cc: Linux ARM kernel Cc: Mark Brown CC: Shawn Guo --- drivers/mmc/host/mxs-mmc.c | 88

[PATCH 06/10 V2] spi: Add SPI driver for mx233/mx28

2012-07-23 Thread Marek Vasut
This is slightly reworked version of the SPI driver. Support for DT has been added and it's been converted to queued API. Based on previous attempt by: Fabio Estevam Signed-off-by: Fabio Estevam Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Grant L

[PATCH 05/10 V2] mmc: spi: Pull out the SSP clock configuration function

2012-07-23 Thread Marek Vasut
Pull out the MMC clock configuration function and make it into SSP clock configuration function, so it can be used by the SPI driver too. Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Fabio Estevam Cc: Grant Likely Cc: Linux ARM kernel Cc: Mark Brown CC

[PATCH 01/10 RESEND] mmc: spi: Move SSP register definitions into separate file

2012-07-23 Thread Marek Vasut
Move the definitions into separate file so separate SPI driver can be implemented. The SSP controller in MXS can act both as a MMC host and as a SPI host. Based on previous attempt by: Fabio Estevam Signed-off-by: Fabio Estevam Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC

[PATCH 03/10 V2] mmc: spi: Add necessary bits into mxs-spi.h

2012-07-23 Thread Marek Vasut
Add missing register bits and registers into mxs-spi.h . These will be used by the SPI driver. Based on previous attempt by: Fabio Estevam Signed-off-by: Fabio Estevam Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Grant Likely Cc: Linux ARM kernel Cc

[PATCH 02/10 RESEND] mmc: spi: Rename IMX2[38]_MMC to IMX2[38]_SSP

2012-07-23 Thread Marek Vasut
Since the SSP controller can act as both SPI and MMC host, renaming the enum to properly reflect the naming seems appropriate. Based on previous attempt by: Fabio Estevam Signed-off-by: Fabio Estevam Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Grant

[PATCH 04/10 RESEND] mmc: spi: Pull out parts shared between MMC and SPI

2012-07-23 Thread Marek Vasut
Abstract out the common part of private data shared between MMC and SPI. These shall later allow to use common clock configuration function. Signed-off-by: Marek Vasut Cc: Attila Kinali Cc: Chris Ball CC: Dong Aisheng Cc: Fabio Estevam Cc: Grant Likely Cc: Linux ARM kernel Cc: Mark Brown

[PATCH 00/10 V2] MXS SPI driver

2012-07-23 Thread Marek Vasut
This patchset adds SPI master support for Freescale i.MX233/i.MX28. This is rebased on top of next-20120713. Please consider applying, bugs shall now be squashed during the previous two review rounds. Marek Vasut (10): mmc: spi: Move SSP register definitions into separate file mmc: spi

Re: [PATCH 00/10] MXS SPI driver

2012-07-18 Thread Marek Vasut
Dear Mark Brown, > On Wed, Jul 18, 2012 at 12:09:54AM +0200, Marek Vasut wrote: > > > On Mon, Jul 16, 2012 at 02:09:47PM +0200, Marek Vasut wrote: > > > > > > Always CC maintainers, and in this case me as well (I'm collecting SPI > > > patches f

Re: [PATCH 05/10] mmc: spi: Pull out the SSP clock configuration function

2012-07-18 Thread Marek Vasut
Dear Attila Kinali, > Good morning Marek, > > On Tue, 17 Jul 2012 23:48:34 +0200 > > Marek Vasut wrote: > > > There is a EXPORT_SYMBOL_GPL(mxs_ssp_set_clk_rate); missing here. > > > > What for? > > To be able to compile mxs-mmc as a module Argh, g

Re: [PATCH 00/10] MXS SPI driver

2012-07-17 Thread Marek Vasut
Dear Mark Brown, > On Mon, Jul 16, 2012 at 02:09:47PM +0200, Marek Vasut wrote: > > This patchset adds SPI master support for Freescale i.MX233/i.MX28. > > This is rebased on top of next-20120713. Please consider applying, > > bugs shall now be squashed during the previ

  1   2   >