aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMagnus Damm <magnus.damm@gmail.com>2008-02-19 07:35:04 -0500
committerPaul Mundt <lethal@linux-sh.org>2009-04-16 03:00:13 -0400
commite4c6a3604e07185046e2ce4be82a201f4447d788 (patch)
tree8abb5616899458a0ae197bdac3e36b7360869f25 /arch
parentb6706ef10f75921733d7275fd45d268f2f6254c8 (diff)
sh: add reg_base member to pci_channel
Store the base address of the pci host controller registers in struct pci_channel and use the address in pci_read_reg() and pci_write_reg(). Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/drivers/pci/ops-sh4.c4
-rw-r--r--arch/sh/drivers/pci/pci-sh4.h4
-rw-r--r--arch/sh/drivers/pci/pci-sh7751.c2
-rw-r--r--arch/sh/drivers/pci/pci-sh7751.h1
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.c2
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.h1
-rw-r--r--arch/sh/include/asm/pci.h1
7 files changed, 9 insertions, 6 deletions
diff --git a/arch/sh/drivers/pci/ops-sh4.c b/arch/sh/drivers/pci/ops-sh4.c
index ee62e6de7133..540683d07c77 100644
--- a/arch/sh/drivers/pci/ops-sh4.c
+++ b/arch/sh/drivers/pci/ops-sh4.c
@@ -121,8 +121,8 @@ int __init sh4_pci_check_direct(struct pci_channel *chan)
121 if (pci_read_reg(chan, SH4_PCIPAR) == P1SEG) { 121 if (pci_read_reg(chan, SH4_PCIPAR) == P1SEG) {
122 pci_write_reg(chan, tmp, SH4_PCIPAR); 122 pci_write_reg(chan, tmp, SH4_PCIPAR);
123 printk(KERN_INFO "PCI: Using configuration type 1\n"); 123 printk(KERN_INFO "PCI: Using configuration type 1\n");
124 request_region(PCI_REG(SH4_PCIPAR), 8, "PCI conf1"); 124 request_region(chan->reg_base + SH4_PCIPAR, 8,
125 125 "PCI conf1");
126 return 0; 126 return 0;
127 } 127 }
128 128
diff --git a/arch/sh/drivers/pci/pci-sh4.h b/arch/sh/drivers/pci/pci-sh4.h
index 62ba35056087..90abfe3d39bb 100644
--- a/arch/sh/drivers/pci/pci-sh4.h
+++ b/arch/sh/drivers/pci/pci-sh4.h
@@ -171,13 +171,13 @@ struct sh4_pci_address_map {
171static inline void pci_write_reg(struct pci_channel *chan, 171static inline void pci_write_reg(struct pci_channel *chan,
172 unsigned long val, unsigned long reg) 172 unsigned long val, unsigned long reg)
173{ 173{
174 ctrl_outl(val, PCI_REG(reg)); 174 ctrl_outl(val, chan->reg_base + reg);
175} 175}
176 176
177static inline unsigned long pci_read_reg(struct pci_channel *chan, 177static inline unsigned long pci_read_reg(struct pci_channel *chan,
178 unsigned long reg) 178 unsigned long reg)
179{ 179{
180 return ctrl_inl(PCI_REG(reg)); 180 return ctrl_inl(chan->reg_base + reg);
181} 181}
182 182
183#endif /* __PCI_SH4_H */ 183#endif /* __PCI_SH4_H */
diff --git a/arch/sh/drivers/pci/pci-sh7751.c b/arch/sh/drivers/pci/pci-sh7751.c
index 447234c69ab1..201266b020f3 100644
--- a/arch/sh/drivers/pci/pci-sh7751.c
+++ b/arch/sh/drivers/pci/pci-sh7751.c
@@ -39,6 +39,8 @@ int __init sh7751_pci_init(struct pci_channel *chan)
39 39
40 pr_debug("PCI: Starting intialization.\n"); 40 pr_debug("PCI: Starting intialization.\n");
41 41
42 chan->reg_base = 0xfe200000;
43
42 /* check for SH7751/SH7751R hardware */ 44 /* check for SH7751/SH7751R hardware */
43 id = pci_read_reg(chan, SH7751_PCICONF0); 45 id = pci_read_reg(chan, SH7751_PCICONF0);
44 if (id != ((SH7751_DEVICE_ID << 16) | SH7751_VENDOR_ID) && 46 if (id != ((SH7751_DEVICE_ID << 16) | SH7751_VENDOR_ID) &&
diff --git a/arch/sh/drivers/pci/pci-sh7751.h b/arch/sh/drivers/pci/pci-sh7751.h
index 0ea4387df136..c390dd2f5e1a 100644
--- a/arch/sh/drivers/pci/pci-sh7751.h
+++ b/arch/sh/drivers/pci/pci-sh7751.h
@@ -26,7 +26,6 @@
26#define SH7751_PCI_IO_SIZE 0x40000 /* Size of IO window */ 26#define SH7751_PCI_IO_SIZE 0x40000 /* Size of IO window */
27 27
28#define SH7751_PCIREG_BASE 0xFE200000 /* PCI regs base address */ 28#define SH7751_PCIREG_BASE 0xFE200000 /* PCI regs base address */
29#define PCI_REG(n) (SH7751_PCIREG_BASE+ n)
30 29
31#define SH7751_PCICONF0 0x0 /* PCI Config Reg 0 */ 30#define SH7751_PCICONF0 0x0 /* PCI Config Reg 0 */
32 #define SH7751_PCICONF0_DEVID 0xFFFF0000 /* Device ID */ 31 #define SH7751_PCICONF0_DEVID 0xFFFF0000 /* Device ID */
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c
index e8f3a308c075..9d6483a26cf9 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -52,6 +52,8 @@ int __init sh7780_pci_init(struct pci_channel *chan)
52 52
53 pr_debug("PCI: Starting intialization.\n"); 53 pr_debug("PCI: Starting intialization.\n");
54 54
55 chan->reg_base = 0xfe040000;
56
55 ctrl_outl(0x00000001, SH7780_PCI_VCR2); /* Enable PCIC */ 57 ctrl_outl(0x00000001, SH7780_PCI_VCR2); /* Enable PCIC */
56 58
57 /* check for SH7780/SH7780R hardware */ 59 /* check for SH7780/SH7780R hardware */
diff --git a/arch/sh/drivers/pci/pci-sh7780.h b/arch/sh/drivers/pci/pci-sh7780.h
index 2f3c92065ec3..fffcf1dcfedf 100644
--- a/arch/sh/drivers/pci/pci-sh7780.h
+++ b/arch/sh/drivers/pci/pci-sh7780.h
@@ -35,7 +35,6 @@
35#define SH7780_PCI_IO_SIZE 0x00400000 /* Size of IO window */ 35#define SH7780_PCI_IO_SIZE 0x00400000 /* Size of IO window */
36 36
37#define SH7780_PCIREG_BASE 0xFE040000 /* PCI regs base address */ 37#define SH7780_PCIREG_BASE 0xFE040000 /* PCI regs base address */
38#define PCI_REG(n) (SH7780_PCIREG_BASE+n)
39 38
40/* SH7780 PCI Config Registers */ 39/* SH7780 PCI Config Registers */
41#define SH7780_PCIVID 0x000 /* Vendor ID */ 40#define SH7780_PCIVID 0x000 /* Vendor ID */
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
index 386587e08830..8e9e0edcf36c 100644
--- a/arch/sh/include/asm/pci.h
+++ b/arch/sh/include/asm/pci.h
@@ -24,6 +24,7 @@ struct pci_channel {
24 int first_devfn; 24 int first_devfn;
25 int last_devfn; 25 int last_devfn;
26 int enabled; 26 int enabled;
27 unsigned long reg_base;
27}; 28};
28 29
29/* 30/*