Subject: Re: [PATCH 3/4] net/ftgmac100: add mac-address-increment option for GMA command from NC-SI

From: Ivan Mikhaylov <[email-masked]>
Date: Sun, 23 Apr 2023 01:02:17 +0000

On Tue, 2023-04-18 at 13:54 -0500, Rob Herring wrote:
> On Thu, Apr 13, 2023 at 12:29:04AM +0000, Ivan Mikhaylov wrote:
> > Add s32 mac-address-increment option for Get MAC Address command
> > from
> > NC-SI.
> > 
> > Signed-off-by: Paul Fertser <[email-masked]>
> > Signed-off-by: Ivan Mikhaylov <[email-masked]>
> > ---
> >  Documentation/devicetree/bindings/net/ftgmac100.txt | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/ftgmac100.txt
> > b/Documentation/devicetree/bindings/net/ftgmac100.txt
> > index 29234021f601..7ef5329d888d 100644
> > --- a/Documentation/devicetree/bindings/net/ftgmac100.txt
> > +++ b/Documentation/devicetree/bindings/net/ftgmac100.txt
> > @@ -22,6 +22,10 @@ Optional properties:
> >  - use-ncsi: Use the NC-SI stack instead of an MDIO PHY. Currently
> > assumes
> >    rmii (100bT) but kept as a separate property in case NC-SI grows
> > support
> >    for a gigabit link.
> > +- mac-address-increment: Increment the MAC address taken by GMA
> > command via
> > +  NC-SI. Specifies a signed number to be added to the host MAC
> > address as
> > +  obtained by the OEM GMA command. If not specified, 1 is used by
> > default
> > +  for Broadcom and Intel network cards, 0 otherwise.
> 
> This would need to be common. There's been some attempts around how
> to 
> support a base MAC address with a transform per instance. So far it's
> not clear that something in DT works for everyone. Until there's 
> something common (if ever), you need platform specific code somewhere
> to 
> handle this. The nvmem binding has had some extensions to support
> that.
> 
> Rob

Rob, I agree but unfortunately there isn't a generic option for such
case, maybe something should be added into net/ethernet-
controller.yaml? As example, `mac-address-increment` option using
widely in openwrt project. About nvmem, are we talking `nvmem-cell-
names` option or reverse_mac_address in drivers/nvmem/imx-ocotp.c?

I'll do the transfer into DT schema, that's not a problem but after
naming resolve.

Adding openbmc community, maybe they have some ideas about this one.

Thanks.