From patchwork Fri Jul 15 14:58:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 104843 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 44211B6F18 for ; Sat, 16 Jul 2011 01:40:36 +1000 (EST) Received: from localhost ([::1]:46958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhkVE-00060g-UY for incoming@patchwork.ozlabs.org; Fri, 15 Jul 2011 11:40:33 -0400 Received: from eggs.gnu.org ([140.186.70.92]:39309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qhjqy-0002rX-NG for qemu-devel@nongnu.org; Fri, 15 Jul 2011 10:59:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qhjqt-00038g-9U for qemu-devel@nongnu.org; Fri, 15 Jul 2011 10:58:55 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:59255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qhjqr-00033y-R5 for qemu-devel@nongnu.org; Fri, 15 Jul 2011 10:58:50 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1QhjqU-0000QT-EQ; Fri, 15 Jul 2011 15:58:26 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 15 Jul 2011 15:58:18 +0100 Message-Id: <1310741906-1606-5-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1310741906-1606-1-git-send-email-peter.maydell@linaro.org> References: <1310741906-1606-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Riku Voipio , =?UTF-8?q?Juha=20Riihim=C3=A4ki?= , Markus Armbruster , patches@linaro.org Subject: [Qemu-devel] [PATCH 04/12] hw/nand: Support multiple reads following READ STATUS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Juha Riihimäki After receiving READ STATUS command all subsequent IO reads should return the status register value until another command is issued. Signed-off-by: Juha Riihimäki [Riku Voipio: Fixes and restructuring patchset] Signed-off-by: Riku Voipio [Peter Maydell: More fixes and cleanups for upstream submission] Signed-off-by: Peter Maydell --- hw/nand.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/nand.c b/hw/nand.c index 2e98f25..e6c551d 100644 --- a/hw/nand.c +++ b/hw/nand.c @@ -496,9 +496,14 @@ uint32_t nand_getio(NANDFlashState *s) for (offset = s->buswidth; offset--;) { x |= s->ioaddr[offset] << (offset << 3); } - s->addr += s->buswidth; - s->ioaddr += s->buswidth; - s->iolen -= s->buswidth; + /* after receiving READ STATUS command all subsequent reads will + * return the status register value until another command is issued + */ + if (s->cmd != NAND_CMD_READSTATUS) { + s->addr += s->buswidth; + s->ioaddr += s->buswidth; + s->iolen -= s->buswidth; + } return x; }