From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: DSA Date: Fri, 27 Apr 2018 11:32:24 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Dave Richards , "netdev@vger.kernel.org" , andrew@lunn.ch, vivien.didelot@savoirfairelinux.com Return-path: Received: from mail-qk0-f175.google.com ([209.85.220.175]:45501 "EHLO mail-qk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753079AbeD0Scd (ORCPT ); Fri, 27 Apr 2018 14:32:33 -0400 Received: by mail-qk0-f175.google.com with SMTP id x22so2145910qkb.12 for ; Fri, 27 Apr 2018 11:32:32 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Hello, On 04/27/2018 11:10 AM, Dave Richards wrote: > Hello, > > I am building a prototype for a new product based on a Lanner, Inc. embedded PC. It is an Intel Celeron-based system with two host I210 GbE chips connected to 2 MV88E6172 chips (one NIC to one switch). Everything appears to show up hardware-wise. My question is, what is the next step? How does DSA know which NICs are intended to be masters? Is this supposed to be auto-detected or is this knowledge supposed to be communicated explicitly. Reading through the DSA driver code I see that there is a check of the OF property list for the device for a "label"/"cpu" property/value pair that needs to be present. Who sets this and when? On system where Device Tree can be used, we expect you to declare all relevant peripherals in Device Tree and those would include the Ethernet controller (i210) and the Ethernet switches. An example of this can be found here: On x86, there is not an universal use of Device Tree, so we can use something along these lines to register an Ethernet switch through DSA: https://github.com/lunn/linux/commit/34055b931848545b6ba11ee50b88e89aeb02c9a5 There might be a way for you to use a conjuction of DMI Match entries to match your specific board design and based on that run the DSA switch registration code, indicating the port mapping and the Ethernet controller to be used as a "master device. -- Florian