linux-mips
[Top] [All Lists]

Re: [PATCH 3/4] MIPS: pci-ar724x: remove static PCI IO/MEM resources

To: Gabor Juhos <juhosg@openwrt.org>
Subject: Re: [PATCH 3/4] MIPS: pci-ar724x: remove static PCI IO/MEM resources
From: Sergei Shtylyov <sshtylyov@mvista.com>
Date: Sun, 03 Feb 2013 15:18:52 +0400
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips <linux-mips@linux-mips.org>, John Crispin <blogic@openwrt.org>
In-reply-to: <1359889185-15779-1-git-send-email-juhosg@openwrt.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1359889120-15699-1-git-send-email-juhosg@openwrt.org> <1359889185-15779-1-git-send-email-juhosg@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
Hello.

On 03-02-2013 14:59, Gabor Juhos wrote:

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>
---
  arch/mips/ath79/pci.c      |   21 ++++++++++++++++++++-
  arch/mips/pci/pci-ar724x.c |   40 ++++++++++++++++++++++++----------------
  2 files changed, 44 insertions(+), 17 deletions(-)

diff --git a/arch/mips/ath79/pci.c b/arch/mips/ath79/pci.c
index d90e071..45d1112 100644
--- a/arch/mips/ath79/pci.c
+++ b/arch/mips/ath79/pci.c
@@ -139,10 +139,13 @@ static struct platform_device *
  ath79_register_pci_ar724x(int id,
                          unsigned long cfg_base,
                          unsigned long ctrl_base,
+                         unsigned long mem_base,
+                         unsigned long mem_size,
+                         unsigned long io_base,
                          int irq)
  {
        struct platform_device *pdev;
-       struct resource res[3];
+       struct resource res[5];

        memset(res, 0, sizeof(res));

@@ -160,6 +163,16 @@ ath79_register_pci_ar724x(int id,
        res[2].start = irq;
        res[2].end = irq;

+       res[3].name = "mem_base";
+       res[3].flags = IORESOURCE_MEM;
+       res[3].start = mem_base;
+       res[3].end = mem_base + mem_size - 1;
+
+       res[4].name = "io_base";
+       res[4].flags = IORESOURCE_IO;
+       res[4].start = io_base;
+       res[4].end = io_base;

   One I/O port, hm? What is it good for?

WBR, Sergei


<Prev in Thread] Current Thread [Next in Thread>