Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1901298pxb; Mon, 12 Apr 2021 09:14:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTu6Ccv2Bxhh8wOXLIFIrlleOKX8NbvDwsNU347V+gyU9+BkSb/o/OxXT4BV3o5aiN6Ki1 X-Received: by 2002:a17:903:189:b029:e5:d7c3:a264 with SMTP id z9-20020a1709030189b02900e5d7c3a264mr27278577plg.6.1618244081036; Mon, 12 Apr 2021 09:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618244081; cv=none; d=google.com; s=arc-20160816; b=pqIkKhcUmY5nJqjQkrUSkxJF4m2CKxckoT13XLmB6pIn+RWmL2f4rbTfU8C0gEwrLS x4OmvAB5nXkCcOjXyxfXKkzFiglwfPTTgXrFcYnepHhNVnia2LX1/HQJ7fcIqp9X+sgK RXWCN/1syWzg042PDcOsbt21oN6G2j0s9Xj9KUkgXCyp57b7oN+/m4CJrRLGP1quzS2s N/R6EtHQjlrhg79MNSZYdbwBNXmvDvNhxDkjpVJ0IN/1TG4aWzq2wS5Jl41SErRubbFW inhUXT/u5TCHcQW5WwMUf2jteko7rKyh6Hl9N9DjEqi2IeCXz/fPHgNfRfyLk6tyN2RG GXog== 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=XBsGUxbvmzuC8SP/tI/g3NCJ/pGb2Uxb6HaHA7C+ycM=; b=V3AgjFxF7Q7/4EcNlX5vUBCBpQT+VI/PIw12IzjhVtbU0T/lCx7I+d9Jbo1yT7oYP/ CmOEhZQQNb5fCKXymHdZYITgUzil8+FBUSYIiDSI+QJfQV7l1Qloza/k3E1/UCwBXTuK ILZTvXPZ4gNao1Ds4JamMJUWYzsfUTzEKFCYFFduWiKxQajFRKKZavRuEujqLiq8uqLq KL/A6YHzEdE0rrAUt5PqCWBoiCCRUKP5m86kR04Zr87RSwXGjSPwvm5BqKGpICQrjJE/ ZVMzD0k4wqFKQdAqL75RnMDB4bxRAz4FDDUrpoM2XwIxWYKS+B9AnAu7DYv4YO+vUyrh 0igA== 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 15si15917745pfo.147.2021.04.12.09.14.28; Mon, 12 Apr 2021 09:14:41 -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 S242939AbhDLQM7 (ORCPT + 99 others); Mon, 12 Apr 2021 12:12:59 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:45822 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242899AbhDLQM6 (ORCPT ); Mon, 12 Apr 2021 12:12:58 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lVzAx-00GHri-OE; Mon, 12 Apr 2021 18:12:35 +0200 Date: Mon, 12 Apr 2021 18:12:35 +0200 From: Andrew Lunn To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Marek =?iso-8859-1?Q?Beh=FAn?= , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: phy: marvell: fix detection of PHY on Topaz switches Message-ID: References: <20210412121430.20898-1-pali@kernel.org> <20210412133447.fyqkavrs5r5wbino@pali> <20210412150152.pbz5zt7mu3aefbrx@pali> <20210412155239.chgrne7uzvlrac2e@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210412155239.chgrne7uzvlrac2e@pali> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 12, 2021 at 05:52:39PM +0200, Pali Roh?r wrote: > On Monday 12 April 2021 17:32:33 Andrew Lunn wrote: > > > Anyway, now I'm looking at phy/marvell.c driver again and it supports > > > only 88E6341 and 88E6390 families from whole 88E63xxx range. > > > > > > So do we need to define for now table for more than > > > MV88E6XXX_FAMILY_6341 and MV88E6XXX_FAMILY_6390 entries? > > > > Probably not. I've no idea if the 6393 has an ID, so to be safe you > > should add that. Assuming it has a family of its own. > > So what about just? > > if (reg == MII_PHYSID2 && !(val & 0x3f0)) { > if (chip->info->family == MV88E6XXX_FAMILY_6341) > val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6341 >> 4; > else if (chip->info->family == MV88E6XXX_FAMILY_6390) > val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >> 4; > } As i said, i expect the 6393 also has no ID. And i recently found out Marvell have some automotive switches, 88Q5xxx which are actually based around the same IP and could be added to this driver. They also might not have an ID. I suspect this list is going to get longer, so having it table driven will make that simpler, less error prone. Andrew