Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1928103pxb; Mon, 12 Apr 2021 09:50:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzaI3coGWZaGHMM4h0ftDw6rswWCOez2zEWSM5H1DXCmqt+44xjzU566S6Sc+ygJmpQiws X-Received: by 2002:a63:1556:: with SMTP id 22mr28611264pgv.142.1618246258276; Mon, 12 Apr 2021 09:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618246258; cv=none; d=google.com; s=arc-20160816; b=C8mowmGJC4Flj4vl3rg/wDNUtMRjwK2cM1oJg6cm+02am2PyW+dSaIgNQpyICuEsC5 lP0qsHo4hywZCzrebVxdfwfw/ZsGNeojTxUQKn5YXV8HaKm/vPZaaooXREwN5qsNq2tx KV6uNF96LUi/2JeXcpdJICAMxRf8I2uduod1hoKwdFs21+Hg+uPfowan1Vz+2XTLg/J0 h+R/t4ePDPiBOUc9E0zG8lkEqmPcKrRRvQJ5yZmIvEz9zENeXfhYiIWiLlYwQ7kZK2H8 c6GN85FhTsmbkVWsX/IxdIw8oYHDNGqTiLurN1E7CYVoJve9JGsSIAWlvtmhIV6S0KgE q3Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zbnTiKKnAdXcLS1ZVW79+DlueF4ZEH0G0a/rbSIGeJM=; b=siEJZV409rEe1GvQ8KLK5MYGQU98JAVTdAfMSYhnDtG/RbwWG6WIe2nZ44RtuViQzc yxGdjVPydO5I2NYAzFtV4Bax0DgSRMslSiHxO2fNTbUM9bbHisXABu+gW1Ui17q4EL0P qcvE3tkCCs4BhnCNFgxMYvxFzeH+S1Xh04wvaZ/WIBCLUWi3tkjJWs1pggJkN18FAoCv d4SOxMNxyOok0rD5aY6npja7w1DhguGtVQCEoolR8ozwchpeOaHQktACRgUjWIttYPBC BewAMEv0lfnhaaKJAC16RoMHdjnhzMlePF5CwD97RklDPpwo4iNRK/55obst5O8RXF9u xdjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=INaZO7S7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si14738277pga.365.2021.04.12.09.50.44; Mon, 12 Apr 2021 09:50:58 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=INaZO7S7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345831AbhDLQsF (ORCPT + 99 others); Mon, 12 Apr 2021 12:48:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:41530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244977AbhDLQiv (ORCPT ); Mon, 12 Apr 2021 12:38:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 902C861025; Mon, 12 Apr 2021 16:38:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618245512; bh=x3poDP3WbJQgi2AQw0KWdhqafvNKtUGED5/DHA8UJXE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=INaZO7S7eTTZQVRTr6KcM2lAn4neII3N+mzu3NKC4VJsrEJVFGyw3Z1DVBXsyOVXK FsiE9LYDWFS9L7EGmmIFN+a+uUgeSDT9Q1CB7X+EcC1PeMtZb3ApGzyUz9l4y34leL CtnXtK2NBPx6CvvOe6EjhC1BBd9+BYWHZfGMKagGK6eRu1i3xGP18U34yZvmp4Psf6 rBz/pOLFS3DrVDjlCoFETjS7VH2q8ika8bbsaeVCro04zlcposLKE2VZxvoULZXqpk A2jTlDBiLpK+ReWXh2Q0Z+/UNr7xsiq41lQPjtLlAVn1s99RSWJLnbUmFl8ISN6gYC EfMeCsWQlPr2A== Received: by pali.im (Postfix) id 15A19687; Mon, 12 Apr 2021 18:38:29 +0200 (CEST) Date: Mon, 12 Apr 2021 18:38:29 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Andrew Lunn Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Marek =?utf-8?B?QmVow7pu?= , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: phy: marvell: fix detection of PHY on Topaz switches Message-ID: <20210412163829.kp7feb3yhzymukg2@pali> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 12 April 2021 18:12:35 Andrew Lunn wrote: > 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 Ok, I will use table but I fill it only with Topaz (6341) and Peridot (6390) which was there before as I do not have 6393 switch for testing. If you or anybody else has 6393 unit for testing, please extend then table.