From patchwork Mon Jan 21 14:08:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 14184 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 65F8623E02 for ; Mon, 21 Jan 2013 14:08:45 +0000 (UTC) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by fiordland.canonical.com (Postfix) with ESMTP id 20123A18A35 for ; Mon, 21 Jan 2013 14:08:45 +0000 (UTC) Received: by mail-vb0-f47.google.com with SMTP id e21so5669963vbm.34 for ; Mon, 21 Jan 2013 06:08:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=RVxXCQG0aoOqkIHaTt+a89zEhfx7/KgTSP2G2siXk8o=; b=PQxWpfPmyrusWN4FcLhtrDy9sYMpSL1rIvr5UrwOaJtf+tqr8aYyI8VNMtwKCWoS6E xQScPsASbb81/oy+XkzLNjY+HxTH+DAF4nAphVVFNK/JKGCaWtYXvjVYgzhPjuOFmEae hYeRfCjhvnL4PVTvhFeyELaJEjCQgXtKoDmdttJP+EMQ5NTlffHt6I8plnDIT5Yt5zRr JQrydUnSvjSfoc+l8m6f3P64e6h9tUX+z6t2yvy77ooUsrTr8Wwz+YFN1HDsF/u5TeKG ur2lNGOLsAE8Wl5ho3p2QwAmlOaMVxEtBiBkvwcd3fWqNIx9K2v9VIGtjP2MyYrDcd1o s/Dw== X-Received: by 10.52.34.108 with SMTP id y12mr13011732vdi.8.1358777324667; Mon, 21 Jan 2013 06:08:44 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp202950veb; Mon, 21 Jan 2013 06:08:44 -0800 (PST) X-Received: by 10.204.5.145 with SMTP id 17mr4754146bkv.98.1358777321996; Mon, 21 Jan 2013 06:08:41 -0800 (PST) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id go2si9987369bkc.247.2013.01.21.06.08.41 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 21 Jan 2013 06:08:41 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1TxI3C-0001yi-Pb; Mon, 21 Jan 2013 14:08:38 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Anthony Liguori Subject: [PATCH 1/2] hw/pflash_cfi01.c: Make read after byte-write or erase return status Date: Mon, 21 Jan 2013 14:08:37 +0000 Message-Id: <1358777318-7579-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1358777318-7579-1-git-send-email-peter.maydell@linaro.org> References: <1358777318-7579-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQkC42Zdg3w6nO/GofnG5ikZp5GElDMhCxC5icepMEFcdo7uQiL1n0Q09phTBB6XGtxwz324 The Intel flash command set requires that a read operation after doing a 'single byte write' command returns the status register; add this case to pflash_read() so we return the correct information. Similarly, the case for the 0x28 flavour of block erase was missing. Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite Tested-by: Peter Crosthwaite --- hw/pflash_cfi01.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c index aadedef..310c716 100644 --- a/hw/pflash_cfi01.c +++ b/hw/pflash_cfi01.c @@ -162,7 +162,10 @@ static uint32_t pflash_read (pflash_t *pfl, hwaddr offset, } break; + case 0x10: /* Single byte program */ case 0x20: /* Block erase */ + case 0x28: /* Block erase */ + case 0x40: /* single byte program */ case 0x50: /* Clear status register */ case 0x60: /* Block /un)lock */ case 0x70: /* Status Register */