From patchwork Wed May 30 13:18:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Maclean X-Patchwork-Id: 922809 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=monkeh.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IyYjVA+t"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="jZNTQOtW"; 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 40wryg4mPXz9s34 for ; Wed, 30 May 2018 23:28:43 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject: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:In-Reply-To:References: List-Owner; bh=OtrmmzvfostUaLeMNaQ7Z2vu2NesC7PUhiRoRYrGLyM=; b=IyYjVA+t/VQqr8 exwZSVF5r+DD8yG3P13KMIZ/YoXxGNzlMWzB9PCSHlccCyuTHIQRfC4s7QF/ZGQFRtvoAqk+Q9moQ lLvE1wdc+tTKYxajCCSOosrxJfcq6nlWNkt/fOYVzTARDRUu8nN+47XD/Ak7U/GyL4CocBa21gS6S 8y81kuXba1AglhCxcHq4+dqAfakleqnzdfis57V5fGNa5Bdz0SQX8QcXccUrYcJUIM9x3OvwgR4tJ nLGhbEmSxT2SGcC1rzlb3eusXPD+EBBgtA7TluHf2qVZHlHdgGpdgaWZ9lWwRgYD/d2N0bv2qbUGI otkSj9986vYKhkIyC7/Q==; 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 1fO19V-0008EE-6x; Wed, 30 May 2018 13:28:33 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fO19T-00089h-3d for openwrt-devel@bombadil.infradead.org; Wed, 30 May 2018 13:28:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: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=BMVKKeJpxOn84Rkm+ZDALuiv2qDpINeptI1muj4Jry0=; b=jZNTQOtW2bsWPXKwwu6hHnzLCS ovd9l1MHp8ezuVQZiPjI4rL6VI5sV4ffEnISqAphO+y1amV9G8Ib22c8JEVjGO5ZNHDshEX/cJjbF hgGtQMyizrMo6qQ8ehvGvWKAY4MewzqV0DYfe2m9cob6u19godk1Xw/KzidaS3LJe5JetcWO/oKB8 4nMmt7KSNv8sJ6Q3Ade0KIg33ifDjVaVXv6pJdW7wzOdbTNaJvMY0hNJPcn8ovz+83fa6tWMk2s8F Nq9OXMlpgXYZhH37/shilmCRtY5YTBzFFpRpwgAemSjwDDVvYvnWYKKLxXG7JxI9D8xAcLyOT1aAz JZXFbmdg==; Received: from monkeh.net ([88.97.98.50] helo=mail.monkeh.net) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fO137-0006Ze-4K for openwrt-devel@lists.openwrt.org; Wed, 30 May 2018 13:21:59 +0000 Received: from terra.home.monkeh.net (unknown [172.16.0.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: monkeh@monkeh.net) by mail.monkeh.net (Postfix) with ESMTPSA id 573F4309DEB for ; Wed, 30 May 2018 13:19:29 +0000 (UTC) From: Alex Maclean To: openwrt-devel@lists.openwrt.org Date: Wed, 30 May 2018 14:18:50 +0100 Message-Id: <20180530131854.9365-1-monkeh@monkeh.net> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180530_142157_209602_1F469C45 X-CRM114-Status: GOOD ( 15.66 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record Subject: [OpenWrt-Devel] [PATCH v2 1/5] ath79: add tiny subtarget 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: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Alex Maclean --- target/linux/ath79/Makefile | 2 +- target/linux/ath79/image/Makefile | 3 + target/linux/ath79/image/common-tp-link.mk | 84 +++++++++++++++++++ target/linux/ath79/image/generic-tp-link.mk | 79 +---------------- target/linux/ath79/image/tiny-tp-link.mk | 2 + target/linux/ath79/tiny/config-default | 14 ++++ .../linux/ath79/tiny/profiles/00-default.mk | 9 ++ target/linux/ath79/tiny/target.mk | 6 ++ 8 files changed, 120 insertions(+), 79 deletions(-) create mode 100644 target/linux/ath79/image/common-tp-link.mk create mode 100644 target/linux/ath79/image/tiny-tp-link.mk create mode 100644 target/linux/ath79/tiny/config-default create mode 100644 target/linux/ath79/tiny/profiles/00-default.mk create mode 100644 target/linux/ath79/tiny/target.mk diff --git a/target/linux/ath79/Makefile b/target/linux/ath79/Makefile index e331cb4210..6add24a72a 100644 --- a/target/linux/ath79/Makefile +++ b/target/linux/ath79/Makefile @@ -4,7 +4,7 @@ ARCH:=mips BOARD:=ath79 BOARDNAME:=Atheros ATH79 (DTS) CPU_TYPE:=24kc -SUBTARGETS:=generic +SUBTARGETS:=generic tiny FEATURES:=ramdisk source-only diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile index 792548657e..cd136b23b9 100644 --- a/target/linux/ath79/image/Makefile +++ b/target/linux/ath79/image/Makefile @@ -70,4 +70,7 @@ include ./generic.mk include ./generic-tp-link.mk include ./generic-ubnt.mk endif +ifeq ($(SUBTARGET),tiny) +include ./tiny-tp-link.mk +endif $(eval $(call BuildImage)) diff --git a/target/linux/ath79/image/common-tp-link.mk b/target/linux/ath79/image/common-tp-link.mk new file mode 100644 index 0000000000..1dd5a289f2 --- /dev/null +++ b/target/linux/ath79/image/common-tp-link.mk @@ -0,0 +1,84 @@ +DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_BOARD_NAME + +define rootfs_align +$(patsubst %-256k,0x40000,$(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs%,0x4,$(patsubst root.%,%,$(1)))))) +endef + +# combine kernel and rootfs into one image +# mktplinkfw +# is "sysupgrade" or "factory" +# +# -a align the rootfs start on an bytes boundary +# -j add jffs2 end-of-filesystem markers +# -s strip padding from end of the image +# -X reserve bytes in the firmware image (hexval prefixed with 0x) +define Build/mktplinkfw + -$(STAGING_DIR_HOST)/bin/mktplinkfw \ + -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) \ + -m $(TPLINK_HEADER_VERSION) \ + -k $(IMAGE_KERNEL) \ + -r $@ \ + -o $@.new \ + -j -X 0x40000 \ + -a $(call rootfs_align,$(FILESYSTEM)) \ + $(wordlist 2,$(words $(1)),$(1)) \ + $(if $(findstring sysupgrade,$(word 1,$(1))),-s) && mv $@.new $@ || rm -f $@ +endef + +# mktplinkfw-combined +# +# -c combined image +define Build/mktplinkfw-combined + $(STAGING_DIR_HOST)/bin/mktplinkfw \ + -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) $(1) \ + -m $(TPLINK_HEADER_VERSION) \ + -k $@ \ + -o $@.new \ + -s -S \ + -c + @mv $@.new $@ +endef + +define Device/tplink + TPLINK_HWREV := 0x1 + TPLINK_HEADER_VERSION := 1 + LOADER_TYPE := gz + KERNEL := kernel-bin | append-dtb | lzma + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | tplink-v1-header + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade | append-metadata + IMAGE/factory.bin := append-rootfs | mktplinkfw factory +endef + +define Device/tplink-nolzma + $(Device/tplink) + LOADER_FLASH_OFFS := 0x22000 + COMPILE := loader-$(1).gz + COMPILE/loader-$(1).gz := loader-okli-compile + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) + KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | tplink-v1-header +endef + +define Device/tplink-4m + $(Device/tplink-nolzma) + TPLINK_FLASHLAYOUT := 4M + IMAGE_SIZE := 3904k +endef + +define Device/tplink-4mlzma + $(Device/tplink) + TPLINK_FLASHLAYOUT := 4Mlzma + IMAGE_SIZE := 3904k +endef + +define Device/tplink-8m + $(Device/tplink-nolzma) + TPLINK_FLASHLAYOUT := 8M + IMAGE_SIZE := 7936k +endef + +define Device/tplink-8mlzma +$(Device/tplink) + TPLINK_FLASHLAYOUT := 8Mlzma + IMAGE_SIZE := 7936k +endef diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 8a0388a7ff..0b4659abea 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -1,82 +1,5 @@ -DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_BOARD_NAME +include ./common-tp-link.mk -define rootfs_align -$(patsubst %-256k,0x40000,$(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs%,0x4,$(patsubst root.%,%,$(1)))))) -endef - -# combine kernel and rootfs into one image -# mktplinkfw -# is "sysupgrade" or "factory" -# -# -a align the rootfs start on an bytes boundary -# -j add jffs2 end-of-filesystem markers -# -s strip padding from end of the image -# -X reserve bytes in the firmware image (hexval prefixed with 0x) -define Build/mktplinkfw - -$(STAGING_DIR_HOST)/bin/mktplinkfw \ - -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) \ - -m $(TPLINK_HEADER_VERSION) \ - -k $(IMAGE_KERNEL) \ - -r $@ \ - -o $@.new \ - -j -X 0x40000 \ - -a $(call rootfs_align,$(FILESYSTEM)) \ - $(wordlist 2,$(words $(1)),$(1)) \ - $(if $(findstring sysupgrade,$(word 1,$(1))),-s) && mv $@.new $@ || rm -f $@ -endef - -# mktplinkfw-combined -# -# -c combined image -define Build/mktplinkfw-combined - $(STAGING_DIR_HOST)/bin/mktplinkfw \ - -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) $(1) \ - -m $(TPLINK_HEADER_VERSION) \ - -k $@ \ - -o $@.new \ - -s -S \ - -c - @mv $@.new $@ -endef - - -define Device/tplink - TPLINK_HWREV := 0x1 - TPLINK_HEADER_VERSION := 1 - LOADER_TYPE := gz - KERNEL := kernel-bin | append-dtb | lzma - KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | tplink-v1-header - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade | append-metadata - IMAGE/factory.bin := append-rootfs | mktplinkfw factory -endef - -define Device/tplink-nolzma - $(Device/tplink) - LOADER_FLASH_OFFS := 0x22000 - COMPILE := loader-$(1).gz - COMPILE/loader-$(1).gz := loader-okli-compile - KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) - KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | tplink-v1-header -endef - -define Device/tplink-4m - $(Device/tplink-nolzma) - TPLINK_FLASHLAYOUT := 4M - IMAGE_SIZE := 3904k -endef - -define Device/tplink-8m - $(Device/tplink-nolzma) - TPLINK_FLASHLAYOUT := 8M - IMAGE_SIZE := 7936k -endef - -define Device/tplink-8mlzma -$(Device/tplink) - TPLINK_FLASHLAYOUT := 8Mlzma - IMAGE_SIZE := 7936k -endef define Device/tl-wr1043nd-v1 $(Device/tplink-8m) diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk new file mode 100644 index 0000000000..cb5a67f5d8 --- /dev/null +++ b/target/linux/ath79/image/tiny-tp-link.mk @@ -0,0 +1,2 @@ +include ./common-tp-link.mk + diff --git a/target/linux/ath79/tiny/config-default b/target/linux/ath79/tiny/config-default new file mode 100644 index 0000000000..01af54446d --- /dev/null +++ b/target/linux/ath79/tiny/config-default @@ -0,0 +1,14 @@ +CONFIG_BLK_MQ_PCI=y +CONFIG_LEDS_RESET=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PCI=y +CONFIG_PCI_AR71XX=y +CONFIG_PCI_AR724X=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y +CONFIG_PCI_DOMAINS=y +CONFIG_PHY_AR7100_USB=y +CONFIG_PHY_AR7200_USB=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y diff --git a/target/linux/ath79/tiny/profiles/00-default.mk b/target/linux/ath79/tiny/profiles/00-default.mk new file mode 100644 index 0000000000..aa8e1195f8 --- /dev/null +++ b/target/linux/ath79/tiny/profiles/00-default.mk @@ -0,0 +1,9 @@ +define Profile/Default + NAME:=Default Profile (all drivers) + PRIORITY := 1 +endef + +define Profile/Default/Description + Default package set compatible with most boards. +endef +$(eval $(call Profile,Default)) diff --git a/target/linux/ath79/tiny/target.mk b/target/linux/ath79/tiny/target.mk new file mode 100644 index 0000000000..87af3ef2bf --- /dev/null +++ b/target/linux/ath79/tiny/target.mk @@ -0,0 +1,6 @@ +BOARDNAME:=Devices with small flash +FEATURES += squashfs small_flash + +define Target/Description + Build firmware images for Atheros AR71xx/AR913x/AR934x based boards with small flash +endef From patchwork Wed May 30 13:18:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Maclean X-Patchwork-Id: 922820 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=monkeh.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="g0sbPaiY"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="DBsAdoVd"; 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 40wsL1189dz9rvt for ; Wed, 30 May 2018 23:45:29 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject: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=6ji8YkkleErqmvJK9BLSSXovZ6JsZXUT91OE5FdHg9I=; b=g0sbPaiYo9LtfQwhecTw5ey67p LSc5tdvloVUX1W7wqRNOcpqWCLVyeF2r2MSaoE3NWwMtKQTtCGFzhhOx32TFPX2NtXoxtC7eDnEEV 4Jo2K7IgIxDwJwntmld12n/iCzYGvghSln743no6KXUBuAbd2s+OTm6Nn6eJtu6JHKkbaeKCHannm nD4/91Luun77nKqRuzjTJwHPT2z0qx+UveBoVLhQSI+8ilcLYrz0Vrh8R//kBBjB1jyqN1yCWOsH4 HJuB3dHEbW3L9imGbXT0LNhG1wrV58A73jVqWyidTaydGnsCS2xNYBwCudNfZ+xQ/QxMEDFGGSouE Yph3fnjA==; 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 1fO1Pe-0001X3-SU; Wed, 30 May 2018 13:45:14 +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 1fO1Nm-00009F-8e for openwrt-devel@bombadil.infradead.org; Wed, 30 May 2018 13:43:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:To:From:Sender:Reply-To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=p7of9MgAdtwUvIO9wefX52nTddC8OUGJaAmWUDX3lXo=; b=DBsAdoVdS1jsBr5V14C88vXOo P6IraU5t2iybfGxQJcBbOX3CpYKsRxrIOAczP1K/xFh0aExdynnj0Q2UkupR9I74h875JiefWMAbJ spD2qHzOdysg+rXNy/FLV6Dp+l0VE+ei1/sy4QaIRdSvcE+HR0fOrJ+ZH7btUDMLda3tTCHjpPB/L MaOLl442oXuPh/AKBQDO4ESWS5sAdQP0815btQ9Iq5kE0Y5gdYibatFcwAVgf1Xzx1BuLz5jrGqF5 ctA6qdCAMtasRkWue/jbyaXFG8ch94bRPEk6q/V8hNQFGD/AhHAF0TuWFJI0kdYVCIbwrvIPWIU7f jkTKMdcyA==; Received: from monkeh.net ([88.97.98.50] helo=mail.monkeh.net) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fO112-0003dZ-US for openwrt-devel@lists.openwrt.org; Wed, 30 May 2018 13:19:49 +0000 Received: from terra.home.monkeh.net (unknown [172.16.0.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: monkeh@monkeh.net) by mail.monkeh.net (Postfix) with ESMTPSA id BFD58309DEC for ; Wed, 30 May 2018 13:19:29 +0000 (UTC) From: Alex Maclean To: openwrt-devel@lists.openwrt.org Date: Wed, 30 May 2018 14:18:51 +0100 Message-Id: <20180530131854.9365-2-monkeh@monkeh.net> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180530131854.9365-1-monkeh@monkeh.net> References: <20180530131854.9365-1-monkeh@monkeh.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180530_091949_092984_72872A96 X-CRM114-Status: GOOD ( 10.70 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record Subject: [OpenWrt-Devel] [PATCH v2 2/5] ath79: add AR7240 dtsi 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: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Alex Maclean --- target/linux/ath79/dts/ar7240.dtsi | 66 ++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 target/linux/ath79/dts/ar7240.dtsi diff --git a/target/linux/ath79/dts/ar7240.dtsi b/target/linux/ath79/dts/ar7240.dtsi new file mode 100644 index 0000000000..6805d1a786 --- /dev/null +++ b/target/linux/ath79/dts/ar7240.dtsi @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar724x.dtsi" + +/ { + usb_phy: usb-phy { + compatible = "qca,ar7200-usb-phy"; + + reset-names = "usb-phy", "usb-ohci-dll"; + resets = <&rst 4>, <&rst 3>; + + #phy-cells = <0>; + + status = "disabled"; + }; +}; + +&ahb { + usb: usb@1b000000 { + compatible = "generic-ohci"; + reg = <0x1b000000 0x1000>; + + interrupts = <3>; + + resets = <&rst 5>; + reset-names = "usb-host"; + + phy-names = "usb-phy"; + phys = <&usb_phy>; + + status = "disabled"; + }; +}; + +&mdio0 { + builtin-switch; +}; + +ð0 { + compatible = "qca,ar7240-eth", "syscon"; + + pll-data = <0x00110000 0x00001099 0x00991099>; + + resets = <&rst 8>, <&rst 9>; + reset-names = "phy", "mac"; +}; + +&mdio1 { + builtin-switch; +}; + +ð1 { + compatible = "qca,ar7240-eth", "syscon"; + + pll-data = <0x00110000 0x00001099 0x00991099>; + + resets = <&rst 12>, <&rst 13>; + reset-names = "phy", "mac"; + + phy-mode = "gmii"; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; From patchwork Wed May 30 13:18:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Maclean X-Patchwork-Id: 922802 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=monkeh.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FtD5QGyK"; 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 40wrpZ0j6mz9s23 for ; Wed, 30 May 2018 23:21:41 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject: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=nkvTJ67oeA//BsaBBVU8RASHBySkiJ4V0Wz94Cv6UXw=; b=FtD5QGyK6P5X+XCh2jwo77TK4F MgsTOhMQMQFuKr2mSdvPTCfLnhz+mfKDDVm8sxcoPes8LZLRD+Wt1VNhpwmbiY9w0nwyi8u/ray+C fFQaYcrqT8Q/DiaeWV3JnfVRDAlLrEXfF+48hnG72iEURzMbk3XjvgoowZBfiKKb8DdnKJYCR9Rcf /Uz3/62N/sWhiDuLwi/JwQicEsMgIhs5PgGSXkHbJEgSQ6iDNzRYokCFd3/igaqAibRR6I/ajpven gEMmH5SRuK2jAwrg9Q49UKM4Jnrjuqvw6kXEyqypeu/SVHVNQY2cUp8mnxBJs+2/xhsWuT5xfG0Pf oHnZMoUA==; 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 1fO12f-0004wA-0K; Wed, 30 May 2018 13:21:29 +0000 Received: from monkeh.net ([88.97.98.50] helo=mail.monkeh.net) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fO10x-0002bg-3I for openwrt-devel@lists.openwrt.org; Wed, 30 May 2018 13:21:01 +0000 Received: from terra.home.monkeh.net (unknown [172.16.0.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: monkeh@monkeh.net) by mail.monkeh.net (Postfix) with ESMTPSA id DE0A2309DED for ; Wed, 30 May 2018 13:19:29 +0000 (UTC) From: Alex Maclean To: openwrt-devel@lists.openwrt.org Date: Wed, 30 May 2018 14:18:52 +0100 Message-Id: <20180530131854.9365-3-monkeh@monkeh.net> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180530131854.9365-1-monkeh@monkeh.net> References: <20180530131854.9365-1-monkeh@monkeh.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180530_061943_320549_D48DC1D2 X-CRM114-Status: UNSURE ( 7.93 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record Subject: [OpenWrt-Devel] [PATCH v2 3/5] ath79: add pinmux node to ar724x.dtsi 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: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Alex Maclean --- target/linux/ath79/dts/ar724x.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/target/linux/ath79/dts/ar724x.dtsi b/target/linux/ath79/dts/ar724x.dtsi index fe1b4eb681..b2844bf179 100644 --- a/target/linux/ath79/dts/ar724x.dtsi +++ b/target/linux/ath79/dts/ar724x.dtsi @@ -64,6 +64,21 @@ #interrupt-cells = <2>; }; + pinmux: pinmux@18040028 { + compatible = "pinctrl-single"; + + reg = <0x18040028 0x8>; + + pinctrl-single,bit-per-mux; + pinctrl-single,register-width = <32>; + pinctrl-single,function-mask = <0x1>; + #pinctrl-cells = <2>; + + jtag_disable_pins: pinmux_jtag_disable_pins { + pinctrl-single,bits = <0x0 0x1 0x1>; + }; + }; + pll: pll-controller@18050000 { compatible = "qca,ar7240-pll", "syscon"; reg = <0x18050000 0x3c>; From patchwork Wed May 30 13:18:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Maclean X-Patchwork-Id: 922804 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=monkeh.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jH3o+Ryp"; 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 40wrq86fbCz9s1d for ; Wed, 30 May 2018 23:22:12 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject: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=qPX/y3dkIjd6r8qoyG+p8N4bzmp3QneOLGiUABIFwkI=; b=jH3o+Ryp0gsca+MuwMHJZO2Sle K+Uwl9e8r7+xgHXXrdV8EFR0bJgj1+vmcpGSSYmRqdQMGJHuWQLvlno2OwJL1SUHTQjxgo4u3EYBx 4MBK2FE5IAS+GW6d6PrleEFMh17Tuv8wdxDkM4Fkcd3vNsUufJ1adLLVjngYBceb2y9lWz3dk8Cvt 4kkJWhXqbUfg1UHmz50IgmqbkxogAjhZW4xAFe2ctg3xGse4GtRLoVDyw97FIYBzL5ZCIXGb/TDzV BhiYXdlXUnRuyDeXDiU/ydb6UJ3OkrV0h/+msw3OXF9lEn1R5wSJbaBgLHMjLXZ2uBQdhGGxEKTMz +EGBhePQ==; 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 1fO135-0005Ap-TI; Wed, 30 May 2018 13:21:55 +0000 Received: from monkeh.net ([88.97.98.50] helo=mail.monkeh.net) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fO10x-0002bf-3I for openwrt-devel@lists.openwrt.org; Wed, 30 May 2018 13:21:20 +0000 Received: from terra.home.monkeh.net (unknown [172.16.0.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: monkeh@monkeh.net) by mail.monkeh.net (Postfix) with ESMTPSA id EC596309DEE for ; Wed, 30 May 2018 13:19:29 +0000 (UTC) From: Alex Maclean To: openwrt-devel@lists.openwrt.org Date: Wed, 30 May 2018 14:18:53 +0100 Message-Id: <20180530131854.9365-4-monkeh@monkeh.net> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180530131854.9365-1-monkeh@monkeh.net> References: <20180530131854.9365-1-monkeh@monkeh.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180530_061943_439696_53F1F0A9 X-CRM114-Status: GOOD ( 12.45 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record Subject: [OpenWrt-Devel] [PATCH v2 4/5] ath79: add TP-Link TL-WR740N/ND v2 port 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: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Alex Maclean --- .../ath79/base-files/etc/board.d/01_leds | 7 + .../ath79/base-files/etc/board.d/02_network | 6 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 1 + .../linux/ath79/dts/ar7240_tl-wr740n-v2.dts | 174 ++++++++++++++++++ target/linux/ath79/image/tiny-tp-link.mk | 9 + 5 files changed, 197 insertions(+) create mode 100644 target/linux/ath79/dts/ar7240_tl-wr740n-v2.dts 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 70d27bc29b..76b0257919 100755 --- a/target/linux/ath79/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/base-files/etc/board.d/01_leds @@ -21,6 +21,13 @@ case "$board" in "glinet,ar150") ucidef_set_led_wlan "wlan" "WLAN" "gl-ar150:orange:wlan" "phy0tpt" ;; +"tplink,tl-wr740n-v2") + ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" + ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x02" + ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x04" + ucidef_set_led_switch "lan3" "LAN3" "$boardname:green:lan3" "switch0" "0x08" + ucidef_set_led_switch "lan4" "LAN4" "$boardname:green:lan4" "switch0" "0x10" + ;; "tplink,tl-wr1043nd-v1") ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1" ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" 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 12176c1877..cc4498ffc5 100755 --- a/target/linux/ath79/base-files/etc/board.d/02_network +++ b/target/linux/ath79/base-files/etc/board.d/02_network @@ -19,6 +19,12 @@ ath79_setup_interfaces() "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" ;; + "tplink,tl-wr740n-v2") + ucidef_set_interfaces_lan_wan "eth1.1" "eth0" + ucidef_add_switch "switch0" \ + "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" + ;; + "tplink,tl-wr1043nd-v1") ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0" diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index c09dca11d7..498cc4e6cb 100644 --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -54,6 +54,7 @@ case "$FIRMWARE" in "tplink,tl-wdr4300") ath9k_eeprom_extract "art" 20480 1088 ;; + "tplink,tl-wr740n-v2"|\ "ubnt,unifi") ath9k_eeprom_extract "art" 4096 2048 ;; diff --git a/target/linux/ath79/dts/ar7240_tl-wr740n-v2.dts b/target/linux/ath79/dts/ar7240_tl-wr740n-v2.dts new file mode 100644 index 0000000000..f86cb50d47 --- /dev/null +++ b/target/linux/ath79/dts/ar7240_tl-wr740n-v2.dts @@ -0,0 +1,174 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar7240.dtsi" + +/ { + compatible = "tplink,tl-wr740n-v2", "qca,ar7240"; + model = "TP-Link TL-WR740N v2"; + + aliases { + led-status = &led_system; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x2000000>; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&switch_led_pins>; + + led_system: system { + label = "tl-wr740n-v2:green:system"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "tl-wr740n-v2:green:lan1"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "tl-wr740n-v2:green:lan2"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "tl-wr740n-v2:green:lan3"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "tl-wr740n-v2:green:lan4"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "tl-wr740n-v2:green:wan"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "tl-wr740n-v2:green:wlan"; + gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; + default-state = "off"; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "tl-wr740n-v2:green:wps"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + reg = <0x0 0x20000>; + label = "u-boot"; + read-only; + }; + + firmware: partition@20000 { + reg = <0x20000 0x3d0000>; + label = "firmware"; + }; + + art: partition@3f0000 { + reg = <0x3f0000 0x10000>; + label = "art"; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy4>; + + mtd-mac-address = <&uboot 0x1fc00>; + mtd-mac-address-increment = <(-1)>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&uboot 0x1fc00>; + mtd-mac-address-increment = <1>; +}; + +&mdio0 { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <4>; + phy-mode = "mii"; + }; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@168c,002b { + compatible = "pci168c,002b"; + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + mtd-mac-address = <&uboot 0x1fc00>; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&pinmux { + switch_led_pins: pinmux_switch_led_pins { + pinctrl-single,bits = <0x0 0x0 0xf8>; + }; +}; + +&uart { + status = "okay"; +}; diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk index cb5a67f5d8..09180bd678 100644 --- a/target/linux/ath79/image/tiny-tp-link.mk +++ b/target/linux/ath79/image/tiny-tp-link.mk @@ -1,2 +1,11 @@ include ./common-tp-link.mk + +define Device/tl-wr740n-v2 + $(Device/tplink-4m) + ATH_SOC := ar7240 + DEVICE_TITLE := TP-Link TL-WR740N/ND v2 + TPLINK_HWID := 0x07400001 + SUPPORTED_DEVICES := tplink,tl-wr740n-v2 tl-wr740n-v2 +endef +TARGET_DEVICES += tl-wr740n-v2 From patchwork Wed May 30 13:18:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Maclean X-Patchwork-Id: 922819 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=monkeh.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RkpvVdaK"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="nL0VtRG1"; 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 40wsKL3hz7z9rvt for ; Wed, 30 May 2018 23:44:54 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject: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=noYPxJdl4MbdH6gkx7O5AnUTJ4TD1bE/MplhKlFj7RQ=; b=RkpvVdaKvcy2WLtOsJWiQpyJn+ Bp5+P5VbV/XJE3ScDYTbtb8mXMclbrFPjw1und5XkDwqfmgXSD6N+55CTKA4TXuECqTGh7rENQ/JG 0+mmyOKL870AdJe2/lE5CpdQwbrdS/pLgsul8VZVPXjH/FGHepIlX6jYuaT3fZQbOQovPGNqmPM2t Aa2YRdbTQLeblAdFkOxZ9Yq3+4Q9CC1hhGOcBKt4xoToV7qxP6yZUR+6zcP64tlYZwGj0uOxgvCNI TYq7uuGoAQvLSE1nqjmGey33rvN4yIppkgKV65ZeT0+igTNAb//PffCiVwMgX4ZX4QOnoj1RaNvId Uo4U73oA==; 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 1fO1P8-0000v4-CX; Wed, 30 May 2018 13:44:42 +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 1fO1Nk-00009F-MW for openwrt-devel@bombadil.infradead.org; Wed, 30 May 2018 13:43:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:To:From:Sender:Reply-To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hS5qwBvFiTUkJIqLnYpgkEfja96eLc5zxnqXXhT/6dA=; b=nL0VtRG1URvg3h4sH16QNWn70 6onkyylUZJSn6Yu4HHnhIFBphtHBci2IYbUnSQUfTR5LpYsItaEyROnqeDdJVE3v7YmMoAb6jfPBn 4/OWOYRq3lQ9jnWQzipdM0Aq50MT9r1r1CIefQAVMGpDqDkxANIgOW05WabDMcIzuOaMpuw5RULGV 50EGXN/LnnhLUKARl5SyHwSitgGlaxPoncMtD/bxA1PzLzBh7pe4hrFkDmrPvYozqgRVDbEo5/c22 k4atzWjw3CYuoM4Ec/cVIc3HYhPhcRr6foWYhFILRq0Yg8LKohXToP0A/X01rPq7tK9pTDuUnlICK cFNe72ivQ==; Received: from monkeh.net ([88.97.98.50] helo=mail.monkeh.net) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fO112-0003da-U5 for openwrt-devel@lists.openwrt.org; Wed, 30 May 2018 13:19:49 +0000 Received: from terra.home.monkeh.net (unknown [172.16.0.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: monkeh@monkeh.net) by mail.monkeh.net (Postfix) with ESMTPSA id 14C63309DEF for ; Wed, 30 May 2018 13:19:30 +0000 (UTC) From: Alex Maclean To: openwrt-devel@lists.openwrt.org Date: Wed, 30 May 2018 14:18:54 +0100 Message-Id: <20180530131854.9365-5-monkeh@monkeh.net> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180530131854.9365-1-monkeh@monkeh.net> References: <20180530131854.9365-1-monkeh@monkeh.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180530_091949_179979_7FB9969E X-CRM114-Status: GOOD ( 12.85 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record Subject: [OpenWrt-Devel] [PATCH v2 5/5] ath79: add TP-Link TL-WR703N port 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: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Alex Maclean --- .../ath79/base-files/etc/board.d/02_network | 1 + target/linux/ath79/dts/ar9331_tl-wr703n.dts | 139 ++++++++++++++++++ target/linux/ath79/image/tiny-tp-link.mk | 10 ++ 3 files changed, 150 insertions(+) create mode 100644 target/linux/ath79/dts/ar9331_tl-wr703n.dts 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 cc4498ffc5..0d0ddb3987 100755 --- a/target/linux/ath79/base-files/etc/board.d/02_network +++ b/target/linux/ath79/base-files/etc/board.d/02_network @@ -9,6 +9,7 @@ ath79_setup_interfaces() case "$board" in "avm,fritz300e"|\ + "tplink,tl-wr703n"|\ "ubnt,unifi") ucidef_set_interface_lan "eth0" ;; diff --git a/target/linux/ath79/dts/ar9331_tl-wr703n.dts b/target/linux/ath79/dts/ar9331_tl-wr703n.dts new file mode 100644 index 0000000000..70f94ed4cb --- /dev/null +++ b/target/linux/ath79/dts/ar9331_tl-wr703n.dts @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9331.dtsi" + +/ { + compatible = "tplink,tl-wr703n", "qca,ar9331"; + model = "TP-Link TL-WR703N"; + + aliases { + serial0 = &uart; + led-status = &led_system; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x2000000>; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led_system: system { + label = "tl-wr703n:blue:system"; + gpios = <&gpio 27 GPIO_ACTIVE_LOW>; + }; + }; + + reg_usb_vbus: reg_usb_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio 8 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + reg = <0x0 0x20000>; + label = "u-boot"; + read-only; + }; + + firmware: partition@20000 { + reg = <0x20000 0x3d0000>; + label = "firmware"; + }; + + art: partition@3f0000 { + reg = <0x3f0000 0x10000>; + label = "art"; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy4>; + + mtd-mac-address = <&uboot 0x1fc00>; + + gmac-config { + device = <&gmac>; + + switch-phy-addr-swap = <0>; + switch-phy-swap = <0>; + }; +}; + +&gpio { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <4>; + phy-mode = "mii"; + }; +}; + +&uart { + status = "okay"; +}; + +&usb { + dr_mode = "host"; + vbus-supply = <®_usb_vbus>; + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&wmac { + status = "okay"; + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&uboot 0x1fc00>; +}; diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk index 09180bd678..e6d5feefc5 100644 --- a/target/linux/ath79/image/tiny-tp-link.mk +++ b/target/linux/ath79/image/tiny-tp-link.mk @@ -1,6 +1,16 @@ include ./common-tp-link.mk +define Device/tl-wr703n + $(Device/tplink-4mlzma) + ATH_SOC := ar9331 + DEVICE_TITLE := TP-Link TL-WR703N + DEVICE_PACKAGES := kmod-usb-chipidea2 + TPLINK_HWID := 0x07030101 + SUPPORTED_DEVICES := tplink,tl-wr703n tl-wr703n +endef +TARGET_DEVICES += tl-wr703n + define Device/tl-wr740n-v2 $(Device/tplink-4m) ATH_SOC := ar7240