aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/ath79
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-02-03 04:59:45 -0500
committerJohn Crispin <blogic@openwrt.org>2013-02-16 19:25:39 -0500
commit34b134aebda89888b6985b7a3139e9cbdf209236 (patch)
treef6dc7a06f2b74420b77bac128a237af91ce00bbb /arch/mips/ath79
parent908339ef25b1d5e80f1c6fab22b9958174708b4a (diff)
MIPS: pci-ar724x: remove static PCI IO/MEM resources
Static resources become impractical when multiple PCI controllers are present. Move the resources into the platform device registration code and change the probe routine to get those from there platform device's resources. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/4914/ Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/ath79')
-rw-r--r--arch/mips/ath79/pci.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/arch/mips/ath79/pci.c b/arch/mips/ath79/pci.c
index d90e07136383..45d1112de50d 100644
--- a/arch/mips/ath79/pci.c
+++ b/arch/mips/ath79/pci.c
@@ -139,10 +139,13 @@ static struct platform_device *
139ath79_register_pci_ar724x(int id, 139ath79_register_pci_ar724x(int id,
140 unsigned long cfg_base, 140 unsigned long cfg_base,
141 unsigned long ctrl_base, 141 unsigned long ctrl_base,
142 unsigned long mem_base,
143 unsigned long mem_size,
144 unsigned long io_base,
142 int irq) 145 int irq)
143{ 146{
144 struct platform_device *pdev; 147 struct platform_device *pdev;
145 struct resource res[3]; 148 struct resource res[5];
146 149
147 memset(res, 0, sizeof(res)); 150 memset(res, 0, sizeof(res));
148 151
@@ -160,6 +163,16 @@ ath79_register_pci_ar724x(int id,
160 res[2].start = irq; 163 res[2].start = irq;
161 res[2].end = irq; 164 res[2].end = irq;
162 165
166 res[3].name = "mem_base";
167 res[3].flags = IORESOURCE_MEM;
168 res[3].start = mem_base;
169 res[3].end = mem_base + mem_size - 1;
170
171 res[4].name = "io_base";
172 res[4].flags = IORESOURCE_IO;
173 res[4].start = io_base;
174 res[4].end = io_base;
175
163 pdev = platform_device_register_simple("ar724x-pci", id, 176 pdev = platform_device_register_simple("ar724x-pci", id,
164 res, ARRAY_SIZE(res)); 177 res, ARRAY_SIZE(res));
165 return pdev; 178 return pdev;
@@ -175,6 +188,9 @@ int __init ath79_register_pci(void)
175 pdev = ath79_register_pci_ar724x(-1, 188 pdev = ath79_register_pci_ar724x(-1,
176 AR724X_PCI_CFG_BASE, 189 AR724X_PCI_CFG_BASE,
177 AR724X_PCI_CTRL_BASE, 190 AR724X_PCI_CTRL_BASE,
191 AR724X_PCI_MEM_BASE,
192 AR724X_PCI_MEM_SIZE,
193 0,
178 ATH79_CPU_IRQ_IP2); 194 ATH79_CPU_IRQ_IP2);
179 } else if (soc_is_ar9342() || 195 } else if (soc_is_ar9342() ||
180 soc_is_ar9344()) { 196 soc_is_ar9344()) {
@@ -187,6 +203,9 @@ int __init ath79_register_pci(void)
187 pdev = ath79_register_pci_ar724x(-1, 203 pdev = ath79_register_pci_ar724x(-1,
188 AR724X_PCI_CFG_BASE, 204 AR724X_PCI_CFG_BASE,
189 AR724X_PCI_CTRL_BASE, 205 AR724X_PCI_CTRL_BASE,
206 AR724X_PCI_MEM_BASE,
207 AR724X_PCI_MEM_SIZE,
208 0,
190 ATH79_IP2_IRQ(0)); 209 ATH79_IP2_IRQ(0));
191 } else { 210 } else {
192 /* No PCI support */ 211 /* No PCI support */