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: 137106 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3102739lji; Mon, 28 May 2018 10:50:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpkbSp6zFDidM1juvjtKVs8ZLDZsufxqC/j9e/1mbH8q1tVyE1Yj9l2aTh0qBw1vkvkC/Yu X-Received: by 2002:a17:902:6e08:: with SMTP id u8-v6mr14341642plk.96.1527529810221; Mon, 28 May 2018 10:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527529810; cv=none; d=google.com; s=arc-20160816; b=gqQuXsSKQe1rC+3ScULOWx+B/qFo5ri+ZLr3EasesSM0/FvJAbqapv2vv4DyKOPY1K /IZGSyjnqyxmGWs0qZDT5QW4UybDcSj/9WVULGbr4p6bQIJ5q5uJhz1xiS3ipdBY+g5E VrlqgPK+Eo/A5r4w3S0ba7J+ocapVTh6bnhd3MYzjDvdI9xIzE+CpO/ocOJf+2Lq1yau Y7sZGlLN/Abw0bAfpi3d7XxOGhbL7RPvNVThFMWD9LyrC1o7ZScCKdBzEwFFcqsLVr8N RTGWEHB9xqblZ1cIJRN4X2sCD72a8aynY/oJVhRsdcukUKrngQ9LWcDuUl/dFiY35Mla 1qDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=/WS5Y8wPw31niuzbd49k8zJJU4MuLI4ztWQG5ImWgYI=; b=FYozpLK8w0ZcJ91u/Jk/cwjPtOSTJmdEgXN+NfPySanFgWtzf0zG3qjIA4zxPQB7c6 QyLbjYUpfHUm5VjGtJTSwVHiLSOOIqTUfRSz6fbivW0t0obVOim9rGwNkw5WyJJcA2Zd zvFILYz9iCJGgQ5ZwA2/tmi+/ieUH4BMktO7lRcPHmPHAG2ilGIPXAdR8g/a6oz34xUE d3ujgWAzMHLQ5hd86DD7/GhL/UQqCpr8CpvEW8VX1SGgsmpumlGefo+icSeJcN+ir/tp GaDu9i4nfyHznl8A+rtldtHErtEm3M8Ql/RPXpL/3DMz0cuxlh5Z3RZ8Qg575508aKsI RR2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WuFzjZ8h; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1-v6si6309016pgc.100.2018.05.28.10.50.09; Mon, 28 May 2018 10:50:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WuFzjZ8h; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932329AbeE1RuC (ORCPT + 9 others); Mon, 28 May 2018 13:50:02 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36479 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932208AbeE1RuA (ORCPT ); Mon, 28 May 2018 13:50:00 -0400 Received: by mail-wr0-f194.google.com with SMTP id f16-v6so6105473wrm.3 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=jduFnGVGqtOByGpB3ly8cneapb+jJP+bQD2OIPAFQ+dRXViDT6VTNgIe5SNSStZsyg Z7MQTZBOyLEzmi31ijaNuRRzF2NaOqg6UhzrFmvHjBR9/IXzDziqsL5IAho6n3GrqBWT h1kwT5Jxcxi/vOCEk8ULqivSfffsiP3SJTFQgXXlhdoydMb3h4TmdGcOcoB1KUFNad1C ynJ1uj47dxiCKOsMj9LfFlbd0D5+ebrJnSKySfalu0bR11zLu5t50yAUD2bmuGiyrHra +tJN67V5l/1N/KUAsIamzAzbwJbnHOeZYnXVGlIhp2F8Sj0lrQuqjpRd/mQnb/ttMhtW WZ6w== X-Gm-Message-State: ALKqPwdTcF4gRIo2/nGuotRRbwffGQMvjSW/ayW2OwNd+ekIKKmcttuA tFczzeCr5OjwpWsAm6ZUj6thhfSxXSI= 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 Cc: netdev@vger.kernel.org, openwrt-devel@lists.openwrt.org, LEDE Development List , Linus Walleij Subject: [PATCH 0/4 RFCv2] Realtek SMI RTL836x DSA driver 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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.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 -- 2.17.0 Reviewed-by: Florian Fainelli