Skip to contentSkip to conversation

Fix GT64120 mapping with REDBOOT

PATCH New Aurelien Jarno 1 participant 1 message Jan 22, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix GT64120 mapping with REDBOOT

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

gt64xxx.c +6 -3
diff -u -d -p -r1.2 gt64xxx.c
@@ -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,
Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net