patch-2.4.20 linux-2.4.20/arch/mips/au1000/pb1500/pci_ops.c
Next file: linux-2.4.20/arch/mips/au1000/pb1500/setup.c
Previous file: linux-2.4.20/arch/mips/au1000/pb1500/pci_fixup.c
Back to the patch index
Back to the overall index
- Lines: 140
- Date:
Thu Nov 28 15:53:09 2002
- Orig file:
linux-2.4.19/arch/mips/au1000/pb1500/pci_ops.c
- Orig date:
Fri Aug 2 17:39:43 2002
diff -urN linux-2.4.19/arch/mips/au1000/pb1500/pci_ops.c linux-2.4.20/arch/mips/au1000/pb1500/pci_ops.c
@@ -46,19 +46,19 @@
#ifdef DEBUG
#define DBG(x...) printk(x)
#else
-#define DBG(x...)
+#define DBG(x...)
#endif
/* TBD */
static struct resource pci_io_resource = {
- "pci IO space",
+ "pci IO space",
Au1500_PCI_IO_START,
Au1500_PCI_IO_END,
IORESOURCE_IO
};
static struct resource pci_mem_resource = {
- "pci memory space",
+ "pci memory space",
Au1500_PCI_MEM_START,
Au1500_PCI_MEM_END,
IORESOURCE_MEM
@@ -73,7 +73,7 @@
};
static unsigned long cfg_addr;
-static int config_access(unsigned char access_type, struct pci_dev *dev,
+static int config_access(unsigned char access_type, struct pci_dev *dev,
unsigned char where, u32 * data)
{
unsigned char bus = dev->bus->number;
@@ -82,7 +82,7 @@
unsigned long config, status;
static int first = 1;
- /*
+ /*
* 7:3 = slot
* 2:0 = function
*/
@@ -95,7 +95,7 @@
if (first) {
first = 0;
cfg_addr = ioremap(Au1500_EXT_CFG, 0x10000000);
- if (!cfg_addr)
+ if (!cfg_addr)
printk (KERN_ERR "PCI unable to ioremap cfg space\n");
}
@@ -110,13 +110,13 @@
}
#endif
- writel(((0x2000 << 16) | (readl(Au1500_PCI_STATCMD) & 0xffff)),
+ au_writel(((0x2000 << 16) | (au_readl(Au1500_PCI_STATCMD) & 0xffff)),
Au1500_PCI_STATCMD);
- //writel(readl(Au1500_PCI_CFG) & ~PCI_ERROR, Au1500_PCI_CFG);
+ //au_writel(au_readl(Au1500_PCI_CFG) & ~PCI_ERROR, Au1500_PCI_CFG);
au_sync_udelay(1);
/* setup the lower 31 bits of the 36 bit address */
- config = cfg_addr |
+ config = cfg_addr |
((1<<device)<<11) | (function << 8) | (where & ~0x3);
#if 0
@@ -125,18 +125,18 @@
#endif
if (access_type == PCI_ACCESS_WRITE) {
- writel(*data, config);
+ au_writel(*data, config);
} else {
- *data = readl(config);
+ *data = au_readl(config);
}
au_sync_udelay(1);
- DBG("config_access: %d bus %d device %d at %x *data %x, conf %x\n",
+ DBG("config_access: %d bus %d device %d at %x *data %x, conf %x\n",
access_type, bus, device, where, *data, config);
/* check master abort */
- status = readl(Au1500_PCI_STATCMD);
- if (status & (1<<29)) {
+ status = au_readl(Au1500_PCI_STATCMD);
+ if (status & (1<<29)) {
*data = 0xffffffff;
return -1;
} else if ((status >> 28) & 0xf) {
@@ -159,7 +159,7 @@
if (where & 1) data >>= 8;
if (where & 2) data >>= 16;
*val = data & 0xff;
- return ret;
+ return ret;
}
@@ -171,7 +171,7 @@
ret = config_access(PCI_ACCESS_READ, dev, where, &data);
if (where & 2) data >>= 16;
*val = data & 0xffff;
- return ret;
+ return ret;
}
static int read_config_dword(struct pci_dev *dev, int where, u32 * val)
@@ -179,14 +179,14 @@
int ret;
ret = config_access(PCI_ACCESS_READ, dev, where, val);
- return ret;
+ return ret;
}
static int write_config_byte(struct pci_dev *dev, int where, u8 val)
{
u32 data = 0;
-
+
if (config_access(PCI_ACCESS_READ, dev, where, &data))
return -1;
@@ -205,11 +205,11 @@
if (where & 1)
return PCIBIOS_BAD_REGISTER_NUMBER;
-
+
if (config_access(PCI_ACCESS_READ, dev, where, &data))
return -1;
- data = (data & ~(0xffff << ((where & 3) << 3))) |
+ data = (data & ~(0xffff << ((where & 3) << 3))) |
(val << ((where & 3) << 3));
if (config_access(PCI_ACCESS_WRITE, dev, where, &data))
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)