diff mbox

[3/3] net: ethoc: document OF bindings

Message ID 1390795167-6677-4-git-send-email-jcmvbkbc@gmail.com
State Superseded, archived
Headers show

Commit Message

Max Filippov Jan. 27, 2014, 3:59 a.m. UTC
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 .../devicetree/bindings/net/opencores-ethoc.txt    | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/opencores-ethoc.txt

Comments

Rob Herring Jan. 27, 2014, 2:10 p.m. UTC | #1
On Sun, Jan 26, 2014 at 9:59 PM, Max Filippov <jcmvbkbc@gmail.com> wrote:
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  .../devicetree/bindings/net/opencores-ethoc.txt    | 25 ++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/opencores-ethoc.txt
>
> diff --git a/Documentation/devicetree/bindings/net/opencores-ethoc.txt b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
> new file mode 100644
> index 0000000..f7c6c94
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
> @@ -0,0 +1,25 @@
> +* OpenCores MAC 10/100 Mbps
> +
> +Required properties:
> +- compatible: Should be "opencores,ethoc".

There are not different versions of IP or is the version probeable?

> +- reg: Address and length of the register set for the device and of its
> +  descriptor memory.
> +- interrupts: Should contain ethoc interrupt.
> +
> +Optional properties:
> +- local-mac-address: 6 bytes, mac address

There's a patch in progress to move all the standard network
properties to a common location, so you can remove this.

> +- clock-frequency: basic MAC frequency.
> +- mii-mgmt-clock-frequency: frequency of MII management bus. Together
> +  with clock-frequency determines the value programmed into the CLKDIV
> +  field of MIIMODER register.
> +
> +Examples:
> +
> +       enet0: ethoc@fd030000 {
> +               compatible = "opencores,ethoc";
> +               reg = <0xfd030000 0x4000 0xfd800000 0x4000>;
> +               interrupts = <1>;
> +               local-mac-address = [00 50 c2 13 6f 00];
> +               clock-frequency = <50000000>;
> +               mii-mgmt-clock-frequency = <5000000>;
> +        };
> --
> 1.8.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Jan. 27, 2014, 2:21 p.m. UTC | #2
Hello.

On 27-01-2014 18:10, Rob Herring wrote:

>> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
>> ---
>>   .../devicetree/bindings/net/opencores-ethoc.txt    | 25 ++++++++++++++++++++++
>>   1 file changed, 25 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/net/opencores-ethoc.txt

>> diff --git a/Documentation/devicetree/bindings/net/opencores-ethoc.txt b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
>> new file mode 100644
>> index 0000000..f7c6c94
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
>> @@ -0,0 +1,25 @@
[...]

>> +- reg: Address and length of the register set for the device and of its
>> +  descriptor memory.
>> +- interrupts: Should contain ethoc interrupt.
>> +
>> +Optional properties:
>> +- local-mac-address: 6 bytes, mac address

> There's a patch in progress to move all the standard network
> properties to a common location, so you can remove this.

    Haven't you asked me to replace the descriptions of common Ethernet props 
with the references to the common bindings file? I'd prefer this prop to 
remain on its place in this case, just the description replaced. 
Unfortunately, my patch will now have to wait till 3.15 (I guess), the same as 
these ones.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Max Filippov Jan. 27, 2014, 3:52 p.m. UTC | #3
Hi Rob,

On Mon, Jan 27, 2014 at 6:10 PM, Rob Herring <robherring2@gmail.com> wrote:
> On Sun, Jan 26, 2014 at 9:59 PM, Max Filippov <jcmvbkbc@gmail.com> wrote:
>> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
>> ---
>>  .../devicetree/bindings/net/opencores-ethoc.txt    | 25 ++++++++++++++++++++++
>>  1 file changed, 25 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/net/opencores-ethoc.txt
>>
>> diff --git a/Documentation/devicetree/bindings/net/opencores-ethoc.txt b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
>> new file mode 100644
>> index 0000000..f7c6c94
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
>> @@ -0,0 +1,25 @@
>> +* OpenCores MAC 10/100 Mbps
>> +
>> +Required properties:
>> +- compatible: Should be "opencores,ethoc".
>
> There are not different versions of IP or is the version probeable?

AFAIK there's single version of this 10/100 MAC.
It doesn't have any identification registers.

>> +- reg: Address and length of the register set for the device and of its
>> +  descriptor memory.
>> +- interrupts: Should contain ethoc interrupt.
>> +
>> +Optional properties:
>> +- local-mac-address: 6 bytes, mac address
>
> There's a patch in progress to move all the standard network
> properties to a common location, so you can remove this.

Will do.

>> +- clock-frequency: basic MAC frequency.
>> +- mii-mgmt-clock-frequency: frequency of MII management bus. Together
>> +  with clock-frequency determines the value programmed into the CLKDIV
>> +  field of MIIMODER register.
>> +
>> +Examples:
>> +
>> +       enet0: ethoc@fd030000 {
>> +               compatible = "opencores,ethoc";
>> +               reg = <0xfd030000 0x4000 0xfd800000 0x4000>;
>> +               interrupts = <1>;
>> +               local-mac-address = [00 50 c2 13 6f 00];
>> +               clock-frequency = <50000000>;
>> +               mii-mgmt-clock-frequency = <5000000>;
>> +        };
>> --
>> 1.8.1.4
Florian Fainelli Jan. 27, 2014, 7:45 p.m. UTC | #4
2014-01-27 Max Filippov <jcmvbkbc@gmail.com>:
> Hi Rob,
>
> On Mon, Jan 27, 2014 at 6:10 PM, Rob Herring <robherring2@gmail.com> wrote:
>> On Sun, Jan 26, 2014 at 9:59 PM, Max Filippov <jcmvbkbc@gmail.com> wrote:
>>> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
>>> ---
>>>  .../devicetree/bindings/net/opencores-ethoc.txt    | 25 ++++++++++++++++++++++
>>>  1 file changed, 25 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/net/opencores-ethoc.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/opencores-ethoc.txt b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
>>> new file mode 100644
>>> index 0000000..f7c6c94
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
>>> @@ -0,0 +1,25 @@
>>> +* OpenCores MAC 10/100 Mbps
>>> +
>>> +Required properties:
>>> +- compatible: Should be "opencores,ethoc".
>>
>> There are not different versions of IP or is the version probeable?
>
> AFAIK there's single version of this 10/100 MAC.
> It doesn't have any identification registers.

Since this is an IP block that people can modify due to its open
source nature, it would have been good to define a revision register
or such which would allow software to gate specific code based on that
revision.
>
>>> +- reg: Address and length of the register set for the device and of its
>>> +  descriptor memory.
>>> +- interrupts: Should contain ethoc interrupt.
>>> +
>>> +Optional properties:
>>> +- local-mac-address: 6 bytes, mac address
>>
>> There's a patch in progress to move all the standard network
>> properties to a common location, so you can remove this.
>
> Will do.
>
>>> +- clock-frequency: basic MAC frequency.
>>> +- mii-mgmt-clock-frequency: frequency of MII management bus. Together
>>> +  with clock-frequency determines the value programmed into the CLKDIV
>>> +  field of MIIMODER register.
>>> +
>>> +Examples:
>>> +
>>> +       enet0: ethoc@fd030000 {
>>> +               compatible = "opencores,ethoc";
>>> +               reg = <0xfd030000 0x4000 0xfd800000 0x4000>;
>>> +               interrupts = <1>;
>>> +               local-mac-address = [00 50 c2 13 6f 00];
>>> +               clock-frequency = <50000000>;
>>> +               mii-mgmt-clock-frequency = <5000000>;

5Mhz management clock? Can't you make it work with the standard 2.5Mhz
management clock? Is not there a risk not to be able to "talk" to some
PHY chips out there which do not support > 2.5Mhz management clock?

Since this is an ethoc specific property, should it be prefixed with "ethoc,"?
Max Filippov Jan. 27, 2014, 8:45 p.m. UTC | #5
On Mon, Jan 27, 2014 at 11:45 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> 2014-01-27 Max Filippov <jcmvbkbc@gmail.com>:
>> On Mon, Jan 27, 2014 at 6:10 PM, Rob Herring <robherring2@gmail.com> wrote:
>>> On Sun, Jan 26, 2014 at 9:59 PM, Max Filippov <jcmvbkbc@gmail.com> wrote:

[...]

>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
>>>> @@ -0,0 +1,25 @@
>>>> +* OpenCores MAC 10/100 Mbps
>>>> +
>>>> +Required properties:
>>>> +- compatible: Should be "opencores,ethoc".
>>>
>>> There are not different versions of IP or is the version probeable?
>>
>> AFAIK there's single version of this 10/100 MAC.
>> It doesn't have any identification registers.
>
> Since this is an IP block that people can modify due to its open
> source nature, it would have been good to define a revision register
> or such which would allow software to gate specific code based on that
> revision.

Probably yes, though I haven't heard of any modified versions of this MAC
out there.

[...]

>>>> +Examples:
>>>> +
>>>> +       enet0: ethoc@fd030000 {
>>>> +               compatible = "opencores,ethoc";
>>>> +               reg = <0xfd030000 0x4000 0xfd800000 0x4000>;
>>>> +               interrupts = <1>;
>>>> +               local-mac-address = [00 50 c2 13 6f 00];
>>>> +               clock-frequency = <50000000>;
>>>> +               mii-mgmt-clock-frequency = <5000000>;
>
> 5Mhz management clock? Can't you make it work with the standard 2.5Mhz
> management clock? Is not there a risk not to be able to "talk" to some
> PHY chips out there which do not support > 2.5Mhz management clock?

Yes I can, it just didn't occur to me that there is a standard 2.5MHz setting.

> Since this is an ethoc specific property, should it be prefixed with "ethoc,"?

Is it worth keeping this parameter at all, or just always default to 2.5MHz?
Florian Fainelli Jan. 27, 2014, 9:12 p.m. UTC | #6
2014-01-27 Max Filippov <jcmvbkbc@gmail.com>:
> On Mon, Jan 27, 2014 at 11:45 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
>> 2014-01-27 Max Filippov <jcmvbkbc@gmail.com>:
>>> On Mon, Jan 27, 2014 at 6:10 PM, Rob Herring <robherring2@gmail.com> wrote:
>>>> On Sun, Jan 26, 2014 at 9:59 PM, Max Filippov <jcmvbkbc@gmail.com> wrote:
>
> [...]
>
>>>>> --- /dev/null
>>>>> +++ b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
>>>>> @@ -0,0 +1,25 @@
>>>>> +* OpenCores MAC 10/100 Mbps
>>>>> +
>>>>> +Required properties:
>>>>> +- compatible: Should be "opencores,ethoc".
>>>>
>>>> There are not different versions of IP or is the version probeable?
>>>
>>> AFAIK there's single version of this 10/100 MAC.
>>> It doesn't have any identification registers.
>>
>> Since this is an IP block that people can modify due to its open
>> source nature, it would have been good to define a revision register
>> or such which would allow software to gate specific code based on that
>> revision.
>
> Probably yes, though I haven't heard of any modified versions of this MAC
> out there.
>
> [...]
>
>>>>> +Examples:
>>>>> +
>>>>> +       enet0: ethoc@fd030000 {
>>>>> +               compatible = "opencores,ethoc";
>>>>> +               reg = <0xfd030000 0x4000 0xfd800000 0x4000>;
>>>>> +               interrupts = <1>;
>>>>> +               local-mac-address = [00 50 c2 13 6f 00];
>>>>> +               clock-frequency = <50000000>;
>>>>> +               mii-mgmt-clock-frequency = <5000000>;
>>
>> 5Mhz management clock? Can't you make it work with the standard 2.5Mhz
>> management clock? Is not there a risk not to be able to "talk" to some
>> PHY chips out there which do not support > 2.5Mhz management clock?
>
> Yes I can, it just didn't occur to me that there is a standard 2.5MHz setting.
>
>> Since this is an ethoc specific property, should it be prefixed with "ethoc,"?
>
> Is it worth keeping this parameter at all, or just always default to 2.5MHz?

Your example lists 5Mhz, so I assume this is of some use for you on
the platform you are working with? My concern is that this might not
be compatible with all PHY devices out there and might create hard to
debug issues where you get some MDIO transactions to succeeds and some
which don't.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/net/opencores-ethoc.txt b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
new file mode 100644
index 0000000..f7c6c94
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/opencores-ethoc.txt
@@ -0,0 +1,25 @@ 
+* OpenCores MAC 10/100 Mbps
+
+Required properties:
+- compatible: Should be "opencores,ethoc".
+- reg: Address and length of the register set for the device and of its
+  descriptor memory.
+- interrupts: Should contain ethoc interrupt.
+
+Optional properties:
+- local-mac-address: 6 bytes, mac address
+- clock-frequency: basic MAC frequency.
+- mii-mgmt-clock-frequency: frequency of MII management bus. Together
+  with clock-frequency determines the value programmed into the CLKDIV
+  field of MIIMODER register.
+
+Examples:
+
+	enet0: ethoc@fd030000 {
+		compatible = "opencores,ethoc";
+		reg = <0xfd030000 0x4000 0xfd800000 0x4000>;
+		interrupts = <1>;
+		local-mac-address = [00 50 c2 13 6f 00];
+		clock-frequency = <50000000>;
+		mii-mgmt-clock-frequency = <5000000>;
+        };