qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: marcin.krzeminski@nokia.com
To: qemu-devel@nongnu.org
Cc: pawel.lenkow@nokia.com, peter.crosthwaite@xilinx.com,
	marcin.krzeminski@nokia.com
Subject: [Qemu-devel] [PATCH 03/12] Reset enable and reset memory commands support.
Date: Wed, 16 Dec 2015 13:57:06 +0100	[thread overview]
Message-ID: <1450270635-27080-4-git-send-email-marcin.krzeminski@nokia.com> (raw)
In-Reply-To: <1450270635-27080-1-git-send-email-marcin.krzeminski@nokia.com>

From: Marcin Krzeminski <marcin.krzeminski@nokia.com>

Signed-off-by: Marcin Krzeminski <marcin.krzeminski@nokia.com>
---
 hw/block/m25p80.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index bcb66a5..5e07b57 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -231,6 +231,10 @@ typedef enum {
     ERASE_4K = 0x20,
     ERASE_32K = 0x52,
     ERASE_SECTOR = 0xd8,
+
+    RESET_ENABLE = 0x66,
+    RESET_MEMORY = 0x99,
+
 } FlashCMD;
 
 typedef enum {
@@ -258,6 +262,7 @@ typedef struct Flash {
     uint8_t cmd_in_progress;
     uint64_t cur_addr;
     bool write_enable;
+    bool reset_enable;
     bool initialized;
     uint8_t reset_pin;
 
@@ -441,6 +446,7 @@ static void reset_memory(Flash *s)
     s->pos = 0;
     s->state = STATE_IDLE;
     s->write_enable = false;
+    s->reset_enable = false;
 
     DB_PRINT_L(0, "Reset done.\n");
 }
@@ -554,6 +560,14 @@ static void decode_new_cmd(Flash *s, uint32_t value)
         break;
     case NOP:
         break;
+    case RESET_ENABLE:
+        s->reset_enable = true;
+        break;
+    case RESET_MEMORY:
+        if (s->reset_enable) {
+            reset_memory(s);
+        }
+        break;
     default:
         qemu_log_mask(LOG_GUEST_ERROR, "M25P80: Unknown cmd %x\n", value);
         break;
@@ -696,6 +710,7 @@ static const VMStateDescription vmstate_m25p80 = {
         VMSTATE_UINT8(cmd_in_progress, Flash),
         VMSTATE_UINT64(cur_addr, Flash),
         VMSTATE_BOOL(write_enable, Flash),
+        VMSTATE_BOOL(reset_enable, Flash),
         VMSTATE_BOOL(initialized, Flash),
         VMSTATE_UINT8(reset_pin, Flash),
         VMSTATE_END_OF_LIST()
-- 
2.5.0

  parent reply	other threads:[~2015-12-16 12:57 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 12:57 [Qemu-devel] [PATCH 00/12] Support for new flash devices/4bytes commands marcin.krzeminski
2015-12-16 12:57 ` [Qemu-devel] [PATCH 01/12] Removed unused variable marcin.krzeminski
2015-12-21 10:20   ` Peter Crosthwaite
2015-12-16 12:57 ` [Qemu-devel] [PATCH 02/12] Added reset-pin emulation in model marcin.krzeminski
2015-12-21 11:04   ` Peter Crosthwaite
2015-12-21 13:39     ` [Qemu-devel] ODP: " Krzeminski, Marcin (Nokia - PL/Wroclaw)
2016-02-01 18:29       ` [Qemu-devel] " Peter Crosthwaite
2016-02-02  7:15         ` Krzeminski, Marcin (Nokia - PL/Wroclaw)
2015-12-16 12:57 ` marcin.krzeminski [this message]
2015-12-21 11:18   ` [Qemu-devel] [PATCH 03/12] Reset enable and reset memory commands support Peter Crosthwaite
2015-12-21 13:42     ` [Qemu-devel] ODP: " Krzeminski, Marcin (Nokia - PL/Wroclaw)
2015-12-16 12:57 ` [Qemu-devel] [PATCH 04/12] Changed variable type to allow serial eeprom emulation (changing 0->1) marcin.krzeminski
2015-12-21 11:23   ` Peter Crosthwaite
2015-12-21 13:46     ` [Qemu-devel] ODP: " Krzeminski, Marcin (Nokia - PL/Wroclaw)
2015-12-16 12:57 ` [Qemu-devel] [PATCH 05/12] Added support for serial eeproms - AT25128A/AT25256A marcin.krzeminski
2015-12-21 11:28   ` Peter Crosthwaite
2015-12-21 13:49     ` [Qemu-devel] ODP: " Krzeminski, Marcin (Nokia - PL/Wroclaw)
2015-12-16 12:57 ` [Qemu-devel] [PATCH 06/12] 4byte address mode support added marcin.krzeminski
2015-12-21 11:35   ` Peter Crosthwaite
     [not found]     ` <CA0E6F9BA6AED7458C23277BD87075E51017D30D@DEMUMBX005.nsn-intra.net>
2015-12-21 13:53       ` [Qemu-devel] ODP: " Krzeminski, Marcin (Nokia - PL/Wroclaw)
2015-12-22 18:41   ` [Qemu-devel] " Cédric Le Goater
2015-12-22 21:28     ` Peter Crosthwaite
2016-02-04 11:58       ` Krzeminski, Marcin (Nokia - PL/Wroclaw)
2015-12-16 12:57 ` [Qemu-devel] [PATCH 07/12] Added support for extend address mode commands marcin.krzeminski
2015-12-21 11:41   ` Peter Crosthwaite
2015-12-21 13:56     ` [Qemu-devel] ODP: " Krzeminski, Marcin (Nokia - PL/Wroclaw)
2015-12-16 12:57 ` [Qemu-devel] [PATCH 08/12] Support for N25Q256A/N25Q512A marcin.krzeminski
2015-12-21 10:29   ` Peter Crosthwaite
2015-12-21 13:57     ` [Qemu-devel] ODP: " Krzeminski, Marcin (Nokia - PL/Wroclaw)
2015-12-16 12:57 ` [Qemu-devel] [PATCH 09/12] Support for 6Bytes jdec marcin.krzeminski
2015-12-21 10:47   ` Peter Crosthwaite
2015-12-21 14:10     ` [Qemu-devel] ODP: " Krzeminski, Marcin (Nokia - PL/Wroclaw)
2015-12-16 12:57 ` [Qemu-devel] [PATCH 10/12] Support for quad commands marcin.krzeminski
2015-12-21 11:52   ` Peter Crosthwaite
2015-12-21 14:29     ` [Qemu-devel] ODP: " Krzeminski, Marcin (Nokia - PL/Wroclaw)
2015-12-22 21:40   ` [Qemu-devel] " Peter Crosthwaite
2015-12-23  2:25     ` Peter Crosthwaite
2015-12-29 14:21       ` Lenkow, Pawel (Nokia - PL/Wroclaw)
2015-12-16 12:57 ` [Qemu-devel] [PATCH 11/12] Support for mx66u51235 and s25fl512s marcin.krzeminski
2015-12-16 12:57 ` [Qemu-devel] [PATCH 12/12] Read flag status register command support added marcin.krzeminski
2015-12-21 11:54   ` Peter Crosthwaite
2015-12-21 14:36     ` [Qemu-devel] ODP: " Krzeminski, Marcin (Nokia - PL/Wroclaw)
2015-12-16 13:01 ` [Qemu-devel] [PATCH 00/12] Support for new flash devices/4bytes commands Krzeminski, Marcin (Nokia - PL/Wroclaw)

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=1450270635-27080-4-git-send-email-marcin.krzeminski@nokia.com \
    --to=marcin.krzeminski@nokia.com \
    --cc=pawel.lenkow@nokia.com \
    --cc=peter.crosthwaite@xilinx.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).