aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-04-17 04:07:47 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-04-17 04:07:47 -0400
commitab1363a8929f32cc163cd3f50ca72f20d901b00c (patch)
tree72412ce4de97e21559d0055b339bbfd6f344c10d
parentf1dcab756687622b658154ded1657538984edcdb (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>
-rw-r--r--arch/sh/drivers/pci/ops-r7780rp.c23
-rw-r--r--arch/sh/drivers/pci/ops-sdk7780.c21
-rw-r--r--arch/sh/drivers/pci/ops-se7780.c23
-rw-r--r--arch/sh/drivers/pci/ops-sh7785lcr.c21
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.c25
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.h4
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
29static 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
36static 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
43extern struct pci_ops sh7780_pci_ops;
44
45struct 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
50static struct sh4_pci_address_map sh7780_pci_map = { 29static 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
62int __init pcibios_init_platform(void) 41int __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
37static 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
44static 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
51struct 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
56static struct sh4_pci_address_map sdk7780_pci_map = { 37static 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 = {
67int __init pcibios_init_platform(void) 48int __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
44static 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
51static 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
58extern struct pci_ops se7780_pci_ops;
59
60struct 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
65static struct sh4_pci_address_map se7780_pci_map = { 44static 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
29static 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
36static 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
43struct 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
48static struct sh4_pci_address_map sh7785_pci_map = { 29static 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
60int __init pcibios_init_platform(void) 41int __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
25int __init sh7780_pci_init(struct pci_channel *chan) 25static 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
72extern u8 pci_cache_line_size; 72extern u8 pci_cache_line_size;
73 73
74int __init sh7780_pcic_init(struct pci_channel *chan, 74static 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
81static 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
88struct 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
93int __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 @@
107struct sh4_pci_address_map; 107struct sh4_pci_address_map;
108 108
109/* arch/sh/drivers/pci/pci-sh7780.c */ 109/* arch/sh/drivers/pci/pci-sh7780.c */
110int sh7780_pci_init(struct pci_channel *chan); 110int sh7780_pcic_init(struct sh4_pci_address_map *map);
111int 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_ */