Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2897954pxy; Sun, 25 Apr 2021 07:35:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ0XQRc3rP597WeIA6/p2xyFYB4mU3vIfIyeHGesHI1m2lUO0qNUqIDb3m0dpgeOepWdIB X-Received: by 2002:a05:6402:5111:: with SMTP id m17mr16599585edd.175.1619361300427; Sun, 25 Apr 2021 07:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619361300; cv=none; d=google.com; s=arc-20160816; b=PdQUcSUygQSyXTUxENvdq5wRFbptXyzfVRFiXJzWnkWFDrcbKb5mkGMtscJdOmQZU0 YmKoN5NkfFdgjS27mwDP7quUMZQ/l8HlOHx7CE7jjFRZSLZZ9k5Yx3lqqlzbaGn6M81R 5Ph6NWswNOqSmBvSiJr/PqHz93QMhj1wTzBwyoOUYI5pngXYESI42WXXWxnh1jsJkyNw L0hGSV/stgTLkRHdVWtpmk4vzBKMmzkq86GMqVTZi/EXeNiyYuI/S5YTIGIMreOwOe7Q zQlye33Rz/BZeSwEq/Z9xRJxPNyTHxPlCIfsWLe0JA95QT3ZzwB0j3gbpqjPLM6jeyHU Md+w== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=rsDFJU5O4O+b+8TL3SWJ+hWRAvvZq7KQxiIUkZ14QEQ=; b=LqiHuMZtxafqWXOlnLf2c4O+gx48mRffCHx0lvDttYcG+orzFC2XmAlMI48M/SNZXU /dtjISwECF7RmKmyjEmDjQOHO6F12yMd7UUVWrGy7SyExh+QzVHq71EZpUsSsR1lf3FU iSI++ABAAspHQ6rQhdtjI+McbBKsb/o9XQ0EsVnuujtuiXPo2EzWgCl1s5XfNh5XU1sD SFQhZZriSX+2jI+6uroBl1ZFX5jyuM1AR3JbVhbpoSAnf4qTZp4bXiFG47DmO030U3YY TqDit+h4T36LCe0+snkH3HZlSmNF7/napOsEH/eh3VIjsYp4W65NaWPKRi490l/AB7+d 8Y+w== 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 24si13503900edv.509.2021.04.25.07.34.37; Sun, 25 Apr 2021 07:35:00 -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 S230328AbhDYOeW (ORCPT + 99 others); Sun, 25 Apr 2021 10:34:22 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:39878 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229906AbhDYOeV (ORCPT ); Sun, 25 Apr 2021 10:34:21 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lafpD-000zu0-0c; Sun, 25 Apr 2021 16:33:31 +0200 Date: Sun, 25 Apr 2021 16:33:30 +0200 From: Andrew Lunn To: Ansuel Smith Cc: DENG Qingfang , Florian Fainelli , Vivien Didelot , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Heiner Kallweit , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 11/14] drivers: net: dsa: qca8k: apply switch revision fix Message-ID: References: <20210423014741.11858-1-ansuelsmth@gmail.com> <20210423014741.11858-12-ansuelsmth@gmail.com> <20210425044554.194770-1-dqfext@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 25, 2021 at 01:59:19PM +0200, Ansuel Smith wrote: > On Sun, Apr 25, 2021 at 12:45:54PM +0800, DENG Qingfang wrote: > > Hi Ansuel, > > > > On Sat, Apr 24, 2021 at 11:18:20PM +0200, Ansuel Smith wrote: > > > > > > I'm starting to do some work with this and a problem arised. Since these > > > value are based on the switch revision, how can I access these kind of > > > data from the phy driver? It's allowed to declare a phy driver in the > > > dsa directory? (The idea would be to create a qca8k dir with the dsa > > > driver and the dedicated internal phy driver.) This would facilitate the > > > use of normal qca8k_read/write (to access the switch revision from the > > > phy driver) using common function? > > > > In case of different switch revision, the PHY ID should also be different. > > I think you can reuse the current at803x.c PHY driver, as they seem to > > share similar registers. > > > > Is this really necessary? Every PHY has the same ID linked to the switch > id but the revision can change across the same switch id. Isn't the phy > dev flag enought to differiante one id from another? Just as general background information: A PHY ID generally consists of three parts. 1) OUI - Identifies the manufacture - 22 bits 2) device - Generally 6 bits 3) revision - Generally 4 bits The 22 bits of OUI is standardized. But the last 10 bits the vendor can use as they wish. But generally, this is how it is used. Loading the PHY driver is generally based on matching the OUI and device ID. The revision is ignored. But it is available to the driver if needed. It could be, the switch revision is also reflected in the PHY revision. Andrew