* [PATCH] mpc52xx_psc_spi setting the tdfOnExit flag only on the last byte
@ 2008-09-30 9:22 Stefano Babic
[not found] ` <1222766572-17499-1-git-send-email-sbabic-ynQEQJNshbs@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2008-09-30 9:22 UTC (permalink / raw)
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Stefano Babic
According to the manual the "tdfOnExit" flag must be set on the last byte
we want to send. The PSC controller holds SS low until the flag is set.
However, the flag was set always on the last byte of the FIFO, independently if
it is the last byte of the transfer. This generates spurious toggling of the
SS signals that breaks the protocol of some peripherals.
Signed-off-by: Stefano Babic <sbabic-ynQEQJNshbs@public.gmane.org>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] mpc52xx_psc_spi setting the tdfOnExit flag only on the last byte
[not found] ` <1222766572-17499-1-git-send-email-sbabic-ynQEQJNshbs@public.gmane.org>
@ 2008-09-30 9:22 ` Stefano Babic
[not found] ` <1222766572-17499-2-git-send-email-sbabic-ynQEQJNshbs@public.gmane.org>
2008-09-30 14:07 ` Grant Likely
1 sibling, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2008-09-30 9:22 UTC (permalink / raw)
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Stefano Babic
Signed-off-by: Stefano Babic <sbabic-ynQEQJNshbs@public.gmane.org>
---
drivers/spi/mpc52xx_psc_spi.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
index 41f9921..d7b1fb5 100644
--- a/drivers/spi/mpc52xx_psc_spi.c
+++ b/drivers/spi/mpc52xx_psc_spi.c
@@ -149,6 +148,7 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
unsigned rfalarm;
unsigned send_at_once = MPC52xx_PSC_BUFSIZE;
unsigned recv_at_once;
+ int last_block = 0;
if (!t->tx_buf && !t->rx_buf && t->len)
return -EINVAL;
@@ -158,15 +158,17 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
while (rb < t->len) {
if (t->len - rb > MPC52xx_PSC_BUFSIZE) {
rfalarm = MPC52xx_PSC_RFALARM;
+ last_block = 0;
} else {
send_at_once = t->len - sb;
rfalarm = MPC52xx_PSC_BUFSIZE - (t->len - rb);
+ last_block = 1;
}
dev_dbg(&spi->dev, "send %d bytes...\n", send_at_once);
for (; send_at_once; sb++, send_at_once--) {
/* set EOF flag before the last word is sent */
- if (send_at_once == 1)
+ if (send_at_once == 1 && last_block)
out_8(&psc->ircr2, 0x01);
if (tx_buf)
--
1.5.4.3
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] mpc52xx_psc_spi setting the tdfOnExit flag only on the last byte
[not found] ` <1222766572-17499-1-git-send-email-sbabic-ynQEQJNshbs@public.gmane.org>
2008-09-30 9:22 ` Stefano Babic
@ 2008-09-30 14:07 ` Grant Likely
[not found] ` <20080930140726.GG18313-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
1 sibling, 1 reply; 8+ messages in thread
From: Grant Likely @ 2008-09-30 14:07 UTC (permalink / raw)
To: Stefano Babic; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Tue, Sep 30, 2008 at 11:22:51AM +0200, Stefano Babic wrote:
> According to the manual the "tdfOnExit" flag must be set on the last byte
> we want to send. The PSC controller holds SS low until the flag is set.
> However, the flag was set always on the last byte of the FIFO, independently if
> it is the last byte of the transfer. This generates spurious toggling of the
> SS signals that breaks the protocol of some peripherals.
>
> Signed-off-by: Stefano Babic <sbabic-ynQEQJNshbs@public.gmane.org>
Your patchs and descriptions are getting sent in separate emails. How are you
sending your patches?
g.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mpc52xx_psc_spi setting the tdfOnExit flag only on the last byte
[not found] ` <1222766572-17499-2-git-send-email-sbabic-ynQEQJNshbs@public.gmane.org>
@ 2008-09-30 14:09 ` Grant Likely
0 siblings, 0 replies; 8+ messages in thread
From: Grant Likely @ 2008-09-30 14:09 UTC (permalink / raw)
To: Stefano Babic; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Tue, Sep 30, 2008 at 11:22:52AM +0200, Stefano Babic wrote:
> Signed-off-by: Stefano Babic <sbabic-ynQEQJNshbs@public.gmane.org>
> ---
> drivers/spi/mpc52xx_psc_spi.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
Other than the issue of the missing description, this looks right to me.
Acked-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
>
> diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
> index 41f9921..d7b1fb5 100644
> --- a/drivers/spi/mpc52xx_psc_spi.c
> +++ b/drivers/spi/mpc52xx_psc_spi.c
> @@ -149,6 +148,7 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
> unsigned rfalarm;
> unsigned send_at_once = MPC52xx_PSC_BUFSIZE;
> unsigned recv_at_once;
> + int last_block = 0;
>
> if (!t->tx_buf && !t->rx_buf && t->len)
> return -EINVAL;
> @@ -158,15 +158,17 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
> while (rb < t->len) {
> if (t->len - rb > MPC52xx_PSC_BUFSIZE) {
> rfalarm = MPC52xx_PSC_RFALARM;
> + last_block = 0;
> } else {
> send_at_once = t->len - sb;
> rfalarm = MPC52xx_PSC_BUFSIZE - (t->len - rb);
> + last_block = 1;
> }
>
> dev_dbg(&spi->dev, "send %d bytes...\n", send_at_once);
> for (; send_at_once; sb++, send_at_once--) {
> /* set EOF flag before the last word is sent */
> - if (send_at_once == 1)
> + if (send_at_once == 1 && last_block)
> out_8(&psc->ircr2, 0x01);
>
> if (tx_buf)
> --
> 1.5.4.3
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> spi-devel-general mailing list
> spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/spi-devel-general
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mpc52xx_psc_spi setting the tdfOnExit flag only on the last byte
[not found] ` <20080930140726.GG18313-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
@ 2008-09-30 14:15 ` Stefano Babic
[not found] ` <48E23473.8060604-ynQEQJNshbs@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Stefano Babic @ 2008-09-30 14:15 UTC (permalink / raw)
To: Grant Likely; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Grant Likely wrote:
> Your patchs and descriptions are getting sent in separate emails. How are you
> sending your patches?
I know, I have not found a way how to tell git-send-email to send
everything in one e-mail:
git-send-email --to spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org --compose
--subject "[PATCH] mpc52xx_psc_spi setting the tdfOnExit flag only on
the last byte" 001-According-to-the-manual.patch
Probably it is very easy, but I have not found the right way ;)
Stefano
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office-ynQEQJNshbs@public.gmane.org
=====================================================================
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mpc52xx_psc_spi setting the tdfOnExit flag only on the last byte
[not found] ` <48E23473.8060604-ynQEQJNshbs@public.gmane.org>
@ 2008-09-30 14:44 ` Grant Likely
2008-10-01 11:12 ` Stefan Roese
1 sibling, 0 replies; 8+ messages in thread
From: Grant Likely @ 2008-09-30 14:44 UTC (permalink / raw)
To: Stefano Babic; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Tue, Sep 30, 2008 at 8:15 AM, Stefano Babic <sbabic-ynQEQJNshbs@public.gmane.org> wrote:
> Grant Likely wrote:
>> Your patchs and descriptions are getting sent in separate emails. How are you
>> sending your patches?
>
> I know, I have not found a way how to tell git-send-email to send
> everything in one e-mail:
>
> git-send-email --to spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org --compose
> --subject "[PATCH] mpc52xx_psc_spi setting the tdfOnExit flag only on
> the last byte" 001-According-to-the-manual.patch
>
> Probably it is very easy, but I have not found the right way ;)
You need to provide the patch description when you commit the change,
not when you send the email.
While you cannot edit a commit directly (commits are immutable), you
can create a new commit from the old using git-cherry-pick:
$ man git-cherry-pick
$ git branch old # Save the current location
$ git reset --hard old~1 # reset to just before the commit to edit
$ git-cherry-pick -e old # Cherry pick the commit that you
# want and edit the commit log.
g.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mpc52xx_psc_spi setting the tdfOnExit flag only on the last byte
[not found] ` <48E23473.8060604-ynQEQJNshbs@public.gmane.org>
2008-09-30 14:44 ` Grant Likely
@ 2008-10-01 11:12 ` Stefan Roese
[not found] ` <200810011312.27678.sr-ynQEQJNshbs@public.gmane.org>
1 sibling, 1 reply; 8+ messages in thread
From: Stefan Roese @ 2008-10-01 11:12 UTC (permalink / raw)
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Stefano Babic
On Tuesday 30 September 2008, Stefano Babic wrote:
> I know, I have not found a way how to tell git-send-email to send
> everything in one e-mail:
>
> git-send-email --to spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org --compose
> --subject "[PATCH] mpc52xx_psc_spi setting the tdfOnExit flag only on
> the last byte" 001-According-to-the-manual.patch
>
> Probably it is very easy, but I have not found the right way ;)
I generate the patch with "git format-patch -1 -o directory" and then send it
with "git send-email --to list directory/patch".
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office-ynQEQJNshbs@public.gmane.org
=====================================================================
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mpc52xx_psc_spi setting the tdfOnExit flag only on the last byte
[not found] ` <200810011312.27678.sr-ynQEQJNshbs@public.gmane.org>
@ 2008-10-01 14:29 ` Stefano Babic
0 siblings, 0 replies; 8+ messages in thread
From: Stefano Babic @ 2008-10-01 14:29 UTC (permalink / raw)
To: Stefan Roese; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Grant Likely wrote:
> $ man git-cherry-pick
> $ git branch old # Save the current location
> $ git reset --hard old~1 # reset to just before the commit to edit
> $ git-cherry-pick -e old # Cherry pick the commit that you
Stefan Roese wrote:
> I generate the patch with "git format-patch -1 -o directory" and then send it
> with "git send-email --to list directory/patch".
Thanks a lot both ! I did not know how to use git-cherry-pick, I have
learned now. By the way, the mistake was trivial (but I have not seen) :
I forgot to add an empty line between subject and text when I commit the
changes and git-send-email took everything as subject ;)
Stefano
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office-ynQEQJNshbs@public.gmane.org
=====================================================================
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-10-01 14:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-30 9:22 [PATCH] mpc52xx_psc_spi setting the tdfOnExit flag only on the last byte Stefano Babic
[not found] ` <1222766572-17499-1-git-send-email-sbabic-ynQEQJNshbs@public.gmane.org>
2008-09-30 9:22 ` Stefano Babic
[not found] ` <1222766572-17499-2-git-send-email-sbabic-ynQEQJNshbs@public.gmane.org>
2008-09-30 14:09 ` Grant Likely
2008-09-30 14:07 ` Grant Likely
[not found] ` <20080930140726.GG18313-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
2008-09-30 14:15 ` Stefano Babic
[not found] ` <48E23473.8060604-ynQEQJNshbs@public.gmane.org>
2008-09-30 14:44 ` Grant Likely
2008-10-01 11:12 ` Stefan Roese
[not found] ` <200810011312.27678.sr-ynQEQJNshbs@public.gmane.org>
2008-10-01 14:29 ` Stefano Babic
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.