aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/pci/pci-sh7780.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/drivers/pci/pci-sh7780.c')
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.c87
1 files changed, 40 insertions, 47 deletions
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c
index f02d9dfcf252..4dd6e3b94a67 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -15,11 +15,47 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include "pci-sh4.h" 16#include "pci-sh4.h"
17 17
18static int __init sh7780_pci_init(struct pci_channel *chan) 18extern u8 pci_cache_line_size;
19
20static struct resource sh7785_io_resource = {
21 .name = "SH7785_IO",
22 .start = SH7780_PCI_IO_BASE,
23 .end = SH7780_PCI_IO_BASE + SH7780_PCI_IO_SIZE - 1,
24 .flags = IORESOURCE_IO
25};
26
27static struct resource sh7785_mem_resource = {
28 .name = "SH7785_mem",
29 .start = SH7780_PCI_MEMORY_BASE,
30 .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1,
31 .flags = IORESOURCE_MEM
32};
33
34static struct pci_channel sh7780_pci_controller = {
35 .pci_ops = &sh4_pci_ops,
36 .mem_resource = &sh7785_mem_resource,
37 .io_resource = &sh7785_io_resource,
38};
39
40static struct sh4_pci_address_map sh7780_pci_map = {
41 .window0 = {
42#if defined(CONFIG_32BIT)
43 .base = SH7780_32BIT_DDR_BASE_ADDR,
44 .size = 0x40000000,
45#else
46 .base = SH7780_CS0_BASE_ADDR,
47 .size = 0x20000000,
48#endif
49 },
50};
51
52static int __init sh7780_pci_init(void)
19{ 53{
54 struct pci_channel *chan = &sh7780_pci_controller;
20 unsigned int id; 55 unsigned int id;
21 const char *type = NULL; 56 const char *type = NULL;
22 int ret; 57 int ret;
58 u32 word;
23 59
24 printk(KERN_NOTICE "PCI: Starting intialization.\n"); 60 printk(KERN_NOTICE "PCI: Starting intialization.\n");
25 61
@@ -55,52 +91,6 @@ static int __init sh7780_pci_init(struct pci_channel *chan)
55 return ret; 91 return ret;
56 92
57 /* 93 /*
58 * Platform specific initialization (BSC registers, and memory space
59 * mapping) will be called via the platform defined function
60 * pcibios_init_platform().
61 */
62 return pcibios_init_platform();
63}
64
65extern u8 pci_cache_line_size;
66
67static struct resource sh7785_io_resource = {
68 .name = "SH7785_IO",
69 .start = SH7780_PCI_IO_BASE,
70 .end = SH7780_PCI_IO_BASE + SH7780_PCI_IO_SIZE - 1,
71 .flags = IORESOURCE_IO
72};
73
74static struct resource sh7785_mem_resource = {
75 .name = "SH7785_mem",
76 .start = SH7780_PCI_MEMORY_BASE,
77 .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1,
78 .flags = IORESOURCE_MEM
79};
80
81struct pci_channel board_pci_channels[] = {
82 { sh7780_pci_init, &sh4_pci_ops, &sh7785_io_resource, &sh7785_mem_resource, 0, 0xff },
83 { NULL, NULL, NULL, 0, 0 },
84};
85
86static struct sh4_pci_address_map sh7780_pci_map = {
87 .window0 = {
88#if defined(CONFIG_32BIT)
89 .base = SH7780_32BIT_DDR_BASE_ADDR,
90 .size = 0x40000000,
91#else
92 .base = SH7780_CS0_BASE_ADDR,
93 .size = 0x20000000,
94#endif
95 },
96};
97
98int __init pcibios_init_platform(void)
99{
100 struct pci_channel *chan = &board_pci_channels[0];
101 u32 word;
102
103 /*
104 * Set the class and sub-class codes. 94 * Set the class and sub-class codes.
105 */ 95 */
106 __raw_writeb(PCI_CLASS_BRIDGE_HOST >> 8, 96 __raw_writeb(PCI_CLASS_BRIDGE_HOST >> 8,
@@ -153,5 +143,8 @@ int __init pcibios_init_platform(void)
153 143
154 __set_io_port_base(SH7780_PCI_IO_BASE); 144 __set_io_port_base(SH7780_PCI_IO_BASE);
155 145
146 register_pci_controller(chan);
147
156 return 0; 148 return 0;
157} 149}
150arch_initcall(sh7780_pci_init);