powerpc: document max-speed and interface-type properties
PATCH v2 1/4 powerpc: document max-speed and interface-type properties
Since ucc_geth is being migrated to use the phylib, the existing (undocumented) 'interface' property is being deprecated in favour of unconjoined variations 'max-speed' and 'interface-type'.
interface-type is now maintained one-to-one with definitions in include/linux/phy.h. If not specified, "mii" is assumed.
max-speed is available for users to override the interface-derived speed, e.g. rgmii at 100Mbit/s.
---
moved to recommended section (from required), removed sgmii, added rgmii-id.
please consider for 2.6.22
Documentation/powerpc/booting-without-of.txt | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
Documentation/powerpc/booting-without-of.txt +5 -0
@@ -1562,6 +1562,10 @@ platforms are moved over to use the flattened-device-tree model. network device. This is used by the bootwrapper to interpret MAC addresses passed by the firmware when no information other than indices is available to associate an address with a device. + - interface-type : a string naming the controller/PHY interface type, + i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "tbi", or "rtbi". + - max-speed : The maximum speed supported by the controller (in Mbit/s) + this is used if the user wants to override the interface-derived speed. Example: ucc@2000 {
@@ -1573,6 +1577,7 @@ platforms are moved over to use the flattened-device-tree model. interrupts = <a0 0>; interrupt-parent = <700>; mac-address = [ 00 04 9f 00 23 23 ]; + interface-type = "rgmii"; rx-clock = "none"; tx-clock = "clk9"; phy-handle = <212000>;
Signature · 1 line
1.5.0.1
Quoted 7 lines · Kim Phillips
Since
ucc_gethis being migrated to use the phylib, the existing (undocumented) 'interface' property is being deprecated in favour of unconjoined variations 'max-speed' and 'interface-type'.interface-type is now maintained one-to-one with definitions in
include/linux/phy.h. If not specified, "mii" is assumed.
Quoted 6 lines
max-speed is available for users to override the interface-derived speed, e.g. rgmii at 100Mbit/s.
Signed-off-by Kim Phillips <[email protected]>---
moved to recommended section (from required), removed sgmii, added rgmii-id.
any reason to remove sgmii? What is rgmii-id?
- k
Quoted 37 lines
please consider for 2.6.22
Documentation/powerpc/booting-without-of.txt | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)Documentation/powerpc/booting-without-of.txt +0
-0@@ -1562,6 +1562,10 @@ platforms are moved over to use theflattened-device-tree model.
network device. This is used by the bootwrapper to interpret MAC addresses passed by the firmware when no information other than indices is available to associate an address with a device.
+ - interface-type : a string naming the controller/PHY interface
type,
+ i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id",
"tbi", or "rtbi".
+ - max-speed : The maximum speed supported by the controller (in
Mbit/s)
+ this is used if the user wants to override the interface-
derived speed.Example:
Documentation/powerpc/booting-without-of.txt +0
-0ucc@2000 {@@ -1573,6 +1577,7 @@ platforms are moved over to use the flattened-device-tree model.
Documentation/powerpc/booting-without-of.txt +1
-0interrupts = <a0 0>; interrupt-parent = <700>; mac-address = [ 00 04 9f 00 23 23 ]; + interface-type = "rgmii"; rx-clock = "none"; tx-clock = "clk9"; phy-handle = <212000>;Signature · 1 line
1.5.0.1
Quoted 8 lines · On Fri, 13 Apr 2007 12:00:32 -0500 Kumar Gala <[email protected]> wrote:
Quoted 3 lines · Kim Phillips
Quoted 1 line
---
moved to recommended section (from required), removed sgmii, added rgmii-id.
any reason to remove sgmii? What is rgmii-id?
UCC doesn't support sgmii.
rgmii-id == RGMII with Internal Delay, see RGMII spec, or http://www.spinics.net/lists/netdev/msg28876.html
Kim
Quoted 4 lines · Kim Phillips
Quoted 1 line · On Fri, 13 Apr 2007 12:00:32 -0500 Kumar Gala <[email protected]> wrote:
Quoted 8 lines
Quoted 7 lines · Kim Phillips
Quoted 3 lines
Quoted 1 line
---
moved to recommended section (from required), removed sgmii, added rgmii-id.
any reason to remove sgmii? What is rgmii-id?
UCC doesn't support sgmii.
ahh.
Quoted 1 line
rgmii-id == RGMII with Internal Delay, see RGMII spec, or http://www.spinics.net/lists/netdev/msg28876.html
can we call this something like rgmii-internal-delay or something a bit more descriptive than -id (which makes one think identifier).
- k
Quoted 3 lines · On Fri, 13 Apr 2007 12:42:31 -0500 Kumar Gala <[email protected]> wrote:
can we call this something like rgmii-internal-delay or something a bit more descriptive than -id (which makes one think identifier).
it's RGMII specification nomenclature; p. 5 of the rgmii spec specifically states "Devices which implement internal delay shall be referred to as RGMII-ID."
Kim
Quoted 8 lines · Kim Phillips
Quoted 3 lines · On Fri, 13 Apr 2007 12:42:31 -0500 Kumar Gala <[email protected]> wrote:
can we call this something like rgmii-internal-delay or something a bit more descriptive than -id (which makes one think identifier).
it's RGMII specification nomenclature; p. 5 of the rgmii spec specifically states "Devices which implement internal delay shall be referred to as RGMII-ID."
ok.
- k
Quoted 3 lines
Since
ucc_gethis being migrated to use the phylib, the existing (undocumented) 'interface' property is being deprecated in favour of unconjoined variations 'max-speed' and 'interface-type'.
Again, please explain why this information shouldn't be in the PHY node instead?
Segher
Quoted 7 lines · On Fri, 13 Apr 2007 21:02:25 +0200 Segher Boessenkool…
Quoted 3 lines
Since
ucc_gethis being migrated to use the phylib, the existing (undocumented) 'interface' property is being deprecated in favour of unconjoined variations 'max-speed' and 'interface-type'.Again, please explain why this information shouldn't be in the PHY node instead?
Strictly speaking, it should be neither in the UCC node nor the PHY node, as it describes the connection between the two, but..
the UCC driver utilizes the data itself; the UCC, unlike other network controllers, does not provide interface data in its programming model.
the phy drivers are not of_ drivers. Porting phylib drivers to be of_ drivers would break phylib for non-OF arches, e.g. x86.
Kim
Quoted 11 lines · Kim Phillips
Quoted 7 lines · On Fri, 13 Apr 2007 21:02:25 +0200 Segher Boessenkool…
Quoted 3 lines
Since
ucc_gethis being migrated to use the phylib, the existing (undocumented) 'interface' property is being deprecated in favour of unconjoined variations 'max-speed' and 'interface-type'.Again, please explain why this information shouldn't be in the PHY node instead?
Quoted 8 lines
Strictly speaking, it should be neither in the UCC node nor the PHY node, as it describes the connection between the two, but..
the UCC driver utilizes the data itself; the UCC, unlike other network controllers, does not provide interface data in its programming model.
the phy drivers are not
of_drivers. Porting phylib drivers to beof_drivers would break phylib for non-OF arches, e.g. x86.
Nothing stops the code in the UCC driver from grabbing the phy device node and pulling the information out if it.
I believe the question is about where the information should truly live. It would seem to be more of a property of the phy than of the enet controller.
- k
Quoted 10 lines
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines
Since
ucc_gethis being migrated to use the phylib, the existing (undocumented) 'interface' property is being deprecated in favour of unconjoined variations 'max-speed' and 'interface-type'.Again, please explain why this information shouldn't be in the PHY node instead?
Strictly speaking, it should be neither in the UCC node nor the PHY node, as it describes the connection between the two, but..
Connections are never described with separate nodes in the device tree.
Quoted 2 lines
Quoted 2 lines
the UCC driver utilizes the data itself; the UCC, unlike other network controllers, does not provide interface data in its programming model.
I have no idea what this means?
Quoted 4 lines
Quoted 2 lines
the phy drivers are not
of_drivers. Porting phylib drivers to beof_drivers would break phylib for non-OF arches, e.g. x86.Nothing stops the code in the UCC driver from grabbing the phy device node and pulling the information out if it.
Quite so. This isn't "bad style" either, it is a perfectly normal thing to do.
Quoted 1 line
I believe the question is about where the information should truly live.
Yeah.
Quoted 1 line
It would seem to be more of a property of the phy than of the enet controller.
Yep. The whole reason why any property is wanted here is to say what type the PHY is, as the enet controller can be attached to several kinds. And what type the PHY is belongs in the PHY node, obviously. In its "compatible" property to be exact.
Segher
Quoted 11 lines · On Mon, 16 Apr 2007 17:47:18 +0200 Segher Boessenkool…
Quoted 10 lines
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines
Since
ucc_gethis being migrated to use the phylib, the existing (undocumented) 'interface' property is being deprecated in favour of unconjoined variations 'max-speed' and 'interface-type'.Again, please explain why this information shouldn't be in the PHY node instead?
Strictly speaking, it should be neither in the UCC node nor the PHY node, as it describes the connection between the two, but..
Quoted 7 lines
Connections are never described with separate nodes in the device tree.
Quoted 2 lines
Quoted 2 lines
the UCC driver utilizes the data itself; the UCC, unlike other network controllers, does not provide interface data in its programming model.
I have no idea what this means?
The UCC is a direct consumer of the values of the properties.
Quoted 14 lines
Quoted 5 lines
Quoted 2 lines
the phy drivers are not
of_drivers. Porting phylib drivers to beof_drivers would break phylib for non-OF arches, e.g. x86.Nothing stops the code in the UCC driver from grabbing the phy device node and pulling the information out if it.
Quite so. This isn't "bad style" either, it is a perfectly normal thing to do.
Quoted 2 lines
I believe the question is about where the information should truly live.
Yeah.
Quoted 8 lines
Quoted 2 lines
It would seem to be more of a property of the phy than of the enet controller.
Yep. The whole reason why any property is wanted here is to say what type the PHY is, as the enet controller can be attached to several kinds. And what type the PHY is belongs in the PHY node, obviously. In its "compatible" property to be exact.
I don't need to know what type the PHY is, e.g. whether it's m88e11x1 compatible or not, the phylib handles that.
If I were to put the properties in the PHY node, I wouldn't be able to describe a 1000Mbit/s capable UCC connected to a 100Mbit/s capable PHY, or vice versa.
Kim
Quoted 5 lines · Segher Boessenkool
Quoted 3 lines
I believe the question is about where the information should truly live.
Yeah.
Agreed
Quoted 9 lines
Quoted 3 lines
It would seem to be more of a property of the phy than of the enet controller.
Yep. The whole reason why any property is wanted here is to say what type the PHY is, as the enet controller can be attached to several kinds. And what type the PHY is belongs in the PHY node, obviously. In its "compatible" property to be exact.
It's not saying what type the PHY is, though. It's describing the connection. The PHY is just as flexible wrt connection type as the ethernet controller. This is actually a property of the board. In some cases its a fixed property of the board. In some cases it's changeable through dip switches, or even through software.
Ethernet controllers need to know what the connection is so they can establish a data connection with the PHYs
PHYs need to know what the connection is so they can establish a data connection with the ethernet controllers.
There is equal flexibility on both sides, and I think the choice of where to put this information is fairly arbitrary. The reason for choosing the ethernet controller in this case has to do with the flow of information.
1) The driver tells the PHY what interface to use
2) The ethernet controller is the endpoint of this connection which is accessible by everyone else. IE data is not sent through PHYs by any means but through the ethernet controller, and data is not received from PHYs by any means but through the ethernet controller.
3) The UCC needs to be told the connection type, because it does not have logic to detect it on its own.
The truth is, this is a somewhat intractable problem because of the myriad possibilities for how board designers can hook up ethernet controllers to PHYs. One can envision scenarios where controllers can hook up to multiple PHYs, each of one fixed type. One can envision scenarios where multiple controllers are hooked up to one PHY, and each of the controllers can use different connections. If we put the information in the PHY node, we allow for the first scenario, but not the second. If we put it in the ethernet node, we reverse that situation. In either case, we'd currently have to modify our dts to specify which PHY we want to use.
Andy
Quoted 2 lines
I don't need to know what type the PHY is, e.g. whether it's m88e11x1 compatible or not, the phylib handles that.
You need to tell the phylib what kind of bus the PHY uses. You can put "rgmii" or whatever in the "compatible" property as well.
Quoted 3 lines
If I were to put the properties in the PHY node, I wouldn't be able to describe a 1000Mbit/s capable UCC connected to a 100Mbit/s capable PHY, or vice versa.
Of course you can. The "compatible" in the enet node implies it can do 1000Mbps; the "compatible" in the PHY node implies it does 100Mbps.
Segher
Quoted 7 lines
Quoted 5 lines
Yep. The whole reason why any property is wanted here is to say what type the PHY is, as the enet controller can be attached to several kinds. And what type the PHY is belongs in the PHY node, obviously. In its "compatible" property to be exact.
It's not saying what type the PHY is, though. It's describing the connection. The PHY is just as flexible wrt connection type as the ethernet controller.
Huh, I've never seen that. I'll take your word for it.
Quoted 1 line
This is actually a property of the board. In some cases its a fixed property of the board. In some cases it's changeable through dip switches, or even through software.
In such a case you cannot describe this with a fixed flat device tree *at all*.
Quoted 1 line
Ethernet controllers need to know what the connection is so they can establish a data connection with the PHYs
Can't you probe for PHYs?
Quoted 3 lines
The reason for choosing the ethernet controller in this case has to do with the flow of information.
1) The driver tells the PHY what interface to use
The device tree is not structured after how Linux device drivers want to use the information; instead, it describes the hardware.
Quoted 1 line
2) The ethernet controller is the endpoint of this connection which is accessible by everyone else. IE data is not sent through PHYs by any means but through the ethernet controller, and data is not received from PHYs by any means but through the ethernet controller.
So?
Quoted 1 line
3) The UCC needs to be told the connection type, because it does not have logic to detect it on its own.
Just try all possible kinds, see if you can see a PHY connected?
Quoted 1 line
The truth is, this is a somewhat intractable problem because of the myriad possibilities for how board designers can hook up ethernet controllers to PHYs. One can envision scenarios where controllers can hook up to multiple PHYs, each of one fixed type.
Yeah, seen that. Quite a common scenario.
Quoted 1 line
One can envision scenarios where multiple controllers are hooked up to one PHY, and each of the controllers can use different connections.
How would that work at all, except when only one controller is active and the rest are shut down?
Quoted 1 line
If we put the information in the PHY node, we allow for the first scenario, but not the second. If we put it in the ethernet node, we reverse that situation. In either case, we'd currently have to modify our dts to specify which PHY we want to use.
Which brings me back to, can't you just probe for it?
Segher
Quoted 4 lines · On Tue, 17 Apr 2007 01:18:56 +0200 Segher Boessenkool…
Quoted 2 lines
I don't need to know what type the PHY is, e.g. whether it's m88e11x1 compatible or not, the phylib handles that.
You need to tell the phylib what kind of bus the PHY uses.
sure, and ucc_geth does just that based on the interface-type property, in addition to correspondingly programming the UCC.
Quoted 3 lines
You can put "rgmii" or whatever in the "compatible" property as well.
I don't understand how intermixing PHY device compatibility with the UCC connection to the PHY would be a good thing.
Quoted 7 lines
Quoted 3 lines
If I were to put the properties in the PHY node, I wouldn't be able to describe a 1000Mbit/s capable UCC connected to a 100Mbit/s capable PHY, or vice versa.
Of course you can. The "compatible" in the enet node implies it can do 1000Mbps; the "compatible" in the PHY node implies it does 100Mbps.
compatible in the UCC node is currently set to "ucc_geth", which does not necessarily imply that that UCC can do 1000Mbit/s. Some UCCs can only do 100Mbit/s.
We currently do not have hardware that connects UCC with max-speed x with a PHY with max. speed capability of y, where x != y, so there is currently no need to specify the speed of the PHY. Not that that would be needed; the phylib would call ucc_geth's adjust_link with the new speed. Note that the max-speed property is used to set registers in the UCC only.
Kim
Quoted 9 lines · Segher Boessenkool
Quoted 7 lines
Quoted 5 lines
Yep. The whole reason why any property is wanted here is to say what type the PHY is, as the enet controller can be attached to several kinds. And what type the PHY is belongs in the PHY node, obviously. In its "compatible" property to be exact.
It's not saying what type the PHY is, though. It's describing the connection. The PHY is just as flexible wrt connection type as the ethernet controller.
Huh, I've never seen that. I'll take your word for it.
Well, mostly this just means that the PHY has pins, and can be told which pins have what meaning in the same way that the ethernet controller can.
Quoted 5 lines
Quoted 2 lines
This is actually a property of the board. In some cases its a fixed property of the board. In some cases it's changeable through dip switches, or even through software.
In such a case you cannot describe this with a fixed flat device tree *at all*.
This is true to the extent that the device tree can't change on the fly. But the device tree could be used to tell the software which one was chosen (by setting it manually, or by detecting it at runtime in the firmware), or it can be used to tell the software which one to choose. This is really a side point to my argument, though.
Quoted 4 lines
Quoted 2 lines
Ethernet controllers need to know what the connection is so they can establish a data connection with the PHYs
Can't you probe for PHYs?
I'm beginning to suspect you are confusing the PHY management bus with the PHY data bus. PHYs are almost universally controlled through an MDIO bus which consists of 2 pins: clock and data. This is not the ethernet packet data, though, it is configuration data. The PHYs can all be discovered on this bus, regardless of what interface is chosen for the data.
Quoted 8 lines
Quoted 4 lines
The reason for choosing the ethernet controller in this case has to do with the flow of information.
1) The driver tells the PHY what interface to use
The device tree is not structured after how Linux device drivers want to use the information; instead, it describes the hardware.
My point was merely that the location of the information is arbitrary, and so here are three reasons for arbitrarily putting it in the ethernet node, rather than the PHY node.
Quoted 4 lines
Quoted 2 lines
2) The ethernet controller is the endpoint of this connection which is accessible by everyone else. IE data is not sent through PHYs by any means but through the ethernet controller, and data is not received from PHYs by any means but through the ethernet controller.
So?
Same point as above
Quoted 5 lines
Quoted 2 lines
3) The UCC needs to be told the connection type, because it does not have logic to detect it on its own.
Just try all possible kinds, see if you can see a PHY connected?
To extend on the point above, this is nearly impossible. As I said, the management bus and the data bus are different. This interface property describes the pin configuration for the data bus. It also describes the "rate" at which the data is sent or received (some interfaces double-pump, some use echo cancellation). The result of a misconfiguration is that you receive gibberish and you send gibberish. The PHY will happily misunderstand the ethernet controller, and visa-versa.
They *both* need to know how they are wired to the other one.
Quoted 9 lines
Quoted 2 lines
The truth is, this is a somewhat intractable problem because of the myriad possibilities for how board designers can hook up ethernet controllers to PHYs. One can envision scenarios where controllers can hook up to multiple PHYs, each of one fixed type.
Yeah, seen that. Quite a common scenario.
Quoted 1 line
One can envision scenarios where multiple controllers are hooked up to one PHY, and each of the controllers can use different connections.
How would that work at all, except when only one controller is active and the rest are shut down?
Right. It's exactly like the previous example, except the previous example has some PHYs sitting around, inactive.
Quoted 4 lines
Quoted 2 lines
If we put the information in the PHY node, we allow for the first scenario, but not the second. If we put it in the ethernet node, we reverse that situation. In either case, we'd currently have to modify our dts to specify which PHY we want to use.
Which brings me back to, can't you just probe for it?
Again, no. You would have to convince me that the interface is more closely tied to the PHY than to the controller. I believe it's an equal weighting, and have provided three arguments above for why the ethernet node is more appropriate. Feel free to do so for the PHY. But you need four or more, or I win. ;)
Andy
Quoted 5 lines
Quoted 3 lines
You can put "rgmii" or whatever in the "compatible" property as well.
I don't understand how intermixing PHY device compatibility with the UCC connection to the PHY would be a good thing.
"compatible" means "what kind of device is this", for the purposes of a client program (i.e., Linux) matching a driver to it (i.e., it should say what kind of PHY it is, and phylib should use that info -- in most cases, it won't need more than the least specific entry in "compatible", i.e. "rgmii" or whatever.
Quoted 11 lines
Quoted 7 lines
Quoted 3 lines
If I were to put the properties in the PHY node, I wouldn't be able to describe a 1000Mbit/s capable UCC connected to a 100Mbit/s capable PHY, or vice versa.
Of course you can. The "compatible" in the enet node implies it can do 1000Mbps; the "compatible" in the PHY node implies it does 100Mbps.
compatible in the UCC node is currently set to "
ucc_geth", which does not necessarily imply that that UCC can do 1000Mbit/s. Some UCCs can only do 100Mbit/s.
So those UCCs should have a different "compatible" entry. It's not rocket science.
Quoted 6 lines
We currently do not have hardware that connects UCC with max-speed x with a PHY with max. speed capability of y, where x != y, so there is currently no need to specify the speed of the PHY. Not that that would be needed; the phylib would call ucc_geth's
adjust_linkwith the new speed. Note that the max-speed property is used to set registers in the UCC only.
max-speed of connection = min(max-speed of enet, max-speed of PHY) -- and both of those are implied by their respective "compatible" properties.
Segher
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
It's not saying what type the PHY is, though. It's describing the connection. The PHY is just as flexible wrt connection type as the ethernet controller.
Huh, I've never seen that. I'll take your word for it.
Well, mostly this just means that the PHY has pins, and can be told which pins have what meaning in the same way that the ethernet controller can.
Oh I see. But the PHY is connected in only one way, so its node should say which way that is.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Ethernet controllers need to know what the connection is so they can establish a data connection with the PHYs
Can't you probe for PHYs?
I'm beginning to suspect you are confusing the PHY management bus with the PHY data bus.
No I'm not -- not this time, anyway ;-)
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
1) The driver tells the PHY what interface to use
The device tree is not structured after how Linux device drivers want to use the information; instead, it describes the hardware.
My point was merely that the location of the information is arbitrary, and so here are three reasons for arbitrarily putting it in the ethernet node, rather than the PHY node.
The max speed of the controller, and the types of MII buses it supports, belongs in the controller node (perhaps as implicit information).
The max speed of the PHY, and the types of MII buses it supports, belongs in the PHY node.
I don't see anything arbitrary here.
Quoted 10 lines
Quoted 4 lines
Quoted 1 line
3) The UCC needs to be told the connection type, because it does not have logic to detect it on its own.
Just try all possible kinds, see if you can see a PHY connected?
To extend on the point above, this is nearly impossible. As I said, the management bus and the data bus are different. This interface property describes the pin configuration for the data bus. It also describes the "rate" at which the data is sent or received (some interfaces double-pump, some use echo cancellation). The result of a misconfiguration is that you receive gibberish and you send gibberish.
The PHY will happily misunderstand the ethernet controller, and
visa-versa.They *both* need to know how they are wired to the other one.
I was thinking you could put the PHY in loopback mode and see what works. This might not be too reliable of course.
Quoted 1 line
Again, no. You would have to convince me that the interface is more closely tied to the PHY than to the controller. I believe it's an equal weighting, and have provided three arguments above for why the ethernet node is more appropriate. Feel free to do so for the PHY. But you need four or more, or I win. ;)
It seems you misunderstand me. I say the controller information belongs in the controller node, and the PHY information belongs in the PHY node. If there are multiple modes possible for a given controller+PHY combination, that information should be put in the PHY node, since a controller can have multiple PHYs but not the other way around (for a given PHY->controller assignment, which is a configuration option for the firmware to decide on, so any given device tree will describe only one such assignment).
Segher
Quoted 6 lines · On Tue, 17 Apr 2007 12:25:51 +0200 Segher Boessenkool…
Quoted 5 lines
Quoted 3 lines
You can put "rgmii" or whatever in the "compatible" property as well.
I don't understand how intermixing PHY device compatibility with the UCC connection to the PHY would be a good thing.
Quoted 7 lines
"compatible" means "what kind of device is this", for the purposes of a client program (i.e., Linux) matching a driver to it (i.e., it should say what kind of PHY it is, and phylib should use that info -- in most cases, it won't need more than the least specific entry in "compatible", i.e. "rgmii" or whatever.
sorry, I disagree; for me, a compatible entry in the PHY node would look something like "marvell" or "m88e11x1". "rgmii" might indeed be something that PHY supports, but it tells the driver nothing about how to enable it (whereas "m88e11x1" would). The rgmii designation in question in this thread is not a property of the PHY, but of the board.
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 5 lines
If I were to put the properties in the PHY node, I wouldn't be able to
describe a 1000Mbit/s capable UCC connected to a 100Mbit/s capable PHY,
or vice versa.Of course you can. The "compatible" in the enet node implies it can do 1000Mbps; the "compatible" in the PHY node implies it does 100Mbps.
Quoted 7 lines
Quoted 3 lines
compatible in the UCC node is currently set to "
ucc_geth", which does not necessarily imply that that UCC can do 1000Mbit/s. Some UCCs can only do 100Mbit/s.So those UCCs should have a different "compatible" entry. It's not rocket science.
It's referring to the name of the driver, as is compatible "gianfar". other values could be "fsl_atm" or "ucc_uart", or whatever other communications protocol a UCC can manage (to which, btw, max-speed would be easily extensible).
Quoted 8 lines
Quoted 7 lines
We currently do not have hardware that connects UCC with max-speed x with a PHY with max. speed capability of y, where x != y, so there is currently no need to specify the speed of the PHY. Not that that would be needed; the phylib would call ucc_geth's
adjust_linkwith the new speed. Note that the max-speed property is used to set registers in the
UCC only.
Quoted 4 lines
max-speed of connection =
min(max-speed of enet, max-speed of PHY)-- and both of those are implied by their respective "compatible" properties.
Again, max-speed is exclusively for configuring the UCC itself, regardless of the connection speed.
Kim
Quoted 10 lines
Quoted 7 lines
"compatible" means "what kind of device is this", for the purposes of a client program (i.e., Linux) matching a driver to it (i.e., it should say what kind of PHY it is, and phylib should use that info -- in most cases, it won't need more than the least specific entry in "compatible", i.e. "rgmii" or whatever.
sorry, I disagree; for me, a compatible entry in the PHY node would look something like "marvell"
which would be completely wrong
Quoted 1 line
or "m88e11x1".
It should be something like "m88e11x1\0m88e1xxx\0rgmii" instead. A "compatible" property can contain many values, ordered from most exact to least exact.
Quoted 4 lines
"rgmii" might indeed be
something that PHY supports, but it tells the driver nothing about how to enable it (whereas "m88e11x1" would). The rgmii designation in question in this thread is not a property of the PHY, but of the board.
It certainly is a property of the PHY as well.
Quoted 4 lines
Quoted 2 lines
So those UCCs should have a different "compatible" entry. It's not rocket science.
It's referring to the name of the driver,
No, not at all. No device tree entry name/value has any direct correspondence with Linux device driver names (in principle; things can "accidentally" have the same name, of course).
Quoted 7 lines
Quoted 4 lines
max-speed of connection =
min(max-speed of enet, max-speed of PHY)-- and both of those are implied by their respective "compatible" properties.Again, max-speed is exclusively for configuring the UCC itself, regardless of the connection speed.
If that is really true, and the value of that property has nothing to do with the MAC<->PHY data channel, it should have a different (not that generic) name.
Segher
Quoted 8 lines · On Wed, 18 Apr 2007 01:18:24 +0200 Segher Boessenkool…
Quoted 8 lines
Quoted 7 lines
"compatible" means "what kind of device is this", for the purposes of a client program (i.e., Linux) matching a driver to it (i.e., it should say what kind of PHY it is, and phylib should use that info -- in most cases, it won't need more than the least specific entry in "compatible", i.e. "rgmii" or whatever.
Quoted 6 lines
Quoted 3 lines
sorry, I disagree; for me, a compatible entry in the PHY node would look
something like "marvell"which would be completely wrong
that depends on what degree the manufacturer's PHYs are compatible.
Quoted 3 lines
Quoted 1 line
or "m88e11x1".
It should be something like "m88e11x1\0m88e1xxx\0rgmii" instead.
m88e11x1 implies rgmii, including all the other interfaces the PHY supports (gmii, mii, tbi, etc.).
..but I'm not interested in specifying what interfaces the PHY supports.
Quoted 10 lines
A "compatible" property can contain many values, ordered from most exact to least exact.
Quoted 4 lines
"rgmii" might indeed be
something that PHY supports, but it tells the driver nothing about how to enable it (whereas "m88e11x1" would). The rgmii designation in question in this thread is not a property of the PHY, but of the board.It certainly is a property of the PHY as well.
sure.
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
So those UCCs should have a different "compatible" entry. It's not rocket science.
It's referring to the name of the driver,
No, not at all. No device tree entry name/value has any direct correspondence with Linux device driver names (in principle; things can "accidentally" have the same name, of course).
well that may be the case here then.
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
max-speed of connection =
min(max-speed of enet, max-speed of PHY)-- and both of those are implied by their respective "compatible" properties.
Quoted 7 lines
Quoted 2 lines
Again, max-speed is exclusively for configuring the UCC itself, regardless of the connection speed.
If that is really true, and the value of that property has nothing to do with the MAC<->PHY data channel, it should have a different (not that generic) name.
can you elaborate on why, including an example of what you'd think would be a better one?
Kim
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
sorry, I disagree; for me, a compatible entry in the PHY node would look
something like "marvell"which would be completely wrong
that depends on what degree the manufacturer's PHYs are compatible.
No, if all there PHYs are compatible (and you have some guarantee that all there future PHYs will be as well!) it should read "marvell-phy" (or better, "MRVL,ethernet-phy" or something similar).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
or "m88e11x1".
It should be something like "m88e11x1\0m88e1xxx\0rgmii" instead.
m88e11x1 implies rgmii, including all the other interfaces the PHY supports (gmii, mii, tbi, etc.).
If you don't put the less-specific entries there, only clients (OSes) that know about the exact name can use that PHY. So if there is a minor upgrade of you board and it has a m88e11x2 instead, your OS needs an update to work with your new device tree. Not an ideal situation.
Quoted 1 line
..but I'm not interested in specifying what interfaces the PHY supports.
But you *have* to. The device tree describes the hardware, it is not a configuration file for Linux to use as it sees fit.
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
max-speed of connection =
min(max-speed of enet, max-speed of PHY)-- and both of those are implied by their respective "compatible" properties.Again, max-speed is exclusively for configuring the UCC itself, regardless of the connection speed.
Quoted 6 lines
Quoted 3 lines
If that is really true, and the value of that property has nothing to do with the MAC<->PHY data channel, it should have a different (not that generic) name.
can you elaborate on why, including an example of what you'd think would be a better one?
Very generic names should only be used by very generic bindings. If a very specific device binding (like yours) uses a property name like that, there is a high chance it will clash with a more generic binding it uses (PCI, ethernet, network, ...) -- perhaps with a *future* version of such a binding.
Also, it isn't a great name /an sich/: "max-speed" -- maximum speed of what?
Segher
Quoted 26 lines · On Wed, 18 Apr 2007 12:34:27 +0200 Segher Boessenkool…
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
sorry, I disagree; for me, a compatible entry in the PHY node would look
something like "marvell"which would be completely wrong
that depends on what degree the manufacturer's PHYs are compatible.
No, if all there PHYs are compatible (and you have some guarantee that all there future PHYs will be as well!) it should read "marvell-phy" (or better, "MRVL,ethernet-phy" or something similar).
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
or "m88e11x1".
It should be something like "m88e11x1\0m88e1xxx\0rgmii" instead.
m88e11x1 implies rgmii, including all the other interfaces the PHY supports (gmii, mii, tbi, etc.).
If you don't put the less-specific entries there, only clients (OSes) that know about the exact name can use that PHY. So if there is a minor upgrade of you board and it has a m88e11x2 instead, your OS needs an update to work with your new device tree. Not an ideal situation.
Quoted 5 lines
Quoted 2 lines
..but I'm not interested in specifying what interfaces the PHY supports.
But you *have* to. The device tree describes the hardware, it is not a configuration file for Linux to use as it sees fit.
not for the purposes of this patch; ucc_geth passes interface_type, a property of the board describing the connection between the MAC and PHY (not a list of what connection types the PHY is capable of) to the phylib, and the phylib is left to probe, identify, and configure the PHY appropriately.
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
max-speed of connection =
min(max-speed of enet, max-speed of PHY)-- and both of those are implied by their respective "compatible" properties.Again, max-speed is exclusively for configuring the UCC itself, regardless of the connection speed.
If that is really true, and the value of that property has nothing to do with the MAC<->PHY data channel, it should have a different (not that generic) name.
Quoted 5 lines
Quoted 3 lines
can you elaborate on why, including an example of what you'd think would
be a better one?Very generic names should only be used by very generic bindings.
it's intentionally generic; UCCs are Universal Communications Controllers and implement many communications protocols.
Quoted 5 lines
If a very specific device binding (like yours) uses a property name like that, there is a high chance it will clash with a more generic binding it uses (PCI, ethernet, network, ...) -- perhaps with a *future* version of such a binding.
I'm sure future versions will be able to adjust accordingly :)
Quoted 3 lines
Also, it isn't a great name /an sich/: "max-speed" -- maximum speed of what?
? it's fine - it's in the context of a communications device. Can you come up with something better?
Kim
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
..but I'm not interested in specifying what interfaces the PHY supports.
But you *have* to. The device tree describes the hardware, it is not a configuration file for Linux to use as it sees fit.
not for the purposes of this patch;
ucc_gethpassesinterface_type,
It doesn't matter what the Linux code does. The device tree describes the hardware, it is not a configuration file for Linux to use as it sees fit.
Quoted 5 lines
a
property of the board describing the connection between the MAC and PHY (not a list of what connection types the PHY is capable of) to the phylib, and the phylib is left to probe, identify, and configure the PHY appropriately.
Sure there's an argument for describing what type of interface the PHY is connected on, if it supports more than one -- but that should be a property in the PHY node, not the controller node, since you can have multiple PHYs connected to the same controller, possibly on different interfaces each.
The m88e11x1 phylib code seems to ignore the "interface" parameter completely btw.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
Again, max-speed is exclusively for configuring the UCC itself, regardless of the connection speed.
If that is really true, and the value of that property has nothing to do with the MAC<->PHY data channel, it should have a different (not that generic) name.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
can you elaborate on why, including an example of what you'd think would
be a better one?Very generic names should only be used by very generic bindings.
it's intentionally generic; UCCs are Universal Communications Controllers and implement many communications protocols.
So? That doesn't put the UCC device binding on the same level as, say, PCI or the base OF definition.
Quoted 6 lines
Quoted 5 lines
If a very specific device binding (like yours) uses a property name like that, there is a high chance it will clash with a more generic binding it uses (PCI, ethernet, network, ...) -- perhaps with a *future* version of such a binding.
I'm sure future versions will be able to adjust accordingly :)
Do you really think that when future changes are made to base OF, or the PCI binding, or similar, that people will even stop to consider what you did in your (unofficial) binding and try to stay compatible to it? Can I have some of those pills?
Quoted 5 lines
Quoted 2 lines
Also, it isn't a great name /an sich/: "max-speed" -- maximum speed of what?
? it's fine - it's in the context of a communications device. Can you come up with something better?
Sure. "ucc,max-speed" solves one problem; "max-comm-speed" solves another. I'm sure there are better names possible, so please find one. Giving good names to things is hard, so good luck.
Segher
Quoted 11 lines · Segher Boessenkool
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
..but I'm not interested in specifying what interfaces the PHY supports.
But you *have* to. The device tree describes the hardware, it is not a configuration file for Linux to use as it sees fit.
not for the purposes of this patch;
ucc_gethpassesinterface_type,It doesn't matter what the Linux code does. The device tree describes the hardware, it is not a configuration file for Linux to use as it sees fit.
Agreed.
Quoted 8 lines
Quoted 7 lines
a
property of the board describing the connection between the MAC and PHY (not a list of what connection types the PHY is capable of) to the phylib, and the phylib is left to probe, identify, and configure the PHY
appropriately.
Quoted 6 lines
Sure there's an argument for describing what type of interface the PHY is connected on, if it supports more than one -- but that should be a property in the PHY node, not the controller node, since you can have multiple PHYs connected to the same controller, possibly on different interfaces each.
I just want to reiterate that I disagree strongly with this statement. If you have multiple PHYs hooked up to one ethernet controller, you're going to need to change the device tree to use a different PHY, anyway. That, or have Linux ignore the phandle that points to the connected PHY.
Also, you'd need to do something to the hardware, since the different interfaces are not, typically, on different pins. Just in different combinations.
And if you put it in the PHY node, you haven't really helped out the people who can change the interface type by flipping a dip switch. I can think of two or three boards off the top of my head that do that (though I know of very few people who actually use this functionality).
My point, again, is that the interface type is not strongly tied to the PHY. It is strongly tied to the board configuration. We *could* put the interface type in the PHY node, but I want to disabuse you of the notion that it would be any better there.
Andy
Quoted 10 lines
Quoted 6 lines
Sure there's an argument for describing what type of interface the PHY is connected on, if it supports more than one -- but that should be a property in the PHY node, not the controller node, since you can have multiple PHYs connected to the same controller, possibly on different interfaces each.
I just want to reiterate that I disagree strongly with this statement.
If you have multiple PHYs hooked up to one ethernet controller,
you're going to need to change the device tree to use a different PHY, anyway. That, or have Linux ignore the phandle that points to the connected PHY.
On some configurations, what PHY to use is a runtime decision, not a static thing. No device tree change is necessary then.
Quoted 1 line
And if you put it in the PHY node, you haven't really helped out the people who can change the interface type by flipping a dip switch. I can think of two or three boards off the top of my head that do that (though I know of very few people who actually use this functionality).
Either the firmware can detect the switch setting and create a proper device tree, or the user will need to create the right static device tree.
Quoted 1 line
My point, again, is that the interface type is not strongly tied to the PHY. It is strongly tied to the board configuration. We *could* put the interface type in the PHY node, but I want to disabuse you of the notion that it would be any better there.
I still think it's the best place for this information.
Segher
Quoted 7 lines · Segher Boessenkool
Quoted 7 lines
Quoted 6 lines
Sure there's an argument for describing what type of interface the PHY is connected on, if it supports more than one -- but that should be a property in the PHY node, not the controller node, since you can have multiple PHYs connected to the same controller, possibly on different interfaces each.
Quoted 5 lines
Quoted 1 line
I just want to reiterate that I disagree strongly with this statement. If you have multiple PHYs hooked up to one ethernet controller, you're going to need to change the device tree to use a different PHY, anyway. That, or have Linux ignore the phandle that points to the connected PHY.
On some configurations, what PHY to use is a runtime decision, not a static thing. No device tree change is necessary then.
1) Could you give me an example?
2) So you'd be having Linux ignore the phandle, then?
Quoted 3 lines
Quoted 1 line
My point, again, is that the interface type is not strongly tied to the PHY. It is strongly tied to the board configuration. We *could* put the interface type in the PHY node, but I want to disabuse you of the notion that it would be any better there.
I still think it's the best place for this information.
I still disagree. :)
Andy
Quoted 5 lines
Quoted 3 lines
On some configurations, what PHY to use is a runtime decision, not a static thing. No device tree change is necessary then.
1) Could you give me an example?
Some older (plugin) cards are like that. I don't have model numbers handy, sorry.
Quoted 1 line
2) So you'd be having Linux ignore the phandle, then?
No, Linux would find all the PHYs connected, via the device tree, and handle them all within the driver.
Segher