backfire: ar71xx: make the AR8216 driver usable on the TEW-632BRP/DIR-615-Cx boards...
authorGabor Juhos <juhosg@openwrt.org>
Fri, 9 Apr 2010 12:06:12 +0000 (12:06 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Fri, 9 Apr 2010 12:06:12 +0000 (12:06 +0000)
SVN-Revision: 20761

target/linux/ar71xx/base-files/etc/defconfig/dir-615-c1/network [new file with mode: 0644]
target/linux/ar71xx/base-files/etc/defconfig/tew-632brp/network
target/linux/ar71xx/files/arch/mips/ar71xx/mach-dir-615-c1.c
target/linux/ar71xx/files/arch/mips/ar71xx/mach-tew-632brp.c

diff --git a/target/linux/ar71xx/base-files/etc/defconfig/dir-615-c1/network b/target/linux/ar71xx/base-files/etc/defconfig/dir-615-c1/network
new file mode 100644 (file)
index 0000000..a2204d4
--- /dev/null
@@ -0,0 +1,26 @@
+config interface loopback
+       option ifname   lo
+       option proto    static
+       option ipaddr   127.0.0.1
+       option netmask  255.0.0.0
+
+config interface lan
+       option ifname   eth0
+       option type     bridge
+       option proto    static
+       option ipaddr   192.168.1.1
+       option netmask  255.255.255.0
+
+config interface wan
+       option ifname   eth1
+       option proto    dhcp
+
+config switch
+        option name    eth0
+        option reset   1
+        option enable_vlan 1
+
+config switch_vlan
+        option device  eth0
+        option vlan    1
+        option ports   '0 1 2 3 4'
index 2d4d8e01219e62aed76a7325998eaef6ef762758..a2204d4a34c776691e0cfdd32dd9d65fb4e5e0f8 100644 (file)
@@ -14,3 +14,13 @@ config interface lan
 config interface wan
        option ifname   eth1
        option proto    dhcp
+
+config switch
+        option name    eth0
+        option reset   1
+        option enable_vlan 1
+
+config switch_vlan
+        option device  eth0
+        option vlan    1
+        option ports   '0 1 2 3 4'
index f5eb7b2e43d0ee443b3c1bcae4fc7f0962f4c821..8433b0cf14c10f2d4f701cfdae3b37167dcf8fd5 100644 (file)
@@ -128,6 +128,11 @@ static struct gpio_button dir_615c1_gpio_buttons[] __initdata = {
        }
 };
 
+#define DIR_615C1_LAN_PHYMASK  BIT(0)
+#define DIR_615C1_WAN_PHYMASK  BIT(4)
+#define DIR_615C1_MDIO_MASK    (~(DIR_615C1_LAN_PHYMASK | \
+                                  DIR_615C1_WAN_PHYMASK))
+
 static void __init dir_615c1_setup(void)
 {
        const char *config = (char *) KSEG1ADDR(DIR_615C1_CONFIG_ADDR);
@@ -141,14 +146,13 @@ static void __init dir_615c1_setup(void)
                wlan_mac = mac;
        }
 
-       ar71xx_add_device_mdio(0x0);
+       ar71xx_add_device_mdio(DIR_615C1_MDIO_MASK);
 
        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.phy_mask = DIR_615C1_LAN_PHYMASK;
 
        ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
-       ar71xx_eth1_data.phy_mask = 0x10;
+       ar71xx_eth1_data.phy_mask = DIR_615C1_WAN_PHYMASK;
 
        ar71xx_add_device_eth(0);
        ar71xx_add_device_eth(1);
index 2bf9ad9b0355bdf7aaf11f516c1b7c1796297380..787f83eb01d0ee06bd9c5709e0909895cf9f661a 100644 (file)
@@ -104,6 +104,11 @@ static struct gpio_button tew_632brp_gpio_buttons[] __initdata = {
        }
 };
 
+#define TEW_632BRP_LAN_PHYMASK BIT(0)
+#define TEW_632BRP_WAN_PHYMASK BIT(4)
+#define TEW_632BRP_MDIO_MASK   (~(TEW_632BRP_LAN_PHYMASK | \
+                                  TEW_632BRP_WAN_PHYMASK))
+
 static void __init tew_632brp_setup(void)
 {
        const char *config = (char *) KSEG1ADDR(TEW_632BRP_CONFIG_ADDR);
@@ -117,14 +122,13 @@ static void __init tew_632brp_setup(void)
                wlan_mac = mac;
        }
 
-       ar71xx_add_device_mdio(0x0);
+       ar71xx_add_device_mdio(TEW_632BRP_MDIO_MASK);
 
        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.phy_mask = TEW_632BRP_LAN_PHYMASK;
 
        ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
-       ar71xx_eth1_data.phy_mask = 0x10;
+       ar71xx_eth1_data.phy_mask = TEW_632BRP_WAN_PHYMASK;
 
        ar71xx_add_device_eth(0);
        ar71xx_add_device_eth(1);