From owner-freebsd-arch@FreeBSD.ORG Sun Feb 12 05:20:22 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 1F6DD1065670; Sun, 12 Feb 2012 05:20:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id 03AF28FC0C; Sun, 12 Feb 2012 05:20:20 +0000 (UTC) Received: by wgbgn7 with SMTP id gn7so1511997wgb.1 for ; Sat, 11 Feb 2012 21:20:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FMdoAqv221Wgy2n/KyTdVGQ5F5+JJ2yHIky7/wjTvnU=; b=xv8qCEkmyFef6ns6+XlvdUwx17QLv4cRR+SVy888z/T9XZT/oZ9Eh3GEpZxi0QsEBn 1jQe8ccViNQW4gRx92aqy1AvHa0SItNQyak1/uPzW1hCA6TxQ48JB0FsY/2Wot5FhKCW 7D/mIK/26PSw9O2adAph3jduhIbVtXwd7mdJ0= MIME-Version: 1.0 Received: by 10.216.135.76 with SMTP id t54mr4620655wei.14.1329024020168; Sat, 11 Feb 2012 21:20:20 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.175.136 with HTTP; Sat, 11 Feb 2012 21:20:20 -0800 (PST) In-Reply-To: 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> Date: Sat, 11 Feb 2012 21:20:20 -0800 X-Google-Sender-Auth: 5_IRdiHVAZ_MkHoQJH7nnGbDpdM Message-ID: From: Adrian Chadd To: Juli Mallett Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Aleksandr Rybalko , Stefan Bethke , FreeBSD-arch , 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:20:22 -0000 On 11 February 2012 21:06, Juli Mallett wrote: >> The PHYs don't sit on arge1. =A0They sit on another device that the driv= er bogusly assumes is tightly coupled to arge1, when in fact it isn't. > > YES! =A0Thank you! =A0And 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. =A0No shortcomings, as far as I can > tell. =A0You 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. =A0But that's probably a bit much to ask for. I'm tempted to just go ahead and do this, and have: * argec: initial device probe/attach, handle mdio/miibus configuration * if_arge: child of argec (with all register accesses going via it), doing the rest of ethernet stuff .. then what, we have argec0/argec1 first probe/attach, then have if_arge0/if_arge1 probe/attach with the relevant miibus PHYs attach to wherever they need to? There'll need to be some kind of locking there so both the argecX and the if_argeX don't clash. Adrian