From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CA13C433DB for ; Sun, 24 Jan 2021 19:04:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 284C022DA7 for ; Sun, 24 Jan 2021 19:04:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726643AbhAXTEf (ORCPT ); Sun, 24 Jan 2021 14:04:35 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:57012 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbhAXTEd (ORCPT ); Sun, 24 Jan 2021 14:04:33 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1l3kfs-002PbZ-3d; Sun, 24 Jan 2021 20:03:48 +0100 Date: Sun, 24 Jan 2021 20:03:48 +0100 From: Andrew Lunn To: Stefan Chulski Cc: Russell King - ARM Linux admin , "netdev@vger.kernel.org" , "thomas.petazzoni@bootlin.com" , "davem@davemloft.net" , Nadav Haklai , Yan Markman , "linux-kernel@vger.kernel.org" , "kuba@kernel.org" , "mw@semihalf.com" , "atenart@kernel.org" Subject: Re: [EXT] Re: [PATCH v2 RFC net-next 04/18] net: mvpp2: add PPv23 version definition Message-ID: References: <1611488647-12478-1-git-send-email-stefanc@marvell.com> <1611488647-12478-5-git-send-email-stefanc@marvell.com> <20210124131810.GZ1551@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, Jan 24, 2021 at 01:55:42PM +0000, Stefan Chulski wrote: > > > Signed-off-by: Stefan Chulski > > > --- > > > drivers/net/ethernet/marvell/mvpp2/mvpp2.h | 24 ++++++++++++------ > > -- > > > drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 17 +++++++++----- > > > 2 files changed, 25 insertions(+), 16 deletions(-) > > > > > > diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h > > > b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h > > > index aec9179..89b3ede 100644 > > > --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h > > > +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h > > > @@ -60,6 +60,9 @@ > > > /* Top Registers */ > > > #define MVPP2_MH_REG(port) (0x5040 + 4 * (port)) > > > #define MVPP2_DSA_EXTENDED BIT(5) > > > +#define MVPP2_VER_ID_REG 0x50b0 > > > +#define MVPP2_VER_PP22 0x10 > > > +#define MVPP2_VER_PP23 0x11 > > > > Looking at the Armada 8040 docs, it seems this register exists on > > PPv2.1 as well, and holds the value zero there. > > > > I wonder whether we should instead read it's value directly into hw_version, > > and test against these values, rather than inventing our own verison enum. > > > > I've also been wondering whether your != MVPP21 comparisons should > > instead be >= MVPP22. > > > > Any thoughts? > > We cannot access PPv2 register space before enabling clocks(done in mvpp2_probe) , PP21 and PP22/23 have different sets of clocks. > So diff between PP21 and PP22/23 should be stored in device tree(in > of_device_id), with MVPP22 and MVPP21 stored as .data Hi Stefan As far as i can see, you are not adding a new compatible. So 'marvell,armada-7k-pp2' means PPv2.2 and PPv2.3? It would be good to update the comment at the beginning of marvell-pp2.txt to indicate this. Andrew