Date: Sun, 8 Jul 2018 12:45:00 -0400 From: Mark Johnston <markj@freebsd.org> To: Warner Losh <imp@bsdimp.com> Cc: Sean Bruno <sbruno@freebsd.org>, Andrew Turner <andrew@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334880 - head/sys/dev/vnic Message-ID: <20180708164459.GE18193@pesky> In-Reply-To: <CANCZdfrY-7wFpgKAG2WTTmCW%2B1XZwt8YgaqUw6yO5jOLudkuDA@mail.gmail.com> References: <201806091447.w59ElnpU026396@repo.freebsd.org> <20180707174351.GA95934@pesky> <ef680451-5750-e0cd-27b5-852fc8e74eb8@freebsd.org> <20180708152621.GB18193@pesky> <5483bcd6-f3bc-8b78-ee51-3bf3c2a1c2da@freebsd.org> <CANCZdfrc9UvzkjQPiamC8oox2qG0ahrNCsOK6md5aC_b8Km0=w@mail.gmail.com> <20180708161415.GD18193@pesky> <CANCZdfrY-7wFpgKAG2WTTmCW%2B1XZwt8YgaqUw6yO5jOLudkuDA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 08, 2018 at 10:23:52AM -0600, Warner Losh wrote: > On Sun, Jul 8, 2018 at 10:14 AM, Mark Johnston <markj@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>; }; };
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180708164459.GE18193>