summaryrefslogtreecommitdiff
path: root/target/linux/adm5120/files/arch
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-10-17 08:10:47 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-10-17 08:10:47 +0000
commit06b8f376442456d4fe011c3090868864c041aed9 (patch)
tree115b75e3ebf8066b1cedbcb21fa9d108b7727bdf /target/linux/adm5120/files/arch
parentce0af016cccf24485c06fe48af09ab4fb0944992 (diff)
[adm5120] switch driver cleanup, 4th phase
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9340 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/adm5120/files/arch')
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/board.c3
-rw-r--r--target/linux/adm5120/files/arch/mips/adm5120/platform.c18
2 files changed, 19 insertions, 2 deletions
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/board.c b/target/linux/adm5120/files/arch/mips/adm5120/board.c
index 1d0cc66189..5f809a16e6 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/board.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/board.c
@@ -98,6 +98,9 @@ static int __init adm5120_board_setup(void)
amba_device_register(&adm5120_uart0_device, &iomem_resource);
amba_device_register(&adm5120_uart1_device, &iomem_resource);
+ /* register built-in ethernet switch */
+ platform_device_register(&adm5120_switch_device);
+
/* setup PCI irq map */
adm5120_pci_set_irq_map(board->pci_nr_irqs, board->pci_irq_map);
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/platform.c b/target/linux/adm5120/files/arch/mips/adm5120/platform.c
index 175e1a5d89..6250ab603c 100644
--- a/target/linux/adm5120/files/arch/mips/adm5120/platform.c
+++ b/target/linux/adm5120/files/arch/mips/adm5120/platform.c
@@ -61,16 +61,30 @@ unsigned char adm5120_eth_vlans[6] = {
0x41, 0x42, 0x44, 0x48, 0x50, 0x60
};
EXPORT_SYMBOL_GPL(adm5120_eth_vlans);
+#endif
-#else
/* Built-in ethernet switch */
+struct resource adm5120_switch_resources[] = {
+ [0] = {
+ .start = ADM5120_SWITCH_BASE,
+ .end = ADM5120_SWITCH_BASE+ADM5120_SWITCH_SIZE-1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = ADM5120_IRQ_SWITCH,
+ .end = ADM5120_IRQ_SWITCH,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
struct adm5120_switch_platform_data adm5120_switch_data;
struct platform_device adm5120_switch_device = {
.name = "adm5120-switch",
.id = -1,
+ .num_resources = ARRAY_SIZE(adm5120_switch_resources),
+ .resource = adm5120_switch_resources,
.dev.platform_data = &adm5120_switch_data,
};
-#endif
/* USB Host Controller */
struct resource adm5120_hcd_resources[] = {