diff mbox series

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

Message ID 20230413002905.5513-4-fr0st61te@gmail.com
State New
Headers show
Series Refactoring for GMA command | expand

Commit Message

Ivan Mikhaylov April 13, 2023, 12:29 a.m. UTC
Add s32 mac-address-increment option for Get MAC Address command from
NC-SI.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
---
 Documentation/devicetree/bindings/net/ftgmac100.txt | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Krzysztof Kozlowski April 13, 2023, 7:53 a.m. UTC | #1
On 13/04/2023 02:29, Ivan Mikhaylov wrote:
> Add s32 mac-address-increment option for Get MAC Address command from
> NC-SI.
> 
> Signed-off-by: Paul Fertser <fercerpav@gmail.com>
> Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
> ---
>  Documentation/devicetree/bindings/net/ftgmac100.txt | 4 ++++

Use subject prefixes matching the subsystem (which you can get for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching).

>  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.

First conversion to DT Schema. New properties are not accepted to TXT files.

Best regards,
Krzysztof
Rob Herring (Arm) April 18, 2023, 6:54 p.m. UTC | #2
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 <fercerpav@gmail.com>
> Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
> ---
>  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
Ivan Mikhaylov April 23, 2023, 1:02 a.m. UTC | #3
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 <fercerpav@gmail.com>
> > Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
> > ---
> >  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.
diff mbox series

Patch

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.
 - no-hw-checksum: Used to disable HW checksum support. Here for backward
   compatibility as the driver now should have correct defaults based on
   the SoC.