qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: qemu-devel@nongnu.org
Cc: Marek Vasut <marek.vasut@gmail.com>
Subject: [Qemu-devel] [PATCH] PL011: Fix ID reporting
Date: Sat,  7 Jan 2012 21:11:17 +0100	[thread overview]
Message-ID: <1325967077-10130-1-git-send-email-marek.vasut@gmail.com> (raw)

The AMBA IDs are supposed to be at the end of 0x2000 block, which the PL011 UART
allocates. Current QEMU implementation puts those IDs at 0x1000 offset, which is
wrong. The QEMU implementation also allocates only 0x1000 instead of 0x2000 of
space.

The fix is tested to work with Linux's PL011 driver and U-Boot running in QEMU.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 hw/pl011.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/pl011.c b/hw/pl011.c
index 1b05d76..49d4de0 100644
--- a/hw/pl011.c
+++ b/hw/pl011.c
@@ -60,8 +60,8 @@ static uint64_t pl011_read(void *opaque, target_phys_addr_t offset,
     pl011_state *s = (pl011_state *)opaque;
     uint32_t c;
 
-    if (offset >= 0xfe0 && offset < 0x1000) {
-        return s->id[(offset - 0xfe0) >> 2];
+    if (offset >= 0x1fe0 && offset < 0x2000) {
+        return s->id[(offset - 0x1fe0) >> 2];
     }
     switch (offset >> 2) {
     case 0: /* UARTDR */
@@ -260,7 +260,7 @@ static int pl011_init(SysBusDevice *dev, const unsigned char *id)
 {
     pl011_state *s = FROM_SYSBUS(pl011_state, dev);
 
-    memory_region_init_io(&s->iomem, &pl011_ops, s, "pl011", 0x1000);
+    memory_region_init_io(&s->iomem, &pl011_ops, s, "pl011", 0x2000);
     sysbus_init_mmio(dev, &s->iomem);
     sysbus_init_irq(dev, &s->irq);
     s->id = id;
-- 
1.7.7.3

             reply	other threads:[~2012-01-07 20:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-07 20:11 Marek Vasut [this message]
2012-01-07 20:38 ` [Qemu-devel] [PATCH] PL011: Fix ID reporting Peter Maydell
2012-01-07 20:56   ` Marek Vasut
2012-01-08 14:36     ` Peter Maydell
2012-01-08 16:02       ` Marek Vasut
2012-01-08 16:21         ` Peter Maydell
2012-01-08 16:57           ` Marek Vasut
2012-01-08 17:10             ` Peter Maydell
2012-01-08 19:44               ` Marek Vasut
2012-01-08 21:36                 ` Peter Maydell
2012-01-08 23:59                   ` Marek Vasut

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=1325967077-10130-1-git-send-email-marek.vasut@gmail.com \
    --to=marek.vasut@gmail.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).