From owner-freebsd-arch@FreeBSD.ORG Sun Feb 12 04:49: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 29D161065673; Sun, 12 Feb 2012 04:49:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4D71B8FC08; Sun, 12 Feb 2012 04:49:31 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so4330938wib.13 for ; Sat, 11 Feb 2012 20:49:30 -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; bh=f3O1Ru++smXF2Ux+fRng7rL5DqYq6u767uBT3KGFoR4=; b=O2w2AXuakfDS6Es4/QhIdH/CYOx8QjQPK4a509MvZH998JXJEMgx6Ng0JNiIesMJil L/Io3p9eV29jv7kg2jbRD5CBs/2HJUClPiQ3C1ib5Sev+muJEbAZcCsFzfj4S3AQCUh7 ryF9a8PMeFNi7pp/tg4WJBxROSgiodXn+qXVE= MIME-Version: 1.0 Received: by 10.180.96.8 with SMTP id do8mr11293472wib.21.1329022170509; Sat, 11 Feb 2012 20:49:30 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.175.136 with HTTP; Sat, 11 Feb 2012 20:49:30 -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> Date: Sat, 11 Feb 2012 20:49:30 -0800 X-Google-Sender-Auth: A_h20vjIgOt-jI9aejNUsUGERZw Message-ID: From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Cc: Aleksandr Rybalko , 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 04:49:32 -0000 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? 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 may make it easier to specify the configuration but it doesn't fix the fundamentally wrong assumption. 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. 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. Adrian