From owner-freebsd-arch@FreeBSD.ORG Sun Feb 12 18:05:17 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 03BE1106566C; Sun, 12 Feb 2012 18:05:17 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id E3A378FC15; Sun, 12 Feb 2012 18:05:15 +0000 (UTC) Received: by eaan10 with SMTP id n10so1758247eaa.13 for ; Sun, 12 Feb 2012 10:05:14 -0800 (PST) Received: by 10.213.17.9 with SMTP id q9mr318663eba.41.1329069914358; Sun, 12 Feb 2012 10:05:14 -0800 (PST) Received: from rnote.ddteam.net (232-209-133-95.pool.ukrtel.net. [95.133.209.232]) by mx.google.com with ESMTPS id a58sm51226649eeb.8.2012.02.12.10.05.12 (version=SSLv3 cipher=OTHER); Sun, 12 Feb 2012 10:05:13 -0800 (PST) Date: Sun, 12 Feb 2012 20:04:37 +0200 From: Aleksandr Rybalko To: Warner Losh Message-Id: <20120212200437.05c7677f.ray@ddteam.net> 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> X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQltav0G7K21BPzukoorNu+6iz14eCkzaFopfIaB0DseeVQkapv5Nk3XU5/0IdBgZ8do9yuk Cc: Adrian Chadd , Stefan Bethke , Juli Mallett , 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 18:05:17 -0000 On Sat, 11 Feb 2012 21:59:08 -0700 Warner Losh wrote: > > On Feb 11, 2012, at 9:49 PM, Adrian Chadd wrote: > > > On 11 February 2012 17:15, Warner Losh wrote: > >> > >> On Feb 11, 2012, at 6:00 PM, Adrian Chadd wrote: > >>> I'd like to try and finally bring some sanity to the hardcoded PHY > >>> mask handling in if_arge (and make it actually work for AR71xx and > >>> AR724x - where AR71xx has one shared MDIO bus between both MACs, > >>> but AR724x has two independent MDIO busses..) > >> > >> FDT would do that... > > > > .. how would it bring sanity to the device driver? > > FDT would encode the links between the MAC and the PHY. FDT is a > directed graph, not a tree, so you can have multiple paths to a > device node that follow different domains. FDT is good thing, but in D-Link devices which I already touch FDT present in bootloader only in one device IIRC (Marvell based NAS). Since we need hardcode it, there is no difference how we do it with FDT or with hints. But I agree that it will be step into future if we will support FDT in such things. > > > Right now the driver assumes that both arge0 and arge1 mdiobus are > > the same and uses the phymask setting to determine how/when to > > access registers (ie, trying to read/write from phy registers not > > in the phymask of argeX are denied.) It is one of the annoying > > issues with the AR7241 internal switch support as that switch hangs > > off of arge1's MII bus. > > It would no longer need to do this, or make any assumptions at all. > FDT would tell it all. > > > It may make it easier to specify the configuration but it doesn't > > fix the fundamentally wrong assumption. > > Nope. Bad assumptions would still need to be fixed. > > > 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. They sit on another device that the > driver bogusly assumes is tightly coupled to arge1, when in fact it > isn't. At least for AR7240/AR7242, MDIO control registers lie in the middle of register space used by if_arge. > > > Ray/Stefan/others: if anything, I'd like to try and bring sanity to > > this particular thorny issue in -HEAD before we worry about switch > > PHY devices. > > Warner > -- Aleksandr Rybalko