Patchwork [1/2] hw/pflash_cfi01.c: Make read after byte-write or erase return status

login
register
mail settings
Submitter Peter Maydell
Date Jan. 21, 2013, 2:08 p.m.
Message ID <1358777318-7579-2-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/214173/
State New
Headers show

Comments

Peter Maydell - Jan. 21, 2013, 2:08 p.m.
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 <peter.maydell@linaro.org>
---
 hw/pflash_cfi01.c |    3 +++
 1 file changed, 3 insertions(+)
Peter Crosthwaite - Feb. 21, 2013, 8:06 a.m.
No breakages for Microblaze test cases and series looks good.

On Tue, Jan 22, 2013 at 12:08 AM, Peter Maydell
<peter.maydell@linaro.org> wrote:
> 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 <peter.maydell@linaro.org>

Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Tested-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

> ---
>  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 */
> --
> 1.7.9.5
>
>

Patch

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 */