diff mbox

[6/7] dt-bindings: net: bgmac: add bindings documentation for bgmac

Message ID 1467327554-22074-7-git-send-email-jon.mason@broadcom.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Jon Mason June 30, 2016, 10:59 p.m. UTC
Signed-off-by: Jon Mason <jon.mason@broadcom.com>
---
 .../devicetree/bindings/net/brcm,bgmac-nsp.txt     | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/brcm,bgmac-nsp.txt

Comments

Rob Herring July 1, 2016, 2:56 a.m. UTC | #1
On Thu, Jun 30, 2016 at 06:59:13PM -0400, Jon Mason wrote:
> Signed-off-by: Jon Mason <jon.mason@broadcom.com>
> ---
>  .../devicetree/bindings/net/brcm,bgmac-nsp.txt     | 24 ++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/brcm,bgmac-nsp.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/brcm,bgmac-nsp.txt b/Documentation/devicetree/bindings/net/brcm,bgmac-nsp.txt
> new file mode 100644
> index 0000000..022946c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/brcm,bgmac-nsp.txt
> @@ -0,0 +1,24 @@
> +Broadcom GMAC Ethernet Controller Device Tree Bindings
> +-------------------------------------------------------------
> +
> +Required properties:
> + - compatible:	"brcm,bgmac-nsp"

Usually we do <soc>-<block> order.

> + - reg:		Address and length of the GMAC registers,
> +		Address and length of the GMAC IDM registers
> + - reg-names:	Names of the registers.  Must have both "gmac_base" and
> +		"idm_base"
> + - interrupts:	Interrupt number
> +
> +Optional properties:
> +- mac-address:	See ethernet.txt file in the same directory
> +
> +Examples:
> +
> +gmac0: ethernet@18022000 {
> +	compatible = "brcm,bgmac-nsp";
> +	reg = <0x18022000 0x1000>,
> +	      <0x18110000 0x1000>;
> +	reg-names = "gmac_base", "idm_base";
> +	interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
> +	status = "disabled";
> +};
> -- 
> 1.9.1
>
Arnd Bergmann July 1, 2016, 9:46 a.m. UTC | #2
On Thursday, June 30, 2016 6:59:13 PM CEST Jon Mason wrote:
> +
> +Required properties:
> + - compatible: "brcm,bgmac-nsp"
> + - reg:                Address and length of the GMAC registers,
> +               Address and length of the GMAC IDM registers
> + - reg-names:  Names of the registers.  Must have both "gmac_base" and
> +               "idm_base"
> + - interrupts: Interrupt number
> +


"brcm,bgmac-nsp" sounds a bit too general. As I understand, this is a family
of SoCs that might not all have the exact same implementation of this
ethernet device, as we can see from the long lookup table in bgmac_probe().

Please document the specific product numbers here that are publically
known already. Having the driver match just on "brcm,bgmac-nsp" as a fallback
is fine, so you can document that one as required for all users.

	Arnd
Jon Mason July 1, 2016, 2:29 p.m. UTC | #3
On Thu, Jun 30, 2016 at 10:56 PM, Rob Herring <robh@kernel.org> wrote:
> On Thu, Jun 30, 2016 at 06:59:13PM -0400, Jon Mason wrote:
>> Signed-off-by: Jon Mason <jon.mason@broadcom.com>
>> ---
>>  .../devicetree/bindings/net/brcm,bgmac-nsp.txt     | 24 ++++++++++++++++++++++
>>  1 file changed, 24 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/net/brcm,bgmac-nsp.txt
>>
>> diff --git a/Documentation/devicetree/bindings/net/brcm,bgmac-nsp.txt b/Documentation/devicetree/bindings/net/brcm,bgmac-nsp.txt
>> new file mode 100644
>> index 0000000..022946c
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/brcm,bgmac-nsp.txt
>> @@ -0,0 +1,24 @@
>> +Broadcom GMAC Ethernet Controller Device Tree Bindings
>> +-------------------------------------------------------------
>> +
>> +Required properties:
>> + - compatible:       "brcm,bgmac-nsp"
>
> Usually we do <soc>-<block> order.

Thanks, I'll make the necessary changes and push out a v2.

>
>> + - reg:              Address and length of the GMAC registers,
>> +             Address and length of the GMAC IDM registers
>> + - reg-names:        Names of the registers.  Must have both "gmac_base" and
>> +             "idm_base"
>> + - interrupts:       Interrupt number
>> +
>> +Optional properties:
>> +- mac-address:       See ethernet.txt file in the same directory
>> +
>> +Examples:
>> +
>> +gmac0: ethernet@18022000 {
>> +     compatible = "brcm,bgmac-nsp";
>> +     reg = <0x18022000 0x1000>,
>> +           <0x18110000 0x1000>;
>> +     reg-names = "gmac_base", "idm_base";
>> +     interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
>> +     status = "disabled";
>> +};
>> --
>> 1.9.1
>>
Jon Mason July 1, 2016, 3:17 p.m. UTC | #4
On Fri, Jul 1, 2016 at 5:46 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Thursday, June 30, 2016 6:59:13 PM CEST Jon Mason wrote:
>> +
>> +Required properties:
>> + - compatible: "brcm,bgmac-nsp"
>> + - reg:                Address and length of the GMAC registers,
>> +               Address and length of the GMAC IDM registers
>> + - reg-names:  Names of the registers.  Must have both "gmac_base" and
>> +               "idm_base"
>> + - interrupts: Interrupt number
>> +
>
>
> "brcm,bgmac-nsp" sounds a bit too general. As I understand, this is a family
> of SoCs that might not all have the exact same implementation of this
> ethernet device, as we can see from the long lookup table in bgmac_probe().

The Broadcom iProc family of SoCs contains:
Northstar
Northstar Plus
Cygnus
Northstar 2
a few SoCs that are under development
and a number of ethernet switches (which might never be officially supported)

Each one of these SoCs could have a different revision of the gmac IP
block, but they should be uniform within each SoC (though there might
be a A0/B0 change necessary).  The Northstar Plus product family has a
number of different implementations, but the SoC is unchanged.  So, I
think this might be too specific, when we really need a general compat
string.

Broadcom has a history of sharing IP blocks amongst the different
divisions.  So, this driver might be used on other SoC families (as it
apparently has been done in the past, based on the code you
reference).  I do not know of any way to know what legacy, non-iProc
chips have used this IP block.  I can make this "brcm,iproc-bgmac",
and add "brcm,iproc-nsp-bgmac" as an alternative compatible string in
this file (which I believe you are suggesting), but there might be
non-iProc SoCs that use this driver.  Is this acceptable?

Thanks,
Jon

> Please document the specific product numbers here that are publically
> known already. Having the driver match just on "brcm,bgmac-nsp" as a fallback
> is fine, so you can document that one as required for all users.
>
>         Arnd
Arnd Bergmann July 1, 2016, 3:42 p.m. UTC | #5
On Friday, July 1, 2016 11:17:25 AM CEST Jon Mason wrote:
> On Fri, Jul 1, 2016 at 5:46 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Thursday, June 30, 2016 6:59:13 PM CEST Jon Mason wrote:
> >> +
> >> +Required properties:
> >> + - compatible: "brcm,bgmac-nsp"
> >> + - reg:                Address and length of the GMAC registers,
> >> +               Address and length of the GMAC IDM registers
> >> + - reg-names:  Names of the registers.  Must have both "gmac_base" and
> >> +               "idm_base"
> >> + - interrupts: Interrupt number
> >> +
> >
> >
> > "brcm,bgmac-nsp" sounds a bit too general. As I understand, this is a family
> > of SoCs that might not all have the exact same implementation of this
> > ethernet device, as we can see from the long lookup table in bgmac_probe().
> 
> The Broadcom iProc family of SoCs contains:
> Northstar
> Northstar Plus
> Cygnus
> Northstar 2
> a few SoCs that are under development
> and a number of ethernet switches (which might never be officially supported)
> 
> Each one of these SoCs could have a different revision of the gmac IP
> block, but they should be uniform within each SoC (though there might
> be a A0/B0 change necessary).  The Northstar Plus product family has a
> number of different implementations, but the SoC is unchanged.  So, I
> think this might be too specific, when we really need a general compat
> string.

Ok, thanks for the clarification, that sounds good enough.

> Broadcom has a history of sharing IP blocks amongst the different
> divisions.  So, this driver might be used on other SoC families (as it
> apparently has been done in the past, based on the code you
> reference).  I do not know of any way to know what legacy, non-iProc
> chips have used this IP block.  I can make this "brcm,iproc-bgmac",
> and add "brcm,iproc-nsp-bgmac" as an alternative compatible string in
> this file (which I believe you are suggesting), but there might be
> non-iProc SoCs that use this driver.  Is this acceptable?

If it is also used outside of iProc, then I see no need for the
extra compatible string, although it would not do any harm either.

Ideally we should name it whatever the name for this IP block is
inside of the company, with "nsp" as the designation for the variant
in Northstar Plus. A lot of Broadcom IP blocks themselves seem to have
some four-digit or five-digit number, maybe this one does too?

	Arnd
Ray Jui July 4, 2016, 4:34 p.m. UTC | #6
On 7/1/2016 8:42 AM, Arnd Bergmann wrote:
> On Friday, July 1, 2016 11:17:25 AM CEST Jon Mason wrote:
>> On Fri, Jul 1, 2016 at 5:46 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>>> On Thursday, June 30, 2016 6:59:13 PM CEST Jon Mason wrote:
>>>> +
>>>> +Required properties:
>>>> + - compatible: "brcm,bgmac-nsp"
>>>> + - reg:                Address and length of the GMAC registers,
>>>> +               Address and length of the GMAC IDM registers
>>>> + - reg-names:  Names of the registers.  Must have both "gmac_base" and
>>>> +               "idm_base"
>>>> + - interrupts: Interrupt number
>>>> +
>>>
>>>
>>> "brcm,bgmac-nsp" sounds a bit too general. As I understand, this is a family
>>> of SoCs that might not all have the exact same implementation of this
>>> ethernet device, as we can see from the long lookup table in bgmac_probe().
>>
>> The Broadcom iProc family of SoCs contains:
>> Northstar
>> Northstar Plus
>> Cygnus
>> Northstar 2
>> a few SoCs that are under development
>> and a number of ethernet switches (which might never be officially supported)
>>
>> Each one of these SoCs could have a different revision of the gmac IP
>> block, but they should be uniform within each SoC (though there might
>> be a A0/B0 change necessary).  The Northstar Plus product family has a
>> number of different implementations, but the SoC is unchanged.  So, I
>> think this might be too specific, when we really need a general compat
>> string.
>
> Ok, thanks for the clarification, that sounds good enough.
>
>> Broadcom has a history of sharing IP blocks amongst the different
>> divisions.  So, this driver might be used on other SoC families (as it
>> apparently has been done in the past, based on the code you
>> reference).  I do not know of any way to know what legacy, non-iProc
>> chips have used this IP block.  I can make this "brcm,iproc-bgmac",
>> and add "brcm,iproc-nsp-bgmac" as an alternative compatible string in
>> this file (which I believe you are suggesting), but there might be
>> non-iProc SoCs that use this driver.  Is this acceptable?
>
> If it is also used outside of iProc, then I see no need for the
> extra compatible string, although it would not do any harm either.
>
> Ideally we should name it whatever the name for this IP block is
> inside of the company, with "nsp" as the designation for the variant
> in Northstar Plus. A lot of Broadcom IP blocks themselves seem to have
> some four-digit or five-digit number, maybe this one does too?
>
> 	Arnd
>

Note this IP block has an official IP controller name of "amac" from the 
ASIC team.

Thanks,

Ray
Arnd Bergmann July 5, 2016, 1:37 p.m. UTC | #7
On Monday, July 4, 2016 9:34:35 AM CEST Ray Jui wrote:
> On 7/1/2016 8:42 AM, Arnd Bergmann wrote:
> > On Friday, July 1, 2016 11:17:25 AM CEST Jon Mason wrote:
> >> On Fri, Jul 1, 2016 at 5:46 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> >>> On Thursday, June 30, 2016 6:59:13 PM CEST Jon Mason wrote:
> >>>> +
> >>>> +Required properties:
> >>>> + - compatible: "brcm,bgmac-nsp"
> >>>> + - reg:                Address and length of the GMAC registers,
> >>>> +               Address and length of the GMAC IDM registers
> >>>> + - reg-names:  Names of the registers.  Must have both "gmac_base" and
> >>>> +               "idm_base"
> >>>> + - interrupts: Interrupt number
> >>>> +
> >>>
> >>>
> >>> "brcm,bgmac-nsp" sounds a bit too general. As I understand, this is a family
> >>> of SoCs that might not all have the exact same implementation of this
> >>> ethernet device, as we can see from the long lookup table in bgmac_probe().
> >>
> >> The Broadcom iProc family of SoCs contains:
> >> Northstar
> >> Northstar Plus
> >> Cygnus
> >> Northstar 2
> >> a few SoCs that are under development
> >> and a number of ethernet switches (which might never be officially supported)
> >>
> >> Each one of these SoCs could have a different revision of the gmac IP
> >> block, but they should be uniform within each SoC (though there might
> >> be a A0/B0 change necessary).  The Northstar Plus product family has a
> >> number of different implementations, but the SoC is unchanged.  So, I
> >> think this might be too specific, when we really need a general compat
> >> string.
> >
> > Ok, thanks for the clarification, that sounds good enough.
> >
> >> Broadcom has a history of sharing IP blocks amongst the different
> >> divisions.  So, this driver might be used on other SoC families (as it
> >> apparently has been done in the past, based on the code you
> >> reference).  I do not know of any way to know what legacy, non-iProc
> >> chips have used this IP block.  I can make this "brcm,iproc-bgmac",
> >> and add "brcm,iproc-nsp-bgmac" as an alternative compatible string in
> >> this file (which I believe you are suggesting), but there might be
> >> non-iProc SoCs that use this driver.  Is this acceptable?
> >
> > If it is also used outside of iProc, then I see no need for the
> > extra compatible string, although it would not do any harm either.
> >
> > Ideally we should name it whatever the name for this IP block is
> > inside of the company, with "nsp" as the designation for the variant
> > in Northstar Plus. A lot of Broadcom IP blocks themselves seem to have
> > some four-digit or five-digit number, maybe this one does too?
> >
> >       Arnd
> >
> 
> Note this IP block has an official IP controller name of "amac" from the 
> ASIC team.

Ok, then I'd suggest making the compatible string here

	compatible = "brcm,nsp-amac", "brcm,amac";

or even better if you have a version number associated with it, make that

	compatible = "brcm,nsp-amac", "brcm,amac-1.234", "brcm,amac";

replacing 1.234 with the actual version of course.

	Arnd
Jon Mason July 5, 2016, 11:18 p.m. UTC | #8
On Tue, Jul 5, 2016 at 9:37 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday, July 4, 2016 9:34:35 AM CEST Ray Jui wrote:
>> On 7/1/2016 8:42 AM, Arnd Bergmann wrote:
>> > On Friday, July 1, 2016 11:17:25 AM CEST Jon Mason wrote:
>> >> On Fri, Jul 1, 2016 at 5:46 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> >>> On Thursday, June 30, 2016 6:59:13 PM CEST Jon Mason wrote:
>> >>>> +
>> >>>> +Required properties:
>> >>>> + - compatible: "brcm,bgmac-nsp"
>> >>>> + - reg:                Address and length of the GMAC registers,
>> >>>> +               Address and length of the GMAC IDM registers
>> >>>> + - reg-names:  Names of the registers.  Must have both "gmac_base" and
>> >>>> +               "idm_base"
>> >>>> + - interrupts: Interrupt number
>> >>>> +
>> >>>
>> >>>
>> >>> "brcm,bgmac-nsp" sounds a bit too general. As I understand, this is a family
>> >>> of SoCs that might not all have the exact same implementation of this
>> >>> ethernet device, as we can see from the long lookup table in bgmac_probe().
>> >>
>> >> The Broadcom iProc family of SoCs contains:
>> >> Northstar
>> >> Northstar Plus
>> >> Cygnus
>> >> Northstar 2
>> >> a few SoCs that are under development
>> >> and a number of ethernet switches (which might never be officially supported)
>> >>
>> >> Each one of these SoCs could have a different revision of the gmac IP
>> >> block, but they should be uniform within each SoC (though there might
>> >> be a A0/B0 change necessary).  The Northstar Plus product family has a
>> >> number of different implementations, but the SoC is unchanged.  So, I
>> >> think this might be too specific, when we really need a general compat
>> >> string.
>> >
>> > Ok, thanks for the clarification, that sounds good enough.
>> >
>> >> Broadcom has a history of sharing IP blocks amongst the different
>> >> divisions.  So, this driver might be used on other SoC families (as it
>> >> apparently has been done in the past, based on the code you
>> >> reference).  I do not know of any way to know what legacy, non-iProc
>> >> chips have used this IP block.  I can make this "brcm,iproc-bgmac",
>> >> and add "brcm,iproc-nsp-bgmac" as an alternative compatible string in
>> >> this file (which I believe you are suggesting), but there might be
>> >> non-iProc SoCs that use this driver.  Is this acceptable?
>> >
>> > If it is also used outside of iProc, then I see no need for the
>> > extra compatible string, although it would not do any harm either.
>> >
>> > Ideally we should name it whatever the name for this IP block is
>> > inside of the company, with "nsp" as the designation for the variant
>> > in Northstar Plus. A lot of Broadcom IP blocks themselves seem to have
>> > some four-digit or five-digit number, maybe this one does too?
>> >
>> >       Arnd
>> >
>>
>> Note this IP block has an official IP controller name of "amac" from the
>> ASIC team.
>
> Ok, then I'd suggest making the compatible string here
>
>         compatible = "brcm,nsp-amac", "brcm,amac";

It is called GMAC in the NS and NSP documentation, but AMAC is fine
with me (as it is called this in the NS2 documentation).  I'll make
the necessary change and repush.

Thanks for all of the input.

> or even better if you have a version number associated with it, make that
>
>         compatible = "brcm,nsp-amac", "brcm,amac-1.234", "brcm,amac";
>
> replacing 1.234 with the actual version of course.
>
>         Arnd
>
Arnd Bergmann July 6, 2016, 7:34 a.m. UTC | #9
On Tuesday, July 5, 2016 7:18:45 PM CEST Jon Mason wrote:
> >
> > Ok, then I'd suggest making the compatible string here
> >
> >         compatible = "brcm,nsp-amac", "brcm,amac";
> 
> It is called GMAC in the NS and NSP documentation, but AMAC is fine
> with me (as it is called this in the NS2 documentation).  I'll make
> the necessary change and repush.

Ok, then we can use

	compatible = "brcm,nsp-gmac", "brcm,amac";

to be consistent with that documentation and have the generic name as the
fallback.

	Arnd
Jon Mason July 7, 2016, 10:42 p.m. UTC | #10
On Wed, Jul 6, 2016 at 3:34 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday, July 5, 2016 7:18:45 PM CEST Jon Mason wrote:
>> >
>> > Ok, then I'd suggest making the compatible string here
>> >
>> >         compatible = "brcm,nsp-amac", "brcm,amac";
>>
>> It is called GMAC in the NS and NSP documentation, but AMAC is fine
>> with me (as it is called this in the NS2 documentation).  I'll make
>> the necessary change and repush.
>
> Ok, then we can use
>
>         compatible = "brcm,nsp-gmac", "brcm,amac";
>
> to be consistent with that documentation and have the generic name as the
> fallback.

After looking at the docs again, I see the blocks being referred to as
"AXI MAC" (while the registers are being called GMAC).  To keep it
consistent, I'll just change everything to be "amac".

Thanks,
Jon

>
>         Arnd
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/net/brcm,bgmac-nsp.txt b/Documentation/devicetree/bindings/net/brcm,bgmac-nsp.txt
new file mode 100644
index 0000000..022946c
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/brcm,bgmac-nsp.txt
@@ -0,0 +1,24 @@ 
+Broadcom GMAC Ethernet Controller Device Tree Bindings
+-------------------------------------------------------------
+
+Required properties:
+ - compatible:	"brcm,bgmac-nsp"
+ - reg:		Address and length of the GMAC registers,
+		Address and length of the GMAC IDM registers
+ - reg-names:	Names of the registers.  Must have both "gmac_base" and
+		"idm_base"
+ - interrupts:	Interrupt number
+
+Optional properties:
+- mac-address:	See ethernet.txt file in the same directory
+
+Examples:
+
+gmac0: ethernet@18022000 {
+	compatible = "brcm,bgmac-nsp";
+	reg = <0x18022000 0x1000>,
+	      <0x18110000 0x1000>;
+	reg-names = "gmac_base", "idm_base";
+	interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
+	status = "disabled";
+};