* [PATCH] OMAP3 : Fix McSPI RX Timeout
@ 2009-10-06 6:37 manjugk
2009-10-09 19:25 ` Tony Lindgren
0 siblings, 1 reply; 3+ messages in thread
From: manjugk @ 2009-10-06 6:37 UTC (permalink / raw)
To: linux-omap; +Cc: Manjunatha GK
McSPI RX timeout issues are reported on some of the OMAP3 custom boards.
After verifying configuration sequence in TRM, there seems to be issue with
McSPI configuration sequence.
The steps to be followed for both TX and RX:
1. Configure OMAP2_MCSPI_CHCONF0 register with required settings such as
TX/RX mode, word length, force chip select(if required).
2. Set MS bit to 0 in OMAP2_MCSPI_CHCTRL0 register to provide the clock.
3. Enable SPI channel in OMAP2_MCSPI_MODULCTRL
But, the sequence used in current code seems to be wrong. Here it is:
1. Set MS bit to 0 in OMAP2_MCSPI_CHCTRL0 register to provide the clock
(This is done during bootup)
2. Enable SPI channel in OMAP2_MCSPI_MODULCTRL
3. Configure OMAP2_MCSPI_CHCONF0 register with required settings such as
TX/RX mode, word length, force chip select(if required).
After correcting configuration sequence, the timeout seems to be not
reproducible anymore.
Signed-off-by: Manjunatha GK <manjugk@ti.com>
---
drivers/spi/omap2_mcspi.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index ba1a872..846485c 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -802,7 +802,6 @@ static void omap2_mcspi_work(struct work_struct *work)
spi = m->spi;
cs = spi->controller_state;
- omap2_mcspi_set_enable(spi, 1);
list_for_each_entry(t, &m->transfers, transfer_list) {
if (t->tx_buf == NULL && t->rx_buf == NULL && t->len) {
status = -EINVAL;
@@ -830,6 +829,9 @@ static void omap2_mcspi_work(struct work_struct *work)
chconf |= OMAP2_MCSPI_CHCONF_TRM_TX_ONLY;
mcspi_write_chconf0(spi, chconf);
+ omap2_mcspi_set_master_mode(mcspi->master);
+
+ omap2_mcspi_set_enable(spi, 1);
if (t->len) {
unsigned count;
--
1.6.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] OMAP3 : Fix McSPI RX Timeout
2009-10-06 6:37 [PATCH] OMAP3 : Fix McSPI RX Timeout manjugk
@ 2009-10-09 19:25 ` Tony Lindgren
0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2009-10-09 19:25 UTC (permalink / raw)
To: manjugk; +Cc: linux-omap
* manjugk@ti.com <manjugk@ti.com> [091005 23:42]:
> McSPI RX timeout issues are reported on some of the OMAP3 custom boards.
>
> After verifying configuration sequence in TRM, there seems to be issue with
> McSPI configuration sequence.
>
> The steps to be followed for both TX and RX:
> 1. Configure OMAP2_MCSPI_CHCONF0 register with required settings such as
> TX/RX mode, word length, force chip select(if required).
> 2. Set MS bit to 0 in OMAP2_MCSPI_CHCTRL0 register to provide the clock.
> 3. Enable SPI channel in OMAP2_MCSPI_MODULCTRL
>
> But, the sequence used in current code seems to be wrong. Here it is:
> 1. Set MS bit to 0 in OMAP2_MCSPI_CHCTRL0 register to provide the clock
> (This is done during bootup)
> 2. Enable SPI channel in OMAP2_MCSPI_MODULCTRL
> 3. Configure OMAP2_MCSPI_CHCONF0 register with required settings such as
> TX/RX mode, word length, force chip select(if required).
>
> After correcting configuration sequence, the timeout seems to be not
> reproducible anymore.
Please resend this to the right lists one for merging:
$ grep -A7 "SPI SUBSYSTEM" MAINTAINERS
SPI SUBSYSTEM
M: David Brownell <dbrownell@users.sourceforge.net>
L: spi-devel-general@lists.sourceforge.net
S: Maintained
F: Documentation/spi/
F: drivers/spi/
F: include/linux/spi/
Please also Cc linux-omap list too so people can easily keep track of it.
Regards,
Tony
>
> Signed-off-by: Manjunatha GK <manjugk@ti.com>
> ---
> drivers/spi/omap2_mcspi.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
> index ba1a872..846485c 100644
> --- a/drivers/spi/omap2_mcspi.c
> +++ b/drivers/spi/omap2_mcspi.c
> @@ -802,7 +802,6 @@ static void omap2_mcspi_work(struct work_struct *work)
> spi = m->spi;
> cs = spi->controller_state;
>
> - omap2_mcspi_set_enable(spi, 1);
> list_for_each_entry(t, &m->transfers, transfer_list) {
> if (t->tx_buf == NULL && t->rx_buf == NULL && t->len) {
> status = -EINVAL;
> @@ -830,6 +829,9 @@ static void omap2_mcspi_work(struct work_struct *work)
> chconf |= OMAP2_MCSPI_CHCONF_TRM_TX_ONLY;
> mcspi_write_chconf0(spi, chconf);
>
> + omap2_mcspi_set_master_mode(mcspi->master);
> +
> + omap2_mcspi_set_enable(spi, 1);
> if (t->len) {
> unsigned count;
>
> --
> 1.6.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] OMAP3 : Fix McSPI RX Timeout
@ 2009-10-12 11:04 manjugk
0 siblings, 0 replies; 3+ messages in thread
From: manjugk @ 2009-10-12 11:04 UTC (permalink / raw)
To: spi-devel-general; +Cc: dbrownell, linux-omap, Manjunatha GK
Resending this patch to SPI mailing list as well.
McSPI RX timeout issues are reported on some of the OMAP3 custom boards.
After verifying configuration sequence in TRM, there seems to be issue with
McSPI configuration sequence.
The steps to be followed for both TX and RX:
1. Configure OMAP2_MCSPI_CHCONF0 register with required settings such as
TX/RX mode, word length, force chip select(if required).
2. Set MS bit to 0 in OMAP2_MCSPI_CHCTRL0 register to provide the clock.
3. Enable SPI channel in OMAP2_MCSPI_MODULCTRL
But, the sequence used in current code seems to be wrong. Here it is:
1. Set MS bit to 0 in OMAP2_MCSPI_CHCTRL0 register to provide the clock
(This is done during bootup)
2. Enable SPI channel in OMAP2_MCSPI_MODULCTRL
3. Configure OMAP2_MCSPI_CHCONF0 register with required settings such as
TX/RX mode, word length, force chip select(if required).
After correcting configuration sequence, the timeout seems to be not
reproducible anymore.
Signed-off-by: Manjunatha GK <manjugk@ti.com>
---
drivers/spi/omap2_mcspi.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index ba1a872..846485c 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -802,7 +802,6 @@ static void omap2_mcspi_work(struct work_struct *work)
spi = m->spi;
cs = spi->controller_state;
- omap2_mcspi_set_enable(spi, 1);
list_for_each_entry(t, &m->transfers, transfer_list) {
if (t->tx_buf == NULL && t->rx_buf == NULL && t->len) {
status = -EINVAL;
@@ -830,6 +829,9 @@ static void omap2_mcspi_work(struct work_struct *work)
chconf |= OMAP2_MCSPI_CHCONF_TRM_TX_ONLY;
mcspi_write_chconf0(spi, chconf);
+ omap2_mcspi_set_master_mode(mcspi->master);
+
+ omap2_mcspi_set_enable(spi, 1);
if (t->len) {
unsigned count;
--
1.6.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-12 11:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-06 6:37 [PATCH] OMAP3 : Fix McSPI RX Timeout manjugk
2009-10-09 19:25 ` Tony Lindgren
-- strict thread matches above, loose matches on Subject: below --
2009-10-12 11:04 manjugk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox