ar71xx: build ALFA AP96 images with default profile as well
[oweals/openwrt.git] / target / linux / ar71xx / files / arch / mips / ar71xx / mach-tl-wr741nd.c
index 60e6d24c8b50d4e287391a4765614ca0b5441e5b..f877e9882288e744ed70b3483ec0b0879298e14f 100644 (file)
@@ -8,9 +8,6 @@
  *  by the Free Software Foundation.
  */
 
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-
 #include <asm/mach-ar71xx/ar71xx.h>
 
 #include "machtype.h"
 
 #define TL_WR741ND_GPIO_LED_QSS                0
 #define TL_WR741ND_GPIO_LED_SYSTEM     1
+#define TL_WR741ND_GPIO_LED_LAN1       13
+#define TL_WR741ND_GPIO_LED_LAN2       14
+#define TL_WR741ND_GPIO_LED_LAN3       15
+#define TL_WR741ND_GPIO_LED_LAN4       16
+#define TL_WR741ND_GPIO_LED_WAN                17
 
 #define TL_WR741ND_GPIO_BTN_RESET      11
 #define TL_WR741ND_GPIO_BTN_QSS                12
 #define TL_WR741ND_KEYS_POLL_INTERVAL  20      /* msecs */
 #define TL_WR741ND_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR741ND_KEYS_POLL_INTERVAL)
 
-#ifdef CONFIG_MTD_PARTITIONS
-static struct mtd_partition tl_wr741nd_partitions[] = {
-       {
-               .name           = "u-boot",
-               .offset         = 0,
-               .size           = 0x020000,
-               .mask_flags     = MTD_WRITEABLE,
-       }, {
-               .name           = "kernel",
-               .offset         = 0x020000,
-               .size           = 0x140000,
-       }, {
-               .name           = "rootfs",
-               .offset         = 0x160000,
-               .size           = 0x290000,
-       }, {
-               .name           = "art",
-               .offset         = 0x3f0000,
-               .size           = 0x010000,
-               .mask_flags     = MTD_WRITEABLE,
-       }, {
-               .name           = "firmware",
-               .offset         = 0x020000,
-               .size           = 0x3d0000,
-       }
+static const char *tl_wr741nd_part_probes[] = {
+       "tp-link",
+       NULL,
 };
-#endif /* CONFIG_MTD_PARTITIONS */
 
 static struct flash_platform_data tl_wr741nd_flash_data = {
-#ifdef CONFIG_MTD_PARTITIONS
-       .parts          = tl_wr741nd_partitions,
-       .nr_parts       = ARRAY_SIZE(tl_wr741nd_partitions),
-#endif
+       .part_probes    = tl_wr741nd_part_probes,
 };
 
 static struct gpio_led tl_wr741nd_leds_gpio[] __initdata = {
        {
-               .name           = "tp-link:green:system",
-               .gpio           = TL_WR741ND_GPIO_LED_SYSTEM,
+               .name           = "tp-link:green:lan1",
+               .gpio           = TL_WR741ND_GPIO_LED_LAN1,
+               .active_low     = 1,
+       }, {
+               .name           = "tp-link:green:lan2",
+               .gpio           = TL_WR741ND_GPIO_LED_LAN2,
+               .active_low     = 1,
+       }, {
+               .name           = "tp-link:green:lan3",
+               .gpio           = TL_WR741ND_GPIO_LED_LAN3,
+               .active_low     = 1,
+       }, {
+               .name           = "tp-link:green:lan4",
+               .gpio           = TL_WR741ND_GPIO_LED_LAN4,
                .active_low     = 1,
        }, {
                .name           = "tp-link:green:qss",
                .gpio           = TL_WR741ND_GPIO_LED_QSS,
                .active_low     = 1,
-       }
+       }, {
+               .name           = "tp-link:green:system",
+               .gpio           = TL_WR741ND_GPIO_LED_SYSTEM,
+               .active_low     = 1,
+       }, {
+               .name           = "tp-link:green:wan",
+               .gpio           = TL_WR741ND_GPIO_LED_WAN,
+               .active_low     = 1,
+       },
 };
 
 static struct gpio_keys_button tl_wr741nd_gpio_keys[] __initdata = {
@@ -101,6 +97,12 @@ static void __init tl_wr741nd_setup(void)
 
        ar71xx_add_device_m25p80(&tl_wr741nd_flash_data);
 
+       ar71xx_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+                                    AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
+                                    AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
+                                    AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
+                                    AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
+
        ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr741nd_leds_gpio),
                                        tl_wr741nd_leds_gpio);
 
@@ -108,8 +110,8 @@ static void __init tl_wr741nd_setup(void)
                                         ARRAY_SIZE(tl_wr741nd_gpio_keys),
                                         tl_wr741nd_gpio_keys);
 
-       ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
-       ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
+       ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 1);
+       ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, -1);
 
        ar71xx_add_device_mdio(0, 0x0);