From owner-svn-src-head@freebsd.org Sun Jul 8 16:45:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 803A9103AFC4; Sun, 8 Jul 2018 16:45:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB8A07DEC8; Sun, 8 Jul 2018 16:45:03 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-wr1-x441.google.com with SMTP id h40-v6so8534566wrh.2; Sun, 08 Jul 2018 09:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2DzOxdDmftjv6/1AeC890OG8C/RtilyVLV62USXPvis=; b=e+ZIwZ5BE6gplk0qxDPyjiOjIgzARmd3bDyhhR3cKPGmm2ceA04J2Us+kxuBrH4sHS eToBCBUU3RnAl7Qjjkp0BkhqSyvBlFqFB09x3p+XjP4rkoxH+PirGfQvrDtO6nyfyxd0 qxpOWqXJQJ1RXEu9VIXmbhcZ5QofPZTK92xI7X6qyBTx8IBR/qtUzinAaV5JxAHQfRGa 5UeeF5MDmuayM2Yf/OH2KnFQYt4lEz9v23LIhXAsClZS+tVvKPWgn26m+a1tCfAjy0ca HqnoahCWbMfXdZdjmhQ3KU6kE76I99/EBwAn0n5AFUXUTGhdoIcE40LAtHsZtc633/LJ +LBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=2DzOxdDmftjv6/1AeC890OG8C/RtilyVLV62USXPvis=; b=RRzSEKILzuqf98Ns33qF+kJ3BY7yEYXjHTgCMzVX8W90MN+ptDgZhIkh3Gzy3G87BI M/L79IB7LGHDNZZcj95p2jJzKuHVzTGdoQvnfpQzOfG+2Nozs5iexogg/6Lwc403E4As SqWimZQ5/5QftQhr2/pScau/RzbVDnDKoi2PQbRmi9malnG1Io06DdXavUMqg600wpih Dadz1sUlmxjR8EJizNMdDdX+BaEDWjCpPN2mPgRnxsSoPO349XRzjXmKOFfbC8t52GVM YB2tgXpLsdXBV8hg9yvSXlhmePlkuq8d6Oa3GMz0MPLSgDdE+0VJ+X28B0JIGSZSYM2V 1xAQ== X-Gm-Message-State: APt69E36viLwLQCxMuOh6GGrUMvGSiGnz11vcud6s8056yQDKaWl4BAw VoNitkFePZbdV4CnQyalbbzRyT2V X-Google-Smtp-Source: AAOMgpfukqUxl87Nd7O4aZrQZ+gcgt14I8A9CYlK+gSEIZ57djTgTEc3rxbARVfIPkA1yvdy0G3gLg== X-Received: by 2002:adf:c546:: with SMTP id s6-v6mr13315124wrf.46.1531068302865; Sun, 08 Jul 2018 09:45:02 -0700 (PDT) Received: from pesky (174.red-81-43-74.staticip.rima-tde.net. [81.43.74.174]) by smtp.gmail.com with ESMTPSA id g125-v6sm14142982wmf.16.2018.07.08.09.45.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Jul 2018 09:45:02 -0700 (PDT) Sender: Mark Johnston Date: Sun, 8 Jul 2018 12:45:00 -0400 From: Mark Johnston To: Warner Losh Cc: Sean Bruno , Andrew Turner , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334880 - head/sys/dev/vnic Message-ID: <20180708164459.GE18193@pesky> References: <201806091447.w59ElnpU026396@repo.freebsd.org> <20180707174351.GA95934@pesky> <20180708152621.GB18193@pesky> <5483bcd6-f3bc-8b78-ee51-3bf3c2a1c2da@freebsd.org> <20180708161415.GD18193@pesky> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2018 16:45:04 -0000 On Sun, Jul 08, 2018 at 10:23:52AM -0600, Warner Losh wrote: > On Sun, Jul 8, 2018 at 10:14 AM, Mark Johnston 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>; }; };