From patchwork Thu Apr 16 10:55:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Roger Pueyo Centelles | Guifi.net" X-Patchwork-Id: 461730 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3EF89140134 for ; Thu, 16 Apr 2015 20:57:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=permerror reason="key not found" header.d=guifi.net header.i=@guifi.net header.b=Xzm+v+54; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D44E7289E9E; Thu, 16 Apr 2015 12:56:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 25E5D289C94 for ; Thu, 16 Apr 2015 12:56:27 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_FROM_MX=-3.1; rate: -7.6 Received: from smtp1.guifi.net (smtp1.guifi.net [109.69.9.53]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 16 Apr 2015 12:56:24 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.guifi.net (Postfix) with ESMTP id 4E40A4B40972 for ; Thu, 16 Apr 2015 12:57:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=guifi.net; h= x-mailer:message-id:date:date:subject:subject:from:from:received :received:received; s=dkim; t=1429181831; x=1430996232; bh=Am72r YGQ7qNzKhegnmZd51rheERureyNwDL3ceO9Szc=; b=Xzm+v+54ZfoRinfyapIw7 alwIJgMFet/DXTvCzK0f9HdEUt0Qvgr1ISMZSosSjgInikda7xjDq59Ur6fj+jZN R3lcerFV/E+QsISfguPXu5yigSRxbiS1u3Dy4p2LdND0NGXS59S59KMiykMtCuIc z+u8Dno4zEZe+vRKJ/Yg2F+c/9k8bGO0P+degIVfHwcyct/qwlKVkakBqZXGyhZ9 b2bRSJ9y9+39Id2cvgdcfjKQJpKSexK9yQZUmOZdIt3t3aKZfZqcQFpRWOB2/thl mc+dNrXDKGu6xd+Z1x/IVRReju1zhHFogMd/w/hMWAo1ZllwAIYsk1jCbXRm8OUY A== X-Amavis-Modified: Mail body modified (using disclaimer) - smtp1.elserrat.org X-Virus-Scanned: Scrollout F1 on Debian amavisd-new at elserrat.org Received: from smtp1.guifi.net ([127.0.0.1]) by localhost (smtp1.elserrat.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id X0-I2QnstINq for ; Thu, 16 Apr 2015 12:57:11 +0200 (CEST) Received: from mail.elserrat.org (109-69-9-9-guifi-gurb.ip4.guifi.net [109.69.9.9]) by smtp1.guifi.net (Postfix) with ESMTP id 5B4BB4B40970 for ; Thu, 16 Apr 2015 12:57:11 +0200 (CEST) Received: from localhost.localdomain (unknown [84.88.85.1]) by mail.elserrat.org (Postfix) with ESMTPSA id 3874E6A823E; Thu, 16 Apr 2015 12:57:11 +0200 (CEST) From: roger.pueyo@guifi.net To: openwrt-devel@lists.openwrt.org Date: Thu, 16 Apr 2015 12:55:51 +0200 Message-Id: <1429181751-12224-1-git-send-email-roger.pueyo@guifi.net> X-Mailer: git-send-email 2.1.4 Cc: Roger Pueyo Centelles Subject: [OpenWrt-Devel] [PATCH] [ar71xx] Add support for Ubiquiti Rocket M XW devices X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" From: Roger Pueyo Centelles This patch adds support for the XW version of the Rocket M series devices manufactured by Ubiquiti, based on the Atheros AR9342 SoC. Signed-off-by: Roger Pueyo Centelles --- target/linux/ar71xx/base-files/etc/diag.sh | 2 +- .../ar71xx/base-files/etc/uci-defaults/01_leds | 1 + .../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 | 3 +- .../903-MIPS-ath79-ubnt-rocket-m-xw-support.patch | 55 ++++++++++++++++++++++ 7 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 target/linux/ar71xx/patches-3.18/903-MIPS-ath79-ubnt-rocket-m-xw-support.patch diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 52a73ee..f4f5190 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -34,7 +34,7 @@ get_status_led() { aw-nr580) status_led="aw-nr580:green:ready" ;; - bullet-m | rocket-m | nano-m | nanostation-m | nanostation-m-xw | loco-m-xw) + bullet-m | rocket-m | rocket-m-xw | nano-m | nanostation-m | nanostation-m-xw | loco-m-xw) status_led="ubnt:green:link4" ;; bxu2000n-2-a1) 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 787523a..0a9a285 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds @@ -38,6 +38,7 @@ ap113) bullet-m | \ nanostation-m | \ rocket-m | \ +rocket-m-xw | \ nanostation-m-xw | \ loco-m-xw) ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100" "0" "13" 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 9789834..af7930a 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network @@ -318,6 +318,7 @@ rb-912uag-2hpnd |\ rb-912uag-5hpnd |\ rb-sxt2n |\ rb-sxt5n |\ +rocket-m-xw |\ tl-mr10u |\ tl-mr11u |\ tl-mr12u |\ diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index b3dbcf5..c6aa81e 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -621,6 +621,9 @@ ar71xx_board_detect() { *"Rocket M") name="rocket-m" ;; + *"Rocket M XW") + name="rocket-m-xw" + ;; *RouterStation) name="routerstation" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 0cbee1d..d349133 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -224,6 +224,7 @@ platform_check_image() { loco-m-xw | \ nanostation-m | \ rocket-m | \ + rocket-m-xw | \ nanostation-m-xw | \ rw2458n | \ wndap360 | \ diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 8766756..45a4504 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -1518,6 +1518,7 @@ $(eval $(call SingleProfile,UBNTXM,64kraw,RW2458N,rw2458n,RW2458N,ttyS0,115200,X $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTAIRROUTER,ubnt-airrouter,UBNT-AR,ttyS0,115200,XM,XM,ar7240)) $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTBULLETM,ubnt-bullet-m,UBNT-BM,ttyS0,115200,XM,XM,ar7240)) $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTROCKETM,ubnt-rocket-m,UBNT-RM,ttyS0,115200,XM,XM,ar7240)) +$(eval $(call SingleProfile,UBNTXM,64kraw,UBNTROCKETMXW,ubnt-rocket-m-xw,UBNT-RM-XW,ttyS0,115200,XM,XW,ar934x)) $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTNANOM,ubnt-nano-m,UBNT-NM,ttyS0,115200,XM,XM,ar7240)) $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTUNIFI,ubnt-unifi,UBNT-UF,ttyS0,115200,XM,BZ,ar7240)) $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTUNIFIOUTDOOR,ubnt-unifi-outdoor,UBNT-U20,ttyS0,115200,XM,BZ,ar7240)) @@ -1573,7 +1574,7 @@ $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 TLWR941NV5 T $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2)) $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1)) $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M)) -$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW)) +$(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTROCKETMXW UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW)) $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R)) $(eval $(call MultiProfile,WNR1000V2,REALWNR1000V2 WNR1000V2_VC)) $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M)) diff --git a/target/linux/ar71xx/patches-3.18/903-MIPS-ath79-ubnt-rocket-m-xw-support.patch b/target/linux/ar71xx/patches-3.18/903-MIPS-ath79-ubnt-rocket-m-xw-support.patch new file mode 100644 index 0000000..056a690 --- /dev/null +++ b/target/linux/ar71xx/patches-3.18/903-MIPS-ath79-ubnt-rocket-m-xw-support.patch @@ -0,0 +1,55 @@ +--- a/arch/mips/ath79/machtypes.h ++++ b/arch/mips/ath79/machtypes.h +@@ -169,6 +169,7 @@ + ATH79_MACH_UBNT_NANO_M, /* Ubiquiti NanoStation M */ + ATH79_MACH_UBNT_NANO_M_XW, /* Ubiquiti NanoStation M XW */ + ATH79_MACH_UBNT_ROCKET_M, /* Ubiquiti Rocket M */ ++ ATH79_MACH_UBNT_ROCKET_M_XW, /* Ubiquiti Rocket M XW*/ + ATH79_MACH_UBNT_RSPRO, /* Ubiquiti RouterStation Pro */ + ATH79_MACH_UBNT_RS, /* Ubiquiti RouterStation */ + ATH79_MACH_UBNT_UAP_PRO, /* Ubiquiti UniFi AP Pro */ +--- a/arch/mips/ath79/mach-ubnt-xm.c ++++ b/arch/mips/ath79/mach-ubnt-xm.c +@@ -449,12 +449,42 @@ + ath79_register_eth(0); + } + ++static void __init ubnt_rocket_m_xw_setup(void) ++{ ++ u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000); ++ ++ ath79_register_m25p80(NULL); ++ ++ ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_xw_leds_gpio), ++ ubnt_xw_leds_gpio); ++ ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL, ++ ARRAY_SIZE(ubnt_xm_gpio_keys), ++ ubnt_xm_gpio_keys); ++ ++ ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL); ++ ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL); ++ ++ ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0); ++ ath79_init_mac(ath79_eth0_data.mac_addr, ++ eeprom + UAP_PRO_MAC0_OFFSET, 0); ++ ++ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; ++ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; ++ ++ ath79_register_mdio(0, ~BIT(4)); ++ ath79_eth0_data.phy_mask = BIT(4); ++ ath79_register_eth(0); ++} ++ + MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti Nanostation M XW", + ubnt_nano_m_xw_setup); + + MIPS_MACHINE(ATH79_MACH_UBNT_LOCO_M_XW, "UBNT-LOCO-XW", "Ubiquiti Loco M XW", + ubnt_loco_m_xw_setup); + ++MIPS_MACHINE(ATH79_MACH_UBNT_ROCKET_M_XW, "UBNT-RM-XW", "Ubiquiti Rocket M XW", ++ ubnt_rocket_m_xw_setup); ++ + static struct gpio_led ubnt_airgateway_gpio_leds[] __initdata = { + { + .name = "ubnt:blue:wlan",