From patchwork Wed Feb 14 01:01:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 873226 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=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="omrOL6N6"; 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 3zh1MH556Gz9t66 for ; Wed, 14 Feb 2018 12:01:47 +1100 (AEDT) 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:Message-ID:To:From :Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=38/Flrn40pzCxFAACF8xxJ4LSjg2whcb1VdfzEsP56I=; b=omrOL6N6w063L8 P0m2WFzTaCapPfWg4+94CJYogBY/GaMAajmNKTN1Y1Hq+qoZjU/FJn5h3TIVRggdZuP9ss79e1l/L wi43NEgcyCT0z4FrZXi9B2U3kOmDbhvSJ3EgEZ1+FPF1479VKdZJk9dlErs4QBC2/inUDkkyBtx4S 0FIjd8yw4iQdPGXLpfkCNIldzHGh9eyazn9/F8mSuu+zkhKQWhZKMjYr8CxSsvj18VtabVgKXujLP c6R4JaTqIQnaU6RP/owsTl5WVJ2en6BUHNZactMf09GOpP19ZjemNkxqeniB0WfjftCtArcmmc0lS 8g57t8I4x8ltfZbXSzXA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ellSC-0008PG-Oe; Wed, 14 Feb 2018 01:01:44 +0000 Received: from fudo.makrotopia.org ([2a07:2ec0:3002::71]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ellS7-0008JF-Sh for lede-dev@lists.infradead.org; Wed, 14 Feb 2018 01:01:42 +0000 Received: from local by fudo.makrotopia.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1ellRt-0001oY-CG for lede-dev@lists.infradead.org; Wed, 14 Feb 2018 02:01:25 +0100 Date: Wed, 14 Feb 2018 02:01:09 +0100 From: Daniel Golle To: lede-dev@lists.infradead.org Message-ID: <20180214010101.GA9019@makrotopia.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.3 (2018-01-21) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180213_170140_125187_6CAB1CF2 X-CRM114-Status: GOOD ( 10.56 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH] ar71xx: add support for Gainstrong Oolite V5.2 X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The Oolite V5.2 is a dual-radio system-on-a-module. Specs: - QCA9531 @ 550MHz with integrated 2T2R 802.11bgn - 64 MB DDR2 RAM - 16 MB SPI NOR Flash (W25Q128FV) - 1+4x 10/100 Mbps Ethernet - QCA9887 1T1R 802.11ac Signed-off-by: Daniel Golle --- .../linux/ar71xx/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 ++ .../ar71xx/base-files/lib/upgrade/platform.sh | 1 + target/linux/ar71xx/config-4.4 | 1 + target/linux/ar71xx/config-4.9 | 1 + .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt | 11 ++++++ target/linux/ar71xx/files/arch/mips/ath79/Makefile | 1 + .../ar71xx/files/arch/mips/ath79/mach-gs-oolite.c | 41 ++++++++++++++++++++++ .../linux/ar71xx/files/arch/mips/ath79/machtypes.h | 1 + target/linux/ar71xx/generic/config-default | 1 + target/linux/ar71xx/image/generic.mk | 10 ++++++ 12 files changed, 73 insertions(+) diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index f131b3b633..002ad977b7 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -322,6 +322,7 @@ ar71xx_setup_interfaces() ;; dir-615-i1|\ omy-g1|\ + oolite-v5.2|\ r6100|\ smart-300|\ tl-wdr6500-v2|\ diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 8284550e92..f7bffe8232 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -67,6 +67,7 @@ case "$FIRMWARE" in cf-e380ac-v1|\ cf-e380ac-v2|\ dlan-pro-1200-ac|\ + oolite-v5.2|\ sr3200|\ xd3200) ath10kcal_extract "art" 20480 2116 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index a255b83802..0dfb278792 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -850,6 +850,9 @@ ar71xx_board_detect() { *"Oolite V1.0") name="oolite" ;; + *"Oolite V5.2") + name="oolite-v5.2" + ;; *"PB42") name="pb42" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 8f56d1a8f6..23e45e941f 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -391,6 +391,7 @@ platform_check_image() { omy-x1|\ onion-omega|\ oolite|\ + oolite-v5.2|\ re355|\ re450|\ rut900|\ diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 068b83ce8a..d2c4472cd3 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -123,6 +123,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_GL_USB150 is not set # CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set # CONFIG_ATH79_MACH_GS_OOLITE is not set +# CONFIG_ATH79_MACH_GS_OOLITE_V5_2 is not set # CONFIG_ATH79_MACH_HIVEAP_121 is not set # CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set # CONFIG_ATH79_MACH_HORNET_UB is not set diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index e495f6b4c2..dd5c63dcd5 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -121,6 +121,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_GL_USB150 is not set # CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set # CONFIG_ATH79_MACH_GS_OOLITE is not set +# CONFIG_ATH79_MACH_GS_OOLITE_V5_2 is not set # CONFIG_ATH79_MACH_HIVEAP_121 is not set # CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set # CONFIG_ATH79_MACH_HORNET_UB is not set diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 248bffb1f5..e7fc8db78c 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -878,6 +878,17 @@ config ATH79_MACH_GS_OOLITE select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_GS_OOLITE_V5_2 + bool "GS Oolite V5.2 support" + select SOC_QCA953X + select ATH79_DEV_AP9X_PCI if PCI + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC + config ATH79_MACH_HIVEAP_121 bool "Aerohive HiveAP-121 support" select SOC_AR934X diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 98d4677a5f..cfa7edb1fe 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -131,6 +131,7 @@ obj-$(CONFIG_ATH79_MACH_GL_MIFI) += mach-gl-mifi.o obj-$(CONFIG_ATH79_MACH_GL_USB150) += mach-gl-usb150.o obj-$(CONFIG_ATH79_MACH_GS_MINIBOX_V1) += mach-gs-minibox-v1.o obj-$(CONFIG_ATH79_MACH_GS_OOLITE) += mach-gs-oolite.o +obj-$(CONFIG_ATH79_MACH_GS_OOLITE_V5_2) += mach-gs-oolite.o obj-$(CONFIG_ATH79_MACH_HIVEAP_121) += mach-hiveap-121.o obj-$(CONFIG_ATH79_MACH_HIWIFI_HC6361) += mach-hiwifi-hc6361.o obj-$(CONFIG_ATH79_MACH_HORNET_UB) += mach-hornet-ub.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-oolite.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-oolite.c index c6cb61c366..a4849c96c6 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-oolite.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gs-oolite.c @@ -20,6 +20,7 @@ #include "dev-wmac.h" #include "machtypes.h" #include "dev-usb.h" +#include "dev-ap9x-pci.h" #define GS_OOLITE_GPIO_BTN6 6 #define GS_OOLITE_GPIO_BTN7 7 @@ -101,3 +102,43 @@ static void __init gs_oolite_setup(void) MIPS_MACHINE(ATH79_MACH_GS_OOLITE, "GS-OOLITE", "Oolite V1.0", gs_oolite_setup); + +static void __init gs_oolite52_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); + u8 *ee10k = (u8 *) KSEG1ADDR(0x1fff5000); + + ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE, + AR934X_GPIO_FUNC_CLK_OBS4_EN); + + ath79_register_usb(); + + ath79_register_m25p80(&gs_oolite_flash_data); + + ath79_register_mdio(0, 0x0); + + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); + ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1); + + /* WAN port */ + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.speed = SPEED_100; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_mask = BIT(4); + ath79_register_eth(0); + + /* LAN ports */ + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_eth1_data.speed = SPEED_1000; + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_switch_data.phy_poll_mask |= BIT(4); + ath79_switch_data.phy4_mii_en = 1; + ath79_register_eth(1); + + ath79_register_wmac(ee, mac); + ap91_pci_init(ee10k, NULL); +} + +MIPS_MACHINE(ATH79_MACH_GS_OOLITE_V5_2, "OOLITE_V5_2", + "Oolite V5.2", gs_oolite52_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 497d794e01..521d45f1d5 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -123,6 +123,7 @@ enum ath79_mach_type { ATH79_MACH_GL_USB150, /* GL.iNet GL-USB150 */ ATH79_MACH_GS_MINIBOX_V1, /* Gainstrong MiniBox V1.0 */ ATH79_MACH_GS_OOLITE, /* GS OOLITE V1.0 */ + ATH79_MACH_GS_OOLITE_V5_2, /* GS OOLITE V5.2 */ ATH79_MACH_HIVEAP_121, /* Aerohive HiveAP-121*/ ATH79_MACH_HIWIFI_HC6361, /* HiWiFi HC6361 */ ATH79_MACH_HORNET_UB, /* ALFA Networks Hornet-UB */ diff --git a/target/linux/ar71xx/generic/config-default b/target/linux/ar71xx/generic/config-default index 9caf29aa5f..74dcc532a3 100644 --- a/target/linux/ar71xx/generic/config-default +++ b/target/linux/ar71xx/generic/config-default @@ -94,6 +94,7 @@ CONFIG_ATH79_MACH_GL_MIFI=y CONFIG_ATH79_MACH_GL_USB150=y CONFIG_ATH79_MACH_GS_MINIBOX_V1=y CONFIG_ATH79_MACH_GS_OOLITE=y +CONFIG_ATH79_MACH_GS_OOLITE_V5_2=y CONFIG_ATH79_MACH_HIWIFI_HC6361=y CONFIG_ATH79_MACH_HORNET_UB=y CONFIG_ATH79_MACH_JA76PF=y diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index eeefde0a98..5f77edaecf 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -855,6 +855,16 @@ define Device/oolite endef TARGET_DEVICES += oolite +define Device/oolite-v5.2 + $(Device/tplink-16mlzma) + DEVICE_TITLE := Gainstrong OOLITE V5.2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca9887 + BOARDNAME := OOLITE_V5_2 + DEVICE_PROFILE := OOLITE_V5_2 + TPLINK_HWID := 0x3C00010B +endef +TARGET_DEVICES += oolite-v5.2 + define Device/n5q DEVICE_TITLE := ALFA Network N5Q DEVICE_PACKAGES := rssileds -swconfig