Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3630301pxy; Tue, 4 May 2021 06:40:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzze8yMWt5QMZIaiNupGWYwy7qqgQlbBRiLSV2zpzLhH2IciDhcgIj5aGSmOmqNkCpuEGV0 X-Received: by 2002:a17:906:5ad1:: with SMTP id x17mr21569476ejs.257.1620135623324; Tue, 04 May 2021 06:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620135623; cv=none; d=google.com; s=arc-20160816; b=BYF6kMiVcbGtfoePZK+HptSB4wVzJ9WjOr0ZYavFWelSTUQsAsxy8mtNyrBAtUNuBa 0QTcDCrsxQke4atXLKxYQ0rO51jX8WUoHGFH0HQaDHKdr5Q/3crigbC4vD0MaeipzJ7i 7QQd0kq2C5GVzG9ghO/N5RPnH24KSsQC4sICpjVykrcOwqKA5FUIltxP+chi7ocJoAyb p8vtNsAbP+BLKq7Wj6hkEa2f/G4cm3gBFqiaV2kVHkV2uJ9javGJzNlB/5/rKOpvUoHP CJcVVbB1RsQ6Q5GW5YxO/1JnODx4yYb8HyJv/Y8AfS3F2znebewZkVN7tKK1P6gdNCji XC+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=S6xaD/AvFsWLKTX/Gg80aVgNVOHPt0/B8YY3rVu0/pU=; b=Pm2AN/z60Ck9gCtgpPykHQawoP0UxA0ziZF/vBS9MaMW7lyr/xUrORsvUCIuWNqEcy 6aT5lHr2+WXMEC/htlmec/4zVrU9zV5q5liA9GrGFEYk63WEENLt0NbsUYDKm6i0BVPJ gPy81thzkOvNx93BlaCvwHapLLa1tzsZZJNBfKjve/nnw+d1IxAjdajfy1/MFeGbzZbq qeuMkddt/ogsaxnh8yydGparlJgKI1lcZKCaoERYVPY5PjPWDD5U4/vcw9jaTzgj4u9c JcRnmRNa87AYOF1z4QFKDfpxKAA4DXZrFmoZ/aefx8piWI/d8nykWTCDoUy8rB4Cpxx3 wuPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r15si13026622edd.83.2021.05.04.06.39.59; Tue, 04 May 2021 06:40:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231259AbhEDNh2 (ORCPT + 99 others); Tue, 4 May 2021 09:37:28 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:52394 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231159AbhEDNh0 (ORCPT ); Tue, 4 May 2021 09:37:26 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1ldvDl-002U6k-3Y; Tue, 04 May 2021 15:36:17 +0200 Date: Tue, 4 May 2021 15:36:17 +0200 From: Andrew Lunn To: Vladimir Oltean Cc: Colin Foster , Rob Herring , Claudiu Manoil , Alexandre Belloni , "supporter:OCELOT ETHERNET SWITCH DRIVER" , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , Russell King , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list , "open list:OCELOT ETHERNET SWITCH DRIVER" Subject: Re: [RFC PATCH vN net-next 2/2] net: mscc: ocelot: add support for VSC75XX SPI control Message-ID: References: <20210504051130.1207550-1-colin.foster@in-advantage.com> <20210504051130.1207550-2-colin.foster@in-advantage.com> <20210504125942.nx5b6j2cy34qyyhm@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210504125942.nx5b6j2cy34qyyhm@skbuf> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > This function seems out of place. Why would SPI access change what the > > ports are capable of doing? Please split this up into more > > patches. Keep the focus of this patch as being adding SPI support. > > What is going on is that this is just the way in which the drivers are > structured. Colin is not really "adding SPI support" to any of the > existing DSA switches that are supported (VSC9953, VSC9959) as much as > "adding support for a new switch which happens to be controlled over > SPI" (VSC7512). > The layering is as follows: > - drivers/net/dsa/ocelot/felix_vsc7512_spi.c: deals with the most > hardware specific SoC support. The regmap is defined here, so are the > port capabilities. > - drivers/net/dsa/ocelot/felix.c: common integration with DSA > - drivers/net/ethernet/mscc/ocelot*.c: the SoC-independent hardware > support. Hi Vladimir I took a quick look at the data sheet. It says in section 2.1.5 Management: External access to registers through PCIe, SPI, MIIM, or through an Ethernet port with inline Microsemi’s Versatile Register Access Protocol (VRAP) So maybe the basic 7512 support should be separate from how you access the registers, so that somebody can later add MMIO or MDIO support? Andrew P.S. I did not know about VRAP. Marvell has something similar. It would be nice to put together some shared generic code to support this. Statistics would really benefit from it.