From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H98nX-00033W-51 for qemu-devel@nongnu.org; Mon, 22 Jan 2007 18:41:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H98nW-000336-Fx for qemu-devel@nongnu.org; Mon, 22 Jan 2007 18:41:58 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H98nW-00032t-9b for qemu-devel@nongnu.org; Mon, 22 Jan 2007 18:41:58 -0500 Received: from [82.232.2.251] (helo=mail.aurel32.net) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H98nV-00023y-QY for qemu-devel@nongnu.org; Mon, 22 Jan 2007 18:41:58 -0500 Received: from farad.aurel32.net ([2001:618:400:fc13:216:3eff:fe00:100c]) by mail.aurel32.net with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1H98nW-00085e-Ks for qemu-devel@nongnu.org; Tue, 23 Jan 2007 00:41:58 +0100 Received: from aurel32 by farad.aurel32.net with local (Exim 4.63) (envelope-from ) id 1H98nW-0003FE-Ew for qemu-devel@nongnu.org; Tue, 23 Jan 2007 00:41:58 +0100 Date: Tue, 23 Jan 2007 00:41:58 +0100 From: Aurelien Jarno Message-ID: <20070122234158.GA12465@farad.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Subject: [Qemu-devel] [PATCH] Fix GT64120 mapping with REDBOOT Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net