From patchwork Thu May 14 13:17:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Morales Vega X-Patchwork-Id: 472347 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 3746F140283 for ; Thu, 14 May 2015 23:18:48 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 9454A2800FA; Thu, 14 May 2015 15:17:17 +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 autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 7F0AC2800C3 for ; Thu, 14 May 2015 15:17:09 +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_HELO_IP=-2 (check from: .samknows. - helo: .mail-wi0-f175.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 14 May 2015 15:17:08 +0200 (CEST) Received: by wizk4 with SMTP id k4so240797564wiz.1 for ; Thu, 14 May 2015 06:18:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XNYkjiVo5DbpzEeTXqAKcmInLXenfM0EqvttveYJ7JQ=; b=JW5IINIe8tjVGU9ijxBGnjlg4JTqHbZ7ZvnerOXvCjUBMq5OD1/hGv+1EZxu0lZnVq qDGxuTupBj+weX2M/6dVHUqIP3yxgseur1rP0LtN9S2coP7ziKjEcok4/cvLelgCXq8Z u7SBF0W1GUyTV510Lm0dejVdOApGpqVuK4+LeNrhPmD9vstMJvlVIvDIhmSxpkRkwIhN 66J/qeBNWfpPHBNlVu5gnPrQ5WNeYk85zHHNyA5fmr7Mm9QMiC4mjlNE3+54RWqTnuEi yIiX71gcTQP1c/T4BkTrVCixRU1lq+TqLYWT1ItOhVcrdfQP+e1623naKTdJMQSA9UuX j88w== X-Gm-Message-State: ALoCoQldSsUOZqQlXe3hn24Ub93pwiKgIvbGP8l+JZe9hBU0XCpVoUUatYVfSCG5gE+QzrE19ZrU X-Received: by 10.194.95.41 with SMTP id dh9mr8185490wjb.55.1431609504485; Thu, 14 May 2015 06:18:24 -0700 (PDT) Received: from localhost.localdomain (5751e334.skybroadband.com. [87.81.227.52]) by mx.google.com with ESMTPSA id ex5sm13291190wib.2.2015.05.14.06.18.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 May 2015 06:18:23 -0700 (PDT) From: Cristian Morales Vega To: openwrt-devel@lists.openwrt.org Date: Thu, 14 May 2015 14:17:56 +0100 Message-Id: <1431609476-21132-1-git-send-email-cristian@samknows.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1431510576-3836-1-git-send-email-cristian@samknows.com> References: <1431510576-3836-1-git-send-email-cristian@samknows.com> Subject: [OpenWrt-Devel] [PATCHv2] ralink: add support for ap699ge8c2 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" Signed-off-by: Cristian Morales Vega --- .../linux/ramips/base-files/etc/board.d/02_network | 5 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/AP699GE8C2.dts | 112 +++++++++++++++++++++ target/linux/ramips/image/Makefile | 6 +- target/linux/ramips/mt7621/profiles/ap699ge8c2.mk | 18 ++++ 6 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/AP699GE8C2.dts create mode 100644 target/linux/ramips/mt7621/profiles/ap699ge8c2.mk diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index 24e1ba8..ee6aab0 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -116,6 +116,7 @@ ramips_setup_interfaces() ;; 3g-6200n | \ + ap699ge8c2 | \ ai-br100 | \ dir-610-a1 | \ dir-300-b7 | \ @@ -268,6 +269,10 @@ ramips_setup_macs() local wan_mac="" case $board in + ap699ge8c2) + wan_mac=$(mtd_get_mac_binary factory 57350) + ;; + br-6475nd) lan_mac=$(cat /sys/class/net/eth0/address) wan_mac=$(mtd_get_mac_binary devdata 7) diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 616f4a1..c1b7898 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -397,6 +397,9 @@ ramips_board_detect() { *"Mediatek MT7628AN evaluation board") name="mt7628" ;; + *"TWSZ AP699GE8C2") + name="ap699ge8c2" + ;; *) name="generic" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 17b456b..b79cca8 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -25,6 +25,7 @@ platform_check_image() { all0256n | \ all5002 | \ all5003 | \ + ap699ge8c2 | \ ar725w | \ asl26555 | \ awapn2403 | \ diff --git a/target/linux/ramips/dts/AP699GE8C2.dts b/target/linux/ramips/dts/AP699GE8C2.dts new file mode 100644 index 0000000..7157962 --- /dev/null +++ b/target/linux/ramips/dts/AP699GE8C2.dts @@ -0,0 +1,112 @@ +/dts-v1/; + +/include/ "mt7621.dtsi" + +/ { + compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc"; + model = "TWSZ AP699GE8C2"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + palmbus@1E000000 { + spi@b00 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "mx25l6405d"; + reg = <0 0>; + linux,modalias = "m25p80"; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + + }; + }; + }; + + pcie@1e140000 { + status = "okay"; + + pcie0 { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + mediatek,mtd-eeprom = <&factory 0x8000>; + mediatek,2ghz = <0>; + }; + }; + + pcie1 { + mt76@1,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + mediatek,mtd-eeprom = <&factory 0x0000>; + mediatek,5ghz = <0>; + }; + }; + }; + + ethernet@1e100000 { + mtd-mac-address = <&factory 0xe000>; + }; + + gpio-leds { + compatible = "gpio-leds"; + + wps { + label = "twsz:green:wps"; + gpios = <&gpio1 14 1>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + wps { + label = "wps"; + gpios = <&gpio1 11 1>; + linux,code = <0x211>; + }; + }; + + pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci"; + ralink,function = "gpio"; + }; + }; + }; +}; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index e6b5112..b024c21 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -906,7 +906,7 @@ endif # ifeq ($(SUBTARGET),mt7621) - TARGET_DEVICES += mt7621 wsr-600 wsr-1166 dir-860l-b1 firewrt + TARGET_DEVICES += mt7621 wsr-600 wsr-1166 dir-860l-b1 firewrt ap699ge8c2 endif define Device/mt7621 @@ -943,6 +943,10 @@ define Device/firewrt IMAGE_SIZE := $(ralink_default_fw_size_16M) endef +define Device/ap699ge8c2 + DTS := AP699GE8C2 +endef + # # MT7628 Profiles # diff --git a/target/linux/ramips/mt7621/profiles/ap699ge8c2.mk b/target/linux/ramips/mt7621/profiles/ap699ge8c2.mk new file mode 100644 index 0000000..30df15b --- /dev/null +++ b/target/linux/ramips/mt7621/profiles/ap699ge8c2.mk @@ -0,0 +1,18 @@ +# +# Copyright (C) 2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/AP699GE8C2 + NAME:=AP699GE8C2 Profile + PACKAGES:=\ + kmod-usb-core kmod-usb3 \ + kmod-ledtrig-usbdev kmod-mt76 +endef + +define Profile/AP699GE8C2/Description + Package set optimized for the TWSZ AP699GE8C2 +endef +$(eval $(call Profile,AP699GE8C2))