qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Fix GT64120 mapping with REDBOOT


From: Aurelien Jarno
Subject: [Qemu-devel] [PATCH] Fix GT64120 mapping with REDBOOT
Date: Tue, 23 Jan 2007 00:41:58 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

The patch below fixes the PCI mapping of the GT64120 when the high
address is lower than the lower address. The datasheet says the zone
should not be mapped in that case. REDBOOT uses such a mapping for a
very short time frame, as it starts to write the low address and then
the high address.

Index: gt64xxx.c
===================================================================
RCS file: /sources/qemu/qemu/hw/gt64xxx.c,v
retrieving revision 1.2
diff -u -d -p -r1.2 gt64xxx.c
--- gt64xxx.c   17 Jan 2007 23:35:01 -0000      1.2
+++ gt64xxx.c   22 Jan 2007 23:38:06 -0000
@@ -229,9 +229,12 @@ static void gt64120_pci_mapping(GT64120S
     target_phys_addr_t start, length;             
 
     /* Update IO mapping */
-    start = s->regs[GT_PCI0IOLD] << 21;
-    length = ((s->regs[GT_PCI0IOHD] + 1) - (s->regs[GT_PCI0IOLD] & 0x7f)) << 
21;
-    isa_mmio_init(start, length);
+    if ((s->regs[GT_PCI0IOLD] & 0x7f) <= s->regs[GT_PCI0IOHD])
+    {
+      start = s->regs[GT_PCI0IOLD] << 21;
+      length = ((s->regs[GT_PCI0IOHD] + 1) - (s->regs[GT_PCI0IOLD] & 0x7f)) << 
21;
+      isa_mmio_init(start, length);
+    }
 }
 
 static void gt64120_writel (void *opaque, target_phys_addr_t addr,

-- 
  .''`.  Aurelien Jarno             | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   address@hidden         | address@hidden
   `-    people.debian.org/~aurel32 | www.aurel32.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]