Re: [PATCH net-next v2 5/5] net-next: dsa: add dsa support for Mediatek MT7530 switch

From: Andrew Lunn
Date: Fri Mar 24 2017 - 03:58:21 EST


On Thu, Mar 23, 2017 at 04:06:56PM +0800, Sean Wang wrote:
> Hi Andrew,
>
> The purpose for the regmap table registered is to
>
> provide a way which helps us to look up a specific
>
> register on the switch through regmap-debugfs.
>
>
> And not all ranges of register is defined
>
> so I only include the meaningful ones in a sparse way
>
> for the table.

Many of there registers can be dumped using existing tools. You can
dump the port registers using ethtool -r, if you implement
get_regs/get_regs_len in your driver. mii-tool can dump the PHY
registers.

What you cannot see are global registers, so i can understand the
usage of regmap-debugfs. However, i have a hard time with you only
actually using the regmap for get/set for one small subset of
registers. Either you need to use regmap to get/set all registers, or
you remove it from the mainline driver, and keep it as a private patch
which you use for your development work. For the Marvell driver we
have an out of tree patch which exports a log of information via
debugfs.

Andrew