From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cQhku-00049r-RM for qemu-devel@nongnu.org; Mon, 09 Jan 2017 16:45:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cQhku-0003Eb-49 for qemu-devel@nongnu.org; Mon, 09 Jan 2017 16:45:28 -0500 Received: from mail-ua0-x236.google.com ([2607:f8b0:400c:c08::236]:33635) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cQhku-0003EU-04 for qemu-devel@nongnu.org; Mon, 09 Jan 2017 16:45:28 -0500 Received: by mail-ua0-x236.google.com with SMTP id i68so369240830uad.0 for ; Mon, 09 Jan 2017 13:45:27 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20170104220624.26557-1-jcd@tribudubois.net> <1be7123c-acee-7d16-8a10-c8965d5805ff@gmail.com> From: Peter Maydell Date: Mon, 9 Jan 2017 21:45:06 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v4] [i.MX] fix CS handling during SPI access. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jean-Christophe DUBOIS Cc: "mar.krzeminski" , QEMU Developers On 9 January 2017 at 21:19, Jean-Christophe DUBOIS 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(). thanks -- PMM