On Sun, Jul 08, 2018 at 10:23:52AM -0600, Warner Losh wrote: > On Sun, Jul 8, 2018 at 10:14 AM, Mark Johnston <ma...@freebsd.org> wrote: > > Being unfamiliar with FDT, could I ask you to explain how the code could > > be using phandles to find the PHYs? > > > > Allwinner provides a good example, and says it in code better than I could > quickly summarize: > > static phandle_t > awg_get_phy_node(device_t dev) > { > phandle_t node; > pcell_t phy_handle; > > node = ofw_bus_get_node(dev); > if (OF_getencprop(node, "phy-handle", (void *)&phy_handle, > sizeof(phy_handle)) <= 0) > return (0); > > return (OF_node_from_xref(phy_handle)); > }
I don't see how this can help in the fallback case where the PHY mode isn't encoded anywhere except in the device name. In this case the nodes referred to by the phy-handle properties look like this: mdio@87e005003800 { compatible = "cavium,thunder-8890-mdio"; #address-cells = <0x1>; #size-cells = <0x0>; reg = <0x87e0 0x5003800 0x0 0x30>; xfi@0 { reg = <0x0>; compatible = "cortina,cs4223-slice"; linux,phandle = <0x75>; phandle = <0x75>; }; xfi@1 { reg = <0x1>; compatible = "cortina,cs4223-slice"; linux,phandle = <0x76>; phandle = <0x76>; }; }; _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"