Update of /cvsroot/linux-mips/linux/arch/mips/au1000/pb1500
In directory usw-pr-cvs1:/tmp/cvs-serv19624/pb1500
Modified Files:
pci_fixup.c pci_ops.c setup.c
Log Message:
* replace inb/oub macros with the corresponding readb/writeb ones
* changed starting pci io bus address to be 0, instead of 0x50000000
* set mips_io_port_base to be the virtual (ioremapped) address of the
pci io window
Index: pci_fixup.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/arch/mips/au1000/pb1500/pci_fixup.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- pci_fixup.c 9 Mar 2002 01:40:52 -0000 1.3
+++ pci_fixup.c 23 Mar 2002 02:13:01 -0000 1.4
@@ -66,6 +66,9 @@
return;
}
+ set_io_port_base(virt_io_addr);
+
+#if 0
pci_for_each_dev(dev) {
for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
if (dev->resource[i].start) {
@@ -73,6 +76,7 @@
}
}
}
+#endif
}
void __init pcibios_fixup_irqs(void)
@@ -107,6 +111,7 @@
{
unsigned long start, size, new_start;
+#if 0
if (dev->resource[r_num].flags & IORESOURCE_IO) {
start = dev->resource[r_num].start;
size = dev->resource[r_num].end - start;
@@ -114,5 +119,6 @@
dev->resource[r_num].start = new_start;
dev->resource[r_num].end = new_start + size;
}
+#endif
}
#endif
Index: pci_ops.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/arch/mips/au1000/pb1500/pci_ops.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- pci_ops.c 15 Feb 2002 19:47:26 -0000 1.2
+++ pci_ops.c 23 Mar 2002 02:13:01 -0000 1.3
@@ -52,15 +52,15 @@
/* TBD */
static struct resource pci_io_resource = {
"pci IO space",
- Au1500_PCI_IO_START,
- Au1500_PCI_IO_END,
+ (u32)Au1500_PCI_IO_START + 0x300,
+ (u32)Au1500_PCI_IO_END,
IORESOURCE_IO
};
static struct resource pci_mem_resource = {
"pci memory space",
- Au1500_PCI_MEM_START,
- Au1500_PCI_MEM_END,
+ (u32)Au1500_PCI_MEM_START,
+ (u32)Au1500_PCI_MEM_END,
IORESOURCE_MEM
};
@@ -72,7 +72,7 @@
(struct resource *) NULL, (int) NULL, (int) NULL}
};
-static unsigned long cfg_addr;
+static unsigned long cfg_addr, cfg_addr_type1;
static int config_access(unsigned char access_type, struct pci_dev *dev,
unsigned char where, u32 * data)
{
@@ -87,28 +87,25 @@
* 2:0 = function
*/
- if (bus != 0) {
- *data = 0xffffffff;
- return -1;
- }
-
if (first) {
first = 0;
cfg_addr = ioremap(Au1500_EXT_CFG, 0x10000000);
if (!cfg_addr)
- printk (KERN_ERR "PCI unable to ioremap cfg space\n");
+ panic (KERN_ERR "PCI unable to ioremap cfg space\n");
+
+ cfg_addr_type1 = ioremap(Au1500_EXT_CFG_TYPE1, 0x10000000);
+ if (!cfg_addr_type1) {
+ panic (KERN_ERR "PCI unable to ioremap cfg space\n");
+ }
}
device = (dev_fn >> 3) & 0x1f;
function = dev_fn & 0x7;
-#if 1
- //if (!cfg_addr || (device < 10) || (device > 16)) {
- if (!cfg_addr || (device > 16)) {
+ if (device > 16) {
*data = 0xffffffff;
return -1;
}
-#endif
writel(((0x2000 << 16) | (readl(Au1500_PCI_STATCMD) & 0xffff)),
Au1500_PCI_STATCMD);
@@ -116,8 +113,13 @@
au_sync_udelay(1);
/* setup the lower 31 bits of the 36 bit address */
- config = cfg_addr |
- ((1<<device)<<11) | (function << 8) | (where & ~0x3);
+ if (bus == 0) {
+ config = cfg_addr |
+ ((1<<device)<<11) | (function << 8) | (where & ~0x3);
+ } else {
+ config = cfg_addr_type1 | (bus<<16) | (device<<11) |
+ (function << 8) | (where & ~0x3);
+ }
#if 0
printk("cfg access: config %x, dev_fn %x, device %x function %x\n",
@@ -129,7 +131,7 @@
} else {
*data = readl(config);
}
- au_sync_udelay(1);
+ au_sync_udelay(2);
DBG("config_access: %d bus %d device %d at %x *data %x, conf %x\n",
access_type, bus, device, where, *data, config);
Index: setup.c
===================================================================
RCS file: /cvsroot/linux-mips/linux/arch/mips/au1000/pb1500/setup.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- setup.c 9 Mar 2002 01:40:06 -0000 1.3
+++ setup.c 23 Mar 2002 02:13:01 -0000 1.4
@@ -119,8 +119,7 @@
__ioremap_fixup = pb1500_ioremap_fixup;
// IO/MEM resources.
- set_io_port_base(0);
- ioport_resource.start = 0x10000000;
+ ioport_resource.start = 0x00000000;
ioport_resource.end = 0xffffffff;
iomem_resource.start = 0x10000000;
iomem_resource.end = 0xffffffff;
@@ -133,7 +132,7 @@
// set AUX clock to 12MHz * 8 = 96 MHz
writel(8, SYS_AUXPLL);
- outl(0, SYS_PINSTATERD);
+ writel(0, SYS_PINSTATERD);
udelay(100);
#if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1000_USB_DEVICE)
@@ -239,7 +238,7 @@
writel(SYS_CNTRL_E0 | SYS_CNTRL_EN0, SYS_COUNTER_CNTRL);
au_sync();
while (readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S);
- outl(0, SYS_TOYTRIM);
+ writel(0, SYS_TOYTRIM);
/* Enable BCLK switching */
writel(0x00000060, 0xb190003c);
@@ -269,6 +268,9 @@
/* check for pci memory window */
if ((phys_addr >= pci_start) && ((phys_addr + size) < pci_end)) {
return (phys_t)((phys_addr - pci_start) + Au1500_PCI_MEM_START);
+ }
+ else if (phys_addr > (pci_start + size)) {
+ printk("warning: bad remap address: %Lx\n", phys_addr);
}
else
return phys_addr;
|