From patchwork Sun Jul 29 10:15:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thibaut X-Patchwork-Id: 950566 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=slashdirt.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="h5w/k6b2"; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=slashdirt.org header.i=@slashdirt.org header.b="XwcDpAI1"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41ddrq5MxXz9ryn for ; Sun, 29 Jul 2018 20:16:11 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=oU4lpa+Z/7PsXubgSK9KKLg6UGKsIPymSHylygvATFI=; b=h5w/k6b22C5bVW+0hsWFqDxV0Y 3Bj9mu1HjdntoQKRwD94u8+V+4K+ci14ZY3tABm6JlgQQueZoh9w6RAn1+qX0TgVbpBcfGhyGFEhh njZ+4yfwuytl7llbzrC6omDYoWEd8KBL5n/GC6K7ezyuHUQp2ZkjbEcUtcWYe1Q/EXMnZqq5ID+A6 /gBD0odR4wLxskLit7O7ltej5aMYE9tIlshzxTNg40KnYFZYtFX4AdFVvfGWntLxLwrCDS2aKKcYD MXsV22Wx6OWl9bu4rIOj/M4jGgBsmfHdtK/Xjqt41x31Qli7dTb1RRqU0wTBQL8qSv2Ae8TyyUHBL Kg8hmbWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fjikA-0007yv-L6; Sun, 29 Jul 2018 10:16:06 +0000 Received: from vps.slashdirt.org ([178.238.224.32]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fjijY-0006qC-Im for openwrt-devel@lists.openwrt.org; Sun, 29 Jul 2018 10:15:33 +0000 Received: from Chuck.lan (tardis.herebedragons.eu [185.144.46.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by vps.slashdirt.org (Postfix) with ESMTPSA id F19A01200A2 for ; Sun, 29 Jul 2018 12:15:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.9.2 vps.slashdirt.org F19A01200A2 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=slashdirt.org; s=mail; t=1532859302; bh=uf+ZZAQ5AMfHx4bD5kelEmo8gSAcJfBc7liaPLYObiI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XwcDpAI1kFlm6oWymxMYhkZFXE9NOUMnkrKMrDnIIqLw6yQkHGZEq6MtGqFlPKL0h +kuVKERzmdG8Fxs29bRcRSOFGcU6/zjT3pLUC0YSTsKD7TzOCMgQN/P72Rq3gziDH9 ki49s2sbAiIBIPn9+iM4j3fcgfIg/LGVdswQGDWQ= From: =?utf-8?q?Thibaut_VAR=C3=88NE?= To: openwrt-devel@lists.openwrt.org Date: Sun, 29 Jul 2018 12:15:00 +0200 Message-Id: <20180729101500.8621-6-hacks@slashdirt.org> X-Mailer: git-send-email 2.13.6 (Apple Git-96) In-Reply-To: <20180729101500.8621-1-hacks@slashdirt.org> References: <20180729101500.8621-1-hacks@slashdirt.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180729_031529_660175_4F64F959 X-CRM114-Status: GOOD ( 12.79 ) X-Spam-Score: 0.3 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.4 NO_DNS_FOR_FROM RBL: Envelope sender has no MX or A DNS records [listed in slashdirt.org. IN A] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH 5/5] ar71xx: improve MikroTik wAP R support X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org 81d446b045176e3e25bb0ef74e3d060b51a0a353 introduced incomplete support for this device. This patch attempts to correct the situation based on OEM source code. LED1-3 are GSM mode on OFW (2G/3G/4G) hence unassigned here. Signed-off-by: Thibaut VARĂˆNE Tested-by: David Ehrmann --- target/linux/ar71xx/base-files/etc/board.d/01_leds | 3 ++ target/linux/ar71xx/base-files/etc/diag.sh | 3 +- .../ar71xx/files/arch/mips/ath79/mach-rbspi.c | 63 +++++++++++++++++++++- 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 11299dcb92..b0f4975e5c 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -680,6 +680,9 @@ rb-wap-2nd) ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000" ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt" ;; +rb-wapr-2nd) + ucidef_set_led_wlan "wlan" "WLAN" "rb:green:user" "phy0tpt" + ;; re355|\ re450) ucidef_set_led_netdev "lan_data" "LAN Data" "$board:green:lan_data" "eth0" "tx rx" diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index efb1305aec..129df16097 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -376,7 +376,8 @@ get_status_led() { rb-lhg-5nd|\ rb-map-2nd|\ rb-mapl-2nd|\ - rb-wap-2nd) + rb-wap-2nd|\ + rb-wapr-2nd) status_led="rb:green:user" ;; rb-951ui-2hnd) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c index 4aff7df55b..cff69092c4 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c @@ -594,6 +594,36 @@ static struct gpio_led rb931_leds[] __initdata = { }, }; +/* RB wAP R-2nD (wAP R) gpios*/ +#define RBWAPR_GPIO_LED_USER 14 +#define RBWAPR_GPIO_LED1 12 +#define RBWAPR_GPIO_LED2 13 +#define RBWAPR_GPIO_LED3 3 +#define RBWAPR_GPIO_PCIE_PWROFF 15 +#define RBWAPR_GPIO_CONTROL 10 +#define RBWAPR_GPIO_BTN_RESET 16 + +static struct gpio_led rbwapr_leds[] __initdata = { + { + .name = "rb:green:user", + .gpio = RBWAPR_GPIO_LED_USER, + .active_low = 0, + },{ + .name = "rb:green:led1", + .gpio = RBWAPR_GPIO_LED1, + .active_low = 1, + },{ + .name = "rb:green:led2", + .gpio = RBWAPR_GPIO_LED2, + .active_low = 1, + },{ + .name = "rb:green:led3", + .gpio = RBWAPR_GPIO_LED3, + .active_low = 0, + }, +}; + + static struct gen_74x164_chip_platform_data rbspi_ssr_data = { .base = RBSPI_SSR_GPIO_BASE, .num_registers = 1, @@ -1170,6 +1200,37 @@ static void __init rb931_setup(void) rb931_gpio_keys); } +/* + * Init the wAP R hardware. + * The wAP R-2nD has a single ethernet port and a mini PCIe slot. + * The OEM source shows it has usb (used over PCIe for LTE devices), + * and the 'control' GPIO is assumed to be an output pin not tied to an LED. + */ +static void __init rbwapr_setup(void) +{ + u32 flags = RBSPI_HAS_WLAN0 | RBSPI_HAS_USB | RBSPI_HAS_PCI; + + if (!rbspi_platform_setup()) + return; + + rbspi_peripherals_setup(flags); + + /* GMAC1 is HW MAC, WLAN0 MAC is HW MAC + 1 */ + rbspi_network_setup(flags, 0, 1, 0); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(rbwapr_leds), rbwapr_leds); + + gpio_request_one(RBWAPR_GPIO_PCIE_PWROFF, GPIOF_OUT_INIT_HIGH | + GPIOF_ACTIVE_LOW | GPIOF_EXPORT_DIR_FIXED, + "PCIE power off"); + + gpio_request_one(RBWAPR_GPIO_CONTROL, GPIOF_OUT_INIT_LOW | + GPIOF_ACTIVE_LOW | GPIOF_EXPORT_DIR_FIXED, + "control"); + + rbspi_register_reset_button(RBWAPR_GPIO_BTN_RESET); +} + MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAPL, "map-hb", rbmapl_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_941, "H951L", rbhapl_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_911L, "911L", rb911l_setup); @@ -1178,7 +1239,7 @@ MIPS_MACHINE_NONAME(ATH79_MACH_RB_962, "962", rb962_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_750UPR2, "750-hb", rb750upr2_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_LHG5, "lhg", rblhg_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAP, "wap-hb", rbwap_setup); -MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAPR, "wap-lte", rbwap_setup); +MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAPR, "wap-lte", rbwapr_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_CAP, "cap-hb", rbcap_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAP, "map2-hb", rbmap_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAPAC, "wapg-sc", rbwapgsc_setup);