]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
sh: add reg_base member to pci_channel
authorMagnus Damm <magnus.damm@gmail.com>
Tue, 19 Feb 2008 12:35:04 +0000 (21:35 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Thu, 16 Apr 2009 07:00:13 +0000 (16:00 +0900)
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>
arch/sh/drivers/pci/ops-sh4.c
arch/sh/drivers/pci/pci-sh4.h
arch/sh/drivers/pci/pci-sh7751.c
arch/sh/drivers/pci/pci-sh7751.h
arch/sh/drivers/pci/pci-sh7780.c
arch/sh/drivers/pci/pci-sh7780.h
arch/sh/include/asm/pci.h

index ee62e6de71332921ee2a74b5e328fab63a96a758..540683d07c77009352a24cf1e347003999dc8070 100644 (file)
@@ -121,8 +121,8 @@ int __init sh4_pci_check_direct(struct pci_channel *chan)
                if (pci_read_reg(chan, SH4_PCIPAR) == P1SEG) {
                        pci_write_reg(chan, tmp, SH4_PCIPAR);
                        printk(KERN_INFO "PCI: Using configuration type 1\n");
-                       request_region(PCI_REG(SH4_PCIPAR), 8, "PCI conf1");
-
+                       request_region(chan->reg_base + SH4_PCIPAR, 8,
+                                      "PCI conf1");
                        return 0;
                }
 
index 62ba35056087a3ca434545b1f4a39039de1e280c..90abfe3d39bb509cbad9cc8943870dd24e9d6a99 100644 (file)
@@ -171,13 +171,13 @@ struct sh4_pci_address_map {
 static inline void pci_write_reg(struct pci_channel *chan,
                                 unsigned long val, unsigned long reg)
 {
-       ctrl_outl(val, PCI_REG(reg));
+       ctrl_outl(val, chan->reg_base + reg);
 }
 
 static inline unsigned long pci_read_reg(struct pci_channel *chan,
                                         unsigned long reg)
 {
-       return ctrl_inl(PCI_REG(reg));
+       return ctrl_inl(chan->reg_base + reg);
 }
 
 #endif /* __PCI_SH4_H */
index 447234c69ab1beafb8a419900f71aa722b2b3984..201266b020f32ebe26d8cae85b641245c42c1599 100644 (file)
@@ -39,6 +39,8 @@ int __init sh7751_pci_init(struct pci_channel *chan)
 
        pr_debug("PCI: Starting intialization.\n");
 
+       chan->reg_base = 0xfe200000;
+
        /* check for SH7751/SH7751R hardware */
        id = pci_read_reg(chan, SH7751_PCICONF0);
        if (id != ((SH7751_DEVICE_ID << 16) | SH7751_VENDOR_ID) &&
index 0ea4387df13612a17613fcb0735f0e919c3a51b2..c390dd2f5e1a38a700110b9dfaf855e1c130726e 100644 (file)
@@ -26,7 +26,6 @@
 #define SH7751_PCI_IO_SIZE           0x40000     /* Size of IO window */
 
 #define SH7751_PCIREG_BASE           0xFE200000  /* PCI regs base address */
-#define PCI_REG(n)                  (SH7751_PCIREG_BASE+ n)
 
 #define SH7751_PCICONF0            0x0           /* PCI Config Reg 0 */
   #define SH7751_PCICONF0_DEVID      0xFFFF0000  /* Device ID */
index e8f3a308c0750dc9c642a4a7d763e88a08b750f9..9d6483a26cf994f6a44fee0aad281b147dd9fbbb 100644 (file)
@@ -52,6 +52,8 @@ int __init sh7780_pci_init(struct pci_channel *chan)
 
        pr_debug("PCI: Starting intialization.\n");
 
+       chan->reg_base = 0xfe040000;
+
        ctrl_outl(0x00000001, SH7780_PCI_VCR2); /* Enable PCIC */
 
        /* check for SH7780/SH7780R hardware */
index 2f3c92065ec34dbed740ab277e7669cd56241cfd..fffcf1dcfedfacdb7a3ca24f6a690ac5b8534ee7 100644 (file)
@@ -35,7 +35,6 @@
 #define SH7780_PCI_IO_SIZE     0x00400000      /* Size of IO window */
 
 #define SH7780_PCIREG_BASE     0xFE040000      /* PCI regs base address */
-#define PCI_REG(n)             (SH7780_PCIREG_BASE+n)
 
 /* SH7780 PCI Config Registers */
 #define SH7780_PCIVID          0x000           /* Vendor ID */
index 386587e0883063a31b97cb3df1c5538cc2cacb6d..8e9e0edcf36c0166f5843dd6142bd5bb8979718c 100644 (file)
@@ -24,6 +24,7 @@ struct pci_channel {
        int first_devfn;
        int last_devfn;
        int enabled;
+       unsigned long reg_base;
 };
 
 /*