qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "mar.krzeminski" <mar.krzeminski@gmail.com>
To: Jean-Christophe DUBOIS <jcd@tribudubois.net>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v4] [i.MX] fix CS handling during SPI access.
Date: Wed, 11 Jan 2017 19:08:13 +0100	[thread overview]
Message-ID: <5ef5d8cd-169f-a54d-69b4-caa572892ef5@gmail.com> (raw)
In-Reply-To: <1d0d2afc-8b59-17a7-be5d-7f9113d9d57f@tribudubois.net>

W dniu 11.01.2017 o 17:12, Jean-Christophe DUBOIS pisze:
> Le 10/01/2017 à 00:02, Peter Maydell a écrit :
>> On 9 January 2017 at 22:27, Jean-Christophe DUBOIS 
>> <jcd@tribudubois.net> wrote:
>>> I might be wrong but I think they are coming out of reset with
>>> their CS line set to low (so they are selected by default)
>>> because this is the default level at reset.
>> If that's true then you're in difficulties, because
>> there's no guarantee about device reset order. So
>> even if your SPI controller calls qemu_set_irq in
>> its reset function, if the devices on the other
>> end happen to have their reset called after the
>> controller then they'll still reset into selected...
I think the simplest solution in this case is to go back what you had 
before:
set each CS line state at the beginning of each new transfer - then at 
first transfer
you will properly set all CS line before transfer begin. After transfer 
end just negate
active CS line.

> How does it work for platforms that would have pull-up resistors on 
> some signals? Is it something we cannot model in QEMU?
>
> On a related note, it seems quite a few SPI controller emulator are 
> actually calling qemu_set_irq() in their reset handler.
I also have the same problem.

Thanks,
Marcin
>
> JC
>
>>
>> thanks
>> -- PMM
>>
>
>

  reply	other threads:[~2017-01-11 18:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04 22:06 [Qemu-devel] [PATCH v4] [i.MX] fix CS handling during SPI access Jean-Christophe Dubois
2017-01-09 10:46 ` Peter Maydell
2017-01-09 19:04   ` mar.krzeminski
2017-01-09 19:06     ` Peter Maydell
2017-01-09 20:05       ` Jean-Christophe DUBOIS
2017-01-09 21:19         ` Jean-Christophe DUBOIS
2017-01-09 21:45           ` Peter Maydell
2017-01-09 22:27             ` Jean-Christophe DUBOIS
2017-01-09 23:02               ` Peter Maydell
2017-01-11 16:12                 ` Jean-Christophe DUBOIS
2017-01-11 18:08                   ` mar.krzeminski [this message]
2017-01-11 18:47                     ` Jean-Christophe DUBOIS

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5ef5d8cd-169f-a54d-69b4-caa572892ef5@gmail.com \
    --to=mar.krzeminski@gmail.com \
    --cc=jcd@tribudubois.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).