ar71xx: merge ap91_eth removal from r23439
authorFelix Fietkau <nbd@openwrt.org>
Thu, 14 Oct 2010 13:49:09 +0000 (13:49 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 14 Oct 2010 13:49:09 +0000 (13:49 +0000)
SVN-Revision: 23440

target/linux/ar71xx/base-files/etc/defconfig/rb-750/network
target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig
target/linux/ar71xx/files/arch/mips/ar71xx/Makefile
target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.c [deleted file]
target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.h [deleted file]
target/linux/ar71xx/files/arch/mips/ar71xx/mach-dir-600-a1.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb750.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr741nd.c

index 113d9f3eeaa855dfb13dcd0cba2cd0adc3f4c249..de201bf5ec4567f6fb3c0e82d68ef92f448a1ed8 100644 (file)
@@ -4,12 +4,8 @@ config interface loopback
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0
 
-config interface eth
-       option ifname   eth0
-       option proto    none
-
 config interface lan
-       option ifname   'port2 port3 port4 port5'
+       option ifname   eth0
        option type     bridge
        option proto    static
        option ipaddr   192.168.1.1
@@ -18,3 +14,11 @@ config interface lan
 config interface wan
        option ifname   eth1
        option proto    dhcp
+
+config switch eth0
+       option enable_vlan      1
+
+config switch_vlan
+       option device   eth0
+       option vlan     1
+       option ports    "0 1 2 3 4"
index c471e3f64091e41fc61082ce2a48eecef0b998d1..0b290f8049c61774ae42347915cb40f94b291469 100644 (file)
@@ -21,7 +21,6 @@ config AR71XX_MACH_AP83
 
 config AR71XX_MACH_DIR_600_A1
        bool "D-Link DIR-600 rev. A1 support"
-       select AR71XX_DEV_AP91_ETH
        select AR71XX_DEV_AP91_PCI if PCI
        select AR71XX_DEV_M25P80
        select AR71XX_DEV_GPIO_BUTTONS
@@ -123,7 +122,6 @@ config AR71XX_MACH_RB4XX
 
 config AR71XX_MACH_RB750
        bool "MikroTik RouterBOARD 750 support"
-       select AR71XX_DEV_AP91_ETH
        default n
 
 config AR71XX_MACH_WNDR3700
@@ -222,10 +220,6 @@ config AR71XX_DEV_M25P80
 config AR71XX_DEV_AP91_PCI
        def_bool n
 
-config AR71XX_DEV_AP91_ETH
-       select AR71XX_DEV_DSA
-       def_bool n
-
 config AR71XX_DEV_AP94_PCI
        def_bool n
 
index e24df571f1314523a0519b54148066d164952f47..690dd97691fe4acce77d82f3d7aa34305d63149e 100644 (file)
@@ -13,7 +13,6 @@ obj-y := prom.o irq.o setup.o devices.o gpio.o ar71xx.o
 obj-$(CONFIG_EARLY_PRINTK)             += early_printk.o
 obj-$(CONFIG_PCI)                      += pci.o
 
-obj-$(CONFIG_AR71XX_DEV_AP91_ETH)      += dev-ap91-eth.o
 obj-$(CONFIG_AR71XX_DEV_AP91_PCI)      += dev-ap91-pci.o
 obj-$(CONFIG_AR71XX_DEV_AP94_PCI)      += dev-ap94-pci.o
 obj-$(CONFIG_AR71XX_DEV_AR913X_WMAC)   += dev-ar913x-wmac.o
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.c b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.c
deleted file mode 100644 (file)
index c48af45..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *  Atheros AP91 reference board ethernet initialization
- *
- *  Copyright (C) 2010 Gabor Juhos <juhosg@openwrt.org>
- *
- *  This program is free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License version 2 as published
- *  by the Free Software Foundation.
- */
-
-#include "devices.h"
-#include "dev-dsa.h"
-#include "dev-ap91-eth.h"
-
-static struct dsa_chip_data ap91_dsa_chip = {
-       .port_names[0]  = "cpu",
-       .port_names[1]  = "lan1",
-       .port_names[2]  = "lan2",
-       .port_names[3]  = "lan3",
-       .port_names[4]  = "lan4",
-};
-
-static struct dsa_platform_data ap91_dsa_data = {
-       .nr_chips       = 1,
-       .chip           = &ap91_dsa_chip,
-};
-
-static void ap91_eth_set_port_name(unsigned port, const char *name)
-{
-       if (port < 1 || port > 5)
-               return;
-
-       if (name)
-               ap91_dsa_chip.port_names[port] = (char *) name;
-}
-
-void __init ap91_eth_init(u8 *mac_addr, const char *port_names[])
-{
-       if (mac_addr)
-               ar71xx_set_mac_base(mac_addr);
-
-       if (port_names) {
-               int i;
-
-               for (i = 0; i < AP91_ETH_NUM_PORT_NAMES; i++)
-                       ap91_eth_set_port_name(i + 1, port_names[i]);
-       }
-
-       /* WAN port */
-       ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
-       ar71xx_eth0_data.speed = SPEED_100;
-       ar71xx_eth0_data.duplex = DUPLEX_FULL;
-       ar71xx_eth0_data.fifo_cfg1 = 0x0fff0000;
-       ar71xx_eth0_data.fifo_cfg2 = 0x00001fff;
-       ar71xx_eth0_data.fifo_cfg3 = 0x008001ff;
-
-       /* LAN ports */
-       ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
-       ar71xx_eth1_data.speed = SPEED_1000;
-       ar71xx_eth1_data.duplex = DUPLEX_FULL;
-       ar71xx_eth1_data.fifo_cfg1 = 0x0fff0000;
-       ar71xx_eth1_data.fifo_cfg2 = 0x00001fff;
-       ar71xx_eth1_data.fifo_cfg3 = 0x008001ff;
-
-       ar71xx_add_device_mdio(0x0);
-       ar71xx_add_device_eth(1);
-       ar71xx_add_device_eth(0);
-
-       ar71xx_add_device_dsa(1, &ap91_dsa_data);
-}
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.h b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.h
deleted file mode 100644 (file)
index d9cd214..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- *  Atheros AP91 reference board ethernet initialization
- *
- *  Copyright (C) 2010 Gabor Juhos <juhosg@openwrt.org>
- *
- *  This program is free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License version 2 as published
- *  by the Free Software Foundation.
- */
-
-#ifndef _AR71XX_DEV_AP91_ETH_H
-#define _AR71XX_DEV_AP91_ETH_H
-
-#define AP91_ETH_NUM_PORT_NAMES        4
-
-#if defined(CONFIG_AR71XX_DEV_AP91_ETH)
-void ap91_eth_init(u8 *mac_addr, const char *port_names[]) __init;
-#else
-static inline void ap91_eth_init(u8 *mac_addr) { }
-#endif
-
-#endif /* _AR71XX_DEV_AP91_ETH_H */
-
index ed9d5cc588ca3a52cf2eb09c49cfe1848e2ce80a..fad417aeb34ca65cced967475ba39525f135cc87 100644 (file)
@@ -16,7 +16,6 @@
 #include "machtype.h"
 #include "devices.h"
 #include "dev-m25p80.h"
-#include "dev-ap91-eth.h"
 #include "dev-ap91-pci.h"
 #include "dev-gpio-buttons.h"
 #include "dev-leds-gpio.h"
index 3972f57ac734f53bad09cb390957ec1f3bd7eef5..41a184e358f9d8cf4a7b8ac77190af725b31e4f8 100644 (file)
@@ -12,8 +12,8 @@
 #include <asm/mach-ar71xx/ar71xx.h>
 #include <asm/mach-ar71xx/mach-rb750.h>
 
+#include "devices.h"
 #include "machtype.h"
-#include "dev-ap91-eth.h"
 
 static struct rb750_led_data rb750_leds[] = {
        {
@@ -55,13 +55,6 @@ static struct platform_device rb750_leds_device = {
        }
 };
 
-static const char *rb750_port_names[AP91_ETH_NUM_PORT_NAMES] __initdata = {
-       "port5",
-       "port4",
-       "port3",
-       "port2",
-};
-
 static struct platform_device rb750_nand_device = {
        .name   = "rb750-nand",
        .id     = -1,
@@ -124,7 +117,21 @@ static void __init rb750_setup(void)
                                     AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
                                     AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
 
-       ap91_eth_init(NULL, rb750_port_names);
+       /* WAN port */
+       ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+       ar71xx_eth0_data.speed = SPEED_100;
+       ar71xx_eth0_data.duplex = DUPLEX_FULL;
+
+       /* LAN ports */
+       ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+       ar71xx_eth1_data.speed = SPEED_1000;
+       ar71xx_eth1_data.duplex = DUPLEX_FULL;
+       ar71xx_eth1_data.has_ar7240_switch = 1;
+
+       ar71xx_add_device_mdio(0x0);
+       ar71xx_add_device_eth(1);
+       ar71xx_add_device_eth(0);
+
        platform_device_register(&rb750_leds_device);
        platform_device_register(&rb750_nand_device);
 }
index 5014ece04f989a5b5b5b2467ea33166d9eeb7590..cd50325890188c7d1705736d36ef69a7ce3c5fd8 100644 (file)
@@ -16,7 +16,6 @@
 #include "machtype.h"
 #include "devices.h"
 #include "dev-m25p80.h"
-#include "dev-ap91-eth.h"
 #include "dev-ap91-pci.h"
 #include "dev-gpio-buttons.h"
 #include "dev-leds-gpio.h"