From patchwork Sun Sep 13 13:32:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Schmutzler X-Patchwork-Id: 1363089 X-Patchwork-Delegate: freifunk@adrianschmutzler.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=adrianschmutzler.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=CIXBDUpi; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bq9TR6FMdz9sRf for ; Sun, 13 Sep 2020 23:34:51 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject: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=PR4NQtYOsCEbCOU951U0DWT4TugWrnxmAHxjldTdngc=; b=CIXBDUpiNRv2fPFmdcE2n0uA4k QBL+btVkw/Efx9nUJK/UpJaP8+2jjvUuIaNPvuSYs8aGrAmRyK09o57gPW7D85adzSeMqewnt4Ehg rj42qpqc2R7VpS33RPTMqODDT3SmkH0iOGj6BjZHVMmsp/LwfxnGfMmVQccp2Yn3rnF0kJb+UD/uN WfDTXe4+MPOJ8uoYozZ1bw3STlMfsB2nP1Y6Dtoqguir1x6IoFOxXzdxegxV3kT1TIBwUwti2x56j 6G3WQker1U7eTYveDiQzsHbE29ZvsH/KUEsrlzHI87D6zWRGc/r+iLx/Vie1qs3DhJV295eHzJEPB E3x/Ki6A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHS81-00088r-UP; Sun, 13 Sep 2020 13:33:13 +0000 Received: from mout.kundenserver.de ([212.227.126.187]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHS7z-00088W-A5 for openwrt-devel@lists.openwrt.org; Sun, 13 Sep 2020 13:33:12 +0000 Received: from buildfff.adridolf.com ([188.192.134.246]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mg6mM-1kiVPb0YwA-00hcwd for ; Sun, 13 Sep 2020 15:33:05 +0200 From: Adrian Schmutzler To: openwrt-devel@lists.openwrt.org Subject: [PATCH] ath79: use common device definition for Buffalo devices Date: Sun, 13 Sep 2020 15:32:16 +0200 Message-Id: <20200913133216.46088-1-freifunk@adrianschmutzler.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:BqYvVD9a58wXmXGoWE1dcdc0LNXHoe2bN/zHjoLRwluHYGOOKfB 4k7vv+xWId4S4rmM2iwntPcFRkzRX8ZuQhoXstOqVOseRM+0hphvhuxpGJu4i9yfc9OTuGn 0onPlQWikVWJ9dehHyEF0/KOFBdwFT/eHaJd/0ZDO4LneQVpudzMs9hC9YDD1mfxjVTh8iq SRFBU8GkfgWjlPaDlI1sA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:TwMuokBJ0lI=:DXrC6R2p2f3UGHe5cOwaHX q96PvjYM3wY06RI4NWQC97kghNE+HZeR4LUGP1wEQyCVQJzUUa/UWaLsm806lrh373FF1YO5w LNKKBgD8cOnokjUVkXLef++8ZhaR1duEt6CxTRnXcONYzaodfHpD73KueXAnXd686ZSSlnJbQ 9pSX/gSxpWfLsL5o1AhI6gHVMz2QYKXVx8bMGUx9okxBm+/CqxNmMNORjQvNx5kc0dCtDMLrN vsOJ4Pw/CHmVuXkaAUROWirjEYC+wF021r/WClY0yW0K2N0Do5q3O5wWO38RCVhsEeHOSF1Cc ASouf3fB9o1BepxnpWEikLLJCBIVHZ8zA5kBpxbIb/stqEZB6gcFpnpJu22bVSZC8H4Z0Cgn2 x9yE9jbhpTl+78qUxzszO9SP72jipaOtASKwHa+gbOz/MUTF0XGhg+qIj/S5WYnFiQ5Ur9Lbe AfhUeR1tEmISPaE2z/FyTLOcDepEFz3PTMSF69JlojZOiljhOyoLESpmf0urZjYVk0WMDZayI 6Ioi3fNLlwRf6mzMPLKYNI63QyZrTY5GmJ260VCISzeS9mJaeKnLx1w9vpF2Dt/gO7ZCJdfRT sKhav5oEEP35ENXSRXAwlW5glAG0nfHKoyWim0NHVldkD9cDet04CGCEvs/w1TLmj0bmto6mB NKs2Lw1dTeVrrjrBC3JsX9snPu6Fj7U18kT6aAEIF1oAbY4eD146mczRzq8p0o8JcFGC+d0iQ AZ3eDB+SE3U2P/T/Em0xBJX9djlHLipRPxPJX7i8g59Tnoy+w3OI9H6sUnJPKGH1RtwaMFzMI Vkq80jMa37Dyw07rgzh4Z6HlaiQKzvQbIrxmTr7VDPqBGcoNYwBeeFnik+oiVj6yHmMUPNZNq VClAp73FTDEFbiMPkveg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200913_093311_600104_2A6D464C X-CRM114-Status: GOOD ( 10.57 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 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 https://www.dnswl.org/, no trust [212.227.126.187 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.126.187 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The Buffalo devices in ath79 share their image generation code, so let's create a shared Device definition for them. Since most of them use BUFFALO_HWVER := 3, this is moved as default to the shared definition as well. Signed-off-by: Adrian Schmutzler --- target/linux/ath79/image/common-buffalo.mk | 15 +++++++++ target/linux/ath79/image/generic.mk | 39 ++++++---------------- target/linux/ath79/image/tiny.mk | 9 ++--- 3 files changed, 27 insertions(+), 36 deletions(-) diff --git a/target/linux/ath79/image/common-buffalo.mk b/target/linux/ath79/image/common-buffalo.mk index d62b7eea94..31936b8234 100644 --- a/target/linux/ath79/image/common-buffalo.mk +++ b/target/linux/ath79/image/common-buffalo.mk @@ -1,3 +1,5 @@ +DEVICE_VARS += BUFFALO_PRODUCT BUFFALO_HWVER + define Build/buffalo-tag $(eval product=$(word 1,$(1))) $(eval hwver=$(word 2,$(1))) @@ -17,3 +19,16 @@ define Build/buffalo-tftp-header ) > $@.new mv $@.new $@ endef + + +define Device/buffalo_common + DEVICE_VENDOR := Buffalo + BUFFALO_PRODUCT := + BUFFALO_HWVER := 3 + IMAGES += factory.bin tftp.bin + IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ + pad-rootfs | check-size + IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc $$$$(BUFFALO_PRODUCT) 1.99 | \ + buffalo-tag $$$$(BUFFALO_PRODUCT) $$$$(BUFFALO_HWVER) + IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header +endef diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 7a00bae287..4b6cdaa826 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -315,17 +315,12 @@ endef TARGET_DEVICES += avm_fritzdvbc define Device/buffalo_bhr-4grv + $(Device/buffalo_common) SOC := ar7242 - DEVICE_VENDOR := Buffalo DEVICE_MODEL := BHR-4GRV + BUFFALO_PRODUCT := BHR-4GRV DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport IMAGE_SIZE := 32256k - IMAGES += factory.bin tftp.bin - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ - pad-rootfs | check-size - IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc BHR-4GRV 1.99 | \ - buffalo-tag BHR-4GRV 3 - IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header SUPPORTED_DEVICES += wzr-hp-g450h endef TARGET_DEVICES += buffalo_bhr-4grv @@ -339,51 +334,37 @@ endef TARGET_DEVICES += buffalo_bhr-4grv2 define Device/buffalo_wzr-hp-ag300h + $(Device/buffalo_common) SOC := ar7161 - DEVICE_VENDOR := Buffalo DEVICE_MODEL := WZR-HP-AG300H - IMAGE_SIZE := 32320k - IMAGES += factory.bin tftp.bin - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ - pad-rootfs | check-size - IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-AG300H 1.99 | \ - buffalo-tag WZR-HP-AG300H 3 - IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header + BUFFALO_PRODUCT := WZR-HP-AG300H DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ kmod-leds-reset kmod-owl-loader + IMAGE_SIZE := 32320k SUPPORTED_DEVICES += wzr-hp-ag300h endef TARGET_DEVICES += buffalo_wzr-hp-ag300h define Device/buffalo_wzr-hp-g302h-a1a0 + $(Device/buffalo_common) SOC := ar7242 - DEVICE_VENDOR := Buffalo DEVICE_MODEL := WZR-HP-G302H DEVICE_VARIANT := A1A0 + BUFFALO_PRODUCT := WZR-HP-G302H + BUFFALO_HWVER := 4 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport IMAGE_SIZE := 32128k - IMAGES += factory.bin tftp.bin - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ - pad-rootfs | check-size - IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-G302H 1.99 | \ - buffalo-tag WZR-HP-G302H 4 - IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header SUPPORTED_DEVICES += wzr-hp-g300nh2 endef TARGET_DEVICES += buffalo_wzr-hp-g302h-a1a0 define Device/buffalo_wzr-hp-g450h + $(Device/buffalo_common) SOC := ar7242 - DEVICE_VENDOR := Buffalo DEVICE_MODEL := WZR-HP-G450H/WZR-450HP + BUFFALO_PRODUCT := WZR-HP-G450H DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport IMAGE_SIZE := 32256k - IMAGES += factory.bin tftp.bin - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ - pad-rootfs | check-size - IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-G450H 1.99 | \ - buffalo-tag WZR-HP-G450H 3 - IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header SUPPORTED_DEVICES += wzr-hp-g450h endef TARGET_DEVICES += buffalo_wzr-hp-g450h diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk index 9f4f89bd9a..83c34d718b 100644 --- a/target/linux/ath79/image/tiny.mk +++ b/target/linux/ath79/image/tiny.mk @@ -1,16 +1,11 @@ include ./common-buffalo.mk define Device/buffalo_whr-g301n + $(Device/buffalo_common) SOC := ar7240 - DEVICE_VENDOR := Buffalo DEVICE_MODEL := WHR-G301N + BUFFALO_PRODUCT := WHR-G301N IMAGE_SIZE := 3712k - IMAGES += factory.bin tftp.bin - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ - pad-rootfs | check-size - IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WHR-G301N 1.99 | \ - buffalo-tag WHR-G301N 3 - IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header SUPPORTED_DEVICES += whr-g301n DEFAULT := n endef