From patchwork Mon May 28 17:47:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 921643 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=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BM0JAO1L"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="WuFzjZ8h"; 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 40vksf2hCCz9s16 for ; Tue, 29 May 2018 03:50:30 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ilCRe5qXMvKB2W7GIPPLof44gSpfH0hAKaxYW4ToGsY=; b=BM0JAO1LEdmCC7 BTLVluWnsOpgb7Ngszg2cVot0ag9HSDkgP+kHth/QMULrUEKtXM/kuIO1sTdW0jUHK/TsNOmsv/GJ DKUMEAknnme+0cM/iA7leUkM0xfHaaIaHygeToCsU6/108gu0L6/rJhUcYAiANQYLoE+ddP+TOQJe m84ANv47Oe3TJNZzIYLMVCQJDGidoCSGGKKU+sB5xz/RJcyMfg4E5OHnNRt1Yi/fRDqq+k8+1xjcL qdIGhmzpQBtjjK9X7VT+2NXM8GJ3vaZy8LiUl2YCYxb8QRsSVrms2xt7O1lVCzF2W6lgJOgZfWYr8 cQ8XYYSXRAW2fzqVyK8Q==; 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 1fNMHh-0007Tf-2O; Mon, 28 May 2018 17:50:17 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNMHd-0006Af-D1 for openwrt-devel@lists.openwrt.org; Mon, 28 May 2018 17:50:15 +0000 Received: by mail-wr0-x243.google.com with SMTP id u12-v6so21417439wrn.8 for ; Mon, 28 May 2018 10:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/WS5Y8wPw31niuzbd49k8zJJU4MuLI4ztWQG5ImWgYI=; b=WuFzjZ8h9KlXcjZw/5Apu7hvkkIcgkWOYsBxyyqanuBFg/AncggQHYGZsbK83bSu5U yRzcFGAWFNPNImR7XHUD7rQ2b1ZiFqZOBoPhQNvKVrebYbG/2fl5F/BYx63vPPCJxBlw kptbue1Kj66dKM2s+ZKWn65ve606/PpJ5MO04= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/WS5Y8wPw31niuzbd49k8zJJU4MuLI4ztWQG5ImWgYI=; b=WYiGIz3s1JaLgJONreLYFyFmMJVhUmRmav5kTpxmPa+7hwnNqSjtcbQTaFrJyXpN02 Get8lUjthtzJArjd2/ISwudyPkPtZtD53d2RdPwJ32U+eT+2//X+tYpzF9glu5BuXhH7 +jSOnx4/h3/tCHqxRIFGHF51hLoCJjobmR6P4trJlmz0HX178tMgT/jk0Qrf3mI8qF3/ Ziv9DJZq65p/FoAHSsF4S8F8STQ7gnTsf9AXx7MGdk84HCICQrnGnVZuaumpHXrJFCsF MQJKlGZAEfIKDE8r8K9uIRgO7SPLvHSIRhhapqXMUNSzWXf88Cn+fPL9lUD7qUapOA7V vkpQ== X-Gm-Message-State: ALKqPwfH3fuw/WWBizzZ4O9LLN1Qe3OVTPR01u6gvvdXiKn3nIQJ7Fz+ 6yW0+TJqdZnA6WhvgXNaYhXtNw== X-Google-Smtp-Source: ADUXVKIwV/5SNF5kkMWgvTLWxVpNlbJX12706V2xJJVjjMyL1BENZ61ef7v7aHNwLQ4R2hIjpdF/SA== X-Received: by 2002:a19:97cb:: with SMTP id z194-v6mr3208259lfd.17.1527529799666; Mon, 28 May 2018 10:49:59 -0700 (PDT) Received: from localhost.localdomain (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id p76-v6sm6913861lfp.44.2018.05.28.10.49.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 May 2018 10:49:58 -0700 (PDT) From: Linus Walleij To: Andrew Lunn , Vivien Didelot , Florian Fainelli Date: Mon, 28 May 2018 19:47:48 +0200 Message-Id: <20180528174752.6806-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180528_105013_446639_68A7807D X-CRM114-Status: GOOD ( 16.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:400c:c0c:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid Subject: [OpenWrt-Devel] [PATCH 0/4 RFCv2] Realtek SMI RTL836x DSA driver X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Linus Walleij , LEDE Development List Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This is a second RFC version of the DSA driver for Realtek RTL8366x especially RTL8366RB. I've been beating my head against this one and I'm not really clear on why my ethernet frames are not coming through to the CPU port on the chip. It appears when using ethtool -S on the ports that packets are passing fine into the router fabric and through to the CPU port but the ethernet driver where the fixed link is connected refuse to accept the packages. Of course packages needs VLAN tagging/untagging, this is not the problem as it seems. The OpenWRT userspace even kicks the interface in promiscuous mode so all packages should be accepted, I also tried tcpdump on the interface to no avail: the ethernet frames are so broken that they do not even make it through the fixed link. The do cause error statistics on the ethernet port on the system side. It might very well be that the problem is on the ethernet driver side, and this driver "just works" with other routers, so reposting it along with the DTS example so others can try it while I keep banging my head against it. Maybe I should just try to obtain another router with this chip so as to establish that it is not the DSA router driver that is wrong. I did try this hardware with the present OpenWRT driver (not DSA) and that failed too. Anyways check out the new DT bindings etc. Linus Walleij (4): net: phy: realtek: Support RTL8366RB variant net: dsa: Add bindings for Realtek SMI DSAs net: dsa: realtek-smi: Add Realtek SMI driver ARM: dts: Add ethernet and switch to D-Link DIR-685 .../bindings/net/dsa/realtek-smi.txt | 153 ++ arch/arm/boot/dts/gemini-dlink-dir-685.dts | 153 +- drivers/net/dsa/Kconfig | 12 + drivers/net/dsa/Makefile | 2 + drivers/net/dsa/realtek-smi.c | 488 ++++++ drivers/net/dsa/realtek-smi.h | 146 ++ drivers/net/dsa/rtl8366.c | 524 ++++++ drivers/net/dsa/rtl8366rb.c | 1411 +++++++++++++++++ drivers/net/phy/realtek.c | 33 + 9 files changed, 2921 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/net/dsa/realtek-smi.txt create mode 100644 drivers/net/dsa/realtek-smi.c create mode 100644 drivers/net/dsa/realtek-smi.h create mode 100644 drivers/net/dsa/rtl8366.c create mode 100644 drivers/net/dsa/rtl8366rb.c