dts: bindings: boards: Update Ethernet PHY to use reg property

Updates Ethernet PHY devicetree bindings to be more consistent with
Linux by using the standard `reg` property for the PHY address instead
of a custom `address` property. As a result, MDIO controller bindings
now require standard `#address-cells` and `#size-cells` properties.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
This commit is contained in:
Maureen Helm 2023-09-25 20:19:28 -05:00 committed by Carles Cufí
commit d5287578fe
19 changed files with 66 additions and 28 deletions

View file

@ -132,9 +132,9 @@ zephyr_udc0: &usb0 {
pinctrl-0 = <&mdio_default>;
pinctrl-names = "default";
phy: ethernet-phy {
phy: ethernet-phy@0 {
compatible = "ethernet-phy";
status = "okay";
address = <0>;
reg = <0>;
};
};

View file

@ -31,9 +31,9 @@
pinctrl-names = "default";
status = "okay";
phy0: ethernet-phy {
phy0: ethernet-phy@7 {
compatible = "ethernet-phy";
address = <0x7>;
reg = <0x7>;
status = "okay";
};
};

View file

@ -198,10 +198,10 @@
pinctrl-0 = <&mdio_default>;
pinctrl-names = "default";
phy: ethernet-phy {
phy: ethernet-phy@0 {
compatible = "ethernet-phy";
status = "okay";
address = <0>;
reg = <0>;
};
};

View file

@ -136,10 +136,10 @@ zephyr_udc0: &usbhs {
pinctrl-0 = <&mdio_default>;
pinctrl-names = "default";
phy: ethernet-phy {
phy: ethernet-phy@0 {
compatible = "ethernet-phy";
status = "okay";
address = <0>;
reg = <0>;
};
};

View file

@ -245,10 +245,10 @@ zephyr_udc0: &usbhs {
pinctrl-0 = <&mdio_default>;
pinctrl-names = "default";
phy: ethernet-phy {
phy: ethernet-phy@0 {
compatible = "ethernet-phy";
status = "okay";
address = <0>;
reg = <0>;
};
};

View file

@ -146,11 +146,13 @@
mdio: mdio {
compatible = "smsc,lan91c111-mdio";
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
phy: ethernet-phy {
phy: ethernet-phy@0 {
compatible = "ethernet-phy";
status = "disabled";
address = <0>;
reg = <0>;
};
};
};

View file

@ -119,10 +119,10 @@
pinctrl-0 = <&mdio_default>;
pinctrl-names = "default";
phy: ethernet-phy {
phy: ethernet-phy@1 {
compatible = "ethernet-phy";
status = "disabled";
address = <1>;
reg = <1>;
};
};

View file

@ -118,6 +118,27 @@ Required changes
:c:func:`can_set_bitrate` and :c:func:`can_set_bitrate_data` now also automatically calculate a
suitable SJW, but their SJW cannot be overwritten by the caller.
* Ethernet PHY devicetree bindings were updated to use the standard ``reg``
property for the PHY address instead of a custom ``address`` property. As a
result, MDIO controller nodes now require ``#address-cells`` and
``#size-cells`` properties. Similarly, Ethernet PHY devicetree nodes and
corresponding driver were updated to consistently use the node name
``ethernet-phy`` instead of ``phy``. Devicetrees and overlays must be updated
accordingly:
.. code-block:: devicetree
mdio {
compatible = "mdio-controller";
#address-cells = <1>;
#size-cells = <0>;
ethernet-phy@0 {
compatible = "ethernet-phy";
reg = <0>;
};
};
Recommended Changes
*******************

View file

@ -477,7 +477,7 @@ static const struct ethphy_driver_api phy_mii_driver_api = {
#define PHY_MII_CONFIG(n) \
static const struct phy_mii_dev_config phy_mii_dev_config_##n = { \
.phy_addr = DT_INST_PROP(n, address), \
.phy_addr = DT_INST_REG_ADDR(n), \
.fixed = IS_FIXED_LINK(n), \
.fixed_speed = DT_INST_ENUM_IDX_OR(n, fixed_link, 0), \
.mdio = UTIL_AND(UTIL_NOT(IS_FIXED_LINK(n)), \

View file

@ -172,6 +172,8 @@
compatible = "atmel,sam-mdio";
reg = <0x40034000 0x4000>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
pinctrl: pinctrl@400e0e00 {

View file

@ -22,6 +22,8 @@
compatible = "atmel,sam-mdio";
reg = <0x42000800 0x400>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
};
};

View file

@ -334,6 +334,8 @@
compatible = "atmel,sam-mdio";
reg = <0x40050000 0x4000>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
tc0: tc@4000c000 {

View file

@ -637,6 +637,8 @@
compatible = "nxp,s32-netc-emdio";
reg = <0x74b60000 0x1c44>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
enetc_psi0: ethernet@74b00000 {

View file

@ -118,11 +118,13 @@
mdio: mdio {
compatible = "smsc,lan91c111-mdio";
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
phy: ethernet-phy {
phy: ethernet-phy@0 {
compatible = "ethernet-phy";
status = "disabled";
address = <0>;
reg = <0>;
};
};
};

View file

@ -10,8 +10,7 @@ compatible: "ethernet-phy"
include: phy.yaml
properties:
address:
type: int
reg:
required: true
description: PHY address
no-reset:

View file

@ -8,12 +8,3 @@ compatible: "adi,adin2111-mdio"
include: mdio-controller.yaml
on-bus: adin2111
properties:
"#address-cells":
required: true
const: 1
"#size-cells":
required: true
const: 0

View file

@ -6,3 +6,12 @@
include: base.yaml
bus: mdio
properties:
"#address-cells":
required: true
const: 1
"#size-cells":
required: true
const: 0

View file

@ -71,6 +71,8 @@
compatible = "espressif,esp32-mdio";
clocks = <&rtc ESP32_EMAC_MODULE>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
pinctrl: pin-controller {

View file

@ -29,6 +29,8 @@
mdc-gpios = <&test_gpio 0 0>;
mdio-gpios = <&test_gpio 0 0>;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
};
test_mdio1: mdio@33334444 {
@ -37,6 +39,8 @@
mdc-gpios = <&test_gpio 0 0>;
mdio-gpios = <&test_gpio 0 0>;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
};
};
};