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);