From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZfAX-000782-AH for qemu-devel@nongnu.org; Fri, 25 Oct 2013 07:03:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZfAP-0005Ha-Qc for qemu-devel@nongnu.org; Fri, 25 Oct 2013 07:03:05 -0400 Received: from 1.mo4.mail-out.ovh.net ([178.33.248.196]:35642 helo=mo4.mail-out.ovh.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZfAP-0005HM-LA for qemu-devel@nongnu.org; Fri, 25 Oct 2013 07:02:57 -0400 Received: from mail614.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo4.mail-out.ovh.net (Postfix) with SMTP id DEEA3FFB27C for ; Fri, 25 Oct 2013 13:03:47 +0200 (CEST) Date: Fri, 25 Oct 2013 13:04:45 +0200 From: Jean-Christophe PLAGNIOL-VILLARD Message-ID: <20131025110445.GA18202@ns203013.ovh.net> References: <1382175183-27090-1-git-send-email-plagnioj@jcrosoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1382175183-27090-1-git-send-email-plagnioj@jcrosoft.com> Subject: Re: [Qemu-devel] [PATCH 1/1] sd: pl181: fix fifo count read support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 11:33 Sat 19 Oct , Jean-Christophe PLAGNIOL-VILLARD wrote: > as it's depend on current direction ony change to get that applied? Barebox relay on it so it can work on both qemu and real hw Best Regards, J. > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > --- > hw/sd/pl181.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c > index 03875bf..91adbbd 100644 > --- a/hw/sd/pl181.c > +++ b/hw/sd/pl181.c > @@ -344,7 +344,11 @@ static uint64_t pl181_read(void *opaque, hwaddr offset, > data engine. DataCnt is decremented after each byte is > transferred between the serial engine and the card. > We don't emulate this level of detail, so both can be the same. */ > - tmp = (s->datacnt + 3) >> 2; > + if (s->datactrl & PL181_DATA_DIRECTION) > + tmp = s->fifo_len; > + else > + tmp = s->datacnt; > + tmp = (tmp + 3) >> 2; > if (s->linux_hack) { > s->linux_hack = 0; > pl181_fifo_run(s); > -- > 1.8.4.rc3 >