From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rjcbw-0005bp-8a for qemu-devel@nongnu.org; Sat, 07 Jan 2012 15:11:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rjcbr-0001pd-Um for qemu-devel@nongnu.org; Sat, 07 Jan 2012 15:11:28 -0500 Received: from mail-ey0-f173.google.com ([209.85.215.173]:49511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rjcbr-0001pT-Hq for qemu-devel@nongnu.org; Sat, 07 Jan 2012 15:11:23 -0500 Received: by eaad1 with SMTP id d1so1593556eaa.4 for ; Sat, 07 Jan 2012 12:11:22 -0800 (PST) From: Marek Vasut Date: Sat, 7 Jan 2012 21:11:17 +0100 Message-Id: <1325967077-10130-1-git-send-email-marek.vasut@gmail.com> Subject: [Qemu-devel] [PATCH] PL011: Fix ID reporting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Marek Vasut 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 --- 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