Ticket #17328: 0001-ar71xx-refactor-ubnt-xw-mach-code-and-add-loco-m-xw.patch

File 0001-ar71xx-refactor-ubnt-xw-mach-code-and-add-loco-m-xw.patch, 9.1 KB (added by lynxis, 3 years ago)
  • target/linux/ar71xx/base-files/etc/diag.sh

    From a1c3998754a5c3f29b454b82387257e24804a905 Mon Sep 17 00:00:00 2001
    From: Alexander Couzens <lynxis@fe80.eu>
    Date: Thu, 14 Aug 2014 15:08:28 +0200
    Subject: [PATCH] ar71xx: refactor ubnt xw mach code and add loco m xw
    
    
    Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
    ---
     target/linux/ar71xx/base-files/etc/diag.sh         |    2 +-
     .../ar71xx/base-files/etc/uci-defaults/01_leds     |    3 +-
     .../ar71xx/base-files/etc/uci-defaults/02_network  |    1 +
     target/linux/ar71xx/base-files/lib/ar71xx.sh       |    3 ++
     .../ar71xx/base-files/lib/upgrade/platform.sh      |    1 +
     target/linux/ar71xx/image/Makefile                 |    5 +--
     .../patches-3.10/616-MIPS-ath79-ubnt-xw.patch      |   33 ++++++++++++++++----
     .../722-MIPS-ath79-add-airGateway-support.patch    |    8 ++---
     8 files changed, 42 insertions(+), 14 deletions(-)
    
    diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
    index 1864b11..fba6032 100755
    a b get_status_led() { 
    3434        aw-nr580) 
    3535                status_led="aw-nr580:green:ready" 
    3636                ;; 
    37         bullet-m | rocket-m | nano-m | nanostation-m | nanostation-m-xw) 
     37        bullet-m | rocket-m | nano-m | nanostation-m | nanostation-m-xw | loco-m-xw) 
    3838                status_led="ubnt:green:link4" 
    3939                ;; 
    4040        bxu2000n-2-a1) 
  • target/linux/ar71xx/base-files/etc/uci-defaults/01_leds

    diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
    index d104f40..afe0641 100755
    a b ap113) 
    3838bullet-m | \ 
    3939nanostation-m | \ 
    4040rocket-m | \ 
    41 nanostation-m-xw) 
     41nanostation-m-xw | \ 
     42loco-m-xw) 
    4243        ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100" "0" "13" 
    4344        ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100" "-25" "13" 
    4445        ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100" "-50" "13" 
  • target/linux/ar71xx/base-files/etc/uci-defaults/02_network

    diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
    index 3b4b330..9423313 100755
    a b bullet-m |\ 
    285285cap4200ag |\ 
    286286eap300v2 |\ 
    287287eap7660d |\ 
     288loco-m-xw |\ 
    288289mr600 |\ 
    289290mr600v2 |\ 
    290291rb-411 |\ 
  • target/linux/ar71xx/base-files/lib/ar71xx.sh

    diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
    index 80a607c..91afb3e 100755
    a b ar71xx_board_detect() { 
    352352        *"Bullet M") 
    353353                name="bullet-m" 
    354354                ;; 
     355        *"Loco M XW") 
     356                name="loco-m-xw" 
     357                ;; 
    355358        *"Nanostation M") 
    356359                name="nanostation-m" 
    357360                ;; 
  • target/linux/ar71xx/base-files/lib/upgrade/platform.sh

    diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
    index b5b2873..f1911ba 100755
    a b platform_check_image() { 
    189189        airgateway | \ 
    190190        airrouter | \ 
    191191        bullet-m | \ 
     192        loco-m-xw | \ 
    192193        nanostation-m | \ 
    193194        rocket-m | \ 
    194195        nanostation-m-xw | \ 
  • target/linux/ar71xx/image/Makefile

    diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
    index ec69b0b..fc42097 100644
    a b $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTROCKETM,ubnt-rocket-m,UBNT-RM,ttyS 
    12221222$(eval $(call SingleProfile,UBNTXM,64kraw,UBNTNANOM,ubnt-nano-m,UBNT-NM,ttyS0,115200,XM,XM,ar7240)) 
    12231223$(eval $(call SingleProfile,UBNTXM,64kraw,UBNTUNIFI,ubnt-unifi,UBNT-UF,ttyS0,115200,XM,BZ,ar7240)) 
    12241224$(eval $(call SingleProfile,UBNTXM,64kraw,UBNTUNIFIOUTDOOR,ubnt-unifi-outdoor,UBNT-U20,ttyS0,115200,XM,BZ,ar7240)) 
    1225 $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTNANOMXW,ubnt-nano-m-xw,UBNT-NM-XW,ttyS0,115200,XM,XW,ar934x)) 
     1225$(eval $(call SingleProfile,UBNTXM,64kraw,UBNTNANOMXW,ubnt-nano-m-xw,UBNT-LOCO-XW,ttyS0,115200,XM,XW,ar934x)) 
     1226$(eval $(call SingleProfile,UBNTXM,64kraw,UBNTLOCOXW,ubnt-loco-m-xw,UBNT-NM-XW,ttyS0,115200,XM,XW,ar934x)) 
    12261227$(eval $(call SingleProfile,UBNTXM,64kraw,UBNTAIRGW,ubnt-air-gateway,UBNT-AGW,ttyATH0,115200,XM,AirGW,ar933x)) 
    12271228 
    12281229$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N)) 
    $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 TLWR941NV6)) 
    12681269$(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2)) 
    12691270$(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1)) 
    12701271$(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M)) 
    1271 $(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTUNIFI UBNTUNIFIOUTDOOR UAPPRO UBNTAIRGW)) 
     1272$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UAPPRO UBNTAIRGW)) 
    12721273$(eval $(call MultiProfile,WNDR3700,WNDR3700V1 WNDR3700V2 WNDR3800 WNDR3800CH WNDRMAC WNDRMACV2)) 
    12731274$(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R)) 
    12741275$(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M)) 
  • target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch

    diff --git a/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch b/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
    index ed2fd24..dde7376 100644
    a b  
    11--- a/arch/mips/ath79/mach-ubnt-xm.c 
    22+++ b/arch/mips/ath79/mach-ubnt-xm.c 
    3 @@ -332,3 +332,60 @@ static void __init ubnt_uap_pro_setup(vo 
     3@@ -332,3 +332,77 @@ static void __init ubnt_uap_pro_setup(vo 
    44 MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP Pro", 
    55             ubnt_uap_pro_setup); 
    66  
     
    2929+       }, 
    3030+}; 
    3131+ 
    32 +static void __init ubnt_nano_m_xw_setup(void) 
     32+static void __init ubnt_xw_init(void) 
    3333+{ 
    3434+       u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000); 
    3535+ 
     
    4444+       ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL); 
    4545+       ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL); 
    4646+ 
    47 +       ath79_register_mdio(0, ~(BIT(0) | BIT(1) | BIT(5))); 
    4847+ 
    4948+       ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0_SLAVE); 
    5049+       ath79_init_mac(ath79_eth0_data.mac_addr, 
    5150+                      eeprom + UAP_PRO_MAC0_OFFSET, 0); 
    5251+ 
    53 +       /* GMAC0 is connected to an AR8326 switch */ 
    5452+       ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; 
     53+       ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; 
     54+} 
     55+ 
     56+static void __init ubnt_nano_m_xw_setup(void) 
     57+{ 
     58+       ubnt_xw_init(); 
     59+ 
     60+       /* GMAC0 is connected to an AR8326 switch */ 
     61+       ath79_register_mdio(0, ~(BIT(0) | BIT(1) | BIT(5))); 
    5562+       ath79_eth0_data.phy_mask = (BIT(0) | BIT(1) | BIT(5)); 
    5663+       ath79_eth0_data.speed = SPEED_100; 
    5764+       ath79_eth0_data.duplex = DUPLEX_FULL; 
    58 +       ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; 
     65+       ath79_register_eth(0); 
     66+} 
     67+ 
     68+static void __init ubnt_loco_m_xw_setup(void) 
     69+{ 
     70+       ubnt_xw_init(); 
     71+ 
     72+       ath79_register_mdio(0, ~BIT(5)); 
    5973+       ath79_register_eth(0); 
    6074+} 
    6175+ 
    6276+MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti Nanostation M XW", 
    6377+            ubnt_nano_m_xw_setup); 
     78+ 
     79+MIPS_MACHINE(ATH79_MACH_UBNT_LOCO_M_XW, "UBNT-LOCO-XW", "Ubiquiti Loco M XW", 
     80+            ubnt_loco_m_xw_setup); 
    6481--- a/arch/mips/ath79/machtypes.h 
    6582+++ b/arch/mips/ath79/machtypes.h 
    66 @@ -124,6 +124,7 @@ enum ath79_mach_type { 
     83@@ -121,9 +121,11 @@ enum ath79_mach_type { 
     84        ATH79_MACH_TL_WR941ND,          /* TP-LINK TL-WR941ND */ 
     85        ATH79_MACH_UBNT_AIRROUTER,      /* Ubiquiti AirRouter */ 
     86        ATH79_MACH_UBNT_BULLET_M,       /* Ubiquiti Bullet M */ 
     87+       ATH79_MACH_UBNT_LOCO_M_XW,      /* Ubiquiti Loco M XW */ 
    6788        ATH79_MACH_UBNT_LSSR71,         /* Ubiquiti LS-SR71 */ 
    6889        ATH79_MACH_UBNT_LSX,            /* Ubiquiti LSX */ 
    6990        ATH79_MACH_UBNT_NANO_M,         /* Ubiquiti NanoStation M */ 
  • target/linux/ar71xx/patches-3.10/722-MIPS-ath79-add-airGateway-support.patch

    diff --git a/target/linux/ar71xx/patches-3.10/722-MIPS-ath79-add-airGateway-support.patch b/target/linux/ar71xx/patches-3.10/722-MIPS-ath79-add-airGateway-support.patch
    index 0fe62d9..c9d1e1e 100644
    a b  
    1212 #include "dev-ap9x-pci.h" 
    1313 #include "dev-eth.h" 
    1414 #include "dev-gpio-buttons.h" 
    15 @@ -389,3 +391,65 @@ static void __init ubnt_nano_m_xw_setup( 
     15@@ -406,3 +408,65 @@ MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, 
    1616  
    17  MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti Nanostation M XW", 
    18              ubnt_nano_m_xw_setup); 
     17 MIPS_MACHINE(ATH79_MACH_UBNT_LOCO_M_XW, "UBNT-LOCO-XW", "Ubiquiti Loco M XW", 
     18             ubnt_loco_m_xw_setup); 
    1919+ 
    2020+static struct gpio_led ubnt_airgateway_gpio_leds[] __initdata = { 
    2121+       { 
     
    8787+       ATH79_MACH_UBNT_AIRGW,          /* Ubiquiti AirGateway */ 
    8888        ATH79_MACH_UBNT_AIRROUTER,      /* Ubiquiti AirRouter */ 
    8989        ATH79_MACH_UBNT_BULLET_M,       /* Ubiquiti Bullet M */ 
    90         ATH79_MACH_UBNT_LSSR71,         /* Ubiquiti LS-SR71 */ 
     90        ATH79_MACH_UBNT_LOCO_M_XW,      /* Ubiquiti Loco M XW */