From owner-freebsd-arch@FreeBSD.ORG Sun Feb 12 05:06:32 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1308D106566B; Sun, 12 Feb 2012 05:06:32 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 371A88FC12; Sun, 12 Feb 2012 05:06:30 +0000 (UTC) Received: by wgbdq11 with SMTP id dq11so4032349wgb.31 for ; Sat, 11 Feb 2012 21:06:30 -0800 (PST) Received: by 10.180.93.194 with SMTP id cw2mr17444333wib.0.1329023190252; Sat, 11 Feb 2012 21:06:30 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.227.209.78 with HTTP; Sat, 11 Feb 2012 21:06:10 -0800 (PST) In-Reply-To: <58EA57DC-75DF-4813-BB03-FD27F2A49BA2@bsdimp.com> References: <95372FB3-406F-46C2-8684-4FDB672D9FCF@lassitu.de> <20120106214741.GB88161@alchemy.franken.de> <20120108130039.GG88161@alchemy.franken.de> <23477898-8D85-498C-8E30-192810BD68A8@lassitu.de> <20120111193738.GB44286@alchemy.franken.de> <66DDA0A2-F878-43FF-8824-54868F493B18@lassitu.de> <20120125221753.GA17821@alchemy.franken.de> <20120211111731.GE39861@alchemy.franken.de> <20120211144544.c91701d9.ray@ddteam.net> <58EA57DC-75DF-4813-BB03-FD27F2A49BA2@bsdimp.com> From: Juli Mallett Date: Sat, 11 Feb 2012 21:06:10 -0800 X-Google-Sender-Auth: 39tzU6Y2Tq6YFhYWIIwm6BFApSo Message-ID: To: Warner Losh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlBuE+ZSXhsaFUxu4j1loBqvOroEMQTtHWfTJkn30ljHzpaf9kS/+9VjmcK66egaCZSPlPB Cc: Adrian Chadd , Stefan Bethke , FreeBSD-arch , Aleksandr Rybalko , Aleksandr Rybalko , Marius Strobl Subject: Re: Extending sys/dev/mii X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 05:06:32 -0000 On Sat, Feb 11, 2012 at 20:59, Warner Losh wrote: >> The trouble in this whole mess (where FDT may help) is that phy's for >> arge0 may actually sit on arge1. So you can't probe/attach the miibus >> on arge0 until you've probe/attached arge1, so the arge1 MII registers >> can be tickled. > > The PHYs don't sit on arge1. =C2=A0They sit on another device that the dr= iver bogusly assumes is tightly coupled to arge1, when in fact it isn't. YES! Thank you! And even if it were tightly coupled in hardware, there's no reason our device tree needs to mirror that, FDT or not. Just break out an "arge controller" device, attach arge0 and arge1 to it, and let it manage the MDIO bus. No shortcomings, as far as I can tell. You can even be extra clever and say that the switch is attached to that device, not either of the arge devices, and that one of the arge devices happens to be connected to the switch's CPU/host port. But that's probably a bit much to ask for.