summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-03-18 19:19:07 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-03-18 19:19:07 +0000
commitd02975eb0d6190c0bfe88da72a27b13f8a37c2a6 (patch)
tree8cc95880e80e0ceeeb15aa778e43395025fa6ee3
parentb051a3b78431a878ef80a074592c0c9c6fcb4019 (diff)
downloadmaster-31e0f0ae-d02975eb0d6190c0bfe88da72a27b13f8a37c2a6.tar.gz
master-31e0f0ae-d02975eb0d6190c0bfe88da72a27b13f8a37c2a6.tar.bz2
master-31e0f0ae-d02975eb0d6190c0bfe88da72a27b13f8a37c2a6.zip
ar71xx: introduce global ar724x_pci_ctrl_base variable
SVN-Revision: 20284
-rw-r--r--target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c
index 251bf6d390..30b34dc7e8 100644
--- a/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c
+++ b/target/linux/ar71xx/files/arch/mips/pci/pci-ar724x.c
@@ -30,38 +30,25 @@
static void __iomem *ar724x_pci_localcfg_base;
static void __iomem *ar724x_pci_devcfg_base;
+static void __iomem *ar724x_pci_ctrl_base;
static int ar724x_pci_fixup_enable;
static DEFINE_SPINLOCK(ar724x_pci_lock);
static inline void ar724x_pci_wr(unsigned reg, u32 val)
{
- void __iomem *base;
-
- base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE);
- __raw_writel(val, base + reg);
- (void) __raw_readl(base + reg);
- iounmap(base);
+ __raw_writel(val, ar724x_pci_ctrl_base + reg);
+ (void) __raw_readl(ar724x_pci_ctrl_base + reg);
}
static inline void ar724x_pci_wr_nf(unsigned reg, u32 val)
{
- void __iomem *base;
-
- base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE);
- __raw_writel(val, base + reg);
- iounmap(base);
+ __raw_writel(val, ar724x_pci_ctrl_base + reg);
}
static inline u32 ar724x_pci_rr(unsigned reg)
{
- void __iomem *base;
- u32 ret;
-
- base = ioremap_nocache(AR724X_PCI_CTRL_BASE, AR724X_PCI_CTRL_SIZE);
- ret = __raw_readl(base + reg);
- iounmap(base);
- return ret;
+ return __raw_readl(ar724x_pci_ctrl_base + reg);
}
static void ar724x_pci_read(void __iomem *base, int where, int size, u32 *value)
@@ -368,10 +355,15 @@ int __init ar724x_pcibios_init(void)
if (ar724x_pci_devcfg_base == NULL)
goto err_unmap_localcfg;
+ ar724x_pci_ctrl_base = ioremap_nocache(AR724X_PCI_CTRL_BASE,
+ AR724X_PCI_CTRL_SIZE);
+ if (ar724x_pci_ctrl_base == NULL)
+ goto err_unmap_devcfg;
+
ar724x_pci_reset();
ret = ar724x_pci_setup();
if (ret)
- goto err_unmap_devcfg;
+ goto err_unmap_ctrl;
ar724x_pci_fixup_enable = 1;
ar724x_pci_irq_init();
@@ -379,7 +371,9 @@ int __init ar724x_pcibios_init(void)
return 0;
- err_unmap_devcfg:
+ err_unmap_ctrl:
+ iounmap(ar724x_pci_ctrl_base);
+ err_unmap_devcfg:
iounmap(ar724x_pci_devcfg_base);
err_unmap_localcfg:
iounmap(ar724x_pci_localcfg_base);