qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Liming Wang <walimisdev@gmail.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-devel] [PATCH 1/2] hw/pflash_cfi01: add "0xf0" to select and deselect read mode
Date: Tue, 20 Mar 2012 22:48:57 +0800	[thread overview]
Message-ID: <1332254938-31023-1-git-send-email-walimisdev@gmail.com> (raw)

In CFI Specification, "0xff" and "0xf0" are both the data
to select and deselect read mode, so add "0xf0" here.

Linux guest os often uses "0xf0" to select read mode, which leads
qemu printing "pflash_write: Unimplemented flash cmd sequence
(offset 00000000, wcycle 0x0 cmd 0x0 value 0xf0)". This patch fixes
this mistake.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
---
 hw/pflash_cfi01.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c
index b03f623..2e6fa71 100644
--- a/hw/pflash_cfi01.c
+++ b/hw/pflash_cfi01.c
@@ -313,7 +313,8 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
             DPRINTF("%s: Write to buffer\n", __func__);
             pfl->status |= 0x80; /* Ready! */
             break;
-        case 0xff: /* Read array mode */
+        case 0xf0: /* Read array mode */
+        case 0xff:
             DPRINTF("%s: Read array mode\n", __func__);
             goto reset_flash;
         default:
@@ -367,7 +368,7 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
             }
             break;
         case 0x98:
-            if (cmd == 0xff) {
+            if (cmd == 0xff || cmd == 0xf0) {
                 goto reset_flash;
             } else {
                 DPRINTF("%s: leaving query mode\n", __func__);
-- 
1.7.0.4

             reply	other threads:[~2012-03-20 14:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 14:48 Liming Wang [this message]
2012-03-20 14:48 ` [Qemu-devel] [PATCH 2/2] hw/pflash_cfi01: change print method to avoid complaint Liming Wang
2012-03-20 23:43   ` Stefan Weil
2012-03-21  1:59     ` walimis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1332254938-31023-1-git-send-email-walimisdev@gmail.com \
    --to=walimisdev@gmail.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).