From patchwork Thu Jan 11 10:27:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catrinel Catrinescu X-Patchwork-Id: 859020 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=65.50.211.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="mfXxtbEz"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=catrinescu.onmicrosoft.com header.i=@catrinescu.onmicrosoft.com header.b="cK0TR1H6"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 3zHMXR5L92z9s7M for ; Thu, 11 Jan 2018 21:28:07 +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:In-Reply-To: References: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=nKDIRCw6k7nFOxGDarqGspQIZVYA0EyK+2JOOK8KVqs=; b=mfXxtbEzbtZZvq SuPgOuYvogeJGLNz5foiseYvNCKdzGWoTyOU8ANvqtGvYI6S7/cRKMrQ2i30Q91y8OnD/geHtCETa D+xBgQI3oJbMDYgMXH+QxrDPieL8ZbWvqaKKJ8xDbUKCXczcnxrh43CwRldgnAY47hiLf8SOqwY5y jmL2zrq77BlIiU/9hzTQLniqdLNGRutGmtFtLAn5iHX3UtEZDbYBJk9gWx/wpFjIljDrfEYJp+vp7 ujd3QAbEM02iBMrHV71hSLwTZ0FjeIYWrFmpZQcQjDcehh0RFJhGDD4+WKwRQptDdOw1pB75g9aoO vwbztqTCtPpSOTTDlCmQ==; 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 1eZa5X-0005x8-4l; Thu, 11 Jan 2018 10:27:59 +0000 Received: from mail-he1eur01on0079.outbound.protection.outlook.com ([104.47.0.79] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eZa5S-0005tb-Nh for lede-dev@lists.infradead.org; Thu, 11 Jan 2018 10:27:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catrinescu.onmicrosoft.com; s=selector1-80211-de; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ZLkanY26z42LHE/kRqTclrqQRQJ346Gibd+mfvCU0gk=; b=cK0TR1H6e4rxmXaoPwNwaOB1MV2Gm99EGiIBJRQbDSgjdHsKXlOdcBbwrWZXTksfECKF4GjULcLwf7XbBNMLdaI0kZ4kOfjdw43q8yR2234sFFxEB+R6tdsqyRAeKUF+0O9gThGrJLV0p7OvYFVgH4KCMjt2gDCA+zG7YUS9CP4= Received: from VI1PR0701MB2573.eurprd07.prod.outlook.com (10.173.85.14) by VI1PR0701MB2414.eurprd07.prod.outlook.com (10.168.138.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.1; Thu, 11 Jan 2018 10:27:39 +0000 Received: from VI1PR0701MB2573.eurprd07.prod.outlook.com ([fe80::8839:19d2:39f4:b788]) by VI1PR0701MB2573.eurprd07.prod.outlook.com ([fe80::8839:19d2:39f4:b788%18]) with mapi id 15.20.0407.004; Thu, 11 Jan 2018 10:27:39 +0000 From: Catrinel Catrinescu To: "lede-dev@lists.infradead.org" Thread-Topic: [PATCH v3] ar71xx: add ew-balin platform from Embedded Wireless Thread-Index: AQHTisXzBmlP8ijYx0SziUs9FVAo4aNudqSg Date: Thu, 11 Jan 2018 10:27:39 +0000 Message-ID: References: <20180111102127.1123-1-cc@80211.de> In-Reply-To: <20180111102127.1123-1-cc@80211.de> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=cc@80211.de; x-originating-ip: [79.219.69.68] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0701MB2414; 6:TV4eJpEBz9UDApM+D1/Y30mkCqMesYNZ3OtGbFsSI9LmaDSPrSn+u7CgS+XVEes7D3kk9JnvSbFOYjOA5MhRTRIk7J1lVgwTphtIYvPsY0nXK9QE8LM5ZLO2ZIbcliMKHL6pxWzCYlcHzRtFela2vCmIqmmt6QXmzaa0sMug38YyJ4E2F72ERyqlUcRHRvWLN22SRlzHRiF4n3A69fgpNtocB+POKaPPn/kmZN+Xw/EfL26k6rBTE0n2bykJsiSXN0+ZA+zMhNQPfRyYvSojKGgDzbWpIOqLS3dgEHZdUWGcYD2zcTZO5YEYvaXBSih2Qf8RpkJAQf5+PX9EpRX20/mGyXWbRb2Rf67tEJelgEn9xkE+mB7w69UePBQ4ccbh; 5:yUMd4Oy/tSxYncwOdNtKiQC3g+GDUdsHVoOC5oQC9xnwlM+iMT+ALYBb5SQ+ajt2wc70Pw7cZuif9Gku8cE8jIKkSQYN+J7B7AXX1Xx5P9Z8mKW/pvP8v+1cmHdLsBSCmTv5Kxtf2uczSSdG/2cOz/Zf/JeDLiUyExvo2gcX7zI=; 24:aP173hbItoxkReRSpRr7uHfjd07+r9jHRe/uTgkJA1b02tXXN1H+VwZu67e/8amZUJc65eKfddtI9daIq9wsXEJjFDsTQjiuiDh2s2iSTr0=; 7:9u9Qjnt6/BLQxEqyGg4EyDKh89xyMyJoUhL1YvxOP1Du7L6rL/Xuh6u72auXWKV3TFR6GhKGG8lZ5wxvCgbcrdx6owWdm2bZdXsFljc3OP07p1IpUmMwiXZKDgI3zlHqwQZnCHvkQGndMXPSC8fPFbypJrCHbR1CH9F4UaYglJ6Q6GP3dUilLxacqyTH9D3WCMPXwGgVCohHlmttHTIb/tz1NCdS6fh/xx13XZ9xWp6BbGbZAXI38jmpGynWqnOV x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 039d4576-f0d6-40f1-2660-08d558ddf0ee x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4603075)(4627115)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:VI1PR0701MB2414; x-ms-traffictypediagnostic: VI1PR0701MB2414: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231023)(944501075)(6041268)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(2016111802025)(6043046)(6072148)(201708071742011); SRVR:VI1PR0701MB2414; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR0701MB2414; x-forefront-prvs: 0549E6FD50 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(39380400002)(39830400003)(376002)(396003)(189003)(199004)(66066001)(76176011)(5640700003)(575784001)(86362001)(6916009)(59450400001)(81156014)(2950100002)(55016002)(966005)(316002)(6306002)(74482002)(7696005)(15974865002)(2351001)(2906002)(8676002)(478600001)(105586002)(9686003)(6436002)(6116002)(14454004)(3846002)(106356001)(25786009)(2501003)(53936002)(5660300001)(75402003)(5250100002)(8936002)(68736007)(33656002)(3660700001)(305945005)(7736002)(81166006)(74316002)(97736004)(6506007)(2900100001)(102836004)(99286004)(3280700002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0701MB2414; H:VI1PR0701MB2573.eurprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: 80211.de does not designate permitted sender hosts) x-microsoft-antispam-message-info: 3qq/tckupqMCeyuRsJH9DYcQg9CXxxuqIG0JndhniFalySC3boGbX87SfaCz1LCzqdfFUAEhzQGnZgUYDnmT0A== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: 80211.de X-MS-Exchange-CrossTenant-Network-Message-Id: 039d4576-f0d6-40f1-2660-08d558ddf0ee X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2018 10:27:39.3449 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72175547-ec04-4fa6-8f9d-95719e86a428 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0701MB2414 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180111_022755_227690_88F9356A X-CRM114-Status: GOOD ( 12.57 ) 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [104.47.0.79 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [104.47.0.79 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Subject: [LEDE-DEV] [PATCH v3] ar71xx: add ew-balin platform from Embedded Wireless 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 Add the Embedded Wireless "Balin" platform, based on AR9344: http://www.embeddedwireless.de/uploads/Balin_data_2016_10.pdf The module comes already with the current vanilla OpenWRT firmware, so no need to install "factory"-image, or any other stuff:-) Signed-off-by: Catrinel Catrinescu --- .../linux/ar71xx/base-files/etc/board.d/02_network | 6 ++ target/linux/ar71xx/base-files/etc/diag.sh | 3 + .../etc/uci-defaults/03_network-switchX-migration | 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-ew-balin.c | 112 +++++++++++++++++++++ .../linux/ar71xx/files/arch/mips/ath79/machtypes.h | 1 + target/linux/ar71xx/image/generic.mk | 9 ++ target/linux/ar71xx/mikrotik/config-default | 1 + target/linux/ar71xx/nand/config-default | 1 + 14 files changed, 152 insertions(+) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c 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 fb61792bf4..4919e7c983 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -368,6 +368,12 @@ ar71xx_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" ;; + ew-balin) + ucidef_set_interface_raw "usb2" "usb0" "static" + ucidef_set_interface_raw "usb3" "usb0" "static" + ucidef_add_switch "switch0" \ + "0@eth0" "5:lan:4" "4:lan:5" "3:wan" + ;; ew-dorin) ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:wan" diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 6cbb3576d8..ca73d5f62b 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -193,6 +193,9 @@ get_status_led() { el-mini) status_led="easylink:green:system" ;; + ew-balin) + status_led="balin:green:status" + ;; ew-dorin|\ ew-dorin-router) status_led="dorin:green:status" diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration index 29fdde40a0..898082f552 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration @@ -53,6 +53,7 @@ dir-615-e1|\ dir-615-e4|\ dir-825-c1|\ ebr-2310-c1|\ +ew-balin|\ ew-dorin|\ ew-dorin-router|\ ja76pf|\ diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index b5440230a5..162742a94c 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -640,6 +640,9 @@ ar71xx_board_detect() { *"EL-MINI") name="el-mini" ;; + *EmbWir-Balin) + name="ew-balin" + ;; *"EmbWir-Dorin") name="ew-dorin" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index ecf6820a2b..9dceadc563 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -237,6 +237,7 @@ platform_check_image() { epg5000|\ esr1750|\ esr900|\ + ew-balin|\ ew-dorin|\ ew-dorin-router|\ gl-ar150|\ diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 5a8004a03e..36b266f21c 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -109,6 +109,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y CONFIG_ATH79_MACH_EPG5000=y CONFIG_ATH79_MACH_ESR1750=y CONFIG_ATH79_MACH_ESR900=y +CONFIG_ATH79_MACH_EW_BALIN=y CONFIG_ATH79_MACH_EW_DORIN=y CONFIG_ATH79_MACH_F9K1115V2=y CONFIG_ATH79_MACH_FRITZ300E=y diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 4334d25b80..d51fe5f797 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -107,6 +107,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y CONFIG_ATH79_MACH_EPG5000=y CONFIG_ATH79_MACH_ESR1750=y CONFIG_ATH79_MACH_ESR900=y +CONFIG_ATH79_MACH_EW_BALIN=y CONFIG_ATH79_MACH_EW_DORIN=y CONFIG_ATH79_MACH_F9K1115V2=y CONFIG_ATH79_MACH_FRITZ300E=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 1198fcb74b..a94c5a3a2e 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -702,6 +702,17 @@ config ATH79_MACH_ESR900 select ATH79_DEV_WMAC select ATH79_NVRAM +config ATH79_MACH_EW_BALIN + bool "embedded wireless Balin Platform support" + select SOC_AR934X + select ATH79_DEV_M25P80 + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_WMAC + select ATH79_DEV_ETH + select ATH79_DEV_USB + select ATH79_DEV_AP9X_PCI if PCI + config ATH79_MACH_EW_DORIN bool "embedded wireless Dorin Platform support" select SOC_AR933X diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 455af762e3..bde1b75308 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -115,6 +115,7 @@ obj-$(CONFIG_ATH79_MACH_ENS202EXT) += mach-ens202ext.o obj-$(CONFIG_ATH79_MACH_EPG5000) += mach-epg5000.o obj-$(CONFIG_ATH79_MACH_ESR1750) += mach-esr1750.o obj-$(CONFIG_ATH79_MACH_ESR900) += mach-esr900.o +obj-$(CONFIG_ATH79_MACH_EW_BALIN) += mach-ew-balin.o obj-$(CONFIG_ATH79_MACH_EW_DORIN) += mach-ew-dorin.o obj-$(CONFIG_ATH79_MACH_F9K1115V2) += mach-f9k1115v2.o obj-$(CONFIG_ATH79_MACH_FRITZ300E) += mach-fritz300e.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c new file mode 100644 index 0000000000..7d7f38c1d2 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c @@ -0,0 +1,112 @@ +/* + * EW Balin board support + * (based on Atheros DB120 reference board support) + * + * Copyright (c) 2011 Qualcomm Atheros + * Copyright (c) 2011-2012 Gabor Juhos + * Copyright (C) 2017 Embedded Wireless GmbH www.80211.de + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#include +#include +#include +#include +#include + +#include + +#include "common.h" +#include "dev-ap9x-pci.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-spi.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" +#include "pci.h" + +#define BALIN_GPIO_LED_STATUS 14 + +#define BALIN_GPIO_BTN_WPS 18 + +#define BALIN_KEYS_POLL_INTERVAL 20 /* msecs */ +#define BALIN_KEYS_DEBOUNCE_INTERVAL (3 * BALIN_KEYS_POLL_INTERVAL) + +#define BALIN_CALDATA_OFFSET 0x1000 +#define BALIN_WMAC_MAC_OFFSET (BALIN_CALDATA_OFFSET + 0x02) + +static struct gpio_led balin_leds_gpio[] __initdata = { + { + .name = "balin:green:status", + .gpio = BALIN_GPIO_LED_STATUS, + .active_low = 1, + }, +}; + +static struct gpio_keys_button balin_gpio_keys[] __initdata = { + { + .desc = "WPS button", + .type = EV_KEY, + .code = KEY_WPS_BUTTON, + .debounce_interval = BALIN_KEYS_DEBOUNCE_INTERVAL, + .gpio = BALIN_GPIO_BTN_WPS, + .active_low = 0, + }, +}; + + +static void __init balin_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); + static u8 mac[6]; + + ath79_register_m25p80(NULL); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(balin_leds_gpio), + balin_leds_gpio); + + ath79_register_gpio_keys_polled(-1, BALIN_KEYS_POLL_INTERVAL, + ARRAY_SIZE(balin_gpio_keys), + balin_gpio_keys); + + ath79_register_usb(); + + + ath79_register_wmac(art + BALIN_CALDATA_OFFSET, + art + BALIN_WMAC_MAC_OFFSET); + + ath79_register_pci(); + + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 | + AR934X_ETH_CFG_SW_ONLY_MODE); + + ath79_register_mdio(1, 0x0); + + /* GMAC1 is connected to the internal switch */ + memcpy(mac, art + BALIN_WMAC_MAC_OFFSET, sizeof(mac)); + mac[3] |= 0x40; + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_eth1_data.speed = SPEED_1000; + ath79_eth1_data.duplex = DUPLEX_FULL; + + ath79_register_eth(1); +} + +MIPS_MACHINE(ATH79_MACH_EW_BALIN, "EW-BALIN", "EmbWir-Balin", + balin_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 0f536f0ec5..ca684b4209 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -106,6 +106,7 @@ enum ath79_mach_type { ATH79_MACH_EPG5000, /* EnGenius EPG5000 */ ATH79_MACH_ESR1750, /* EnGenius ESR1750 */ ATH79_MACH_ESR900, /* EnGenius ESR900 */ + ATH79_MACH_EW_BALIN, /* embedded wireless Balin Platform */ ATH79_MACH_EW_DORIN, /* embedded wireless Dorin Platform */ ATH79_MACH_EW_DORIN_ROUTER, /* embedded wireless Dorin Router Platform */ ATH79_MACH_F9K1115V2, /* Belkin AC1750DB */ diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 6829f113a7..9e9f747803 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -229,6 +229,15 @@ define Device/dragino2 endef TARGET_DEVICES += dragino2 +define Device/ew-balin + DEVICE_TITLE := Embedded Wireless Balin Platform + DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea + BOARDNAME = EW-BALIN + IMAGE_SIZE = 16000k + MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro +endef +TARGET_DEVICES += ew-balin + define Device/ew-dorin DEVICE_TITLE := Embedded Wireless Dorin Platform DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default index a77813d23d..ffa07bd3dd 100644 --- a/target/linux/ar71xx/mikrotik/config-default +++ b/target/linux/ar71xx/mikrotik/config-default @@ -73,6 +73,7 @@ # CONFIG_ATH79_MACH_EPG5000 is not set # CONFIG_ATH79_MACH_ESR1750 is not set # CONFIG_ATH79_MACH_ESR900 is not set +# CONFIG_ATH79_MACH_EW_BALIN is not set # CONFIG_ATH79_MACH_EW_DORIN is not set # CONFIG_ATH79_MACH_F9K1115V2 is not set # CONFIG_ATH79_MACH_FRITZ300E is not set diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default index d85a21d91a..18d56c1f80 100644 --- a/target/linux/ar71xx/nand/config-default +++ b/target/linux/ar71xx/nand/config-default @@ -74,6 +74,7 @@ CONFIG_ATH79_MACH_DOMYWIFI_DW33D=y # CONFIG_ATH79_MACH_EPG5000 is not set # CONFIG_ATH79_MACH_ESR1750 is not set # CONFIG_ATH79_MACH_ESR900 is not set +# CONFIG_ATH79_MACH_EW_BALIN is not set # CONFIG_ATH79_MACH_EW_DORIN is not set # CONFIG_ATH79_MACH_F9K1115V2 is not set # CONFIG_ATH79_MACH_FRITZ300E is not set