linux-mips
[Top] [All Lists]

[PATCH 12/12] pci-expmem-hack

To: linux-mips@linux-mips.org
Subject: [PATCH 12/12] pci-expmem-hack
From: "Andrew Isaacson" <adi@broadcom.com>
Date: Wed, 19 Oct 2005 23:59:46 -0700
In-reply-to: <20051020065320.GA23857@broadcom.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20051020065320.GA23857@broadcom.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.1i
CFE 1.2.5 and earlier fails to turn on the ExpMemEn bit in the
PCIFeatureControl register, which means that DMA does not work
beyond physical address 01_0000_0000, ergo to DRAM beyond 1GB.

With ExpMemEn turned on, 01_0000_0000-0f_ffff_ffff is mapped,
so DMA works for up to 61 GB of DRAM.

Will be fixed in CFE 1.2.6 (yet to be released).

Signed-Off-By: Andy Isaacson <adi@broadcom.com>

 arch/mips/pci/pci-bcm1480.c |    8 ++++++++
 1 files changed, 8 insertions(+)

Index: lmo/arch/mips/pci/pci-bcm1480.c
===================================================================
--- lmo.orig/arch/mips/pci/pci-bcm1480.c        2005-10-19 22:34:13.000000000 
-0700
+++ lmo/arch/mips/pci/pci-bcm1480.c     2005-10-19 22:34:13.000000000 -0700
@@ -232,6 +232,14 @@
                bcm1480_bus_status |= PCI_BUS_ENABLED;
        }
 
+       /* turn on ExpMemEn */
+       cmdreg = READCFG32(CFGOFFSET(0, PCI_DEVFN(PCI_BRIDGE_DEVICE, 0), 0x40));
+       printk("PCIFeatureCtrl = %x\n", cmdreg);
+       WRITECFG32(CFGOFFSET(0, PCI_DEVFN(PCI_BRIDGE_DEVICE, 0), 0x40),
+                       cmdreg | 0x10);
+       cmdreg = READCFG32(CFGOFFSET(0, PCI_DEVFN(PCI_BRIDGE_DEVICE, 0), 0x40));
+       printk("PCIFeatureCtrl = %x\n", cmdreg);
+
        /*
         * Establish mappings in KSEG2 (kernel virtual) to PCI I/O
         * space.  Use "match bytes" policy to make everything look


<Prev in Thread] Current Thread [Next in Thread>