28 #include <linux/types.h>
29 #include <linux/pci.h>
30 #include <linux/kernel.h>
36 #define PCI_ACCESS_READ 0
37 #define PCI_ACCESS_WRITE 1
40 static unsigned int korina_cnfg_regs[25] = {
48 static struct resource rc32434_res_pci_mem1;
49 static struct resource rc32434_res_pci_mem2;
51 static struct resource rc32434_res_pci_mem1 = {
56 .parent = &rc32434_res_pci_mem1,
58 .child = &rc32434_res_pci_mem2
61 static struct resource rc32434_res_pci_mem2 = {
66 .parent = &rc32434_res_pci_mem1,
71 static struct resource rc32434_res_pci_io1 = {
80 #define PCI_MEM1_START PCI_ADDR_START
81 #define PCI_MEM1_END (PCI_ADDR_START + CPUTOPCI_MEM_WIN - 1)
82 #define PCI_MEM2_START (PCI_ADDR_START + CPUTOPCI_MEM_WIN)
83 #define PCI_MEM2_END (PCI_ADDR_START + (2 * CPUTOPCI_MEM_WIN) - 1)
84 #define PCI_IO1_START (PCI_ADDR_START + (2 * CPUTOPCI_MEM_WIN))
86 (PCI_ADDR_START + (2 * CPUTOPCI_MEM_WIN) + CPUTOPCI_IO_WIN - 1)
87 #define PCI_IO2_START \
88 (PCI_ADDR_START + (2 * CPUTOPCI_MEM_WIN) + CPUTOPCI_IO_WIN)
90 (PCI_ADDR_START + (2 * CPUTOPCI_MEM_WIN) + (2 * CPUTOPCI_IO_WIN) - 1)
96 .mem_resource = &rc32434_res_pci_mem1,
97 .io_resource = &rc32434_res_pci_io1,
104 #define PCI_ENDIAN_FLAG PCILBAC_sb_m
106 #define PCI_ENDIAN_FLAG 0
109 static int __init rc32434_pcibridge_init(
void)
111 unsigned int pcicvalue, pcicdata = 0;
112 unsigned int dummyread, pcicntlval;
114 unsigned int pci_config_addr;
121 pr_err(
"PCI init error!!!\n");
186 pci_config_addr = (
unsigned int) (0x80000004);
187 for (loopCount = 0; loopCount < 24; loopCount++) {
190 rc32434_pci->pcicfgd = korina_cnfg_regs[loopCount];
192 pci_config_addr += 4;
206 static int __init rc32434_pci_init(
void)
210 pr_info(
"PCI: Initializing PCI\n");
215 rc32434_pcibridge_init();
218 resource_size(&rc32434_res_pci_io1));
223 rc32434_controller.io_map_base =
224 (
unsigned long)io_map_base - rc32434_res_pci_io1.
start;