summaryrefslogtreecommitdiffstats
path: root/target/linux/adm5120/files/arch/mips/adm5120
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/adm5120/files/arch/mips/adm5120')
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/board.c7
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/boards/cellvision.c13
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/boards/compex.c28
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/boards/edimax.c4
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/boards/generic.c4
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/boards/infineon.c4
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c21
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/boards/zyxel.c13
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/platform.c8
9 files changed, 76 insertions, 26 deletions
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/board.c b/target/linux/adm5120/files/arch/mips/adm5120/board.c
index 376a11966..e124d7b5f 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/board.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/board.c
@@ -96,9 +96,8 @@ static int __init adm5120_board_setup(void)
amba_device_register(&adm5120_uart0_device, &iomem_resource);
amba_device_register(&adm5120_uart1_device, &iomem_resource);
- /* register PCI controller */
- if (adm5120_package_bga())
- platform_device_register(&adm5120_pci_device);
+ /* setup PCI irq map */
+ adm5120_pci_set_irq_map(board->pci_nr_irqs, board->pci_irq_map);
/* register board devices */
if (board->num_devices > 0 && board->devices != NULL ) {
@@ -109,6 +108,7 @@ static int __init adm5120_board_setup(void)
return 0;
}
+postcore_initcall(adm5120_board_setup);
void __init adm5120_board_register(struct adm5120_board *board)
{
@@ -125,4 +125,3 @@ void __init adm5120_register_boards(struct adm5120_board **boards,
adm5120_board_register(boards[i]);
}
-arch_initcall(adm5120_board_setup);
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/boards/cellvision.c b/target/linux/adm5120/files/arch/mips/adm5120/boards/cellvision.c
index f7d44e257..d4baee05e 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/boards/cellvision.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/boards/cellvision.c
@@ -29,8 +29,9 @@
#include <asm/bootinfo.h>
#include <asm/gpio.h>
-#include <asm/mach-adm5120/adm5120_board.h>
-#include <asm/mach-adm5120/adm5120_platform.h>
+#include <adm5120_board.h>
+#include <adm5120_platform.h>
+#include <adm5120_irq.h>
static void switch_bank_gpio5(unsigned bank)
{
@@ -44,6 +45,12 @@ static void switch_bank_gpio5(unsigned bank)
}
}
+static struct adm5120_pci_irq cas771_pci_irqs[] __initdata = {
+ PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
+ PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI1),
+ PCIIRQ(3, 2, 3, ADM5120_IRQ_PCI2)
+};
+
static struct mtd_partition cas6xx_partitions[] = {
{
.name = "admboot",
@@ -158,6 +165,8 @@ static struct adm5120_board cas771_board __initdata = {
.eth_num_ports = 1,
.num_devices = ARRAY_SIZE(cas7xx_devices),
.devices = cas7xx_devices,
+ .pci_nr_irqs = ARRAY_SIZE(cas771_pci_irqs),
+ .pci_irq_map = cas771_pci_irqs,
};
static struct adm5120_board cas790_board __initdata = {
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/boards/compex.c b/target/linux/adm5120/files/arch/mips/adm5120/boards/compex.c
index 893baf463..bcc4ee71d 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/boards/compex.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/boards/compex.c
@@ -29,8 +29,9 @@
#include <asm/bootinfo.h>
#include <asm/gpio.h>
-#include <asm/mach-adm5120/adm5120_board.h>
-#include <asm/mach-adm5120/adm5120_platform.h>
+#include <adm5120_board.h>
+#include <adm5120_platform.h>
+#include <adm5120_irq.h>
static void switch_bank_gpio5(unsigned bank)
{
@@ -49,6 +50,17 @@ static void wp54_reset(void)
gpio_set_value(ADM5120_GPIO_PIN3, 0);
}
+static struct adm5120_pci_irq wp54_pci_irqs[] __initdata = {
+ PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
+};
+
+static struct adm5120_pci_irq np28g_pci_irqs[] __initdata = {
+ PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
+ PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI0),
+ PCIIRQ(3, 1, 2, ADM5120_IRQ_PCI1),
+ PCIIRQ(3, 2, 3, ADM5120_IRQ_PCI2)
+};
+
static struct mtd_partition wp54g_wrt_partitions[] = {
{
.name = "cfe",
@@ -148,6 +160,8 @@ static struct adm5120_board np28g_board __initdata = {
.eth_vlans = np28g_vlans,
.num_devices = ARRAY_SIZE(np2xg_devices),
.devices = np2xg_devices,
+ .pci_nr_irqs = ARRAY_SIZE(np28g_pci_irqs),
+ .pci_irq_map = np28g_pci_irqs,
};
static struct adm5120_board wp54ag_board __initdata = {
@@ -159,6 +173,8 @@ static struct adm5120_board wp54ag_board __initdata = {
.eth_vlans = wp54_vlans,
.num_devices = ARRAY_SIZE(wp54_devices),
.devices = wp54_devices,
+ .pci_nr_irqs = ARRAY_SIZE(wp54_pci_irqs),
+ .pci_irq_map = wp54_pci_irqs,
};
static struct adm5120_board wp54g_board __initdata = {
@@ -170,6 +186,8 @@ static struct adm5120_board wp54g_board __initdata = {
.eth_vlans = wp54_vlans,
.num_devices = ARRAY_SIZE(wp54_devices),
.devices = wp54_devices,
+ .pci_nr_irqs = ARRAY_SIZE(wp54_pci_irqs),
+ .pci_irq_map = wp54_pci_irqs,
};
static struct adm5120_board wp54g_wrt_board __initdata = {
@@ -181,6 +199,8 @@ static struct adm5120_board wp54g_wrt_board __initdata = {
.eth_vlans = wp54_vlans,
.num_devices = ARRAY_SIZE(wp54_devices),
.devices = wp54_devices,
+ .pci_nr_irqs = ARRAY_SIZE(wp54_pci_irqs),
+ .pci_irq_map = wp54_pci_irqs,
};
static struct adm5120_board wpp54ag_board __initdata = {
@@ -192,6 +212,8 @@ static struct adm5120_board wpp54ag_board __initdata = {
.eth_vlans = wp54_vlans,
.num_devices = ARRAY_SIZE(wp54_devices),
.devices = wp54_devices,
+ .pci_nr_irqs = ARRAY_SIZE(wp54_pci_irqs),
+ .pci_irq_map = wp54_pci_irqs,
};
static struct adm5120_board wpp54g_board __initdata = {
@@ -203,6 +225,8 @@ static struct adm5120_board wpp54g_board __initdata = {
.eth_vlans = wp54_vlans,
.num_devices = ARRAY_SIZE(wp54_devices),
.devices = wp54_devices,
+ .pci_nr_irqs = ARRAY_SIZE(wp54_pci_irqs),
+ .pci_irq_map = wp54_pci_irqs,
};
static int __init register_boards(void)
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/boards/edimax.c b/target/linux/adm5120/files/arch/mips/adm5120/boards/edimax.c
index d4b1b7442..6b7e7e696 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/boards/edimax.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/boards/edimax.c
@@ -29,8 +29,8 @@
#include <asm/bootinfo.h>
#include <asm/gpio.h>
-#include <asm/mach-adm5120/adm5120_board.h>
-#include <asm/mach-adm5120/adm5120_platform.h>
+#include <adm5120_board.h>
+#include <adm5120_platform.h>
static struct mtd_partition br6104k_partitions[] = {
{
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/boards/generic.c b/target/linux/adm5120/files/arch/mips/adm5120/boards/generic.c
index 044490e50..735dda34a 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/boards/generic.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/boards/generic.c
@@ -29,8 +29,8 @@
#include <asm/bootinfo.h>
#include <asm/gpio.h>
-#include <asm/mach-adm5120/adm5120_board.h>
-#include <asm/mach-adm5120/adm5120_platform.h>
+#include <adm5120_board.h>
+#include <adm5120_platform.h>
static struct platform_device *generic_devices[] __initdata = {
&adm5120_flash0_device,
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/boards/infineon.c b/target/linux/adm5120/files/arch/mips/adm5120/boards/infineon.c
index f0c682bcb..c927f0030 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/boards/infineon.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/boards/infineon.c
@@ -29,8 +29,8 @@
#include <asm/bootinfo.h>
#include <asm/gpio.h>
-#include <asm/mach-adm5120/adm5120_board.h>
-#include <asm/mach-adm5120/adm5120_platform.h>
+#include <adm5120_board.h>
+#include <adm5120_platform.h>
static void switch_bank_gpio3(unsigned bank)
{
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c b/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c
index 570ffb0ce..88cccd5be 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c
@@ -29,8 +29,15 @@
#include <asm/bootinfo.h>
#include <asm/gpio.h>
-#include <asm/mach-adm5120/adm5120_board.h>
-#include <asm/mach-adm5120/adm5120_platform.h>
+#include <adm5120_board.h>
+#include <adm5120_platform.h>
+#include <adm5120_irq.h>
+
+static struct adm5120_pci_irq rb1xx_pci_irqs[] __initdata = {
+ PCIIRQ(1, 0, 1, ADM5120_IRQ_PCI0),
+ PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI1),
+ PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI2)
+};
static struct mtd_partition rb1xx_partitions[] = {
{
@@ -111,6 +118,8 @@ static struct adm5120_board rb111_board __initdata = {
.eth_vlans = rb11x_vlans,
.num_devices = ARRAY_SIZE(rb1xx_devices),
.devices = rb1xx_devices,
+ .pci_nr_irqs = ARRAY_SIZE(rb1xx_pci_irqs),
+ .pci_irq_map = rb1xx_pci_irqs,
};
static struct adm5120_board rb112_board __initdata = {
@@ -121,6 +130,8 @@ static struct adm5120_board rb112_board __initdata = {
.eth_vlans = rb11x_vlans,
.num_devices = ARRAY_SIZE(rb1xx_devices),
.devices = rb1xx_devices,
+ .pci_nr_irqs = ARRAY_SIZE(rb1xx_pci_irqs),
+ .pci_irq_map = rb1xx_pci_irqs,
};
static struct adm5120_board rb133_board __initdata = {
@@ -141,6 +152,8 @@ static struct adm5120_board rb133c_board __initdata = {
.eth_vlans = rb133c_vlans,
.num_devices = ARRAY_SIZE(rb1xx_devices),
.devices = rb1xx_devices,
+ .pci_nr_irqs = ARRAY_SIZE(rb1xx_pci_irqs),
+ .pci_irq_map = rb1xx_pci_irqs,
};
static struct adm5120_board rb150_board __initdata = {
@@ -161,6 +174,8 @@ static struct adm5120_board rb153_board __initdata = {
.eth_vlans = rb15x_vlans,
.num_devices = ARRAY_SIZE(rb1xx_devices),
.devices = rb1xx_devices,
+ .pci_nr_irqs = ARRAY_SIZE(rb1xx_pci_irqs),
+ .pci_irq_map = rb1xx_pci_irqs,
};
static struct adm5120_board rb192_board __initdata = {
@@ -171,6 +186,8 @@ static struct adm5120_board rb192_board __initdata = {
.eth_vlans = rb192_vlans,
.num_devices = ARRAY_SIZE(rb1xx_devices),
.devices = rb1xx_devices,
+ .pci_nr_irqs = ARRAY_SIZE(rb1xx_pci_irqs),
+ .pci_irq_map = rb1xx_pci_irqs,
};
static int __init register_boards(void)
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/boards/zyxel.c b/target/linux/adm5120/files/arch/mips/adm5120/boards/zyxel.c
index f6c3183df..0e766a856 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/boards/zyxel.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/boards/zyxel.c
@@ -29,8 +29,9 @@
#include <asm/bootinfo.h>
#include <asm/gpio.h>
-#include <asm/mach-adm5120/adm5120_board.h>
-#include <asm/mach-adm5120/adm5120_platform.h>
+#include <adm5120_board.h>
+#include <adm5120_platform.h>
+#include <adm5120_irq.h>
static void switch_bank_gpio5(unsigned bank)
{
@@ -44,6 +45,10 @@ static void switch_bank_gpio5(unsigned bank)
}
}
+static struct adm5120_pci_irq p33x_pci_irqs[] __initdata = {
+ PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI0),
+};
+
static struct mtd_partition p33x_partitions[] = {
{
.name = "bootbase",
@@ -105,6 +110,8 @@ static struct adm5120_board p334wt_board __initdata = {
.eth_vlans = p33x_vlans,
.num_devices = ARRAY_SIZE(p334_devices),
.devices = p334_devices,
+ .pci_nr_irqs = ARRAY_SIZE(p33x_pci_irqs),
+ .pci_irq_map = p33x_pci_irqs,
};
static struct adm5120_board p335_board __initdata = {
@@ -115,6 +122,8 @@ static struct adm5120_board p335_board __initdata = {
.eth_vlans = p33x_vlans,
.num_devices = ARRAY_SIZE(p335_devices),
.devices = p335_devices,
+ .pci_nr_irqs = ARRAY_SIZE(p33x_pci_irqs),
+ .pci_irq_map = p33x_pci_irqs,
};
static int __init register_boards(void)
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/platform.c b/target/linux/adm5120/files/arch/mips/adm5120/platform.c
index e4353a00a..2a795c950 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/platform.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/platform.c
@@ -74,14 +74,6 @@ struct platform_device adm5120_switch_device = {
};
#endif
-/* PCI Host Controller */
-struct adm5120_pci_platform_data adm5120_pci_data;
-struct platform_device adm5120_pci_device = {
- .name = "adm5120-pci",
- .id = -1,
- .dev.platform_data = &adm5120_pci_data,
-};
-
/* USB Host Controller */
struct resource adm5120_hcd_resources[] = {
[0] = {