diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-04-17 04:07:47 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-04-17 04:07:47 -0400 |
commit | ab1363a8929f32cc163cd3f50ca72f20d901b00c (patch) | |
tree | 72412ce4de97e21559d0055b339bbfd6f344c10d /arch/sh/drivers | |
parent | f1dcab756687622b658154ded1657538984edcdb (diff) |
sh: pci: Consolidate PCI I/O and mem window definitions for SH7780.
This consolidates all of the PCI I/O and memory window definitions across
the pci-sh7780 users in pci-sh7780 itself. No functional changes, in that
every platform had exactly the same implementation.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers')
-rw-r--r-- | arch/sh/drivers/pci/ops-r7780rp.c | 23 | ||||
-rw-r--r-- | arch/sh/drivers/pci/ops-sdk7780.c | 21 | ||||
-rw-r--r-- | arch/sh/drivers/pci/ops-se7780.c | 23 | ||||
-rw-r--r-- | arch/sh/drivers/pci/ops-sh7785lcr.c | 21 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci-sh7780.c | 25 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci-sh7780.h | 4 |
6 files changed, 27 insertions, 90 deletions
diff --git a/arch/sh/drivers/pci/ops-r7780rp.c b/arch/sh/drivers/pci/ops-r7780rp.c index 8ec6d225ef9d..044525df18c5 100644 --- a/arch/sh/drivers/pci/ops-r7780rp.c +++ b/arch/sh/drivers/pci/ops-r7780rp.c | |||
@@ -26,27 +26,6 @@ int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) | |||
26 | return irq_tab[slot]; | 26 | return irq_tab[slot]; |
27 | } | 27 | } |
28 | 28 | ||
29 | static struct resource sh7780_io_resource = { | ||
30 | .name = "SH7780_IO", | ||
31 | .start = SH7780_PCI_IO_BASE, | ||
32 | .end = SH7780_PCI_IO_BASE + SH7780_PCI_IO_SIZE - 1, | ||
33 | .flags = IORESOURCE_IO | ||
34 | }; | ||
35 | |||
36 | static struct resource sh7780_mem_resource = { | ||
37 | .name = "SH7780_mem", | ||
38 | .start = SH7780_PCI_MEMORY_BASE, | ||
39 | .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1, | ||
40 | .flags = IORESOURCE_MEM | ||
41 | }; | ||
42 | |||
43 | extern struct pci_ops sh7780_pci_ops; | ||
44 | |||
45 | struct pci_channel board_pci_channels[] = { | ||
46 | { sh7780_pci_init, &sh4_pci_ops, &sh7780_io_resource, &sh7780_mem_resource, 0, 0xff }, | ||
47 | { NULL, NULL, NULL, 0, 0 }, | ||
48 | }; | ||
49 | |||
50 | static struct sh4_pci_address_map sh7780_pci_map = { | 29 | static struct sh4_pci_address_map sh7780_pci_map = { |
51 | .window0 = { | 30 | .window0 = { |
52 | .base = SH7780_CS2_BASE_ADDR, | 31 | .base = SH7780_CS2_BASE_ADDR, |
@@ -61,5 +40,5 @@ static struct sh4_pci_address_map sh7780_pci_map = { | |||
61 | 40 | ||
62 | int __init pcibios_init_platform(void) | 41 | int __init pcibios_init_platform(void) |
63 | { | 42 | { |
64 | return sh7780_pcic_init(&board_pci_channels[0], &sh7780_pci_map); | 43 | return sh7780_pcic_init(&sh7780_pci_map); |
65 | } | 44 | } |
diff --git a/arch/sh/drivers/pci/ops-sdk7780.c b/arch/sh/drivers/pci/ops-sdk7780.c index 6a0b7c067831..570fd71f6937 100644 --- a/arch/sh/drivers/pci/ops-sdk7780.c +++ b/arch/sh/drivers/pci/ops-sdk7780.c | |||
@@ -34,25 +34,6 @@ int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) | |||
34 | return sdk7780_irq_tab[pin-1][slot]; | 34 | return sdk7780_irq_tab[pin-1][slot]; |
35 | } | 35 | } |
36 | 36 | ||
37 | static struct resource sdk7780_io_resource = { | ||
38 | .name = "SH7780_IO", | ||
39 | .start = SH7780_PCI_IO_BASE, | ||
40 | .end = SH7780_PCI_IO_BASE + SH7780_PCI_IO_SIZE - 1, | ||
41 | .flags = IORESOURCE_IO | ||
42 | }; | ||
43 | |||
44 | static struct resource sdk7780_mem_resource = { | ||
45 | .name = "SH7780_mem", | ||
46 | .start = SH7780_PCI_MEMORY_BASE, | ||
47 | .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1, | ||
48 | .flags = IORESOURCE_MEM | ||
49 | }; | ||
50 | |||
51 | struct pci_channel board_pci_channels[] = { | ||
52 | { sh7780_pci_init, &sh4_pci_ops, &sdk7780_io_resource, &sdk7780_mem_resource, 0, 0xff }, | ||
53 | { NULL, NULL, NULL, 0, 0 }, | ||
54 | }; | ||
55 | |||
56 | static struct sh4_pci_address_map sdk7780_pci_map = { | 37 | static struct sh4_pci_address_map sdk7780_pci_map = { |
57 | .window0 = { | 38 | .window0 = { |
58 | .base = SH7780_CS2_BASE_ADDR, | 39 | .base = SH7780_CS2_BASE_ADDR, |
@@ -67,5 +48,5 @@ static struct sh4_pci_address_map sdk7780_pci_map = { | |||
67 | int __init pcibios_init_platform(void) | 48 | int __init pcibios_init_platform(void) |
68 | { | 49 | { |
69 | printk(KERN_INFO "SH7780 PCI: Finished initializing PCI controller\n"); | 50 | printk(KERN_INFO "SH7780 PCI: Finished initializing PCI controller\n"); |
70 | return sh7780_pcic_init(&board_pci_channels[0], &sdk7780_pci_map); | 51 | return sh7780_pcic_init(&sdk7780_pci_map); |
71 | } | 52 | } |
diff --git a/arch/sh/drivers/pci/ops-se7780.c b/arch/sh/drivers/pci/ops-se7780.c index 583b8e82ff99..8b0941515b0f 100644 --- a/arch/sh/drivers/pci/ops-se7780.c +++ b/arch/sh/drivers/pci/ops-se7780.c | |||
@@ -41,27 +41,6 @@ int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) | |||
41 | return se7780_irq_tab[pin-1][slot]; | 41 | return se7780_irq_tab[pin-1][slot]; |
42 | } | 42 | } |
43 | 43 | ||
44 | static struct resource se7780_io_resource = { | ||
45 | .name = "SH7780_IO", | ||
46 | .start = SH7780_PCI_IO_BASE, | ||
47 | .end = SH7780_PCI_IO_BASE + SH7780_PCI_IO_SIZE - 1, | ||
48 | .flags = IORESOURCE_IO | ||
49 | }; | ||
50 | |||
51 | static struct resource se7780_mem_resource = { | ||
52 | .name = "SH7780_mem", | ||
53 | .start = SH7780_PCI_MEMORY_BASE, | ||
54 | .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1, | ||
55 | .flags = IORESOURCE_MEM | ||
56 | }; | ||
57 | |||
58 | extern struct pci_ops se7780_pci_ops; | ||
59 | |||
60 | struct pci_channel board_pci_channels[] = { | ||
61 | { sh7780_pci_init, &sh4_pci_ops, &se7780_io_resource, &se7780_mem_resource, 0, 0xff }, | ||
62 | { NULL, NULL, NULL, 0, 0 }, | ||
63 | }; | ||
64 | |||
65 | static struct sh4_pci_address_map se7780_pci_map = { | 44 | static struct sh4_pci_address_map se7780_pci_map = { |
66 | .window0 = { | 45 | .window0 = { |
67 | .base = SH7780_CS2_BASE_ADDR, | 46 | .base = SH7780_CS2_BASE_ADDR, |
@@ -90,5 +69,5 @@ int __init pcibios_init_platform(void) | |||
90 | ctrl_outw(0x0013, FPGA_PCI_INTSEL1); | 69 | ctrl_outw(0x0013, FPGA_PCI_INTSEL1); |
91 | ctrl_outw(0xE402, FPGA_PCI_INTSEL2); | 70 | ctrl_outw(0xE402, FPGA_PCI_INTSEL2); |
92 | 71 | ||
93 | return sh7780_pcic_init(&board_pci_channels[0], &se7780_pci_map); | 72 | return sh7780_pcic_init(&se7780_pci_map); |
94 | } | 73 | } |
diff --git a/arch/sh/drivers/pci/ops-sh7785lcr.c b/arch/sh/drivers/pci/ops-sh7785lcr.c index ab0d1decf2df..bac46b5d1580 100644 --- a/arch/sh/drivers/pci/ops-sh7785lcr.c +++ b/arch/sh/drivers/pci/ops-sh7785lcr.c | |||
@@ -26,25 +26,6 @@ int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) | |||
26 | return irq_tab[slot]; | 26 | return irq_tab[slot]; |
27 | } | 27 | } |
28 | 28 | ||
29 | static struct resource sh7785_io_resource = { | ||
30 | .name = "SH7785_IO", | ||
31 | .start = SH7780_PCI_IO_BASE, | ||
32 | .end = SH7780_PCI_IO_BASE + SH7780_PCI_IO_SIZE - 1, | ||
33 | .flags = IORESOURCE_IO | ||
34 | }; | ||
35 | |||
36 | static struct resource sh7785_mem_resource = { | ||
37 | .name = "SH7785_mem", | ||
38 | .start = SH7780_PCI_MEMORY_BASE, | ||
39 | .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1, | ||
40 | .flags = IORESOURCE_MEM | ||
41 | }; | ||
42 | |||
43 | struct pci_channel board_pci_channels[] = { | ||
44 | { sh7780_pci_init, &sh4_pci_ops, &sh7785_io_resource, &sh7785_mem_resource, 0, 0xff }, | ||
45 | { NULL, NULL, NULL, 0, 0 }, | ||
46 | }; | ||
47 | |||
48 | static struct sh4_pci_address_map sh7785_pci_map = { | 29 | static struct sh4_pci_address_map sh7785_pci_map = { |
49 | .window0 = { | 30 | .window0 = { |
50 | #if defined(CONFIG_32BIT) | 31 | #if defined(CONFIG_32BIT) |
@@ -59,5 +40,5 @@ static struct sh4_pci_address_map sh7785_pci_map = { | |||
59 | 40 | ||
60 | int __init pcibios_init_platform(void) | 41 | int __init pcibios_init_platform(void) |
61 | { | 42 | { |
62 | return sh7780_pcic_init(&board_pci_channels[0], &sh7785_pci_map); | 43 | return sh7780_pcic_init(&sh7785_pci_map); |
63 | } | 44 | } |
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c index 207b7206fbda..eb217ddf025f 100644 --- a/arch/sh/drivers/pci/pci-sh7780.c +++ b/arch/sh/drivers/pci/pci-sh7780.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include "pci-sh4.h" | 23 | #include "pci-sh4.h" |
24 | 24 | ||
25 | int __init sh7780_pci_init(struct pci_channel *chan) | 25 | static int __init sh7780_pci_init(struct pci_channel *chan) |
26 | { | 26 | { |
27 | unsigned int id; | 27 | unsigned int id; |
28 | const char *type = NULL; | 28 | const char *type = NULL; |
@@ -71,9 +71,28 @@ int __init sh7780_pci_init(struct pci_channel *chan) | |||
71 | 71 | ||
72 | extern u8 pci_cache_line_size; | 72 | extern u8 pci_cache_line_size; |
73 | 73 | ||
74 | int __init sh7780_pcic_init(struct pci_channel *chan, | 74 | static struct resource sh7785_io_resource = { |
75 | struct sh4_pci_address_map *map) | 75 | .name = "SH7785_IO", |
76 | .start = SH7780_PCI_IO_BASE, | ||
77 | .end = SH7780_PCI_IO_BASE + SH7780_PCI_IO_SIZE - 1, | ||
78 | .flags = IORESOURCE_IO | ||
79 | }; | ||
80 | |||
81 | static struct resource sh7785_mem_resource = { | ||
82 | .name = "SH7785_mem", | ||
83 | .start = SH7780_PCI_MEMORY_BASE, | ||
84 | .end = SH7780_PCI_MEMORY_BASE + SH7780_PCI_MEM_SIZE - 1, | ||
85 | .flags = IORESOURCE_MEM | ||
86 | }; | ||
87 | |||
88 | struct pci_channel board_pci_channels[] = { | ||
89 | { sh7780_pci_init, &sh4_pci_ops, &sh7785_io_resource, &sh7785_mem_resource, 0, 0xff }, | ||
90 | { NULL, NULL, NULL, 0, 0 }, | ||
91 | }; | ||
92 | |||
93 | int __init sh7780_pcic_init(struct sh4_pci_address_map *map) | ||
76 | { | 94 | { |
95 | struct pci_channel *chan = &board_pci_channels[0]; | ||
77 | u32 word; | 96 | u32 word; |
78 | 97 | ||
79 | /* | 98 | /* |
diff --git a/arch/sh/drivers/pci/pci-sh7780.h b/arch/sh/drivers/pci/pci-sh7780.h index 213f1d8c9ca5..7a4f8a8dd690 100644 --- a/arch/sh/drivers/pci/pci-sh7780.h +++ b/arch/sh/drivers/pci/pci-sh7780.h | |||
@@ -107,8 +107,6 @@ | |||
107 | struct sh4_pci_address_map; | 107 | struct sh4_pci_address_map; |
108 | 108 | ||
109 | /* arch/sh/drivers/pci/pci-sh7780.c */ | 109 | /* arch/sh/drivers/pci/pci-sh7780.c */ |
110 | int sh7780_pci_init(struct pci_channel *chan); | 110 | int sh7780_pcic_init(struct sh4_pci_address_map *map); |
111 | int sh7780_pcic_init(struct pci_channel *chan, | ||
112 | struct sh4_pci_address_map *map); | ||
113 | 111 | ||
114 | #endif /* _PCI_SH7780_H_ */ | 112 | #endif /* _PCI_SH7780_H_ */ |