From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751723AbdJNWLS (ORCPT ); Sat, 14 Oct 2017 18:11:18 -0400 Received: from mail-oi0-f44.google.com ([209.85.218.44]:45268 "EHLO mail-oi0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751138AbdJNWLQ (ORCPT ); Sat, 14 Oct 2017 18:11:16 -0400 X-Google-Smtp-Source: ABhQp+T0neIIhY5Ae7LhJ0r7bbBMSSWN8ARzOncvEKw/64i4gHp6nFk7n1XqihJsFkucpF7a1mIUlQ== Date: Sat, 14 Oct 2017 15:11:09 -0700 User-Agent: K-9 Mail for Android In-Reply-To: References: <1507194974-12050-1-git-send-email-razvan.stefanescu@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Subject: Re: [OpenWrt-Devel] [PATCH v3 0/6] staging: Introduce DPAA2 Ethernet Switch driver To: Linus Walleij CC: Razvan Stefanescu , OpenWrt Development List , "netdev@vger.kernel.org" , "devel@driverdev.osuosl.org" , ruxandra.radulescu@nxp.com, Arnd Bergmann , Greg KH , alexandru.marginean@nxp.com, "linux-kernel@vger.kernel.org" , Alexander Graf , Stuart Yoder , bogdan.purcareata@nxp.com, laurentiu.tudor@nxp.com, Andrew Lunn , Vivien Didelot From: Florian Fainelli Message-ID: <21A90A5D-3AD5-4281-8709-F25BAB6B1602@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v9EMBNpg030088 On October 14, 2017 2:59:22 PM PDT, Linus Walleij wrote: >On Sat, Oct 14, 2017 at 8:52 PM, Florian Fainelli > wrote: > >> The most deployed switch device drivers have been converted to DSA >> already: b53, qca8k (ar83xx in OpenWrt/LEDE) and mtk7530 are all in >> tree, and now we are getting new submissions from Michrochip to >support >> their pretty large KSZ series. Converting from swconfig to DSA is >> actually quite simple, but like anything requires time and testing, >and >> access to hardware and ideally datasheet. > >Hm, I have a Realtek RB8366RB in this router on my desk. > >I guess that means I should just take the old switchdev-based >SMI-driver and convert it to DSA. > >I bet I can do that :D Yes, it really should not be too hard. The OpenWrt/LEDE driver had mostly the same semantics as what is needed for being a proper DSA driver. You should of course start simple: get basic switching working, then add statistics, VLAN, FDB, etc. OpenWrt/LEDE models switches as PHY device objects which would not work upstream so you should have the driver be probed as a MDIO/SPI/I2C (see b53 for example) and set up fixed-link properties between the CPU and the switch. > >Well, I will try. Because it's blocking me to work on the Gemini >ethernet driver. Well usually the boot loader may leave the switch in a good enough state that you can work on the CPU controller mostly independently from dealing with the switch. This is not universally true, and a properly working bootloader should actually quiesce/reset both blocks prior to OS control. Don't hesitate if you have questions. Cheers. -- Florian