diff mbox series

[1/4] dt-bindings: net: add bitfield defines for Ethernet speeds

Message ID 20220503153613.15320-1-zajec5@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/4] dt-bindings: net: add bitfield defines for Ethernet speeds | expand

Commit Message

Rafał Miłecki May 3, 2022, 3:36 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

This allows specifying multiple Ethernet speeds in a single DT uint32
value.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 include/dt-bindings/net/eth.h | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 include/dt-bindings/net/eth.h

Comments

Andrew Lunn May 4, 2022, 9:23 p.m. UTC | #1
On Tue, May 03, 2022 at 05:36:10PM +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>

Hi Rafał

Please take a look at:

https://lore.kernel.org/netdev/1651616511.165627.139789.nullmailer@robh.at.kernel.org/T/

You need to somehow combine with that series. We want one way to
configure PHY leds.

Also, please don't post only DT patches, we want to see the driver
changes as well which goes with it.

    Andrew
Rafał Miłecki May 5, 2022, 5:19 a.m. UTC | #2
On 3.05.2022 17:36, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> This allows specifying multiple Ethernet speeds in a single DT uint32
> value.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>

Ansuel please check if my patchset conflicts in any way with your work.

Andrew suggested to combine both but right now I don't see it as
necessary.

I'd still appreciate your review of my work. Such binding may be
required for some hardware controlled LEDs setup too I guess.
Andrew Lunn May 5, 2022, 12:17 p.m. UTC | #3
On Thu, May 05, 2022 at 07:19:41AM +0200, Rafał Miłecki wrote:
> On 3.05.2022 17:36, Rafał Miłecki wrote:
> > From: Rafał Miłecki <rafal@milecki.pl>
> > 
> > This allows specifying multiple Ethernet speeds in a single DT uint32
> > value.
> > 
> > Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> 
> Ansuel please check if my patchset conflicts in any way with your work.
> 
> Andrew suggested to combine both but right now I don't see it as
> necessary.
> 
> I'd still appreciate your review of my work. Such binding may be
> required for some hardware controlled LEDs setup too I guess.

Please look at the LED binding. It is an LED you are trying to
control, so that is the binding you should be using.  How do you
describe this functionality using that binding. Ansuel code will give
you the framework to actually do the implementation within.

    Andrew
Rafał Miłecki May 5, 2022, 1:46 p.m. UTC | #4
I don't understand anything from below, I'm sorry. Could you clarify,
please?

On 5.05.2022 14:17, Andrew Lunn wrote:
> On Thu, May 05, 2022 at 07:19:41AM +0200, Rafał Miłecki wrote:
>> On 3.05.2022 17:36, Rafał Miłecki wrote:
>>> From: Rafał Miłecki <rafal@milecki.pl>
>>>
>>> This allows specifying multiple Ethernet speeds in a single DT uint32
>>> value.
>>>
>>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>>
>> Ansuel please check if my patchset conflicts in any way with your work.
>>
>> Andrew suggested to combine both but right now I don't see it as
>> necessary.
>>
>> I'd still appreciate your review of my work. Such binding may be
>> required for some hardware controlled LEDs setup too I guess.


 > Please look at the LED binding.

My binding or Ansuel's binding?


 > It is an LED you are trying to control, so that is the binding you should be using.

Well, of course, LED setup requires DT binding.


 > How do you describe this functionality using that binding.

I allow describing trigger source network device by using
"trigger-sources" property referencing network device. That is an
extension or what we already use for describing USB port that are
trigger sources.


 > Ansuel code will give you the framework to actually do the implementation within.

I was planning to base my work on top of Ansuel's one. I'll send proof
on concept meanwhile without asking for it to be applied.
Andrew Lunn May 5, 2022, 2:11 p.m. UTC | #5
> > Please look at the LED binding.
> 
> My binding or Ansuel's binding?

Ansuels binding is using the LED binding.

> I was planning to base my work on top of Ansuel's one. I'll send proof
> on concept meanwhile without asking for it to be applied.

Great. The more testing Ansuel work gets the better.

	Thanks
		Andrew
diff mbox series

Patch

diff --git a/include/dt-bindings/net/eth.h b/include/dt-bindings/net/eth.h
new file mode 100644
index 000000000000..89caff09179b
--- /dev/null
+++ b/include/dt-bindings/net/eth.h
@@ -0,0 +1,27 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Device Tree constants for the Ethernet
+ */
+
+#ifndef _DT_BINDINGS_ETH_H
+#define _DT_BINDINGS_ETH_H
+
+#define SPEED_UNSPEC		0
+#define SPEED_10		(1 << 0)
+#define SPEED_100		(1 << 1)
+#define SPEED_1000		(1 << 2)
+#define SPEED_2000		(1 << 3)
+#define SPEED_2500		(1 << 4)
+#define SPEED_5000		(1 << 5)
+#define SPEED_10000		(1 << 6)
+#define SPEED_14000		(1 << 7)
+#define SPEED_20000		(1 << 8)
+#define SPEED_25000		(1 << 9)
+#define SPEED_40000		(1 << 10)
+#define SPEED_50000		(1 << 11)
+#define SPEED_56000		(1 << 12)
+#define SPEED_100000		(1 << 13)
+#define SPEED_200000		(1 << 14)
+#define SPEED_400000		(1 << 15)
+
+#endif