qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Leon Alrae <leon.alrae@imgtec.com>
To: qemu-devel@nongnu.org
Cc: yongbok.kim@imgtec.com, cristian.cuna@imgtec.com,
	leon.alrae@imgtec.com, paul.burton@imgtec.com,
	aurelien@aurel32.net
Subject: [Qemu-devel] [PATCH 6/6] pflash_cfi01: duplicate status byte from bits 23:16 for 32bit reads
Date: Fri, 14 Jun 2013 08:30:48 +0100	[thread overview]
Message-ID: <1371195048-19618-7-git-send-email-leon.alrae@imgtec.com> (raw)
In-Reply-To: <1371195048-19618-1-git-send-email-leon.alrae@imgtec.com>

From: Paul Burton <paul.burton@imgtec.com>

The firmware commonly used with MIPS Malta boards (YAMON) reads the
status of the pflash with a 32bit memory access. On real hardware
this results in the status byte being mirrored in the upper 16 bits
of the read value. For example if the status byte is represented by
SS then the hardware reads 0x00SS00SS. The YAMON firmware compares the
status against 32bit values expecting the mirrored value and fails
without it.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
---
 hw/block/pflash_cfi01.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
index 63d7c99..047ee65 100644
--- a/hw/block/pflash_cfi01.c
+++ b/hw/block/pflash_cfi01.c
@@ -186,6 +186,9 @@ static uint32_t pflash_read (pflash_t *pfl, hwaddr offset,
     case 0xe8: /* Write block */
         /* Status register read */
         ret = pfl->status;
+        if (width > 2) {
+            ret |= pfl->status << 16;
+        }
         DPRINTF("%s: status %x\n", __func__, ret);
         break;
     case 0x90:
-- 
1.7.5.4

  parent reply	other threads:[~2013-06-14  7:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14  7:30 [Qemu-devel] [PATCH 0/6] mips_malta: fixes to support YAMON firmware Leon Alrae
2013-06-14  7:30 ` [Qemu-devel] [PATCH 1/6] mips_malta: fix BIOS endianness swapping Leon Alrae
2013-06-14  7:30 ` [Qemu-devel] [PATCH 2/6] mips_malta: correct reading MIPS revision at 0x1fc00010 Leon Alrae
2013-07-29  4:33   ` Andreas Färber
2013-06-14  7:30 ` [Qemu-devel] [PATCH 3/6] mips_malta: generate SPD EEPROM data at runtime Leon Alrae
2013-06-14  7:30 ` [Qemu-devel] [PATCH 4/6] mips_malta: cap BIOS endian swap length at 0x3e0000 bytes Leon Alrae
2013-06-14  7:30 ` [Qemu-devel] [PATCH 5/6] mips_malta: generate SMBUS EEPROM data Leon Alrae
2013-06-14  7:30 ` Leon Alrae [this message]
2013-06-28 13:20 ` [Qemu-devel] [PATCH 0/6] mips_malta: fixes to support YAMON firmware Leon Alrae
2013-07-18  7:34   ` Leon Alrae
2013-07-28 22:24 ` Aurelien Jarno

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=1371195048-19618-7-git-send-email-leon.alrae@imgtec.com \
    --to=leon.alrae@imgtec.com \
    --cc=aurelien@aurel32.net \
    --cc=cristian.cuna@imgtec.com \
    --cc=paul.burton@imgtec.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yongbok.kim@imgtec.com \
    /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).