Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 35877master
parent
12d49b5195
commit
64a9fe2894
@ -1,12 +1,20 @@ |
||||
From f2d2d928c3900b67a5f95e53b86de5b61a3ab12c Mon Sep 17 00:00:00 2001
|
||||
From 42541838d9fdbad8573141d69cf8e38831a6cbb6 Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Mon, 11 Jun 2012 13:19:44 +0200
|
||||
Subject: [PATCH 04/34] MIPS: pci-ar724x: convert to a platform driver
|
||||
Date: Sat, 2 Feb 2013 11:40:42 +0000
|
||||
Subject: [PATCH] MIPS: pci-ar724x: convert into a platform driver
|
||||
|
||||
commit 58d2e9bcd682d76bcb9575dc56c85f1d82a81bfa upstream.
|
||||
|
||||
The patch converts the pci-ar724x driver into a
|
||||
platform driver. This makes it possible to register
|
||||
the PCI controller as a plain platform device.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
Patchwork: http://patchwork.linux-mips.org/patch/4905/
|
||||
Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
---
|
||||
arch/mips/pci/pci-ar724x.c | 57 ++++++++++++++++++++++++++++++++++++++++++-
|
||||
1 files changed, 55 insertions(+), 2 deletions(-)
|
||||
arch/mips/pci/pci-ar724x.c | 57 ++++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 55 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/arch/mips/pci/pci-ar724x.c
|
||||
+++ b/arch/mips/pci/pci-ar724x.c
|
@ -1,12 +1,20 @@ |
||||
From d1a22e73f991145a4abd7d0c37bcf318703c89ed Mon Sep 17 00:00:00 2001
|
||||
From 060c9a226a25e044167e877d9830ec53f836da9e Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Mon, 11 Jun 2012 13:24:55 +0200
|
||||
Subject: [PATCH 05/34] MIPS: pci-ar71xx: convert to a platform driver
|
||||
Date: Sat, 2 Feb 2013 11:40:43 +0000
|
||||
Subject: [PATCH] MIPS: pci-ar71xx: convert into a platform driver
|
||||
|
||||
commit fb167e891d5cc6386840dd092af2d461b38eb802 upstream.
|
||||
|
||||
The patch converts the pci-ar71xx driver into a
|
||||
platform driver. This makes it possible to register
|
||||
the PCI controller as a plain platform device.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
Patchwork: http://patchwork.linux-mips.org/patch/4906/
|
||||
Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
---
|
||||
arch/mips/pci/pci-ar71xx.c | 60 +++++++++++++++++++++++++++++++++++++++++---
|
||||
1 files changed, 56 insertions(+), 4 deletions(-)
|
||||
1 file changed, 56 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/arch/mips/pci/pci-ar71xx.c
|
||||
+++ b/arch/mips/pci/pci-ar71xx.c
|
@ -1,11 +1,15 @@ |
||||
From c3a8b5fa196cedc4b940c1e5ec482dd875aa3180 Mon Sep 17 00:00:00 2001
|
||||
From 1dece618b107f5db28c8f63d4d32424dd18324d1 Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Mon, 11 Jun 2012 13:38:06 +0200
|
||||
Subject: [PATCH 06/34] MIPS: ath79: move global PCI defines into a common header
|
||||
Date: Mon, 4 Feb 2013 11:56:53 +0100
|
||||
Subject: [PATCH] MIPS: ath79: move global PCI defines into a common header
|
||||
|
||||
commit ad4ce92e919f7ad5561a2060deb58899de58b40c upstream.
|
||||
|
||||
The constants will be used by a subsequent patch.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
Patchwork: http://patchwork.linux-mips.org/patch/4907/
|
||||
Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
---
|
||||
arch/mips/include/asm/mach-ath79/ar71xx_regs.h | 24 ++++++++++++++++++++++++
|
||||
arch/mips/pci/pci-ar71xx.c | 16 ----------------
|
@ -1,12 +1,22 @@ |
||||
From 2fdf8dcff3ffaa806e9f9d7f1c1bd876222cff4d Mon Sep 17 00:00:00 2001
|
||||
From 87cdbe4315e4c72c2bc8568d1258e1207e1c772b Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Mon, 11 Jun 2012 13:39:32 +0200
|
||||
Subject: [PATCH 07/34] MIPS: ath79: register platform devices for the PCI controllers
|
||||
Date: Sat, 2 Feb 2013 11:44:24 +0000
|
||||
Subject: [PATCH] MIPS: ath79: register platform devices for the PCI
|
||||
controllers
|
||||
|
||||
commit 9fc1ca5b73a82daedffa2d1d5daa48dd2093c39a upstream.
|
||||
|
||||
The pci-ar71xx and pci-ar724x drivers were converted
|
||||
into platform drivers. Register the corresponding
|
||||
platform devices for the PCI controllers instead
|
||||
of using the ar7{1x,24}x_pcibios_init functions.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
Patchwork: http://patchwork.linux-mips.org/patch/4908/
|
||||
Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
---
|
||||
arch/mips/ath79/pci.c | 87 +++++++++++++++++++++++++++++++++++++++++++-----
|
||||
1 files changed, 78 insertions(+), 9 deletions(-)
|
||||
arch/mips/ath79/pci.c | 87 ++++++++++++++++++++++++++++++++++++++++++++-----
|
||||
1 file changed, 78 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/arch/mips/ath79/pci.c
|
||||
+++ b/arch/mips/ath79/pci.c
|
@ -1,17 +1,22 @@ |
||||
From 07224e2fa5f889162ee0560c6ab1eb8cd16a8dd2 Mon Sep 17 00:00:00 2001
|
||||
From db36c9d6a6be232bdee245407fc8ccde53ea69c6 Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Mon, 11 Jun 2012 14:59:39 +0200
|
||||
Subject: [PATCH 08/34] MIPS: ath79: remove unused ar7{1x,24}x_pcibios_init functions
|
||||
Date: Mon, 4 Feb 2013 11:58:49 +0100
|
||||
Subject: [PATCH] MIPS: ath79: remove unused ar7{1x,24}x_pcibios_init
|
||||
functions
|
||||
|
||||
commit 6e783865b4e60f2ecf7708f8ea24db5c5ea07ced upstream.
|
||||
|
||||
The functions are unused now, so remove them.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
Patchwork: http://patchwork.linux-mips.org/patch/4909/
|
||||
Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
---
|
||||
arch/mips/ath79/pci.c | 1 -
|
||||
arch/mips/include/asm/mach-ath79/pci.h | 28 ----------------------------
|
||||
arch/mips/pci/pci-ar71xx.c | 26 --------------------------
|
||||
arch/mips/pci/pci-ar724x.c | 32 --------------------------------
|
||||
4 files changed, 0 insertions(+), 87 deletions(-)
|
||||
4 files changed, 87 deletions(-)
|
||||
delete mode 100644 arch/mips/include/asm/mach-ath79/pci.h
|
||||
|
||||
--- a/arch/mips/ath79/pci.c
|
@ -1,12 +1,29 @@ |
||||
From a018b28d3953a32008de839d997a992a724ae314 Mon Sep 17 00:00:00 2001
|
||||
From 4da85831c8eaf2de2cadae6723e8231068c313b7 Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Sun, 24 Jun 2012 17:40:45 +0200
|
||||
Subject: [PATCH 09/34] MIPS: avoid possible resource conflict in register_pci_controller
|
||||
Date: Sat, 2 Feb 2013 13:18:54 +0000
|
||||
Subject: [PATCH] MIPS: avoid possible resource conflict in
|
||||
register_pci_controller
|
||||
|
||||
commit 222831787704c9ad9215f6b56f975b233968607c upstream.
|
||||
|
||||
The IO and memory resources of a PCI controller
|
||||
might already have a parent resource set when
|
||||
they are passed to 'register_pci_controller'.
|
||||
|
||||
If the parent resource is set, the request_resource
|
||||
call will fail due to resource conflict and the
|
||||
current code will not be able to register the
|
||||
PCI controller.
|
||||
|
||||
Use the parent resource if it is available in the
|
||||
request_resource call to avoid the isssue.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
Patchwork: http://patchwork.linux-mips.org/patch/4910/
|
||||
Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
---
|
||||
arch/mips/pci/pci.c | 15 +++++++++++++--
|
||||
1 files changed, 13 insertions(+), 2 deletions(-)
|
||||
1 file changed, 13 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/arch/mips/pci/pci.c
|
||||
+++ b/arch/mips/pci/pci.c
|
@ -1,13 +1,19 @@ |
||||
From 12c68e4fccadc22a0470177141a57892a76e4a2b Mon Sep 17 00:00:00 2001
|
||||
From 53ba4919664636487155c810fb49781169780e0c Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Sun, 24 Jun 2012 15:33:16 +0200
|
||||
Subject: [PATCH 25/34] MIPS: ath79: allow to specify bus number in PCI IRQ maps
|
||||
Date: Sun, 3 Feb 2013 09:58:37 +0000
|
||||
Subject: [PATCH] MIPS: ath79: allow to specify bus number in PCI IRQ maps
|
||||
|
||||
commit 617fed41e98417f3ea3e9974be251e125c8796f2 upstream.
|
||||
|
||||
This is needed for multiple PCI bus support.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
Patchwork: http://patchwork.linux-mips.org/patch/4913/
|
||||
Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
---
|
||||
arch/mips/ath79/pci.c | 4 +++-
|
||||
arch/mips/ath79/pci.h | 1 +
|
||||
2 files changed, 4 insertions(+), 1 deletions(-)
|
||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/mips/ath79/pci.c
|
||||
+++ b/arch/mips/ath79/pci.c
|
@ -1,12 +1,26 @@ |
||||
From 242aedf3246dc5085271aca56134ac455bfb64b5 Mon Sep 17 00:00:00 2001
|
||||
From 21b3cafae425cf2e317a22292a9a5773ff0e2e5e Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Sun, 24 Jun 2012 11:51:34 +0200
|
||||
Subject: [PATCH 10/34] MIPS: pci-ar724x: use dynamically allocated PCI controller structure
|
||||
Date: Sun, 3 Feb 2013 09:58:38 +0000
|
||||
Subject: [PATCH] MIPS: pci-ar724x: use dynamically allocated PCI controller
|
||||
structure
|
||||
|
||||
commit 908339ef25b1d5e80f1c6fab22b9958174708b4a upstream.
|
||||
|
||||
The current code uses static variables to store the
|
||||
PCI controller specific data. This works if the system
|
||||
contains one PCI controller only, however it becomes
|
||||
impractical when multiple PCI controllers are present.
|
||||
|
||||
Move the variables into a dynamically allocated controller
|
||||
specific structure, and use that instead of the static
|
||||
variables.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
Patchwork: http://patchwork.linux-mips.org/patch/4912/
|
||||
Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
---
|
||||
arch/mips/pci/pci-ar724x.c | 129 ++++++++++++++++++++++++++++----------------
|
||||
1 files changed, 82 insertions(+), 47 deletions(-)
|
||||
1 file changed, 82 insertions(+), 47 deletions(-)
|
||||
|
||||
--- a/arch/mips/pci/pci-ar724x.c
|
||||
+++ b/arch/mips/pci/pci-ar724x.c
|
@ -0,0 +1,113 @@ |
||||
From f073cb029873ed487e14784d3682b6aa25afe997 Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Thu, 7 Feb 2013 19:28:15 +0000
|
||||
Subject: [PATCH] MIPS: pci-ar71xx: remove static PCI IO/MEM resources
|
||||
|
||||
commit 42cb60d1fab4c81ef24876d985e08fc5bb899e41 upstream.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
Patchwork: http://patchwork.linux-mips.org/patch/4927/
|
||||
Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
---
|
||||
arch/mips/ath79/pci.c | 12 +++++++++++-
|
||||
arch/mips/pci/pci-ar71xx.c | 40 ++++++++++++++++++++++++----------------
|
||||
2 files changed, 35 insertions(+), 17 deletions(-)
|
||||
|
||||
--- a/arch/mips/ath79/pci.c
|
||||
+++ b/arch/mips/ath79/pci.c
|
||||
@@ -117,7 +117,7 @@ static struct platform_device *
|
||||
ath79_register_pci_ar71xx(void)
|
||||
{
|
||||
struct platform_device *pdev;
|
||||
- struct resource res[2];
|
||||
+ struct resource res[4];
|
||||
|
||||
memset(res, 0, sizeof(res));
|
||||
|
||||
@@ -130,6 +130,16 @@ ath79_register_pci_ar71xx(void)
|
||||
res[1].start = ATH79_CPU_IRQ_IP2;
|
||||
res[1].end = ATH79_CPU_IRQ_IP2;
|
||||
|
||||
+ res[2].name = "io_base";
|
||||
+ res[2].flags = IORESOURCE_IO;
|
||||
+ res[2].start = 0;
|
||||
+ res[2].end = 0;
|
||||
+
|
||||
+ res[3].name = "mem_base";
|
||||
+ res[3].flags = IORESOURCE_MEM;
|
||||
+ res[3].start = AR71XX_PCI_MEM_BASE;
|
||||
+ res[3].end = AR71XX_PCI_MEM_BASE + AR71XX_PCI_MEM_SIZE - 1;
|
||||
+
|
||||
pdev = platform_device_register_simple("ar71xx-pci", -1,
|
||||
res, ARRAY_SIZE(res));
|
||||
return pdev;
|
||||
--- a/arch/mips/pci/pci-ar71xx.c
|
||||
+++ b/arch/mips/pci/pci-ar71xx.c
|
||||
@@ -53,6 +53,8 @@ struct ar71xx_pci_controller {
|
||||
spinlock_t lock;
|
||||
int irq;
|
||||
struct pci_controller pci_ctrl;
|
||||
+ struct resource io_res;
|
||||
+ struct resource mem_res;
|
||||
};
|
||||
|
||||
/* Byte lane enable bits */
|
||||
@@ -234,20 +236,6 @@ static struct pci_ops ar71xx_pci_ops = {
|
||||
.write = ar71xx_pci_write_config,
|
||||
};
|
||||
|
||||
-static struct resource ar71xx_pci_io_resource = {
|
||||
- .name = "PCI IO space",
|
||||
- .start = 0,
|
||||
- .end = 0,
|
||||
- .flags = IORESOURCE_IO,
|
||||
-};
|
||||
-
|
||||
-static struct resource ar71xx_pci_mem_resource = {
|
||||
- .name = "PCI memory space",
|
||||
- .start = AR71XX_PCI_MEM_BASE,
|
||||
- .end = AR71XX_PCI_MEM_BASE + AR71XX_PCI_MEM_SIZE - 1,
|
||||
- .flags = IORESOURCE_MEM
|
||||
-};
|
||||
-
|
||||
static void ar71xx_pci_irq_handler(unsigned int irq, struct irq_desc *desc)
|
||||
{
|
||||
void __iomem *base = ath79_reset_base;
|
||||
@@ -370,6 +358,26 @@ static int ar71xx_pci_probe(struct platf
|
||||
if (apc->irq < 0)
|
||||
return -EINVAL;
|
||||
|
||||
+ res = platform_get_resource_byname(pdev, IORESOURCE_IO, "io_base");
|
||||
+ if (!res)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ apc->io_res.parent = res;
|
||||
+ apc->io_res.name = "PCI IO space";
|
||||
+ apc->io_res.start = res->start;
|
||||
+ apc->io_res.end = res->end;
|
||||
+ apc->io_res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mem_base");
|
||||
+ if (!res)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ apc->mem_res.parent = res;
|
||||
+ apc->mem_res.name = "PCI memory space";
|
||||
+ apc->mem_res.start = res->start;
|
||||
+ apc->mem_res.end = res->end;
|
||||
+ apc->mem_res.flags = IORESOURCE_MEM;
|
||||
+
|
||||
ar71xx_pci_reset();
|
||||
|
||||
/* setup COMMAND register */
|
||||
@@ -383,8 +391,8 @@ static int ar71xx_pci_probe(struct platf
|
||||
ar71xx_pci_irq_init(apc);
|
||||
|
||||
apc->pci_ctrl.pci_ops = &ar71xx_pci_ops;
|
||||
- apc->pci_ctrl.mem_resource = &ar71xx_pci_mem_resource;
|
||||
- apc->pci_ctrl.io_resource = &ar71xx_pci_io_resource;
|
||||
+ apc->pci_ctrl.mem_resource = &apc->mem_res;
|
||||
+ apc->pci_ctrl.io_resource = &apc->io_res;
|
||||
|
||||
register_pci_controller(&apc->pci_ctrl);
|
||||
|
@ -0,0 +1,105 @@ |
||||
From bec8339e917651e51592dd57ed005f8ccd9b0e8d Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Thu, 7 Feb 2013 19:29:38 +0000
|
||||
Subject: [PATCH] MIPS: pci-ar71xx: move irq base to the controller structure
|
||||
|
||||
commit 326e8d17d73fdf213f6334917ef46b2ba7b1354a upstream.
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
Patchwork: http://patchwork.linux-mips.org/patch/4928/
|
||||
Signed-off-by: John Crispin <blogic@openwrt.org>
|
||||
---
|
||||
arch/mips/pci/pci-ar71xx.c | 32 ++++++++++++++++++++++++--------
|
||||
1 file changed, 24 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/arch/mips/pci/pci-ar71xx.c
|
||||
+++ b/arch/mips/pci/pci-ar71xx.c
|
||||
@@ -52,6 +52,7 @@ struct ar71xx_pci_controller {
|
||||
void __iomem *cfg_base;
|
||||
spinlock_t lock;
|
||||
int irq;
|
||||
+ int irq_base;
|
||||
struct pci_controller pci_ctrl;
|
||||
struct resource io_res;
|
||||
struct resource mem_res;
|
||||
@@ -238,23 +239,26 @@ static struct pci_ops ar71xx_pci_ops = {
|
||||
|
||||
static void ar71xx_pci_irq_handler(unsigned int irq, struct irq_desc *desc)
|
||||
{
|
||||
+ struct ar71xx_pci_controller *apc;
|
||||
void __iomem *base = ath79_reset_base;
|
||||
u32 pending;
|
||||
|
||||
+ apc = irq_get_handler_data(irq);
|
||||
+
|
||||
pending = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_STATUS) &
|
||||
__raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE);
|
||||
|
||||
if (pending & AR71XX_PCI_INT_DEV0)
|
||||
- generic_handle_irq(ATH79_PCI_IRQ(0));
|
||||
+ generic_handle_irq(apc->irq_base + 0);
|
||||
|
||||
else if (pending & AR71XX_PCI_INT_DEV1)
|
||||
- generic_handle_irq(ATH79_PCI_IRQ(1));
|
||||
+ generic_handle_irq(apc->irq_base + 1);
|
||||
|
||||
else if (pending & AR71XX_PCI_INT_DEV2)
|
||||
- generic_handle_irq(ATH79_PCI_IRQ(2));
|
||||
+ generic_handle_irq(apc->irq_base + 2);
|
||||
|
||||
else if (pending & AR71XX_PCI_INT_CORE)
|
||||
- generic_handle_irq(ATH79_PCI_IRQ(4));
|
||||
+ generic_handle_irq(apc->irq_base + 4);
|
||||
|
||||
else
|
||||
spurious_interrupt();
|
||||
@@ -262,10 +266,14 @@ static void ar71xx_pci_irq_handler(unsig
|
||||
|
||||
static void ar71xx_pci_irq_unmask(struct irq_data *d)
|
||||
{
|
||||
- unsigned int irq = d->irq - ATH79_PCI_IRQ_BASE;
|
||||
+ struct ar71xx_pci_controller *apc;
|
||||
+ unsigned int irq;
|
||||
void __iomem *base = ath79_reset_base;
|
||||
u32 t;
|
||||
|
||||
+ apc = irq_data_get_irq_chip_data(d);
|
||||
+ irq = d->irq - apc->irq_base;
|
||||
+
|
||||
t = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE);
|
||||
__raw_writel(t | (1 << irq), base + AR71XX_RESET_REG_PCI_INT_ENABLE);
|
||||
|
||||
@@ -275,10 +283,14 @@ static void ar71xx_pci_irq_unmask(struct
|
||||
|
||||
static void ar71xx_pci_irq_mask(struct irq_data *d)
|
||||
{
|
||||
- unsigned int irq = d->irq - ATH79_PCI_IRQ_BASE;
|
||||
+ struct ar71xx_pci_controller *apc;
|
||||
+ unsigned int irq;
|
||||
void __iomem *base = ath79_reset_base;
|
||||
u32 t;
|
||||
|
||||
+ apc = irq_data_get_irq_chip_data(d);
|
||||
+ irq = d->irq - apc->irq_base;
|
||||
+
|
||||
t = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE);
|
||||
__raw_writel(t & ~(1 << irq), base + AR71XX_RESET_REG_PCI_INT_ENABLE);
|
||||
|
||||
@@ -303,11 +315,15 @@ static void ar71xx_pci_irq_init(struct a
|
||||
|
||||
BUILD_BUG_ON(ATH79_PCI_IRQ_COUNT < AR71XX_PCI_IRQ_COUNT);
|
||||
|
||||
- for (i = ATH79_PCI_IRQ_BASE;
|
||||
- i < ATH79_PCI_IRQ_BASE + AR71XX_PCI_IRQ_COUNT; i++)
|
||||
+ apc->irq_base = ATH79_PCI_IRQ_BASE;
|
||||
+ for (i = apc->irq_base;
|
||||
+ i < apc->irq_base + AR71XX_PCI_IRQ_COUNT; i++) {
|
||||
irq_set_chip_and_handler(i, &ar71xx_pci_irq_chip,
|
||||
handle_level_irq);
|
||||
+ irq_set_chip_data(i, apc);
|
||||
+ }
|
||||
|
||||
+ irq_set_handler_data(apc->irq, apc);
|
||||
irq_set_chained_handler(apc->irq, ar71xx_pci_irq_handler);
|
||||
}
|
||||
|
@ -1,70 +0,0 @@ |
||||
From 7dc3ccb5dc972b06c41b309653d132beaaedeb37 Mon Sep 17 00:00:00 2001
|
||||
From: Gabor Juhos <juhosg@openwrt.org>
|
||||
Date: Mon, 25 Jun 2012 09:52:23 +0200
|
||||
Subject: [PATCH 15/34] MIPS: pci-ar71xx: remove static PCI controller resources
|
||||
|
||||
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
||||
---
|
||||
arch/mips/pci/pci-ar71xx.c | 30 ++++++++++++++----------------
|
||||
1 files changed, 14 insertions(+), 16 deletions(-)
|
||||
|
||||
--- a/arch/mips/pci/pci-ar71xx.c
|
||||
+++ b/arch/mips/pci/pci-ar71xx.c
|
||||
@@ -54,6 +54,8 @@ struct ar71xx_pci_controller {
|
||||
spinlock_t lock;
|
||||
int irq;
|
||||
struct pci_controller pci_ctrl;
|
||||
+ struct resource io_res;
|
||||
+ struct resource mem_res;
|
||||
};
|
||||
|
||||
/* Byte lane enable bits */
|
||||
@@ -235,20 +237,6 @@ static struct pci_ops ar71xx_pci_ops = {
|
||||
.write = ar71xx_pci_write_config,
|
||||
};
|
||||
|
||||
-static struct resource ar71xx_pci_io_resource = {
|
||||
- .name = "PCI IO space",
|
||||
- .start = 0,
|
||||
- .end = 0,
|
||||
- .flags = IORESOURCE_IO,
|
||||
-};
|
||||
-
|
||||
-static struct resource ar71xx_pci_mem_resource = {
|
||||
- .name = "PCI memory space",
|
||||
- .start = AR71XX_PCI_MEM_BASE,
|
||||
- .end = AR71XX_PCI_MEM_BASE + AR71XX_PCI_MEM_SIZE - 1,
|
||||
- .flags = IORESOURCE_MEM
|
||||
-};
|
||||
-
|
||||
static void ar71xx_pci_irq_handler(unsigned int irq, struct irq_desc *desc)
|
||||
{
|
||||
void __iomem *base = ath79_reset_base;
|
||||
@@ -370,6 +358,16 @@ static int ar71xx_pci_probe(struct platf
|
||||
if (apc->irq < 0)
|
||||
return -EINVAL;
|
||||
|
||||
+ apc->io_res.name = "PCI IO space";
|
||||
+ apc->io_res.start = 0;
|
||||
+ apc->io_res.end = 0;
|
||||
+ apc->io_res.flags = IORESOURCE_IO;
|
||||
+
|
||||
+ apc->mem_res.name = "PCI memory space";
|
||||
+ apc->mem_res.start = AR71XX_PCI_MEM_BASE;
|
||||
+ apc->mem_res.end = AR71XX_PCI_MEM_BASE + AR71XX_PCI_MEM_SIZE - 1;
|
||||
+ apc->mem_res.flags = IORESOURCE_MEM;
|
||||
+
|
||||
ar71xx_pci_reset();
|
||||
|
||||
/* setup COMMAND register */
|
||||
@@ -383,8 +381,8 @@ static int ar71xx_pci_probe(struct platf
|
||||
ar71xx_pci_irq_init(apc);
|
||||
|
||||
apc->pci_ctrl.pci_ops = &ar71xx_pci_ops;
|
||||
- apc->pci_ctrl.mem_resource = &ar71xx_pci_mem_resource;
|
||||
- apc->pci_ctrl.io_resource = &ar71xx_pci_io_resource;
|
||||
+ apc->pci_ctrl.mem_resource = &apc->mem_res;
|
||||
+ apc->pci_ctrl.io_resource = &apc->io_res;
|
||||
|
||||
register_pci_controller(&apc->pci_ctrl);
|
||||
|
Loading…
Reference in new issue