diff mbox

[1/2] block: m25p80: Add Quad Page Program 4byte version op

Message ID 1481894862-14102-2-git-send-email-marcin.krzeminski@nokia.com (mailing list archive)
State New, archived
Headers show

Commit Message

marcin.krzeminski@nokia.com Dec. 16, 2016, 1:27 p.m. UTC
From: Marcin Krzeminski <marcin.krzeminski@nokia.com>

Some flash chips has additional page program opcode that
takes only 4 byte address. This commit adds support
for such command in Qemu.

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

Comments

Edgar E. Iglesias Dec. 16, 2016, 4:18 p.m. UTC | #1
On Fri, Dec 16, 2016 at 02:27:41PM +0100, marcin.krzeminski@nokia.com wrote:
> From: Marcin Krzeminski <marcin.krzeminski@nokia.com>
> 
> Some flash chips has additional page program opcode that
> takes only 4 byte address. This commit adds support
> for such command in Qemu.
> 
> Signed-off-by: Marcin Krzeminski <marcin.krzeminski@nokia.com>

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>


> ---
>  hw/block/m25p80.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
> index d29ff4c..2bc7028 100644
> --- a/hw/block/m25p80.c
> +++ b/hw/block/m25p80.c
> @@ -325,6 +325,7 @@ typedef enum {
>      PP4_4 = 0x3e,
>      DPP = 0xa2,
>      QPP = 0x32,
> +    QPP_4 = 0x34,
>  
>      ERASE_4K = 0x20,
>      ERASE4_4K = 0x21,
> @@ -573,6 +574,7 @@ static inline int get_addr_length(Flash *s)
>     switch (s->cmd_in_progress) {
>     case PP4:
>     case PP4_4:
> +   case QPP_4:
>     case READ4:
>     case QIOR4:
>     case ERASE4_4K:
> @@ -606,6 +608,7 @@ static void complete_collecting_data(Flash *s)
>      switch (s->cmd_in_progress) {
>      case DPP:
>      case QPP:
> +    case QPP_4:
>      case PP:
>      case PP4:
>      case PP4_4:
> @@ -873,6 +876,7 @@ static void decode_new_cmd(Flash *s, uint32_t value)
>      case READ4:
>      case DPP:
>      case QPP:
> +    case QPP_4:
>      case PP:
>      case PP4:
>      case PP4_4:
> -- 
> 2.7.4
> 
>
diff mbox

Patch

diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index d29ff4c..2bc7028 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -325,6 +325,7 @@  typedef enum {
     PP4_4 = 0x3e,
     DPP = 0xa2,
     QPP = 0x32,
+    QPP_4 = 0x34,
 
     ERASE_4K = 0x20,
     ERASE4_4K = 0x21,
@@ -573,6 +574,7 @@  static inline int get_addr_length(Flash *s)
    switch (s->cmd_in_progress) {
    case PP4:
    case PP4_4:
+   case QPP_4:
    case READ4:
    case QIOR4:
    case ERASE4_4K:
@@ -606,6 +608,7 @@  static void complete_collecting_data(Flash *s)
     switch (s->cmd_in_progress) {
     case DPP:
     case QPP:
+    case QPP_4:
     case PP:
     case PP4:
     case PP4_4:
@@ -873,6 +876,7 @@  static void decode_new_cmd(Flash *s, uint32_t value)
     case READ4:
     case DPP:
     case QPP:
+    case QPP_4:
     case PP:
     case PP4:
     case PP4_4: