From patchwork Wed Oct 17 20:37:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 985502 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b2j+iype"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dCK0SYxl"; 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 42b3ts1YBKz9s2P for ; Thu, 18 Oct 2018 07:39:17 +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: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=DHWZc8oV9WtoHQQlFVVrNSljGcXjSm9Rox+84MGkU8Y=; b=b2j+iypeexvd9x u4cIGj+fqKVlFFj5vbhbMd0RYdVi/FtGhNByhvWwDBKJaBoPODxM4P+K6gzaqvVGohwmTSQ/1AK8/ djlpAhT5fEOx06/3urMaWaEcffgLEBAYWO4vJhNbqIt2W76ac0px+c576fWkBVGJSWsTpW3SIkHrD 3bBjFttcI93DEQgG7rMV25RwdSc3o7lOg2lP05Fse2DCQIVipXQDa+onKOZidhPloeeAT15G1V+T5 Bzc+TbCrisct3z0eov9E5cx1usXlefOFPaFP7y8r3KJ7aVmI2rlmKMN3Mjroq/B30wY1hOJdqcUL0 pkZf1PeOF9HHJXeRk91g==; 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 1gCsaw-00042y-Ms; Wed, 17 Oct 2018 20:39:06 +0000 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCsZm-0003Vl-B5 for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 20:37:59 +0000 Received: by mail-ed1-x542.google.com with SMTP id d15-v6so26170181edq.6 for ; Wed, 17 Oct 2018 13:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Sy0wPWHBaK64579ZDrkR03+TW39WC9ygvGWdiakC+y4=; b=dCK0SYxlGuedMfOgmhiitzPfQ3E/nMWfPPWxnxhW0m9k/7+oBYDKZ7kp4/rc1maAAK HlUqH/1xs91rC9b6XvARulkWtchdmnzv0Fyo+0R2N6bUEDSzlnhKrqV/X3522F4bBeeT CiwWm/UZ15UDS58muLd6xTw+oiyKvClz7073t79tzovAuRuDXHQZWggGwCSSzHhQ1Xw4 goKCytP2QhExY9Km8YIXm1vRb0nERoLn+GsgqPpAUN2DylSpJpaICU38N3QeD7jNI9ND pmns1W/LzIHZy50+7Ty5ztbB4xb1ktisSguJFBL1szCtmKFyQNTYfUwFDOjO0vCucPow 5SDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Sy0wPWHBaK64579ZDrkR03+TW39WC9ygvGWdiakC+y4=; b=QIUxTDYXkYDOQErvU6PbficG3aZKfWJccwgbb15MhosrIRKQy0EVbJZmNoaocKR9hV fGjKuaxlamtUK9kCCRjCi6hDCSKcS1nsk0jPgMCldWWMTEISoqC1RMeOeugTmhIY3hmR OwjrMTM+lhfYUwO2rREfKnr0+iEJT1v7KBDPChSVsMANiAe0tUEIxqu63pQhUwPVis2s anzEdGR/DudB5mHrsHylwjklmypo7m5fPnYNR7RfEg4Qq6VzgjsWCpLkEwYRKrBlEmiT msKR2t7mXXjpoyr1GPTVuETvWKPMiFM5leJKap5vCcD8NL1jCAAPKVlV2FroiYD/9UwN lE7g== X-Gm-Message-State: ABuFfohtGdBlNhkeQZJomoSYWZEV9Ur3LcdxC4N+InCtI1a5DON3rRUM SV5Emrm/ujzjfw153Tym4DEOcfFqrmY= X-Google-Smtp-Source: ACcGV62R/6jtqUV/6FuBLsKlLMaazhjMhvLR5odX/ieEoigJleBE3Sbr1y8kTsuwYFJ54eMAKfB5eA== X-Received: by 2002:a50:afa2:: with SMTP id h31-v6mr1607192edd.169.1539808662118; Wed, 17 Oct 2018 13:37:42 -0700 (PDT) Received: from debian64.daheim (p200300D5FBC22EFCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbc2:2efc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id m25-v6sm6869850edc.86.2018.10.17.13.37.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Oct 2018 13:37:40 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1gCsZX-0007Hf-F8 for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 22:37:39 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Date: Wed, 17 Oct 2018 22:37:32 +0200 Message-Id: <7a4efe10a840f555fe162d5bf44809a7bbc23f11.1539808453.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181017_133754_395753_5310D7FB X-CRM114-Status: GOOD ( 10.58 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH v1 1/8] apm821xx: add uboot-envtools support 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org All apm821xx devices use u-boot and most of them have an accessible u-boot environment. This patch adds the necessary template file, but does not add the uboot-envtools package to any of the targets. Signed-off-by: Christian Lamparter --- package/boot/uboot-envtools/files/apm821xx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 package/boot/uboot-envtools/files/apm821xx diff --git a/package/boot/uboot-envtools/files/apm821xx b/package/boot/uboot-envtools/files/apm821xx new file mode 100644 index 0000000000..3cedd8bc2d --- /dev/null +++ b/package/boot/uboot-envtools/files/apm821xx @@ -0,0 +1,18 @@ +#!/bin/sh + +[ -e /etc/config/ubootenv ] && exit 0 + +touch /etc/config/ubootenv + +. /lib/uboot-envtools.sh +. /lib/functions.sh + +board=$(board_name) + +case "$board" in +esac + +config_load ubootenv +config_foreach ubootenv_add_app_config ubootenv + +exit 0 From patchwork Wed Oct 17 20:37:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 985504 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QSqws1JV"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Z9TjvwYM"; 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 42b3wR4Kspz9s2P for ; Thu, 18 Oct 2018 07:40:39 +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: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=lmKVo+ivoLa/2lhqv1RInAnUoHDia44yuuXyC8ACbGE=; b=QSqws1JVzpxso/GZ89IVFaESQs a/kBFds7naW8UZuwdDWpsSQF+E4AH2uwCjK64UkExuRejnBR0pcDJ3rCtTfzSYrOqS/8XVXOfpPa0 OXvqWKX/aHDlDjxlkbuX/zhZ3Gnkm+sQVbNgW+lZSm8Mxpy/xq5d8EBS1XMFYKqtyiicxtER1n/p1 orVpDTrnNCFv02YzBITHeEhaKCPvcaATphLj7QsEeSUap1A5OLFUN4UdQegsSENb8EKkIXXmQtgXF NSuF88Lz8+isrJyg67SW4gGInuujpA1NFr9Ev8tBMiSBinhg8xQBknXs2C2dS08bzZp8wODbSQyum UrvtmeDw==; 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 1gCscH-0005NX-LI; Wed, 17 Oct 2018 20:40:29 +0000 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCsZm-0003VE-B7 for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 20:37:59 +0000 Received: by mail-ed1-x542.google.com with SMTP id r1-v6so26183236edd.7 for ; Wed, 17 Oct 2018 13:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=3kn+HbJETHRaGu2xKvwG7Ofj+sS3wde717eNsN/HAZk=; b=Z9TjvwYMSpUe9I+KONOG5CPUsuK71O7WroeHn4DEWoClcRBbwwOqY/VCqESDDIGrht 3dU/MLp68m5otg7LXuBiKsNLNI17CP3e4kLtMbUJwYU4Uj4VeOrXUtr4eTIwQ3zjNh+T PWq5A/UARvkcIzEMgyNS4i9oUSsNqmALCXXEF7ZTGjC8w4P0QU0YAE0fGc7I/YsSY1xs LQJg5g3z/NhlXdTCD9guKlbkTKYB9D02M6wAkmaImo6581YTfzDMBN07BlL+se9GvJR+ wZ31CzFiOGcCHmTD9prCKefIiNPpkBaJzsTmxYOLaJypeEMWA9C+CQ9s3MVrx4l1S9oc 9Vpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3kn+HbJETHRaGu2xKvwG7Ofj+sS3wde717eNsN/HAZk=; b=VsmmjIkTHd2bf0r4DV9MwdMVpZD3zSjRPEjSDPvrFIoTN0p4q+dsfeBgI/GYKCsH05 KQEzl4LgBOLYxjky+RALEXaKt8NTG0TWT1pm3O0PQcNg4VttcHk8oETnuTxdAzDYWw/X pYmvv3N2KG3YMs8dtjR0wq3W3fZExg9Iq5VS0li2Q2JWMrFVcR6jZfrs3hYwwXzlaXdv STwrDCm3pM/3ja2BoDG45lp+57M2vvHp6HxHmiiZB5+Td0eCFXHecbYUO7Qu/CM1arz4 1LbdX/KptWWwbzftdSZuNBa9tF+1jsK6Mc0BghZqFAxBMZaNFlljH2NPnQNer/GG9JZe gFHA== X-Gm-Message-State: ABuFfog11i6QonU3vHgTRtgPQuFrgSswU9E/MFJhvXxtQGB7g59kREUy I7rbGUHHgA5/m7CdxDCyIn4nivqKL5I= X-Google-Smtp-Source: ACcGV60yboQ7H4aKbotEWh6wDZjl4UuJlsYzWP0Wjc19rDJq2eqvVsEawke0LZESS4YdFcBOUfLgGg== X-Received: by 2002:a17:906:3792:: with SMTP id n18-v6mr27739002ejc.179.1539808661747; Wed, 17 Oct 2018 13:37:41 -0700 (PDT) Received: from debian64.daheim (p200300D5FBC22EFCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbc2:2efc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id l34-v6sm6928695eda.54.2018.10.17.13.37.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Oct 2018 13:37:40 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1gCsZX-0007Hi-G5 for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 22:37:39 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Date: Wed, 17 Oct 2018 22:37:33 +0200 Message-Id: X-Mailer: git-send-email 2.19.1 In-Reply-To: <7a4efe10a840f555fe162d5bf44809a7bbc23f11.1539808453.git.chunkeey@gmail.com> References: <7a4efe10a840f555fe162d5bf44809a7bbc23f11.1539808453.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181017_133754_412625_0A421DED X-CRM114-Status: GOOD ( 12.21 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH v1 2/8] apm821xx: MR24: add to uboot-envtools 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This patch adds the complicated u-boot environment access settings for to the MR24 target. Signed-off-by: Christian Lamparter --- package/boot/uboot-envtools/files/apm821xx | 4 ++++ target/linux/apm821xx/dts/meraki-mr24.dts | 25 +++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/package/boot/uboot-envtools/files/apm821xx b/package/boot/uboot-envtools/files/apm821xx index 3cedd8bc2d..94c0d8944a 100644 --- a/package/boot/uboot-envtools/files/apm821xx +++ b/package/boot/uboot-envtools/files/apm821xx @@ -10,6 +10,10 @@ touch /etc/config/ubootenv board=$(board_name) case "$board" in +meraki,mr24) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" "4" + ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x4000" "4" + ;; esac config_load ubootenv diff --git a/target/linux/apm821xx/dts/meraki-mr24.dts b/target/linux/apm821xx/dts/meraki-mr24.dts index fc879fe8c1..3b05d9c24e 100644 --- a/target/linux/apm821xx/dts/meraki-mr24.dts +++ b/target/linux/apm821xx/dts/meraki-mr24.dts @@ -55,7 +55,30 @@ partition@0 { label = "u-boot"; - reg = <0x00000000 0x00170000>; + reg = <0x00000000 0x00150000>; + read-only; + }; + + partition@150000 { + /* + * The u-boot environment size is one NAND + * block (16KiB). u-boot allocates four NAND + * blocks (64KiB) in order to have spares + * around for bad block management + */ + label = "u-boot-env"; + reg = <0x00150000 0x00010000>; + read-only; + }; + + partition@160000 { + /* + * redundant u-boot environment. + * has to be kept it in sync with the + * data in "u-boot-env". + */ + label = "u-boot-env-redundant"; + reg = <0x00160000 0x00010000>; read-only; }; From patchwork Wed Oct 17 20:37:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 985500 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GfowNLkM"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WqZWaNQF"; 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 42b3sn4Gxcz9s2P for ; Thu, 18 Oct 2018 07:38:21 +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: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=ttLZzWpZRRs00tpfAA5eIxQI9tkmxG4kRrAoi/fS6Iw=; b=GfowNLkMI1gvYDdDGpyMFPuDdU nrMT7oqEO2hr0tb1YTfH5L1Y5rZUtMMQzYkd6qI2Y2M4WC+HUMP4Kv8o/CeKf+3SKt/Yp1re+Mpqe wI9c07Hu9bA/rrw+K7cYRgqPf69k1bH9M98o3wiOT+WdpWEAJwr+4RQOIAD/0ZO8IlnkUVHm6hIo8 +zQuGyf8Qc19BtG/tqb0P8/Rip65CvgnFTAZD2LdxqihjlFGn9HI5DcDvfvrxK+fgPvLSIZ5UIf7Q 5fOIJ4owK2lOLQfDO4ZQKB/nTRIH/duADjr5gDfSMj4Sk/MM6MeMQDR/VMWOlIi0+Yz0m6HOpbSeW dqsxLXGg==; 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 1gCsZs-0003Zk-Ne; Wed, 17 Oct 2018 20:38:00 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCsZm-0003Ts-4B for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 20:37:56 +0000 Received: by mail-ed1-x541.google.com with SMTP id x31-v6so26159935edd.8 for ; Wed, 17 Oct 2018 13:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=U6J0VgcSaHtJwhsOPtcdLGDbqjjD2Z4zB1ECHxAywas=; b=WqZWaNQFI6b3e7e1WkgfY85NsHqE8dmMO05W4V07u+zhhCJ7Wy3eHb4KYn5vKkgc4A O2pwvlnQ9U/ba69Kg+xwQn8g8QKSZ9ba+XkFcLjYGPspq/iYKup5CLB9KYOO2FYCOtaz zryU3pcLAlQpdHVuFuf+jAPr8AX9og6ZdthnvctVWUFh9mx4j1iNNBKGgXCVW9EPiQnB KI4RMYLpgMzLxQUTQFM/MQdD6ZHMwz5i8WGbe0ukRK0dEj+S1bybhckuQRGjVeBqIr1e RKh3UhZPH7J2wYZH9JzxfeI5RUfMA09kZthsGDI6uMVZ957YrRuQHVSWVbCUN4NBuG8F J70Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U6J0VgcSaHtJwhsOPtcdLGDbqjjD2Z4zB1ECHxAywas=; b=drEd4nnNKzOisuaMR7QIJDAHadDL5ChUw2n7u/9tR0hghYtQ5bl8JTUZwzlRd1ltBR PoOEaR9uW3ZZTiKXLNc1Z5jU7qS8NAt4XRrmytIEZdc3JHBxwdl1WJFGx2pvMivVLEbY Ry1kLnFE0BIZun4N3RpThxsm8fHLmq+8xBl5G2uDnKyCt6uyACf61dNhhNVr0ljkstNy yftR1+6E6hw6of7EDFoizCBXkeIMD/OkObfXEXsSU6y/ybItLjbV8CKqwlJ409qkuGyo 1z+8SajAvC3rbzy2mBwWuyO/+BByfXskr23gSgQcDtlunHgRfLym479KLVv/R6kCTFE9 +iww== X-Gm-Message-State: ABuFfogc+tcCXT2KLgtF2bUFPXH0oldcXCTvs7ynf5XKaXDRpZs4m40l s3KHQrOupN76JZcSRj/SGSXFXYmjGZA= X-Google-Smtp-Source: ACcGV62s/n/wGZ6WQv3hLcmdjOcy5FzNkbAWrgxsLvT0bB+Fgiakz539LZkCZ7/Bat6jVwz7CtjZHw== X-Received: by 2002:a50:8d86:: with SMTP id r6-v6mr1465479edh.125.1539808661412; Wed, 17 Oct 2018 13:37:41 -0700 (PDT) Received: from debian64.daheim (p200300D5FBC22EFCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbc2:2efc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id a27-v6sm7591384edc.46.2018.10.17.13.37.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Oct 2018 13:37:40 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1gCsZX-0007Hn-Gp for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 22:37:39 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Date: Wed, 17 Oct 2018 22:37:34 +0200 Message-Id: <5849270378a0870bb0896e378cc4cbd351d27fa8.1539808453.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: <7a4efe10a840f555fe162d5bf44809a7bbc23f11.1539808453.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181017_133754_250928_EF93E5C6 X-CRM114-Status: UNSURE ( 9.02 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:541 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH v1 3/8] apm821xx: MX60(W): enable u-boot environment 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This patch adds u-boot environment access to the MX60(W) target. "The environment size is one NAND block (128KiB on Buckminster). We allocate four NAND blocks to deal with bad blocks which may exist in the saved environment" Signed-off-by: Christian Lamparter --- package/boot/uboot-envtools/files/apm821xx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/boot/uboot-envtools/files/apm821xx b/package/boot/uboot-envtools/files/apm821xx index 94c0d8944a..bf61e972de 100644 --- a/package/boot/uboot-envtools/files/apm821xx +++ b/package/boot/uboot-envtools/files/apm821xx @@ -14,6 +14,9 @@ meraki,mr24) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" "4" ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x4000" "4" ;; +meraki,mx60) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "4" + ;; esac config_load ubootenv From patchwork Wed Oct 17 20:37:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 985506 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="e79ppEFm"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="swF37ue+"; 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 42b3xn4qRQz9s2P for ; Thu, 18 Oct 2018 07:41:49 +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: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=1YQ6qn/VSBQEUGmYUVaLKv9j8O1OfBZlo/Tcp24oOn4=; b=e79ppEFm143xFSO5tZgXmsuF30 Rymz0VWUwcWMJhrF6XmIVBPhjtLQ1N0+kUT2xK5CrL+b4tKhCgfK0NanfE4MJahGHy0Rm+mhbqWLo R9UYet/9qkFNgoVvNz5AYDF7jExqK7n7zizbdS5mKuk+jeqtORXG720vj/hfBASUJkLuJw4N5Ezhj nB+FROoDn9veSIKUcmKI/kasBSezo2S7kKmYKm4EdnXKkejBI/1a/M/kvLJaPYIMbOXWncphKxtUk IlSkwEE1LmruJtYKGDY7VQcX47wWHNUL09upq5Cr+rHnh2BD9CFYPO7IkgzEz5ARKJjaqgYYV0IyS +ura5kYg==; 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 1gCsdR-0006U2-AJ; Wed, 17 Oct 2018 20:41:41 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCsZm-0003X4-Sm for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 20:38:09 +0000 Received: by mail-ed1-x544.google.com with SMTP id c26-v6so26167723edt.3 for ; Wed, 17 Oct 2018 13:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ppFcgQWVyc56LyCd7qMKixuyfHBQ551X2RPRkFpKLEI=; b=swF37ue+nRTY++Mpc6/qVLD8aHXqI9v0ouyP1JzpFa5wWgPjkvjghvHcjZ9ctDEl4s az57B56+3oA8L8fGyISw/SG5Q3YEhGmFjUHL/+2r8hyegR//yT4DSUd0XJtZMcDkg01d KFAr1tCIi7l/B8Loj1kLp9fGkpmv90MBJMq8T4+KDPtfTvvnclPnHogISKzW/uCkvExw 6sdA29SPN3zWbxWMYAst2Gmu7jFoGuYD5gI5by3v40ejOV5cGdyJjRI+SibENKfetonQ /4iYHi+qG/2RKPLidbCwWoa3HSCR4MA7RUmDlRK/8xbv0cGmrgrBAtyJ71M7EjW7Nh34 wI+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ppFcgQWVyc56LyCd7qMKixuyfHBQ551X2RPRkFpKLEI=; b=NhuWZYFVuiOxu/mOPuh+JMxIGlEn/vgkQHa3dKJqceDQJQLthpwmBQfet/Di4eeT9A B2qywu2B7/2/anWfZ2L07kkLYNilUFkH06dF8FAj45MIcj9e0+tm790LeQIA+j8HYQDK N64JgAxDE0dMDuULeK9C0/pbzs4PiGkpY0EuJ3b0uBYajgR4khfBTQ8x5pS981u5XYrJ Pe9Wv/X/pf/RgvCQ0XPujW4yemjRJ9b1kUWy7RQ1jgAkCCeOM8maE0XmFqTov8GIl4O6 3Px6q4LB0DdEVRsvIVBUOFT7w7/fwBQrJIuJuEIZrTc8P8exWSzGgYzwXPc+SQJLIj0w FT3g== X-Gm-Message-State: ABuFfog4hzOc5/pPeiFDryxPcFxRoLdru9DtQ6eq8qv4RKYyMa6c/dvN BXyv6BF+aIidwf6LSfRdWzpZCeij7K8= X-Google-Smtp-Source: ACcGV61bDwyvtVe9jyZWkjQl7ATmrgsMWzjOHqiTnpeRkAxlGGNE93ECZpfc3y46g7yRw80+7g/wkw== X-Received: by 2002:a50:b246:: with SMTP id o64-v6mr1642309edd.80.1539808662552; Wed, 17 Oct 2018 13:37:42 -0700 (PDT) Received: from debian64.daheim (p200300D5FBC22EFCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbc2:2efc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id h17-v6sm8406298edh.77.2018.10.17.13.37.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Oct 2018 13:37:40 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1gCsZX-0007Hs-HM for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 22:37:39 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Date: Wed, 17 Oct 2018 22:37:35 +0200 Message-Id: <4e5a0d5bb56a918c59c48c27ea5a84c0b442fddb.1539808453.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <5849270378a0870bb0896e378cc4cbd351d27fa8.1539808453.git.chunkeey@gmail.com> References: <7a4efe10a840f555fe162d5bf44809a7bbc23f11.1539808453.git.chunkeey@gmail.com> <5849270378a0870bb0896e378cc4cbd351d27fa8.1539808453.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181017_133754_967825_EB5A1256 X-CRM114-Status: GOOD ( 16.11 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH v1 4/8] apm821xx: import gpio-export DT code from lantiq 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This will come in handy for the Netgear WNDAP620's antennae mux. Signed-off-by: Christian Lamparter --- .../140-GPIO-add-named-gpio-exports.patch | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 target/linux/apm821xx/patches-4.14/140-GPIO-add-named-gpio-exports.patch diff --git a/target/linux/apm821xx/patches-4.14/140-GPIO-add-named-gpio-exports.patch b/target/linux/apm821xx/patches-4.14/140-GPIO-add-named-gpio-exports.patch new file mode 100644 index 0000000000..95cdf8c5af --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/140-GPIO-add-named-gpio-exports.patch @@ -0,0 +1,169 @@ +From cc809a441d8f2924f785eb863dfa6aef47a25b0b Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Tue, 12 Aug 2014 20:49:27 +0200 +Subject: [PATCH 30/36] GPIO: add named gpio exports + +Signed-off-by: John Crispin +--- + drivers/gpio/gpiolib-of.c | 68 +++++++++++++++++++++++++++++++++++++++++ + drivers/gpio/gpiolib.c | 11 +++++-- + include/asm-generic/gpio.h | 5 +++ + include/linux/gpio/consumer.h | 8 +++++ + 4 files changed, 90 insertions(+), 2 deletions(-) + +--- a/drivers/gpio/gpiolib-of.c ++++ b/drivers/gpio/gpiolib-of.c +@@ -23,6 +23,8 @@ + #include + #include + #include ++#include ++#include + + #include "gpiolib.h" + +@@ -506,3 +508,72 @@ void of_gpiochip_remove(struct gpio_chip + gpiochip_remove_pin_ranges(chip); + of_node_put(chip->of_node); + } ++ ++#ifdef CONFIG_GPIO_SYSFS ++ ++static struct of_device_id gpio_export_ids[] = { ++ { .compatible = "gpio-export" }, ++ { /* sentinel */ } ++}; ++ ++static int of_gpio_export_probe(struct platform_device *pdev) ++{ ++ struct device_node *np = pdev->dev.of_node; ++ struct device_node *cnp; ++ u32 val; ++ int nb = 0; ++ ++ for_each_child_of_node(np, cnp) { ++ const char *name = NULL; ++ int gpio; ++ bool dmc; ++ int max_gpio = 1; ++ int i; ++ ++ of_property_read_string(cnp, "gpio-export,name", &name); ++ ++ if (!name) ++ max_gpio = of_gpio_count(cnp); ++ ++ for (i = 0; i < max_gpio; i++) { ++ unsigned flags = 0; ++ enum of_gpio_flags of_flags; ++ ++ gpio = of_get_gpio_flags(cnp, i, &of_flags); ++ if (!gpio_is_valid(gpio)) ++ return gpio; ++ ++ if (of_flags == OF_GPIO_ACTIVE_LOW) ++ flags |= GPIOF_ACTIVE_LOW; ++ ++ if (!of_property_read_u32(cnp, "gpio-export,output", &val)) ++ flags |= val ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW; ++ else ++ flags |= GPIOF_IN; ++ ++ if (devm_gpio_request_one(&pdev->dev, gpio, flags, name ? name : of_node_full_name(np))) ++ continue; ++ ++ dmc = of_property_read_bool(cnp, "gpio-export,direction_may_change"); ++ gpio_export_with_name(gpio, dmc, name); ++ nb++; ++ } ++ } ++ ++ dev_info(&pdev->dev, "%d gpio(s) exported\n", nb); ++ ++ return 0; ++} ++ ++static struct platform_driver gpio_export_driver = { ++ .driver = { ++ .name = "gpio-export", ++ .owner = THIS_MODULE, ++ .of_match_table = of_match_ptr(gpio_export_ids), ++ }, ++ .probe = of_gpio_export_probe, ++}; ++ ++module_platform_driver(gpio_export_driver); ++ ++#endif +--- a/include/asm-generic/gpio.h ++++ b/include/asm-generic/gpio.h +@@ -127,6 +127,12 @@ static inline int gpio_export(unsigned g + return gpiod_export(gpio_to_desc(gpio), direction_may_change); + } + ++int __gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name); ++static inline int gpio_export_with_name(unsigned gpio, bool direction_may_change, const char *name) ++{ ++ return __gpiod_export(gpio_to_desc(gpio), direction_may_change, name); ++} ++ + static inline int gpio_export_link(struct device *dev, const char *name, + unsigned gpio) + { +--- a/include/linux/gpio/consumer.h ++++ b/include/linux/gpio/consumer.h +@@ -451,6 +451,7 @@ struct gpio_desc *devm_fwnode_get_gpiod_ + + #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS) + ++int _gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name); + int gpiod_export(struct gpio_desc *desc, bool direction_may_change); + int gpiod_export_link(struct device *dev, const char *name, + struct gpio_desc *desc); +@@ -458,6 +459,13 @@ void gpiod_unexport(struct gpio_desc *de + + #else /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */ + ++static inline int _gpiod_export(struct gpio_desc *desc, ++ bool direction_may_change, ++ const char *name) ++{ ++ return -ENOSYS; ++} ++ + static inline int gpiod_export(struct gpio_desc *desc, + bool direction_may_change) + { +--- a/drivers/gpio/gpiolib-sysfs.c ++++ b/drivers/gpio/gpiolib-sysfs.c +@@ -553,7 +553,7 @@ static struct class gpio_class = { + * + * Returns zero on success, else an error. + */ +-int gpiod_export(struct gpio_desc *desc, bool direction_may_change) ++int __gpiod_export(struct gpio_desc *desc, bool direction_may_change, const char *name) + { + struct gpio_chip *chip; + struct gpio_device *gdev; +@@ -615,6 +615,8 @@ int gpiod_export(struct gpio_desc *desc, + offset = gpio_chip_hwgpio(desc); + if (chip->names && chip->names[offset]) + ioname = chip->names[offset]; ++ if (name) ++ ioname = name; + + dev = device_create_with_groups(&gpio_class, &gdev->dev, + MKDEV(0, 0), data, gpio_groups, +@@ -636,6 +638,12 @@ err_unlock: + gpiod_dbg(desc, "%s: status %d\n", __func__, status); + return status; + } ++EXPORT_SYMBOL_GPL(__gpiod_export); ++ ++int gpiod_export(struct gpio_desc *desc, bool direction_may_change) ++{ ++ return __gpiod_export(desc, direction_may_change, NULL); ++} + EXPORT_SYMBOL_GPL(gpiod_export); + + static int match_export(struct device *dev, const void *desc) From patchwork Wed Oct 17 20:37:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 985501 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DLxV6Qvt"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZP+aRJ1y"; 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 42b3t72hPxz9s2P for ; Thu, 18 Oct 2018 07:38:39 +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: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=B955DYGNE3RDsL0x8mPGyeRf57+g0RhK6VV/lI92ug8=; b=DLxV6Qvt7Z13CHNlsUQnyLYQu+ d8rJSXUEexLZ9vC7f5u0UNSmt1CRcvWDpGAuVzSAxwkq5GVM5puS3EM3LUeum5dT6dQj9H4CfS1F6 qXQyChlELl47GzmLOWQX/Yfv4tK+QDRcabA39O49hIbCu4pSV7vEdRY+6IZWRM123wBQkRlpDR0ew HT1mv5Jt4MOBWfZA40lsX95FcnHz++KjD1njaWIMJLveHFiFb9avDPnoc0ShpFWDpnxa0n1KTso62 ZcHi9i3g36qNmxBUfh8c+C5UhZSC1VmvpgOHBuQ/TVbuUlcKCOeLhcg2/FbWbfMoWg9fJDhQfcOFz nDnv6ZLw==; 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 1gCsaN-0003lu-13; Wed, 17 Oct 2018 20:38:31 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCsZm-0003X5-42 for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 20:37:56 +0000 Received: by mail-ed1-x541.google.com with SMTP id b7-v6so26143759edd.9 for ; Wed, 17 Oct 2018 13:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=0sR9yrib1jtrLaRWmj/trNdu4Cs1SsgRQUFBwSC/jJY=; b=ZP+aRJ1yQtjq8mN1ncFNcwrO3gEYbfdVsgoSJuMgM3admy48pb2lJzm2LBDEi8Fhuw JpbASJO36qoVGcSuTE1G/iK9sz16ww1SRLyhd4+5UYmTgJxGK2zC7U4xAwUIGpO+mas1 fm3B6ZgZfaLfAJGtmhAJKUFD3CNrGfk/i2wQugxvJVQyexLdy274KeIfDcHOAdlfCB/E /4BYriyP5GZhNW/DNFmlgDEJQs2Khqy79cmBT/UPH66Yp0LsnELZlFSYPiVKJTAXrlZu rUjPPXkqUkrhqWdA2EraeptsL9lE3XAOsIoXEdOdmQJW/72Rej+VQ9huv9o2CjxAMcnc 5FmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0sR9yrib1jtrLaRWmj/trNdu4Cs1SsgRQUFBwSC/jJY=; b=AmToGvneDc4LaCYcvsZ/XdsnchrfSo9Kv5K9nIXhh3WvvA0h9pIVS64Eh3f/lY59ks 7zazn7+LQZNzrjYwhqM/0LgXR//yAQdSZQYXMhHZx7OdOMiGV/L87mHgrnWsqeJNxQPT nGvOlG/Tx8TZgLg7rf78f2Q21B3EgoPQIOdAWBoOpmUc4lNMqXBKLYg3Sn9uyLKhvl4c plIcxnDS5Lz1UrBZQ1IVxeZrIFUg5vkUG7Pcn8JsYuVo1JLKK3hzcOLZ15fQf7svWXVy FTH1py6jsTkTtDDrjz6qNSwXXDaTdY2s8yyYQfaWZiKiB2uJnvYZfROLbDKFyErsrsvT DaHA== X-Gm-Message-State: ABuFfojum/At2ldZi+gwdsbLRSE159RtB+c+qYwt1iLLCdzuITO+RwkX ihVPULSVjubG3lE+IMRSHB0ziV6/XBg= X-Google-Smtp-Source: ACcGV60LkAxGl78zXSAj2WwamfeacTHwYB1U2AbC90HceKnma2Tcp3fZTueD9XqkDh65KpEn9cI1Jw== X-Received: by 2002:a50:ec89:: with SMTP id e9-v6mr1585560edr.134.1539808663047; Wed, 17 Oct 2018 13:37:43 -0700 (PDT) Received: from debian64.daheim (p200300D5FBC22EFCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbc2:2efc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id br14-v6sm3927321ejb.17.2018.10.17.13.37.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Oct 2018 13:37:40 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1gCsZX-0007Hx-IC for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 22:37:39 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Date: Wed, 17 Oct 2018 22:37:36 +0200 Message-Id: <3d538df93d72e14bc48a7c817fbc7046e0f225b3.1539808453.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <4e5a0d5bb56a918c59c48c27ea5a84c0b442fddb.1539808453.git.chunkeey@gmail.com> References: <7a4efe10a840f555fe162d5bf44809a7bbc23f11.1539808453.git.chunkeey@gmail.com> <5849270378a0870bb0896e378cc4cbd351d27fa8.1539808453.git.chunkeey@gmail.com> <4e5a0d5bb56a918c59c48c27ea5a84c0b442fddb.1539808453.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181017_133754_264236_F5698189 X-CRM114-Status: GOOD ( 16.02 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:541 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH v1 5/8] generic: rtl836x: support defered probe on mdio-bus 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org On the WNDAP620, the mdio and mdc lines are controlled by the EMAC ethernet device. This results in a hen-vs-egg problem. The rtl8367b driver is probed before the ethernet driver and the mdio-bus is not available yet, which caused the rtl8367b driver to fail. This patch changes the rtl8366_smi_probe_of() function to return -EPROBE_DEFER if the mdio-bus lookup failed and changes rtl8366_smi_probe()'s signature to return the error code back to the callee, so it can propagate back to the kernel. Which, will retry the switch probe at a later time. Signed-off-by: Christian Lamparter --- .../generic/files/drivers/net/phy/rtl8366_smi.c | 14 +++++++++----- .../generic/files/drivers/net/phy/rtl8366rb.c | 4 ++-- .../linux/generic/files/drivers/net/phy/rtl8366s.c | 4 ++-- .../linux/generic/files/drivers/net/phy/rtl8367.c | 4 ++-- .../linux/generic/files/drivers/net/phy/rtl8367b.c | 4 ++-- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c index c0cb680e23..2c4d53fc67 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c @@ -1553,8 +1553,8 @@ int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi) smi->ext_mbus = of_mdio_find_bus(mdio_node); if (!smi->ext_mbus) { - dev_err(&pdev->dev, - "cannot find mdio bus from bus handle"); + dev_info(&pdev->dev, + "cannot find mdio bus from bus handle (yet)"); goto try_gpio; } @@ -1562,8 +1562,12 @@ int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi) try_gpio: if (!gpio_is_valid(sck) || !gpio_is_valid(sda)) { - dev_err(&pdev->dev, "gpios missing in devictree\n"); - return -EINVAL; + if (!mdio_node) { + dev_err(&pdev->dev, "gpios missing in devictree\n"); + return -EINVAL; + } else { + return -EPROBE_DEFER; + } } smi->gpio_sda = sda; @@ -1619,7 +1623,7 @@ struct rtl8366_smi *rtl8366_smi_probe(struct platform_device *pdev) free_smi: kfree(smi); - return NULL; + return ERR_PTR(err); } EXPORT_SYMBOL_GPL(rtl8366_smi_probe); diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c index dc394c02b6..0e0116051a 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c @@ -1445,8 +1445,8 @@ static int rtl8366rb_probe(struct platform_device *pdev) " version " RTL8366RB_DRIVER_VER"\n"); smi = rtl8366_smi_probe(pdev); - if (!smi) - return -ENODEV; + if (IS_ERR(smi)) + return PTR_ERR(smi); smi->clk_delay = 10; smi->cmd_read = 0xa9; diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366s.c b/target/linux/generic/files/drivers/net/phy/rtl8366s.c index 3f458f9dec..8c746778b8 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366s.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366s.c @@ -1233,8 +1233,8 @@ static int rtl8366s_probe(struct platform_device *pdev) " version " RTL8366S_DRIVER_VER"\n"); smi = rtl8366_smi_probe(pdev); - if (!smi) - return -ENODEV; + if (IS_ERR(smi)) + return PTR_ERR(smi); smi->clk_delay = 10; smi->cmd_read = 0xa9; diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367.c b/target/linux/generic/files/drivers/net/phy/rtl8367.c index 9549961d76..7f0569d038 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8367.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8367.c @@ -1752,8 +1752,8 @@ static int rtl8367_probe(struct platform_device *pdev) int err; smi = rtl8366_smi_probe(pdev); - if (!smi) - return -ENODEV; + if (IS_ERR(smi)) + return PTR_ERR(smi); smi->clk_delay = 1500; smi->cmd_read = 0xb9; diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367b.c b/target/linux/generic/files/drivers/net/phy/rtl8367b.c index e6ea6509ae..cd8de810b5 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8367b.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8367b.c @@ -1527,8 +1527,8 @@ static int rtl8367b_probe(struct platform_device *pdev) int err; smi = rtl8366_smi_probe(pdev); - if (!smi) - return -ENODEV; + if (IS_ERR(smi)) + return PTR_ERR(smi); smi->clk_delay = 1500; smi->cmd_read = 0xb9; From patchwork Wed Oct 17 20:37:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 985503 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kI7Ijsio"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VFzJDc8O"; 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 42b3vV2fMgz9s2P for ; Thu, 18 Oct 2018 07:39:50 +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: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=x7rzfrHM+UOJu33M5Sa+g/6bqK+Ocs/CAxDBHKwNZ7k=; b=kI7IjsioWKVkHLhKsKEPtUNEk4 uhJqJ8Ttl45eM13MMlGHrjpCCqjhMo2dtzBNQmbSgQPZifr7Vbp7rkP/GCjG/QC/Oj82ITW8YMqEx 9MS1ga7z/NrExvfuvLCM0EP0VZ+eGovAvLSTBQdi9DXcb67KMsqfhfEPltNn6khi7x6iCPro2RUpL YedGXOolwP54z0Zf6gTkoQq8d7Vw+0F7J7vcovUkWXz/+JCZBFhrBkYtGiWd3pmCI/wM4gHWivRKr 1kF/nBCt+Sk65mENptBFl2cPnjTjEEtBcpE9K788vDI7PCa9X9z7519LMWDkudHGX4nBMSZGcQKJx nlM1lpKw==; 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 1gCsbW-0004Ic-7j; Wed, 17 Oct 2018 20:39:42 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCsZm-0003X8-Sw for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 20:37:59 +0000 Received: by mail-ed1-x544.google.com with SMTP id b7-v6so26143837edd.9 for ; Wed, 17 Oct 2018 13:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Ila/ObNNcwZMzXz0zfZU2NiT2rFzjb3dYs5N12/yZhA=; b=VFzJDc8OgJZ5cw5BiSYWhCxR1fxqqC0SydReWDitUu5cURM5O0dG/18XevhQTNItJe V26rVQsRy6DOh13xEkLHpizOwaeHk9Fg73d5di5Vnc6O2GB1ol1bO1pLaqKPaMTThHoA WAV6N0e0mocGgNENhLJpAlQYKkcCZLoZohgHliDfDKvl1rdL1twVxG1Wny6pIr91jx+z jtLo9TuCorl/BobPDBCmqJRnRZg7UBbEtwFuW50B1+hHP54K4uODW7CEK/6v3zU7jB/n cFcc20cL0Xg9Lp9Sawab5q/M7xf4/kezEV/R86Cjjbn5e7BnwcG9v4mxuts4/cW54KJu gtxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ila/ObNNcwZMzXz0zfZU2NiT2rFzjb3dYs5N12/yZhA=; b=rhvPFW98h0qhBZv0kF20GYTdSB4/UCUm40xdSxCbtwcBvPFgvnv31r8klm8tJ2ka6j EjY5UkiCvj/cFMoQLgDIWfleoE5RE3c8nAiDn+SOkRT0PeWjR+v+1raPzF/+pO3zcew9 +sEIiPe9+Wd9bnClYNxiSx1AFtG1vgmW+wkQ+hfSsxAgHc9bt1VaayAyn6sFfkPaRTqI wkERlh6AWwcu8eeMr1NlE7GY8pW2/1QDSQbZw71mhxB8/+M/dC8rdxhbdFd9BY8sMlix mnNaiFNFLk6kMWrPKAXuxb7GWfIfsM5MoLMxVlIE9xRAWbklV9PpqOwd5ziQ0COEwUOc 3qOA== X-Gm-Message-State: ABuFfojVy1s9dHah+EVJbOyJlcDOz57OtS7ZQDznZp1UMBMGTze3rnpH l47q/jLIAuN+j6JufchmTqfbl+4g1vQ= X-Google-Smtp-Source: ACcGV61yCT1t8ZpPpV/N9yXKtEZraP3k1bD2UiD9sXF/DAj21X5X2IzoGGMUkNrwzxdwp6o7Mr5O8Q== X-Received: by 2002:a17:906:b857:: with SMTP id ga23-v6mr27948772ejb.222.1539808664468; Wed, 17 Oct 2018 13:37:44 -0700 (PDT) Received: from debian64.daheim (p200300D5FBC22EFCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbc2:2efc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id h15-v6sm8260690edk.62.2018.10.17.13.37.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Oct 2018 13:37:40 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1gCsZX-0007I2-Il for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 22:37:39 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Date: Wed, 17 Oct 2018 22:37:37 +0200 Message-Id: <7dd87d4514c20e96b4c578bd6574255912c00249.1539808453.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <3d538df93d72e14bc48a7c817fbc7046e0f225b3.1539808453.git.chunkeey@gmail.com> References: <7a4efe10a840f555fe162d5bf44809a7bbc23f11.1539808453.git.chunkeey@gmail.com> <5849270378a0870bb0896e378cc4cbd351d27fa8.1539808453.git.chunkeey@gmail.com> <4e5a0d5bb56a918c59c48c27ea5a84c0b442fddb.1539808453.git.chunkeey@gmail.com> <3d538df93d72e14bc48a7c817fbc7046e0f225b3.1539808453.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181017_133754_957842_4B20FBFF X-CRM114-Status: GOOD ( 11.68 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH v1 6/8] generic: rtl8367b: make it possible to specify cpu_port via DT 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This patch adds the feature to parse the existing cpu_port DT property, which is used to specify which port is the cpu port of the switch. Signed-off-by: Christian Lamparter --- target/linux/generic/files/drivers/net/phy/rtl8367b.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/rtl8367b.c b/target/linux/generic/files/drivers/net/phy/rtl8367b.c index cd8de810b5..be9f74f888 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8367b.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8367b.c @@ -1401,7 +1401,7 @@ static int rtl8367b_switch_init(struct rtl8366_smi *smi) int err; dev->name = "RTL8367B"; - dev->cpu_port = RTL8367B_CPU_PORT_NUM; + dev->cpu_port = smi->cpu_port; dev->ports = RTL8367B_NUM_PORTS; dev->vlans = RTL8367B_NUM_VIDS; dev->ops = &rtl8367b_sw_ops; @@ -1534,8 +1534,10 @@ static int rtl8367b_probe(struct platform_device *pdev) smi->cmd_read = 0xb9; smi->cmd_write = 0xb8; smi->ops = &rtl8367b_smi_ops; - smi->cpu_port = RTL8367B_CPU_PORT_NUM; smi->num_ports = RTL8367B_NUM_PORTS; + if (of_property_read_u32(pdev->dev.of_node, "cpu_port", &smi->cpu_port) + || smi->cpu_port >= smi->num_ports) + smi->cpu_port = RTL8367B_CPU_PORT_NUM; smi->num_vlan_mc = RTL8367B_NUM_VLANS; smi->mib_counters = rtl8367b_mib_counters; smi->num_mib_counters = ARRAY_SIZE(rtl8367b_mib_counters); From patchwork Wed Oct 17 20:37:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 985507 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hImuzVzU"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UE40Ds3S"; 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 42b3yM4w7cz9s2P for ; Thu, 18 Oct 2018 07:42:19 +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: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=uXxxsbXwaFovkRcbdLIAMl8iEv6OTYSC5kF6ZngDWBo=; b=hImuzVzUeQ7J3kmIF8wNALDsej xuLHlRsLsgGY963LYqySjAHQGFi/zKQtWltMzapLg45DG7TI6JovKchkzR3DcLZeAYlVpuy76gLVa 3WyT8AdhmnaYFBslOo60pIG7xKbmrSa7vk+zO9RTGJINQ2FZfvd+W2EqvQS/Cm4qyE5CwqMh/RvOE oG+Th2mH/dcj4j297IvWAe7h6eMxQducIgzLHLvYwnf+CQbhnjaarDa0UT+Yvy8zCd70Mxc7ljYvN Fp4dfMynKj2TJMjUNAbMFvb1mvD3TteZTSPjjCd5sEFPU4Vs7pLPIIa87MFfrNt4of9f9Hvd7o/Ct JZgIoqUw==; 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 1gCsdw-0006jf-8c; Wed, 17 Oct 2018 20:42:12 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCsZm-0003X7-46 for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 20:38:12 +0000 Received: by mail-ed1-x541.google.com with SMTP id y19-v6so26167776edd.2 for ; Wed, 17 Oct 2018 13:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=pRCoqY5un/+rqeEqlLsfGx5iZALdCXb18PbWfGhav7Y=; b=UE40Ds3StSafUHJFT7HoihZVzNONZXlkVBfVecsHHFmvuyq3kPBdPV4ha7R743/I7u L0Cmwq0Nkxw54L6V0YmxphTmEubfGYvVWCXgIvY4scT7fSoUC3YesUJrny5oTrwlShsU P0KnBOcSNVk+pQBpkesKJ9XfaJmcWvGurIvGwEKTtxHJ55zlVAyREiHVdNISK4g4z7OF 88ov11Ei2rawJTRFpDOenIj+2S+Kdpn5XR2H3QelFgC0Qr1zmmlvP8YMC/m5wmuUY8u5 F+kWuNIvOzCkzy6jCn2kT2Js8hSpxqtxSkOePuOxbQ5OnaNl2OlDwzdhvHR/Cd4tNLw6 ttLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pRCoqY5un/+rqeEqlLsfGx5iZALdCXb18PbWfGhav7Y=; b=tWQ/N5+KPYSHiqc6XrYx/XKJV38K4mb36H75HIi6PzqiCWM+6STOQVrtMyw++DW484 NmWu4wKitmhJEeDDfTIWXZlrRw03nJGX2D0BxHVwdaGtjZPqiys7h5pVxAoi3UYtITm3 c97G+wUp4p9Fy8FNd2gddT/HSmthvEFdE8YzVrDR8IvmFDSKMiiDqXGY6DW3S7XbhERX aR+LcMssiyA+eXrH2Lb6pkIAC3HK4V98MfG8rgffisARfnOI+/SYOzY7Ey76li7IboWv GGugS3vF/xv8L+T7Nqa+0wSCEx0rJ9elT+cGF8fVQPfFybbYGgO8BMYIwA9kpzd0Vx51 BnEQ== X-Gm-Message-State: ABuFfojdeelf+cquwJ01ZO4+pHJCZe2F1KAtEPi6Ahu0yARO4BoK4NqX sgqFo9lAu7lzh5jmR/J5dpm1aILHw6s= X-Google-Smtp-Source: ACcGV61bzXT4v5Qj94irnzKKP9A8oWUxJ5mf9P5mtCj/no1EKRRLzXddHfv8bHTd2Jtl2pkSSimKVw== X-Received: by 2002:a50:b905:: with SMTP id m5-v6mr1511884ede.108.1539808663811; Wed, 17 Oct 2018 13:37:43 -0700 (PDT) Received: from debian64.daheim (p200300D5FBC22EFCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbc2:2efc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id 31-v6sm6968126edr.12.2018.10.17.13.37.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Oct 2018 13:37:40 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1gCsZX-0007I7-Jq for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 22:37:39 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Date: Wed, 17 Oct 2018 22:37:38 +0200 Message-Id: X-Mailer: git-send-email 2.19.1 In-Reply-To: <7dd87d4514c20e96b4c578bd6574255912c00249.1539808453.git.chunkeey@gmail.com> References: <7a4efe10a840f555fe162d5bf44809a7bbc23f11.1539808453.git.chunkeey@gmail.com> <5849270378a0870bb0896e378cc4cbd351d27fa8.1539808453.git.chunkeey@gmail.com> <4e5a0d5bb56a918c59c48c27ea5a84c0b442fddb.1539808453.git.chunkeey@gmail.com> <3d538df93d72e14bc48a7c817fbc7046e0f225b3.1539808453.git.chunkeey@gmail.com> <7dd87d4514c20e96b4c578bd6574255912c00249.1539808453.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181017_133754_260277_C038EA85 X-CRM114-Status: GOOD ( 20.30 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:541 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH v1 7/8] apm821xx: add support for the Netgear WNDAP620 and WNDAP660 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This patch adds support for the Netgear WNDAP620 and WNDAP660, they are similar devices, but due to the LAN LED configuration, the switch setup and WIFI configuration each gets a different device target. Hardware Highlights WNDAP620: CPU: AMCC PowerPC APM82181 at 1000 MHz DRAM: 128 MB, 2 x 64 MiB DDR2 Hynix H5PS5162GF CPU: AMCC PowerPC APM82181 at 1000 MHz FLASH: 32 MiB, NAND SLC, Hynix HY27US08561A Ethernet: RealTek RTL8363SB 2x2-Port Switch PHY - Only 1 GBit Port (POE) Wifi: Atheros AR9380 minipcie - Dual-Band - 3x3:3 Serial: console port with RJ45 Interface (9600-N-8-1) LEDS: Power, LAN-Activity, dual color LAN-Linkspeed, 2.4GHz, 5GHz LEDs Button: Soft Reset Button Antennae: 3 internal dual-band antennae + 3 x RSMA for external antennaes Hardware Highlights WNDAP660: CPU: AMCC PowerPC APM82181 at 1000 MHz + 2 Heatsinks DRAM: 256 MB, 2 x 128 MiB DDR2 FLASH: 32 MiB, NAND SLC, Hynix HY27US08561A Ethernet: RealTek RTL8363SB 2x2-Port Switch PHY (POE) Wifi1: Atheros AR9380 minipcie - Dual-Band - 3x3:3 Wifi2: Atheros AR9380 minipcie - Dual-Band - 3x3:3 Serial: console port with RJ45 Interface (9600-N-8-1) LEDS: Power, LAN-Activity, 2x dual color LAN-Linkspeed, 2.4GHz, 5GHz LEDs Button: Soft Reset Button Antennae: 6 internal dual-band antennae + 3 x RSMA for external antennaes Flashing requirements: - needs a tftp server at 192.168.1.10/serverip. - special 8P8C(aka RJ45)<->D-SUB9 Console Cable ("Cisco Console Cable"). Note: Both WNDAP6x0 have a MAX3232 transceivers, hence no need for any separate CMOS/TTL level shifters. External Antenna: The antennae mux is controlled by GPIO 11 and GPIO14. Valid Configurations: = Config# = | = GPIO 11 = | = GPIO 14 = | ===== Description ===== 1. | 1 / High | 0 / Low | Use the internal antennae (default) 2. | 0 / Low | 1 / High | Use the external antennae The external antennaes are only meant for the 2.4 GHz band. One-way Flashing instructions via u-boot: 0. connect the serial cable to the RJ45 Console Port Note: This requires a poper RS232 and not a TTL/USB adaptor. 1. power up the AP and interrupt the u-boot process at 'Hit any key to stop autoboot' 2. setup serverip and ipaddr env settings Enter the following commands into the u-boot shell # setenv ipaddr 192.168.1.1 # setenv serverip 192.168.1.10 3. download the factory.img image to the AP Enter the following commands into the u-boot shell # tftp ${kernel_addr_r} openwrt-apm821xx-nand-netgear_wndap660-squashfs-factory.img 4. verfiy image integrity Enter the following commands into the u-boot shell # crc32 $fileaddr $filesize If the calculated crc32 checksum does not match, go back to step 3. 5. flash the image Enter the following commands into the u-boot shell # nand erase 0x110000 0x1bd0000 # nand write ${kernel_addr_r} 0x110000 ${filesize} 6. setup uboot environment Enter the following commands into the u-boot shell # setenv bootargs # setenv fileaddr # setenv filesize # setenv addroot 'setenv bootargs ${bootargs} root=/dev/ubiblock0_0' # setenv owrt_boot 'nboot ${kernel_addr_r} nand0 0x110000; run addroot; run addtty; bootm ${kernel_addr_r}' # setenv bootcmd 'run owrt_boot' # saveenv 7. boot # run bootcmd Booting initramfs instructions via u-boot: Follow steps 0 - 2 from above. 3. boot initramfs Enter the following commands into the u-boot shell # tftp ${kernel_addr_r} openwrt-apm821xx-nand-netgear_wndap660-initramfs-kernel.bin # run addtty # bootm ${kernel_addr_r} Signed-off-by: Christian Lamparter --- package/boot/uboot-envtools/files/apm821xx | 4 + .../apm821xx/base-files/etc/board.d/01_leds | 16 ++ .../base-files/etc/board.d/02_network | 7 +- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 21 ++ .../base-files/lib/upgrade/platform.sh | 2 + .../linux/apm821xx/dts/netgear-wndap620.dts | 28 +++ .../linux/apm821xx/dts/netgear-wndap660.dts | 38 +++ .../linux/apm821xx/dts/netgear-wndap6x0.dtsi | 227 ++++++++++++++++++ target/linux/apm821xx/image/Makefile | 29 +++ target/linux/apm821xx/nand/config-default | 3 + 10 files changed, 374 insertions(+), 1 deletion(-) create mode 100644 target/linux/apm821xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac create mode 100644 target/linux/apm821xx/dts/netgear-wndap620.dts create mode 100644 target/linux/apm821xx/dts/netgear-wndap660.dts create mode 100644 target/linux/apm821xx/dts/netgear-wndap6x0.dtsi diff --git a/package/boot/uboot-envtools/files/apm821xx b/package/boot/uboot-envtools/files/apm821xx index bf61e972de..6bcc3ad62f 100644 --- a/package/boot/uboot-envtools/files/apm821xx +++ b/package/boot/uboot-envtools/files/apm821xx @@ -17,6 +17,10 @@ meraki,mr24) meraki,mx60) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "4" ;; +netgear,wndap620|\ +netgear,wndap660) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" "4" + ;; esac config_load ubootenv diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds b/target/linux/apm821xx/base-files/etc/board.d/01_leds index 632d22a470..dd529b528d 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/01_leds +++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds @@ -23,6 +23,22 @@ meraki,mx60) ucidef_set_led_switch "lan4" "LAN4" "mx60:green:lan4" "switch0" "0x02" ;; +netgear,wndap620) + ucidef_set_led_switch "lan_act" "LAN (Activity)" "wndap6x0:green:activity" "switch0" "0x04" "0x0f" "rx tx" + ucidef_set_led_switch "lan_100" "LAN 100Mbps" "wndap620:amber:link100" "switch0" "0x04" "0x04" "link" + ucidef_set_led_switch "lan_1000" "LAN 1000Mbps" "wndap620:green:link1000" "switch0" "0x04" "0x08" "link" + ;; + +netgear,wndap660) + ucidef_set_led_netdev "lan_act" "LAN (Activity)" "wndap6x0:green:activity" "eth0" + ucidef_set_led_switch "lan1_100" "LAN 100Mbps" "wndap660:amber:lan1-link100" "switch0" "0x04" "0x04" "link" + ucidef_set_led_switch "lan1_1000" "LAN 1000Mbps" "wndap660:green:lan1-link1000" "switch0" "0x04" "0x08" "link" + ucidef_set_led_switch "lan2_100" "LAN 100Mbps" "wndap660:amber:lan2-link100" "switch0" "0x02" "0x04" "link" + ucidef_set_led_switch "lan2_1000" "LAN 1000Mbps" "wndap660:green:lan2-link1000" "switch0" "0x02" "0x08" "link" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "wndap6x0:green:wlan2g" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "wndap6x0:green:wlan5g" "phy1tpt" + ;; + netgear,wndr4700) ucidef_set_led_switch "wan_green" "WAN (green)" "wndr4700:green:wan" "switch0" "0x20" ucidef_set_led_netdev "wan_yellow" "WAN (yellow)" "wndr4700:yellow:wan" "eth0.2" "tx rx" diff --git a/target/linux/apm821xx/base-files/etc/board.d/02_network b/target/linux/apm821xx/base-files/etc/board.d/02_network index 6f4456e8a1..69bc038bd4 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/02_network +++ b/target/linux/apm821xx/base-files/etc/board.d/02_network @@ -13,7 +13,12 @@ wd,mybooklive|\ wd,mybooklive-duo) ucidef_set_interface_lan "eth0" ;; - +netgear,wndap620) + ucidef_add_switch "switch0" "2:lan" "5@eth0" + ;; +netgear,wndap660) + ucidef_add_switch "switch0" "1:lan:2" "2:lan:1" "5@eth0" + ;; meraki,mx60|\ netgear,wndr4700) ucidef_add_switch "switch0" \ diff --git a/target/linux/apm821xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/apm821xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac new file mode 100644 index 0000000000..597b5dcca6 --- /dev/null +++ b/target/linux/apm821xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -0,0 +1,21 @@ +#!/bin/ash + +[ "$ACTION" == "add" ] || exit 0 + +PHYNBR=${DEVPATH##*/phy} + +[ -n $PHYNBR ] || exit 0 + +. /lib/functions.sh +. /lib/functions/system.sh + +board=$(board_name) + +case "$board" in +netgear,wndap620|\ +netgear,wndap660) + echo $(macaddr_add $(mtd_get_mac_ascii u-boot-env baseMAC) $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress + ;; +*) + ;; +esac diff --git a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh index fa0aa38014..02c750130c 100755 --- a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh @@ -26,6 +26,8 @@ platform_do_upgrade() { ;; meraki,mr24|\ meraki,mx60|\ + netgear,wndap620|\ + netgear,wndap660|\ netgear,wndr4700) nand_do_upgrade "$1" ;; diff --git a/target/linux/apm821xx/dts/netgear-wndap620.dts b/target/linux/apm821xx/dts/netgear-wndap620.dts new file mode 100644 index 0000000000..afaf0616ba --- /dev/null +++ b/target/linux/apm821xx/dts/netgear-wndap620.dts @@ -0,0 +1,28 @@ +/* + * Device Tree Source for Netgear WNDAP620 + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without + * any warranty of any kind, whether express or implied. + */ + +/dts-v1/; + +#include "netgear-wndap6x0.dtsi"; + +/ { + model = "Netgear WNDAP620"; + compatible = "netgear,wndap620", "apm,bluestone"; +}; + +&LEDS { + link1000 { + label = "wndap620:green:link1000"; + gpios = <&GPIO0 9 GPIO_ACTIVE_HIGH>; + }; + + link100 { + label = "wndap620:amber:link100"; + gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>; + }; +}; diff --git a/target/linux/apm821xx/dts/netgear-wndap660.dts b/target/linux/apm821xx/dts/netgear-wndap660.dts new file mode 100644 index 0000000000..3e5daac835 --- /dev/null +++ b/target/linux/apm821xx/dts/netgear-wndap660.dts @@ -0,0 +1,38 @@ +/* + * Device Tree Source for Netgear WNDAP660 + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without + * any warranty of any kind, whether express or implied. + */ + +/dts-v1/; + +#include "netgear-wndap6x0.dtsi" + +/ { + model = "Netgear WNDAP660"; + compatible = "netgear,wndap660", "apm,bluestone"; +}; + +&LEDS { + lan1-link1000 { + label = "wndap660:green:lan1-link1000"; + gpios = <&GPIO0 22 GPIO_ACTIVE_HIGH>; + }; + + lan1-link100 { + label = "wndap660:amber:lan1-link100"; + gpios = <&GPIO0 23 GPIO_ACTIVE_HIGH>; + }; + + lan2-link1000 { + label = "wndap660:green:lan2-link1000"; + gpios = <&GPIO0 9 GPIO_ACTIVE_HIGH>; + }; + + lan2-link100 { + label = "wndap660:amber:lan2-link100"; + gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>; + }; +}; diff --git a/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi b/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi new file mode 100644 index 0000000000..a163b1d82d --- /dev/null +++ b/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi @@ -0,0 +1,227 @@ +/* + * Device Tree Source for Netgear WNDAP620 and WNDAP660 + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without + * any warranty of any kind, whether express or implied. + */ + +#include "apm82181.dtsi" + +/ { + aliases { + serial0 = &UART0; + led-boot = &status; + led-failsafe = &failsafe; + led-running = &status; + led-upgrade = &status; + }; + + chosen { + stdout-path = "/plb/opb/serial@ef600300"; + }; +}; + +&CRYPTO { + status = "okay"; +}; + +&PKA { + status = "okay"; +}; + +&TRNG { + status = "okay"; +}; + +&EBC0 { + ndfc@1,0 { + status = "okay"; + /* 32 MiB SLC NAND Flash */ + nand { + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x00000000 0x00100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x00100000 0x00010000>; + read-only; + }; + + partition@110000,0 { + label = "firmware"; + reg = <0x00110000 0x01ac0000>; + }; + + partition@110000,1 { + /* + * The u-boot bootloader will look at this + * offset (0x110000) for an uImage binary. + */ + label = "kernel"; + reg = <0x00110000 0x003f0000>; + }; + + partition@500000 { + label = "ubi"; + reg = <0x00500000 0x016d0000>; + }; + + partition@1bd0000 { + /* + * original vendor device-tree - do not use or + * overwrite. The original u-boot also supports + * the gzipped legacy monolithic/Multi-File Image + * format, which is a better choice. + */ + label = "device-tree"; + reg = <0x01bd0000 0x0010000>; + read-only; + }; + + partition@1be0000 { + label = "var"; + reg = <0x01be0000 0x0400000>; + read-only; + }; + + partition@1fe0000 { + label = "manudata"; + reg = <0x01fe0000 0x20000 >; + read-only; + }; + }; + }; +}; + +&UART0 { + status = "okay"; +}; + +&GPIO0 { + status = "okay"; +}; + +&EMAC0 { + status = "okay"; + + fixed-link { + speed = <1000>; + full-duplex; + pause; + asym-pause; + }; + + mdio0: mdio { + #address-cells = <1>; + #size-cells = <0>; + }; +}; + +&POB0 { + gpio_keys_polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + #interrupt-cells = <2>; + poll-interval = <60>; /* 3 * 20 = 60ms */ + autorepeat; + + reset { + label = "Reset Button"; + gpios = <&GPIO0 16 GPIO_ACTIVE_HIGH>; + linux,code = ; + interrupt-parent = <&UIC1>; + interrupts = <0x15 IRQ_TYPE_EDGE_FALLING>; + }; + }; + + LEDS: gpio-leds { + compatible = "gpio-leds"; + + status: power { + label = "wndap6x0:green:power"; + gpios = <&GPIO0 18 GPIO_ACTIVE_HIGH>; + }; + + failsafe: test { + label = "wndap6x0:amber:test"; + gpios = <&GPIO0 17 GPIO_ACTIVE_HIGH>; + panic-indicator; + }; + + activity { + label = "wndap6x0:green:activity"; + gpios = <&GPIO0 21 GPIO_ACTIVE_HIGH>; + }; + + wlan2g { + label = "wndap6x0:green:wlan2g"; + gpios = <&GPIO0 19 GPIO_ACTIVE_HIGH>; + }; + + wlan5g { + label = "wndap6x0:green:wlan5g"; + gpios = <&GPIO0 20 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + internal-antenna { + gpio-export,name = "wndap6x0:internal-antenna"; + gpio-export,output = <1>; + gpios = <&GPIO0 11 GPIO_ACTIVE_HIGH>; + }; + + external-antenna { + gpio-export,name = "wndap6x0:external-antenna"; + gpio-export,output = <0>; + gpios = <&GPIO0 14 GPIO_ACTIVE_HIGH>; + }; + + mains-powered { + /* + * Input pin describing what powers the AP + * 0/Low = PoE + * 1/High = 12v mains powered + */ + gpio-export,name = "wndap620:mains-powered"; + gpios = <&GPIO0 3 GPIO_ACTIVE_HIGH>; + }; + }; + + rtl8367b { + compatible = "realtek,rtl8367b"; + cpu_port = <5>; + realtek,extif0 = <1 2 1 1 1 1 1 1 2>; + mii-bus = <&mdio0>; + }; +}; + +&PCIE0 { + status = "okay"; +}; + +&MSI { + status = "okay"; +}; + +&IIC0 { + status = "okay"; + + at24@52 { + compatible = "atmel,24c04"; + reg = <0x52>; + pagesize = <16>; + read-only; + }; +}; + diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 4a6ca9b633..4dec5fdf3c 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -152,6 +152,35 @@ define Build/MuImage-initramfs rm -rf $@.fakerd endef +define Device/netgear_wndap6x0 + DEVICE_PACKAGES := kmod-eeprom-at24 + SUBPAGESIZE := 256 + PAGESIZE := 512 + BLOCKSIZE := 16k + DTB_SIZE := 32768 + IMAGE_SIZE := 27392k + IMAGES := sysupgrade.tar factory.img + KERNEL_SIZE := 4032k + KERNEL := dtb | kernel-bin | gzip | MuImage-initramfs gzip + IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + UBINIZE_OPTS := -E 5 +endef + +define Device/netgear_wndap620 + $(Device/netgear_wndap6x0) + DEVICE_TITLE := Netgear WNDAP620 - Premium Wireless-N + DEVICE_DTS := netgear-wndap620 +endef +TARGET_DEVICES += netgear_wndap620 + +define Device/netgear_wndap660 + $(Device/netgear_wndap6x0) + DEVICE_TITLE := Netgear WNDAP660 - Dual Radio Dual Band Wireless-N + DEVICE_DTS := netgear-wndap660 +endef +TARGET_DEVICES += netgear_wndap660 + define Device/netgear_wndr4700 DEVICE_TITLE := Netgear Centria N900 WNDR4700/WNDR4720 DEVICE_PACKAGES := badblocks block-mount e2fsprogs \ diff --git a/target/linux/apm821xx/nand/config-default b/target/linux/apm821xx/nand/config-default index 7b66f27d30..1c05a83fb1 100644 --- a/target/linux/apm821xx/nand/config-default +++ b/target/linux/apm821xx/nand/config-default @@ -39,8 +39,11 @@ CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_UBIFS_FS=y # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_RTL8366_SMI=y +CONFIG_RTL8367B_PHY=y CONFIG_SENSORS_LM90=y CONFIG_SENSORS_TC654=y CONFIG_SWCONFIG=y CONFIG_SWCONFIG_LEDS=y CONFIG_WNDR4700=y + From patchwork Wed Oct 17 20:37:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 985505 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CWbPFFy/"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="i/ELHlNq"; 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 42b3x90ml5z9s2P for ; Thu, 18 Oct 2018 07:41:17 +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: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=GjG1ylYALRH/SWYDjVB6neZ4GlcB2yfykVIo9l++Hs8=; b=CWbPFFy/yaz2iGkZt9xkrP6Q6l UB/RSdZEBbEmjI/+2IXb/Nnbauvas56L3icdHSd+ooDq0dnIgaDYt5kOsvtvyI7d5RgJzIYdBlRfB ElNHe5Nv0Wd8xQQo/PXHS31+6bsVsRrJ295n80xDaa7YUU26Un+rIn5im0Z1WyMII3yHiiiRKbdnu d4EWoNEpNLqp1+w3aBWwSkPH26eC6TKHfwycqNml3HDIlHzGz5Rr2lXyKW0c+QQFCZyJQpGKF1Ksi ko3rlRmWS5lNsUEus+yDMESFcnSDD7UExwA+H1XH7zYwSNSfogTtwy7KHX6AoNf4W5JBaeM/9a4A1 YcAvTTMw==; 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 1gCsct-0006DV-2B; Wed, 17 Oct 2018 20:41:07 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCsZm-0003X6-Sv for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 20:38:00 +0000 Received: by mail-ed1-x544.google.com with SMTP id z21-v6so26147253edb.11 for ; Wed, 17 Oct 2018 13:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=fw4wkbwntNcCZ/IDQOvgEl2L2YRm3DUkPLaYNsTiq00=; b=i/ELHlNqZS/DcaDdaFuXNCQt+C5gdeudK6mjpJXV/SjAII84R7xzaXAtV/404V+2LD pIlbeJK2Bh1lDE6t9OCCJ8uzxY/+MO5rRVflEVikCauYo29PKmGeOYHnxDlf1G3Hnn32 rO2o/Lw2W7LZ7spQbuzmxf+uAQWpZOte8rkkzZsygPbdnX1CBfY23xOxRSqNvQkZx5+T UYbAyUviGfJdou9G43wxBz/V+sZhKk/wUsjjASuIcYwxIWBk3j/wanaJrLiN2lZk6umC XTmgR3Ct9jyxl3GhSYeXXkOSaoSUIXkiRx5rTG0DhfAF7U95GGBB2v6XTiJFvOjTiIHu x7ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fw4wkbwntNcCZ/IDQOvgEl2L2YRm3DUkPLaYNsTiq00=; b=raBwy2yQfnnWKj/HyCJv+m3IK2hklKDnFSl2/pnfkCvOXfRgihB6ttdw3xD5Qu1mI0 uueCJYJTzYBcW3TQxFM3pluFLSbdetHs01lI0VVZmkP+urhfg8sYsTJdTPtSQQ0vaqSy cSv6d1bBlIrNpV2I8224Vw/QgT615mkt3Iuw71aRV2xd0TW73OebZVHlDe7lLfL2M7+8 sSCNMm57pS/B6eI9pSZrjuPceqOuB3Gsxar9wsAELMTq/FfmfiK4jljkMo2oSbhG5mEm 21y+ma8yfCqn0tn964KZYC2LPQPB2VX+WbTtjkFWUmqzAV31bJ6ZdI+wB9wCSgPtNvKN TWpw== X-Gm-Message-State: ABuFfoilIhZtW+yA8IhCfGxgGDo3taLjY90/oYNzOc6+7lBMHMK1ca2Y UbMVW9GoLbNBHOMarm5xNLPKuzTvZJI= X-Google-Smtp-Source: ACcGV63cSJ1qw6p6z6D/HYXanHRb0GJpcdZT8Je84PXGH2WZwPdglz7lbbwAIe1CDDkxkYK5ccWjTQ== X-Received: by 2002:a17:906:c156:: with SMTP id bp22-v6mr2901531ejb.82.1539808663365; Wed, 17 Oct 2018 13:37:43 -0700 (PDT) Received: from debian64.daheim (p200300D5FBC22EFCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbc2:2efc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id e38-v6sm8122605eda.67.2018.10.17.13.37.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Oct 2018 13:37:40 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1gCsZX-0007IC-KR for openwrt-devel@lists.openwrt.org; Wed, 17 Oct 2018 22:37:39 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Date: Wed, 17 Oct 2018 22:37:39 +0200 Message-Id: <3b536da9e4f91ee65f53fef4fc5e9e19a742262b.1539808453.git.chunkeey@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: <7a4efe10a840f555fe162d5bf44809a7bbc23f11.1539808453.git.chunkeey@gmail.com> <5849270378a0870bb0896e378cc4cbd351d27fa8.1539808453.git.chunkeey@gmail.com> <4e5a0d5bb56a918c59c48c27ea5a84c0b442fddb.1539808453.git.chunkeey@gmail.com> <3d538df93d72e14bc48a7c817fbc7046e0f225b3.1539808453.git.chunkeey@gmail.com> <7dd87d4514c20e96b4c578bd6574255912c00249.1539808453.git.chunkeey@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181017_133754_953712_2B1C9DE5 X-CRM114-Status: GOOD ( 15.95 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH v1 8/8] apm821xx: shuffle helper scripts to the front 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org In a patch for the ath79, Mathias Kresin mentioned that helper scripts should be in front of the device targets. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/image/Makefile | 165 +++++++++++++-------------- 1 file changed, 82 insertions(+), 83 deletions(-) diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 4dec5fdf3c..1925a00d6e 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -7,37 +7,49 @@ include $(INCLUDE_DIR)/image.mk DEVICE_VARS += IMAGE_SIZE DTB_SIZE -define Device/Default - PROFILES := Default - KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts) - DEVICE_DTS := - KERNEL_ENTRY := 0x00000000 - KERNEL_LOADADDR := 0x00000000 - DEVICE_DTS_DIR := ../dts - SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) +define Build/boot-img + $(RM) -rf $@.bootdir + mkdir -p $@.bootdir/boot + + $(CP) $@.scr $@.bootdir/boot/boot.scr + $(CP) $(IMAGE_KERNEL).dtb $@.bootdir/boot/$(DEVICE_DTB) + $(CP) $(IMAGE_KERNEL) $@.bootdir/boot/uImage + + genext2fs --block-size $(BLOCKSIZE:%k=%Ki) --size-in-blocks $$((1024 * $(BOOT_SIZE))) --root $@.bootdir $@.boot + + # convert it to revision 1 - needed for u-boot ext2load + $(STAGING_DIR_HOST)/bin/tune2fs -O filetype $@.boot + $(STAGING_DIR_HOST)/bin/e2fsck -pDf $@.boot > /dev/null endef -define Build/dtb - $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb,,--space $(DTB_SIZE)) +define Build/boot-script + $(STAGING_DIR_HOST)/bin/mkimage -A powerpc -T script -C none -n "$(PROFILE) Boot Script" \ + -d mbl_boot.scr \ + $@.scr endef -define Build/prepend-dtb - cat "$@.dtb.uimage" "$@" > "$@.new" - mv "$@.new" "$@" +define Build/copy-file + cat "$(1)" > "$@" endef -define Build/export-dtb - cp $(IMAGE_KERNEL).dtb $@ +define Build/create-uImage-dtb + # flat_dt target expect FIT image - which WNDR4700's uboot doesn't support + -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) \ + -O linux -T kernel -C none \ + -n '$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION)' \ + -d "$@.dtb" "$@.dtb.uimage" endef -ifeq ($(SUBTARGET),nand) +define Build/dtb + $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb,,--space $(DTB_SIZE)) +endef -define Image/cpiogz - ( cd $(TARGET_DIR); find . | cpio -o -H newc | gzip -9n >$(KDIR_TMP)/$(IMG_PREFIX)-rootfs.cpio.gz ) +define Build/export-dtb + cp $(IMAGE_KERNEL).dtb $@ endef -define Build/copy-file - cat "$(1)" > "$@" +define Build/hdd-img + ./mbl_gen_hdd_img.sh $@ $@.boot $(IMAGE_ROOTFS) $(BOOT_SIZE) $(CONFIG_TARGET_ROOTFS_PARTSIZE) endef define Build/MerakiAdd-dtb @@ -72,6 +84,56 @@ define Build/MerakiNAND @cp $@.new $@ endef +define Build/MuImage-initramfs + rm -rf $@.fakerd $@.new + + dd if=/dev/zero of=$@.fakerd bs=32 count=1 conv=sync + + # Netgear used an old uboot that doesn't have FIT support. + # So we are stuck with either a full ext2/4 fs in a initrd. + # ... or we try to make the "multi" image approach to work + # for us. + # + # Sadly, the "multi" image has to consists of three + # "fixed" parts in the following "fixed" order: + # 1. The kernel which is in $@ + # 2. The (fake) initrd which is in $@.fakerd + # 3. The device tree binary which is in $@.dtb + # + # Now, given that we use the function for the kernel which + # already has a initramfs image inside, we still have to + # add a "fake" initrd (which a mkimage header) in the second + # part of the legacy multi image. Since we need to put the + # device tree stuff into part 3. + + -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T multi \ + -C $(1) -a $(KERNEL_LOADADDR) -e $(KERNEL_ENTRY) \ + -n '$(BOARD_NAME) initramfs' -d $@:$@.fakerd:$@.dtb $@.new + mv $@.new $@ + rm -rf $@.fakerd +endef + +define Build/prepend-dtb + cat "$@.dtb.uimage" "$@" > "$@.new" + mv "$@.new" "$@" +endef + +define Image/cpiogz + ( cd $(TARGET_DIR); find . | cpio -o -H newc | gzip -9n >$(KDIR_TMP)/$(IMG_PREFIX)-rootfs.cpio.gz ) +endef + +define Device/Default + PROFILES := Default + KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts) + DEVICE_DTS := + KERNEL_ENTRY := 0x00000000 + KERNEL_LOADADDR := 0x00000000 + DEVICE_DTS_DIR := ../dts + SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) +endef + +ifeq ($(SUBTARGET),nand) + define Device/meraki_mr24 DEVICE_TITLE := Cisco Meraki MR24 DEVICE_PACKAGES := kmod-spi-gpio -swconfig @@ -115,43 +177,6 @@ define Device/meraki_mx60 endef TARGET_DEVICES += meraki_mx60 -define Build/create-uImage-dtb - # flat_dt target expect FIT image - which WNDR4700's uboot doesn't support - -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) \ - -O linux -T kernel -C none \ - -n '$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION)' \ - -d "$@.dtb" "$@.dtb.uimage" -endef - -define Build/MuImage-initramfs - rm -rf $@.fakerd $@.new - - dd if=/dev/zero of=$@.fakerd bs=32 count=1 conv=sync - - # Netgear used an old uboot that doesn't have FIT support. - # So we are stuck with either a full ext2/4 fs in a initrd. - # ... or we try to make the "multi" image approach to work - # for us. - # - # Sadly, the "multi" image has to consists of three - # "fixed" parts in the following "fixed" order: - # 1. The kernel which is in $@ - # 2. The (fake) initrd which is in $@.fakerd - # 3. The device tree binary which is in $@.dtb - # - # Now, given that we use the function for the kernel which - # already has a initramfs image inside, we still have to - # add a "fake" initrd (which a mkimage header) in the second - # part of the legacy multi image. Since we need to put the - # device tree stuff into part 3. - - -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T multi \ - -C $(1) -a $(KERNEL_LOADADDR) -e $(KERNEL_ENTRY) \ - -n '$(BOARD_NAME) initramfs' -d $@:$@.fakerd:$@.dtb $@.new - mv $@.new $@ - rm -rf $@.fakerd -endef - define Device/netgear_wndap6x0 DEVICE_PACKAGES := kmod-eeprom-at24 SUBPAGESIZE := 256 @@ -217,32 +242,6 @@ endif ifeq ($(SUBTARGET),sata) -### Image scripts for the WD My Book Live Series ### -define Build/boot-script - $(STAGING_DIR_HOST)/bin/mkimage -A powerpc -T script -C none -n "$(PROFILE) Boot Script" \ - -d mbl_boot.scr \ - $@.scr -endef - -define Build/boot-img - $(RM) -rf $@.bootdir - mkdir -p $@.bootdir/boot - - $(CP) $@.scr $@.bootdir/boot/boot.scr - $(CP) $(IMAGE_KERNEL).dtb $@.bootdir/boot/$(DEVICE_DTB) - $(CP) $(IMAGE_KERNEL) $@.bootdir/boot/uImage - - genext2fs --block-size $(BLOCKSIZE:%k=%Ki) --size-in-blocks $$((1024 * $(BOOT_SIZE))) --root $@.bootdir $@.boot - - # convert it to revision 1 - needed for u-boot ext2load - $(STAGING_DIR_HOST)/bin/tune2fs -O filetype $@.boot - $(STAGING_DIR_HOST)/bin/e2fsck -pDf $@.boot > /dev/null -endef - -define Build/hdd-img - ./mbl_gen_hdd_img.sh $@ $@.boot $(IMAGE_ROOTFS) $(BOOT_SIZE) $(CONFIG_TARGET_ROOTFS_PARTSIZE) -endef - define Device/wd_mybooklive DEVICE_TITLE := Western Digital My Book Live Series (Single + Duo) DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic