[U-Boot] [EXT] [PATCH v2 2/4] doc: bindings: add mdio.txt describing generic MDIO properties

Ken Ma make at marvell.com
Thu Jul 25 10:08:55 UTC 2019


I added the optional property name in order that the legacy miiphy_get_dev_by_name() could be used with the mdio name.

And I think that my mdio searching way was much better than linux at least at last year.
I do not know now how in linux net interface finds its phy's mdio bus now. But at last year, linux stored all phys' FDT node addesses under all mdio buses, and when searching network interface' phy, linux driver compared its phy fdt node addresses to each phy fdt node address it stored one by one.
So I added mdio_device_get_from_phy/mdio_mii_bus_get_from_phy/mdio_device_get_from_eth to simply the mdio/phy searching.

Yours,
Ken

-----Original Message-----
From: Alex Marginean <alexandru.marginean at nxp.com> 
Sent: Thursday, July 25, 2019 11:33 AM
To: u-boot at lists.denx.de
Cc: Joe Hershberger <joe.hershberger at ni.com>; Ken Ma <make at marvell.com>; Nevo Hed <nhed+uboot at starry.com>; Alex Marginean <alexandru.marginean at nxp.com>; Alex Marginean <alexm.osslist at gmail.com>
Subject: [EXT] [PATCH v2 2/4] doc: bindings: add mdio.txt describing generic MDIO properties

External Email

----------------------------------------------------------------------
Adds a binding document for mdio.  A notable deviation from corresponding Linux binding is the introduction of device-name optional property, which can be used to name MDIO buses.  Two reset optional properties described by Linux binding are also not present as they don't seem to be used in U-Boot at this time.

Signed-off-by: Alex Marginean <alexm.osslist at gmail.com>
Acked-by: Joe Hershberger <joe.hershberger at ni.com>
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
---
 doc/device-tree-bindings/net/mdio.txt | 36 +++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 doc/device-tree-bindings/net/mdio.txt

diff --git a/doc/device-tree-bindings/net/mdio.txt b/doc/device-tree-bindings/net/mdio.txt
new file mode 100644
index 0000000000..1595325050
--- /dev/null
+++ b/doc/device-tree-bindings/net/mdio.txt
@@ -0,0 +1,36 @@
+Common MDIO bus properties.
+
+These are generic properties that can apply to any MDIO bus.
+
+Optional properties:
+	- device-name - If present it is used to name the device and MDIO bus.
+			The name must be unique and must not contain spaces.
+
+A list of child nodes, one per device on the bus is expected.  These 
+could be PHYs, switches or similar devices and child nodes should 
+follow the specific binding for the device type.
+
+Example :
+This example shows the structure used for the external MDIO bus on NXP 
+LS1028A RDB board.  Note that this MDIO device is an integrated PCI 
+function and requires no compatible property for probing.
+
+/* definition in SoC dtsi file */
+	pcie at 1f0000000 {
+
+		mdio0: pci at 0,3 {
+			#address-cells=<0>;
+			#size-cells=<1>;
+			reg = <0x000300 0 0 0 0>;
+			status = "disabled";
+			device-name = "emdio";
+		};
+	};
+/* definition of PHYs in RDB dts file */
+&mdio0 {
+	status = "okay";
+	rdb_phy0: phy at 2 {
+		reg = <2>;
+	};
+};
+
--
2.17.1



More information about the U-Boot mailing list