From patchwork Thu Nov 15 12:32:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 998287 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=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="k/aRCKSJ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="v8xfvS9H"; 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 42wgky2GB5z9s9G for ; Thu, 15 Nov 2018 23:33:29 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qs4sl6Cw6BV7myRiZdWiIchLqWAcW8xksN9PqyQRSrw=; b=k/aRCKSJGJBDfc rqla3ib70yswgwtiDpq7lL+GEaRJUFHrmXL9sGMbil0LZ/mgAfpPTRkKQmQSIY3aTPAgQTE2qj+xD SEzXcUljOl4ki92EdY91FdMewfnGBjKLin1oyFbVYjkjNFZMxP0kb4PgXulhDvuZJ33+vMdew7VrH z55E+eSJUR+gWHc1lAxkq7sBfWzHlZv2YDJPTEILKA+R8WQa3ERZ66/0U5wDkJ2hVjDXt3O2IPXCk HVLDBA4DH8Qv5mFgfcW+ArcssQyZdMM/PNkP3O3V7sIWKryEbS2ad+PCTbGGsDL5y2hFydZZjlakT k2cabmSnMhEaJ0H9IZzQ==; 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 1gNGpi-0003o2-AB; Thu, 15 Nov 2018 12:33:18 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNGpg-0003ne-37 for openwrt-devel@bombadil.infradead.org; Thu, 15 Nov 2018 12:33:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=64MOIlMsDH5I/dbhAJZr+ZafElGd7+zRyZf36pbA8Dc=; b=v8xfvS9HKVyhpepYVkmoOak6tb VwS7dcQ/TMXNa7Wdg3BUftgJTJ6JcUjXeePgN9tc4NeKWZ3RGPYVKi4Uz0ld+YZwSmTxrhxefBUMs Cn5ifsq6661c8tV7TlnfOs8hUJ4a4p3ux8lhBqN14ikqfv7aP99jqaHHZ7cOSgLsA1oGh3F4hn9km p/F6t65YB6rn28BSdDdWTOQ2byV7eKV/aeSD2E7BFDpoB6Zkl33n/EZREOfEDcCIKzbHIv+WQeQkc WaHUIoNc8Zn1C2BVnmx3tnrIbGc85mTVQNGoaktQPuyx6zLm6/lSo/TQ9QTukwk9lv4DWz+PG8960 ACFMi0qQ==; Received: from smtp-out.xnet.cz ([178.217.244.18]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNGpa-0002gM-Py for openwrt-devel@lists.openwrt.org; Thu, 15 Nov 2018 12:33:13 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 5215C365F; Thu, 15 Nov 2018 13:32:54 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by meh.true.cz (OpenSMTPD) with ESMTP id 0bd8bb32; Thu, 15 Nov 2018 13:32:08 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Thu, 15 Nov 2018 13:32:43 +0100 Message-Id: <1542285163-12370-1-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181115_073310_979944_3283238D X-CRM114-Status: GOOD ( 13.34 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] Subject: [OpenWrt-Devel] [PATCH] ath79: Add support for Ubiquity Bullet M2HP 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: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= , =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Petr Štetiar CPU: AR9342 SoC RAM: 64 MB DDR2 Flash: 8 MB NOR SPI Ports: 100 MBit (24V PoE in) WLAN: 2.4 GHz UART: 1 UART on PCB marked as J1 with 115200 8N1 config LEDs: Power, Ethernet, WPS, USB, RF 2.4G, RF 5G Buttons: Reset UART connection details .---------------------------------. | | [ETH] J1 [ANT] | o VCC o RX o TX o GND | `---------------------------------' Flashing instructions A) Serial console, U-Boot and TFTP 1. Connect to serial header J1 on the PCB 2. Power on device and enter U-Boot console 3. Set up TFTP server serving an OpenWrt initramfs build 4. Load initramfs build using the command tftpboot in the U-Boot cli 5. Boot the loaded image using the command bootm 6. Copy squashfs OpenWrt sysupgrade build to the booted device 7. Use mtd to write sysupgrade to partition "firmware" 8. Reboot and enjoy B) Sysupgrade over SSH in airOS v6.1.7 1. Upgrade or downgrade airOS to v6.1.7 2. git clone https://github.com/true-systems/ubnt-bullet-m2hp-openwrt-flashing 3. cd ubnt-bullet-m2hp-openwrt-flashing 4. less README.md 5. make flash FW_UBNT=/path/to/your/openwrt-ath79-generic-ubnt_bullet-m2hp-squashfs-sysupgrade.bin Signed-off-by: Petr Štetiar Tested-by: Petr Štetiar (tested on ar71xx/ath79 with bullet-m-xw) --- target/linux/ath79/base-files/etc/board.d/01_leds | 1 + .../linux/ath79/base-files/etc/board.d/02_network | 1 + target/linux/ath79/dts/ar9342_ubnt_bullet-m2hp.dts | 66 ++++++++++++++++ target/linux/ath79/dts/ar9342_ubnt_xw.dtsi | 88 ++++++++++++++++++++++ target/linux/ath79/image/generic-ubnt.mk | 16 ++++ 5 files changed, 172 insertions(+) create mode 100644 target/linux/ath79/dts/ar9342_ubnt_bullet-m2hp.dts create mode 100644 target/linux/ath79/dts/ar9342_ubnt_xw.dtsi diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds b/target/linux/ath79/base-files/etc/board.d/01_leds index f04eb7f..281686e 100755 --- a/target/linux/ath79/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/base-files/etc/board.d/01_leds @@ -94,6 +94,7 @@ tplink,tl-wr841-v11) ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02" ;; ubnt,bullet-m|\ +ubnt,bullet-m2hp|\ ubnt,nano-m|\ ubnt,rocket-m) ucidef_set_rssimon "wlan0" "200000" "1" diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network index 5f02c57..8556bd3 100755 --- a/target/linux/ath79/base-files/etc/board.d/02_network +++ b/target/linux/ath79/base-files/etc/board.d/02_network @@ -22,6 +22,7 @@ ath79_setup_interfaces() tplink,tl-wa901nd-v2|\ tplink,tl-wr703n|\ ubnt,bullet-m|\ + ubnt,bullet-m2hp|\ ubnt,lap-120|\ ubnt,nanostation-ac-loco|\ ubnt,rocket-m|\ diff --git a/target/linux/ath79/dts/ar9342_ubnt_bullet-m2hp.dts b/target/linux/ath79/dts/ar9342_ubnt_bullet-m2hp.dts new file mode 100644 index 0000000..2e978cf --- /dev/null +++ b/target/linux/ath79/dts/ar9342_ubnt_bullet-m2hp.dts @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include +#include + +#include "ar9342_ubnt_xw.dtsi" + +/ { + compatible = "ubnt,bullet-m2hp", "ubnt,xw"; + model = "Ubiquiti Bullet M2HP (XW)"; + + gpio-leds { + compatible = "gpio-leds"; + + link1 { + label = "ubnt:red:link1"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + link2 { + label = "ubnt:orange:link2"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + link3 { + label = "ubnt:green:link3"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + link4 { + label = "ubnt:green:link4"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <4>; + phy4: ethernet-phy@4 { + phy-mode = "rgmii"; + reg = <4>; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x06000000 0x00000101 0x00001313>; + mtd-mac-address = <&eeprom 0x0>; + + phy-mode = "rgmii"; + phy-handle = <&phy4>; + + gmac-config { + device = <&gmac>; + rxd-delay = <3>; + rxdv-delay = <3>; + }; +}; + +ð1 { + status = "disabled"; +}; diff --git a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi new file mode 100644 index 0000000..c5ae5df --- /dev/null +++ b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include + +#include "ar9344.dtsi" + +/ { + compatible = "ubnt,xw", "qca,ar9342"; + model = "Ubiquiti Networks XW board"; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x050000 0x760000>; + }; + + partition@fb0000 { + label = "cfg"; + reg = <0x7b0000 0x040000>; + read-only; + }; + + eeprom: partition@ff0000 { + label = "EEPROM"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&wmac { + status = "okay"; + + qca,disable-5ghz; + mtd-cal-data = <&eeprom 0x1000>; + mtd-mac-address = <&eeprom 0x1002>; +}; diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index bb86c8b..d12a32e 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -63,6 +63,15 @@ define Device/ubnt-wa ATH_SOC := ar9342 endef +define Device/ubnt-xw + $(Device/ubnt) + UBNT_TYPE := XW + UBNT_CHIP := ar934x + UBNT_BOARD := XM + UBNT_VERSION := 6.0.4 + ATH_SOC := ar9342 +endef + define Device/ubnt_bullet-m $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti Bullet-M @@ -70,6 +79,13 @@ define Device/ubnt_bullet-m endef TARGET_DEVICES += ubnt_bullet-m +define Device/ubnt_bullet-m2hp + $(Device/ubnt-xw) + DEVICE_TITLE := Ubiquiti Bullet M2HP + SUPPORTED_DEVICES += bullet-m2hp +endef +TARGET_DEVICES += ubnt_bullet-m2hp + define Device/ubnt_rocket-m $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti Rocket-M