36 #include <linux/types.h>
37 #include <linux/pci.h>
38 #include <linux/kernel.h>
43 #include <asm/addrspace.h>
48 static int mkaddr(
struct pci_bus *
bus,
unsigned char devfn,
unsigned char where)
54 ((bus->
number & 0xff) << 0x10) |
55 ((devfn & 0xff) << 0x08) |
56 (where & 0xfc) | (bus->
parent ? 1 : 0);
64 static inline int check_abort(
void)
76 static int tx3927_pci_read_config(
struct pci_bus *bus,
unsigned int devfn,
79 if (mkaddr(bus, devfn, where)) {
86 *val = *(
volatile u8 *) ((
unsigned long) &
tx3927_pcicptr->icd | (where & 3));
101 static int tx3927_pci_write_config(
struct pci_bus *bus,
unsigned int devfn,
102 int where,
int size,
u32 val)
104 if (mkaddr(bus, devfn, where))
121 return check_abort();
124 static struct pci_ops tx3927_pci_ops = {
125 .read = tx3927_pci_read_config,
126 .write = tx3927_pci_write_config,
130 unsigned long sdram_size,
int extarb)
135 unsigned long io_size =
136 channel->io_resource->end - channel->io_resource->start;
137 unsigned long io_pciaddr =
138 channel->io_resource->start - channel->io_offset;
140 channel->mem_resource->start;
142 channel->mem_resource->end - channel->mem_resource->start;
143 unsigned long mem_pciaddr =
144 channel->mem_resource->start - channel->mem_offset;
146 printk(
KERN_INFO "TX3927 PCIC -- DID:%04x VID:%04x RID:%02x Arbiter:%s",
149 extarb ?
"External" :
"Internal");
150 channel->pci_ops = &tx3927_pci_ops;
227 tx3927_pcierr_interrupt,