Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp356896pxa; Fri, 14 Aug 2020 06:21:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRMLvdNOZyZ0zsRx+cU4WnYLaKaf1h1PiKtB21CHqeoZhCkoTlclGuNE51uRrgUYW42lfR X-Received: by 2002:aa7:c9c2:: with SMTP id i2mr2120528edt.326.1597411287758; Fri, 14 Aug 2020 06:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597411287; cv=none; d=google.com; s=arc-20160816; b=O6elXjdVVgLRl6d+ImpJ03zL/F94at0v+Mwp2tLDJhsf3ealeB3t+hM3GduwA9ID9k cCSqfRAA8P65C05tFOcI2ivruOUPdj7EMeIcJz/nXRfpL/ilE4ndDmmXcSExqLTYynpl YMbDXuqDGuxDntKDfq/wiwIO6BL3kgH3c3mBCd6q7u8sGKwMtBNtPmafbpoB+eska3B3 ivDFlW1yDwRQVadQkIOEWurh9S7qI8uVIR25JOpqzGr3at6pq9zlxseKCVhYj2hcqCJi gEoZ/pJwKdz9SytPDtOKn34ozesWHBvm1or0uH0S4vOmj+Ctbptfc3qeteQtJZJGRe7W LUPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=46Bl1Z8r/gnvzP8FEy/9p7rp8HAVeprE7BILu5bN5ck=; b=StNpu6Np3ZBVkHTrTRsQq8gJAqmyI1dRK+cCDxO/le/iy+RMviCmbss6jcvJ0wE7CJ yNCS+IvGygCpa8Tata3dXQcQrL0ZPwMWXAgl+meL5apVYPTKJsSLwdBvpNHWfkXonR0A tkklYL2618GopS2XYcTxPY33EN2HimQ+3laW0vCBxsSweMHeeKjxsyeatoRSNoUSfLmJ Ltyhpn52bx1sfgpjdWCVT/fPcATW0Zou62LjMk8m+qviwl93Boh1ah0f6nfJ9I2DyhL9 vOv5FCVL2Sfrx5rUWSBWY7gbT7blwlMJowP63weCJ8gFH+Co00DbOjip0ujh0mirG1Tp /3kg== 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 gs8si5342283ejb.665.2020.08.14.06.21.03; Fri, 14 Aug 2020 06:21:27 -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 S1728529AbgHNNS1 (ORCPT + 99 others); Fri, 14 Aug 2020 09:18:27 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:53706 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726593AbgHNNS0 (ORCPT ); Fri, 14 Aug 2020 09:18:26 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1k6Zb5-009OOp-E8; Fri, 14 Aug 2020 15:18:15 +0200 Date: Fri, 14 Aug 2020 15:18:15 +0200 From: Andrew Lunn To: Vadym Kochan Cc: Jonathan McDowell , "David S. Miller" , Jakub Kicinski , Jiri Pirko , Ido Schimmel , Oleksandr Mazur , Serhiy Boiko , Serhiy Pshyk , Volodymyr Mytnyk , Taras Chornyi , Andrii Savka , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko , Mickey Rachamim Subject: Re: [net-next v4 1/6] net: marvell: prestera: Add driver for Prestera family ASIC devices Message-ID: <20200814131815.GA2238071@lunn.ch> References: <20200727122242.32337-1-vadym.kochan@plvision.eu> <20200727122242.32337-2-vadym.kochan@plvision.eu> <20200813080322.GH21409@earth.li> <20200814082054.GD17795@plvision.eu> <20200814120536.GA26106@earth.li> <20200814122744.GF17795@plvision.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200814122744.GF17795@plvision.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > Currently > > > > > > compatible = "marvell,prestera" > > > > > > is used as default, so may be > > > > > > you mean to support few matching including particular silicon too, like ? > > > > > > > > > compatible = "marvell,prestera" > > > compatible = "marvell,prestera-ac3x" > > > > > > Would you please give an example ? > > > > AFAICT "Prestera" is the general name for the Marvell > > enterprise/data-centre silicon, comparable to the "LinkStreet" > > designation for their lower end switching. The mv88e* drivers do not > > mention LinkStreet in their compatible strings at all, choosing instead > > to refer to chip IDs (I see mv88e6085, mv88e6190 + mv88e6250). > > > > I do not have enough familiarity with the Prestera range to be able to > > tell what commonality there is between the different versions (it > > appears you need an NDA to get hold of the programming references), but > > even just looking at your driver and the vendor code for the BobCat it > > seems that AlleyCat3 uses an extended DSA header format, and requires a > > firmware with message based access, in comparison to the BobCat which > > uses register poking. > > > > Based on that I'd recommend not using the bare "marvell,prestera" > > compatible string, but instead something more specific. > > "marvell,prestera-ac3x" seems like a suitable choice, assuming that's > > how these chips are named/generally referred to. > > > > Also I'd expand your Kconfig information to actually include "Marvell > > Prestera 98DX326x" as that's the only supported chip range at present. > > > > Yes, Prestera covers more range of devices. But it is planning to cover > other devices too, and currently there is no device-specific DTS > properties which are used in this version, but only the generic one - > since only the MAC address node. > > I mean that if there will be other Prestera devices supported then it > will require to extend the DTS matching string in the driver just to > support the same generic DTS properties for new device. > > Anyway I will rise and discuss this question. Hi Vadym Lets start with how mv88e6xxx does this. The switches have ID registers. Once you have read the ID registers, you know what device you have, and you can select device specific code as needed. However, these ID registers are in three different locations, depending on the chip family. So the compatible string is all about where to read the ID from, not about what specific chip is. So most device tree bindings say "marvell,mv88e6085", but the 6390 family use "marvell,mv88e6190" for example. This naming scheme is actually odd compared to others. And that oddness causes confusion. But it avoids a few problems. If you have per chip compatible strings, what do you do when it conflicts with the ID registers. If from day 1 you validate the compatible string against the ID register and fail the probe if it is incorrect, you are O.K. But if you decide to add this validation later, you are going to find a number of device tree blobs which have the wrong compatible string. Do you fail the probe on boards which have worked? So what to do with this driver? Does the prestera have ID registers? Are you using them in the driver? Marvell is not particularly good at backwards compatibility. Does your compatible string give you enough wiggle room you can easily introduce another compatible string in order to find the ID registers when they move? Andrew