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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, 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 59C63C433ED for ; Sun, 11 Apr 2021 23:16:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19B27611C9 for ; Sun, 11 Apr 2021 23:16:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235592AbhDKXRK (ORCPT ); Sun, 11 Apr 2021 19:17:10 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:44534 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235005AbhDKXRJ (ORCPT ); Sun, 11 Apr 2021 19:17:09 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lVjJx-00GAPY-Us; Mon, 12 Apr 2021 01:16:49 +0200 Date: Mon, 12 Apr 2021 01:16:49 +0200 From: Andrew Lunn To: Martin Blumenstingl Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, davem@davemloft.net, olteanv@gmail.com, f.fainelli@gmail.com, vivien.didelot@gmail.com, Hauke Mehrtens Subject: Re: [PATCH net-next] net: dsa: lantiq_gswip: Add support for dumping the registers Message-ID: References: <20210411205511.417085-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210411205511.417085-1-martin.blumenstingl@googlemail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, Apr 11, 2021 at 10:55:11PM +0200, Martin Blumenstingl wrote: > Add support for .get_regs_len and .get_regs so it is easier to find out > about the state of the ports on the GSWIP hardware. For this we > specifically add the GSWIP_MAC_PSTATp(port) and GSWIP_MDIO_STATp(port) > register #defines as these contain the current port status (as well as > the result of the auto polling mechanism). Other global and per-port > registers which are also considered useful are included as well. Although this is O.K, there has been a trend towards using devlink regions for this, and other register sets in the switch. Take a look at drivers/net/dsa/mv88e6xxx/devlink.c. There is a userspace tool for the mv88e6xxx devlink regions here: https://github.com/lunn/mv88e6xxx_dump and a few people have forked it and modified it for other DSA switches. At some point we might want to try to merge the forks back together so we have one tool to dump any switch. Andrew