From: Alexander Stadler <[email protected]>

kernel support for dir-835-a1

Signed-off-by: Alexander Stadler <[email protected]>
---
support implemented within the mach-dir-825-c1.c like requested
diff -urN a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c       
2013-03-05 17:54:10.000000000 +0100
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-825-c1.c       
2013-03-07 17:42:36.000000000 +0100
@@ -79,6 +79,34 @@
        },
 };
 
+static struct gpio_led dir835a1_leds_gpio[] __initdata = {
+       {
+               .name           = "d-link:orange:power",
+               .gpio           = DIR825C1_GPIO_LED_ORANGE_POWER,
+               .active_low     = 1,
+       },
+       {
+               .name           = "d-link:green:power",
+               .gpio           = DIR825C1_GPIO_LED_BLUE_POWER,
+               .active_low     = 1,
+       },
+       {
+               .name           = "d-link:blue:wps",
+               .gpio           = DIR825C1_GPIO_LED_BLUE_WPS,
+               .active_low     = 1,
+       },
+       {
+               .name           = "d-link:orange:planet",
+               .gpio           = DIR825C1_GPIO_LED_ORANGE_PLANET,
+               .active_low     = 1,
+       },
+       {
+               .name           = "d-link:green:planet",
+               .gpio           = DIR825C1_GPIO_LED_BLUE_PLANET,
+               .active_low     = 1,
+       },
+};
+
 static struct gpio_keys_button dir825c1_gpio_keys[] __initdata = {
        {
                .desc           = "reset",
@@ -126,6 +154,17 @@
        .led_cfg = &dir825c1_ar8327_led_cfg,
 };
 
+static struct ar8327_platform_data dir835a1_ar8327_data = {
+       .pad0_cfg = &dir825c1_ar8327_pad0_cfg,
+       .port0_cfg = {
+               .force_link = 1,
+               .speed = AR8327_PORT_SPEED_1000,
+               .duplex = 1,
+               .txpause = 1,
+               .rxpause = 1,
+       },
+};
+
 static struct mdio_board_info dir825c1_mdio0_info[] = {
        {
                .bus_id = "ag71xx-mdio.0",
@@ -134,6 +173,14 @@
        },
 };
 
+static struct mdio_board_info dir835a1_mdio0_info[] = {
+       {
+               .bus_id = "ag71xx-mdio.0",
+               .phy_addr = 0,
+               .platform_data = &dir835a1_ar8327_data,
+       },
+};
+
 static void dir825c1_read_ascii_mac(u8 *dest, u8 *src)
 {
        int ret;
@@ -146,7 +193,9 @@
                memset(dest, 0, ETH_ALEN);
 }
 
-static void __init dir825c1_setup(void)
+static void __init dir825c1_generic_setup(struct gpio_led *const leds_gpio, 
size_t leds_gpio_size,
+                                         struct gpio_keys_button *const 
gpio_keys, size_t gpio_keys_size,
+                                         struct mdio_board_info *const 
mdio0_info, size_t mdio0_info_size)
 {
        u8 *mac = (u8 *) KSEG1ADDR(0x1ffe0000);
        u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
@@ -156,18 +205,13 @@
        dir825c1_read_ascii_mac(mac0, mac + DIR825C1_MAC0_OFFSET);
        dir825c1_read_ascii_mac(mac1, mac + DIR825C1_MAC1_OFFSET);
 
-       ath79_gpio_output_select(DIR825C1_GPIO_LED_BLUE_USB, 
AR934X_GPIO_OUT_GPIO);
-
        ath79_register_m25p80(NULL);
 
-       ath79_register_leds_gpio(-1, ARRAY_SIZE(dir825c1_leds_gpio),
-                                dir825c1_leds_gpio);
+       ath79_register_leds_gpio(-1, leds_gpio_size,
+                                leds_gpio);
        ath79_register_gpio_keys_polled(-1, DIR825C1_KEYS_POLL_INTERVAL,
-                                       ARRAY_SIZE(dir825c1_gpio_keys),
-                                       dir825c1_gpio_keys);
-
-       ap9x_pci_setup_wmac_led_pin(0, 13);
-       ap9x_pci_setup_wmac_led_pin(1, 32);
+                                       gpio_keys_size,
+                                       gpio_keys);
 
        ath79_init_mac(wmac0, mac0, 0);
        ath79_register_wmac(art + DIR825C1_WMAC_CALDATA_OFFSET, wmac0);
@@ -177,8 +221,8 @@
 
        ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0);
 
-       mdiobus_register_board_info(dir825c1_mdio0_info,
-                                   ARRAY_SIZE(dir825c1_mdio0_info));
+       mdiobus_register_board_info(mdio0_info,
+                                   mdio0_info_size);
 
        ath79_register_mdio(0, 0x0);
 
@@ -194,6 +238,29 @@
        ath79_register_usb();
 }
 
+static void __init dir825c1_setup(void)
+{
+       ath79_gpio_output_select(DIR825C1_GPIO_LED_BLUE_USB, 
AR934X_GPIO_OUT_GPIO);
+
+       ap9x_pci_setup_wmac_led_pin(0, 13);
+       ap9x_pci_setup_wmac_led_pin(1, 32);
+
+       
dir825c1_generic_setup(dir825c1_leds_gpio,ARRAY_SIZE(dir825c1_leds_gpio),
+                              
dir825c1_gpio_keys,ARRAY_SIZE(dir825c1_gpio_keys),
+                              
dir825c1_mdio0_info,ARRAY_SIZE(dir825c1_mdio0_info));
+}
+
+static void __init dir835a1_setup(void)
+{
+       
dir825c1_generic_setup(dir835a1_leds_gpio,ARRAY_SIZE(dir835a1_leds_gpio),
+                              
dir825c1_gpio_keys,ARRAY_SIZE(dir825c1_gpio_keys),
+                              
dir835a1_mdio0_info,ARRAY_SIZE(dir835a1_mdio0_info));
+}
+
 MIPS_MACHINE(ATH79_MACH_DIR_825_C1, "DIR-825-C1",
             "D-Link DIR-825 rev. C1",
             dir825c1_setup);
+
+MIPS_MACHINE(ATH79_MACH_DIR_835_A1, "DIR-835-A1",
+            "D-Link DIR-835 rev. A1",
+            dir835a1_setup);
diff -urN 
a/target/linux/ar71xx/patches-3.8/612-MIPS-ath79-add-DIR-825-C1-support.patch 
b/target/linux/ar71xx/patches-3.8/612-MIPS-ath79-add-DIR-825-C1-support.patch
--- 
a/target/linux/ar71xx/patches-3.8/612-MIPS-ath79-add-DIR-825-C1-support.patch   
    2013-03-05 17:53:43.000000000 +0100
+++ 
b/target/linux/ar71xx/patches-3.8/612-MIPS-ath79-add-DIR-825-C1-support.patch   
    2013-03-05 23:14:53.000000000 +0100
@@ -1,10 +1,11 @@
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -39,6 +39,7 @@ enum ath79_mach_type {
+@@ -39,6 +39,8 @@ enum ath79_mach_type {
        ATH79_MACH_DIR_615_C1,          /* D-Link DIR-615 rev. C1 */
        ATH79_MACH_DIR_615_E4,          /* D-Link DIR-615 rev. E4 */
        ATH79_MACH_DIR_825_B1,          /* D-Link DIR-825 rev. B1 */
 +      ATH79_MACH_DIR_825_C1,          /* D-Link DIR-825 rev. C1 */
++      ATH79_MACH_DIR_835_A1,          /* D-Link DIR-835 rev. A1 */
        ATH79_MACH_EW_DORIN,            /* embedded wireless Dorin Platform */
        ATH79_MACH_EW_DORIN_ROUTER,     /* embedded wireless Dorin Router 
Platform */
        ATH79_MACH_EAP7660D,            /* Senao EAP7660D */
@@ -15,7 +16,7 @@
        select ATH79_DEV_USB
  
 +config ATH79_MACH_DIR_825_C1
-+      bool "D-Link DIR-825 rev. C1 board support"
++      bool "D-Link DIR-825 rev. C1/DIR-835 rev. A1 board support"
 +      select SOC_AR934X
 +      select ATH79_DEV_AP9X_PCI if PCI
 +      select ATH79_DEV_ETH
diff -urN 
a/target/linux/ar71xx/patches-3.8/613-MIPS-ath79-add-TL-WDR3500-support.patch 
b/target/linux/ar71xx/patches-3.8/613-MIPS-ath79-add-TL-WDR3500-support.patch
--- 
a/target/linux/ar71xx/patches-3.8/613-MIPS-ath79-add-TL-WDR3500-support.patch   
    2013-03-06 01:40:55.000000000 +0100
+++ 
b/target/linux/ar71xx/patches-3.8/613-MIPS-ath79-add-TL-WDR3500-support.patch   
    2013-03-06 01:49:25.000000000 +0100
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -84,6 +84,7 @@ enum ath79_mach_type {
+@@ -85,6 +85,7 @@ enum ath79_mach_type {
        ATH79_MACH_TL_WA7510N_V1,       /* TP-LINK TL-WA7510N v1*/
        ATH79_MACH_TL_WA901ND,          /* TP-LINK TL-WA901ND */
        ATH79_MACH_TL_WA901ND_V2,       /* TP-LINK TL-WA901ND v2 */
diff -urN 
a/target/linux/ar71xx/patches-3.8/614-MIPS-ath79-MR600v2-support.patch 
b/target/linux/ar71xx/patches-3.8/614-MIPS-ath79-MR600v2-support.patch
--- a/target/linux/ar71xx/patches-3.8/614-MIPS-ath79-MR600v2-support.patch      
2013-03-06 01:40:55.000000000 +0100
+++ b/target/linux/ar71xx/patches-3.8/614-MIPS-ath79-MR600v2-support.patch      
2013-03-06 01:49:43.000000000 +0100
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -47,6 +47,7 @@ enum ath79_mach_type {
+@@ -48,6 +48,7 @@ enum ath79_mach_type {
        ATH79_MACH_JA76PF2,             /* jjPlus JA76PF2 */
        ATH79_MACH_JWAP003,             /* jjPlus JWAP003 */
        ATH79_MACH_HORNET_UB,           /* ALFA Networks Hornet-UB */
diff -urN a/target/linux/ar71xx/patches-3.8/615-MIPS-ath79-RB951G-support.patch 
b/target/linux/ar71xx/patches-3.8/615-MIPS-ath79-RB951G-support.patch
--- a/target/linux/ar71xx/patches-3.8/615-MIPS-ath79-RB951G-support.patch       
2013-03-06 01:40:55.000000000 +0100
+++ b/target/linux/ar71xx/patches-3.8/615-MIPS-ath79-RB951G-support.patch       
2013-03-06 01:49:57.000000000 +0100
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -70,6 +70,7 @@ enum ath79_mach_type {
+@@ -71,6 +71,7 @@ enum ath79_mach_type {
        ATH79_MACH_RB_750G_R3,          /* MikroTik RouterBOARD 750GL */
        ATH79_MACH_RB_751,              /* MikroTik RouterBOARD 751 */
        ATH79_MACH_RB_751G,             /* Mikrotik RouterBOARD 751G */
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to