qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4] [i.MX] fix CS handling during SPI access.


From: Jean-Christophe DUBOIS
Subject: Re: [Qemu-devel] [PATCH v4] [i.MX] fix CS handling during SPI access.
Date: Mon, 9 Jan 2017 23:27:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

Le 09/01/2017 à 22:45, Peter Maydell a écrit :
On 9 January 2017 at 21:19, Jean-Christophe DUBOIS <address@hidden> wrote:
Hum, ... I think I have a problem.

With the default register value (that I get a reset) the CS line is
deselected when the CS is high.

So at reset I would need to set my 4 CS lines to high in order to be able to
drive them low later.

So during the "reset" I need to set my 4 CS line to 1 but according to you
feedback I should not do it with qemu_set_irq()...

Is there another way than qemu_set_irq() to do set my lines to high level ?
"Line should be asserted at device reset" is an awkward case
that we can't really handle cleanly at the moment,
unfortunately. Assuming that the device at the other end
comes out of reset as "not selected" it should still work,
though -- there is no state stored in a qemu_set_irq(),
so if both ends believe that the reset state of the line
is 1 then there's no need to call qemu_set_irq().

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 I have 4 devices on the same SPI bus/controller (attached to different CS line) they would all be selected by default I think.

JC


thanks
-- PMM






reply via email to

[Prev in Thread] Current Thread [Next in Thread]