* [Qemu-devel] [PATCH v1 0/1] xilinx_spips dummy bytes fix
@ 2018-04-17 14:18 Sai Pavan Boddu
2018-04-17 14:18 ` [Qemu-devel] [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it Sai Pavan Boddu
2018-04-17 15:47 ` [Qemu-devel] [PATCH v1 0/1] xilinx_spips dummy bytes fix Alistair Francis
0 siblings, 2 replies; 6+ messages in thread
From: Sai Pavan Boddu @ 2018-04-17 14:18 UTC (permalink / raw)
To: alistair, crosthwaite.peter, peter.maydell, edgar.iglesias,
frasse.iglesias
Cc: qemu-devel
For zynq-7000 boards, we saw issues when u-boot/linux accessing the qspi.
Issue is due to wrong dummy byte transfers for few of un-handled commands ex: 0x9F, 0x6, 0xe9, 0x4, 0x18, etc
There are many unhandled commands which do not require dummy bytes but they can be followed by address cycles.
To fix this issue for above commands, the next upcoming tx bytes are not considered dummies rather sent to slave directly.
Sai Pavan Boddu (1):
xilinx_spips: send dummy only if cmd requires it
hw/ssi/xilinx_spips.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it
2018-04-17 14:18 [Qemu-devel] [PATCH v1 0/1] xilinx_spips dummy bytes fix Sai Pavan Boddu
@ 2018-04-17 14:18 ` Sai Pavan Boddu
2018-04-17 22:43 ` francisco iglesias
2018-04-17 15:47 ` [Qemu-devel] [PATCH v1 0/1] xilinx_spips dummy bytes fix Alistair Francis
1 sibling, 1 reply; 6+ messages in thread
From: Sai Pavan Boddu @ 2018-04-17 14:18 UTC (permalink / raw)
To: alistair, crosthwaite.peter, peter.maydell, edgar.iglesias,
frasse.iglesias
Cc: qemu-devel
For all the commands, which do not have an entry in
xilinx_spips_num_dummies, present logic sends dummy byte when ever we
are in SNOOP_NONE state, fix it to send only if cmd requires them.
Only transmit max of 1 dummy byte(i.e 8 cycles) is a single snoop cycle.
And also convert dummy bytes to cycles (required by m25p80).
Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com>
---
hw/ssi/xilinx_spips.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
index 426f971..8278930 100644
--- a/hw/ssi/xilinx_spips.c
+++ b/hw/ssi/xilinx_spips.c
@@ -627,10 +627,17 @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS *s)
tx_rx[i] = tx;
}
} else {
- /* Extract a dummy byte and generate dummy cycles according to the
- * link state */
tx = fifo8_pop(&s->tx_fifo);
- dummy_cycles = 8 / s->link_state;
+ if (s->cmd_dummies > 0) {
+ /* Extract a dummy byte and generate dummy cycles according to
+ * the link state */
+ dummy_cycles = (s->cmd_dummies ? 1 : 0) * 8 / s->link_state;
+ s->cmd_dummies--;
+ } else {
+ for (i = 0; i < num_effective_busses(s); ++i) {
+ tx_rx[i] = tx;
+ }
+ }
}
for (i = 0; i < num_effective_busses(s); ++i) {
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v1 0/1] xilinx_spips dummy bytes fix
2018-04-17 14:18 [Qemu-devel] [PATCH v1 0/1] xilinx_spips dummy bytes fix Sai Pavan Boddu
2018-04-17 14:18 ` [Qemu-devel] [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it Sai Pavan Boddu
@ 2018-04-17 15:47 ` Alistair Francis
2018-04-17 16:08 ` Alistair Francis
1 sibling, 1 reply; 6+ messages in thread
From: Alistair Francis @ 2018-04-17 15:47 UTC (permalink / raw)
To: Sai Pavan Boddu
Cc: Alistair Francis, Peter Crosthwaite, Peter Maydell,
Edgar Iglesias, Francisco Iglesias,
qemu-devel@nongnu.org Developers
On Tue, Apr 17, 2018 at 7:18 AM, Sai Pavan Boddu
<sai.pavan.boddu@xilinx.com> wrote:
> For zynq-7000 boards, we saw issues when u-boot/linux accessing the qspi.
> Issue is due to wrong dummy byte transfers for few of un-handled commands ex: 0x9F, 0x6, 0xe9, 0x4, 0x18, etc
> There are many unhandled commands which do not require dummy bytes but they can be followed by address cycles.
>
> To fix this issue for above commands, the next upcoming tx bytes are not considered dummies rather sent to slave directly.
>
> Sai Pavan Boddu (1):
> xilinx_spips: send dummy only if cmd requires it
I don't see this patch on the list, I only see the cover letter.
Do other see it?
Alistair
>
> hw/ssi/xilinx_spips.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> --
> 2.7.4
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v1 0/1] xilinx_spips dummy bytes fix
2018-04-17 15:47 ` [Qemu-devel] [PATCH v1 0/1] xilinx_spips dummy bytes fix Alistair Francis
@ 2018-04-17 16:08 ` Alistair Francis
0 siblings, 0 replies; 6+ messages in thread
From: Alistair Francis @ 2018-04-17 16:08 UTC (permalink / raw)
To: Sai Pavan Boddu
Cc: Alistair Francis, Peter Crosthwaite, Peter Maydell,
Edgar Iglesias, Francisco Iglesias,
qemu-devel@nongnu.org Developers
On Tue, Apr 17, 2018 at 8:47 AM, Alistair Francis <alistair23@gmail.com> wrote:
> On Tue, Apr 17, 2018 at 7:18 AM, Sai Pavan Boddu
> <sai.pavan.boddu@xilinx.com> wrote:
>> For zynq-7000 boards, we saw issues when u-boot/linux accessing the qspi.
>> Issue is due to wrong dummy byte transfers for few of un-handled commands ex: 0x9F, 0x6, 0xe9, 0x4, 0x18, etc
>> There are many unhandled commands which do not require dummy bytes but they can be followed by address cycles.
>>
>> To fix this issue for above commands, the next upcoming tx bytes are not considered dummies rather sent to slave directly.
>>
>> Sai Pavan Boddu (1):
>> xilinx_spips: send dummy only if cmd requires it
>
> I don't see this patch on the list, I only see the cover letter.
>
> Do other see it?
Never mind, it just came through.
Alistair
>
> Alistair
>
>>
>> hw/ssi/xilinx_spips.c | 13 ++++++++++---
>> 1 file changed, 10 insertions(+), 3 deletions(-)
>>
>> --
>> 2.7.4
>>
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it
2018-04-17 14:18 ` [Qemu-devel] [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it Sai Pavan Boddu
@ 2018-04-17 22:43 ` francisco iglesias
2018-04-18 7:17 ` Sai Pavan Boddu
0 siblings, 1 reply; 6+ messages in thread
From: francisco iglesias @ 2018-04-17 22:43 UTC (permalink / raw)
To: Sai Pavan Boddu
Cc: alistair, crosthwaite.peter, Peter Maydell, Edde,
qemu-devel@nongnu.org Developers
Hi Sai,
[PATCH v1] xilinx_spips: send dummy only if cmd requires it
s/dummy/dummy cycles/
On 17 April 2018 at 16:18, Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
wrote:
> For all the commands, which do not have an entry in
> xilinx_spips_num_dummies, present logic sends dummy byte when ever we
>
s/dummy byte/dummy cycles/
> are in SNOOP_NONE state, fix it to send only if cmd requires them.
>
> s/fix it to send only if cmd/fix it to only send dummy cycles if the
command/
Only transmit max of 1 dummy byte(i.e 8 cycles) is a single snoop cycle.
> And also convert dummy bytes to cycles (required by m25p80).
>
Maybe it is better to drop this two last lines (was already done before so
it could be misleading when reading git history).
>
>
Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com>
> ---
> hw/ssi/xilinx_spips.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
> index 426f971..8278930 100644
> --- a/hw/ssi/xilinx_spips.c
> +++ b/hw/ssi/xilinx_spips.c
> @@ -627,10 +627,17 @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS
> *s)
> tx_rx[i] = tx;
> }
> } else {
> - /* Extract a dummy byte and generate dummy cycles according
> to the
> - * link state */
> tx = fifo8_pop(&s->tx_fifo);
> - dummy_cycles = 8 / s->link_state;
> + if (s->cmd_dummies > 0) {
> + /* Extract a dummy byte and generate dummy cycles
> according to
> + * the link state */
> + dummy_cycles = (s->cmd_dummies ? 1 : 0) * 8 /
> s->link_state;
> + s->cmd_dummies--;
> + } else {
> + for (i = 0; i < num_effective_busses(s); ++i) {
> + tx_rx[i] = tx;
> + }
> + }
> }
>
>
Could we replace above with below in the same if ladder so we don't
complicate the code more than necessary? (Should give the same result when
num_effective_busses == 1)
- } else if (s->snoop_state == SNOOP_STRIPING) {
+ } else if (s->snoop_state == SNOOP_STRIPING ||
+ s->snoop_state == SNOOP_NONE) {
Thank you!
Best regards,
Francisco Iglesias
> for (i = 0; i < num_effective_busses(s); ++i) {
> --
> 2.7.4
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it
2018-04-17 22:43 ` francisco iglesias
@ 2018-04-18 7:17 ` Sai Pavan Boddu
0 siblings, 0 replies; 6+ messages in thread
From: Sai Pavan Boddu @ 2018-04-18 7:17 UTC (permalink / raw)
To: francisco iglesias
Cc: alistair, crosthwaite.peter, Peter Maydell, Edde,
qemu-devel@nongnu.org Developers
Hi Francisco,
From: francisco iglesias [mailto:frasse.iglesias@gmail.com]
Sent: Wednesday, April 18, 2018 4:13 AM
To: Sai Pavan Boddu <saipava@xilinx.com>
Cc: alistair@alistair23.me; crosthwaite.peter@gmail.com; Peter Maydell <peter.maydell@linaro.org>; Edde <edgar.iglesias@gmail.com>; qemu-devel@nongnu.org Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it
Hi Sai,
[PATCH v1] xilinx_spips: send dummy only if cmd requires it
s/dummy/dummy cycles/
On 17 April 2018 at 16:18, Sai Pavan Boddu <sai.pavan.boddu@xilinx.com<mailto:sai.pavan.boddu@xilinx.com>> wrote:
For all the commands, which do not have an entry in
xilinx_spips_num_dummies, present logic sends dummy byte when ever we
s/dummy byte/dummy cycles/
are in SNOOP_NONE state, fix it to send only if cmd requires them.
s/fix it to send only if cmd/fix it to only send dummy cycles if the command/
Only transmit max of 1 dummy byte(i.e 8 cycles) is a single snoop cycle.
And also convert dummy bytes to cycles (required by m25p80).
Maybe it is better to drop this two last lines (was already done before so it could be misleading when reading git history).
Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com<mailto:saipava@xilinx.com>>
---
hw/ssi/xilinx_spips.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
index 426f971..8278930 100644
--- a/hw/ssi/xilinx_spips.c
+++ b/hw/ssi/xilinx_spips.c
@@ -627,10 +627,17 @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS *s)
tx_rx[i] = tx;
}
} else {
- /* Extract a dummy byte and generate dummy cycles according to the
- * link state */
tx = fifo8_pop(&s->tx_fifo);
- dummy_cycles = 8 / s->link_state;
+ if (s->cmd_dummies > 0) {
+ /* Extract a dummy byte and generate dummy cycles according to
+ * the link state */
+ dummy_cycles = (s->cmd_dummies ? 1 : 0) * 8 / s->link_state;
+ s->cmd_dummies--;
+ } else {
+ for (i = 0; i < num_effective_busses(s); ++i) {
+ tx_rx[i] = tx;
+ }
+ }
}
Could we replace above with below in the same if ladder so we don't complicate the code more than necessary? (Should give the same result when num_effective_busses == 1)
- } else if (s->snoop_state == SNOOP_STRIPING) {
+ } else if (s->snoop_state == SNOOP_STRIPING ||
+ s->snoop_state == SNOOP_NONE) {
[Sai Pavan Boddu] Yes, this can be done. As SNOOP_NONE state is moved above, the last bottom else can be used only to issue dummy cycles. I will send V2 with above changes and commit message fixed.
Regards,
Sai Pavan
Thank you!
Best regards,
Francisco Iglesias
for (i = 0; i < num_effective_busses(s); ++i) {
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-04-18 7:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-17 14:18 [Qemu-devel] [PATCH v1 0/1] xilinx_spips dummy bytes fix Sai Pavan Boddu
2018-04-17 14:18 ` [Qemu-devel] [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it Sai Pavan Boddu
2018-04-17 22:43 ` francisco iglesias
2018-04-18 7:17 ` Sai Pavan Boddu
2018-04-17 15:47 ` [Qemu-devel] [PATCH v1 0/1] xilinx_spips dummy bytes fix Alistair Francis
2018-04-17 16:08 ` Alistair Francis
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.