From owner-freebsd-arch@FreeBSD.ORG Sun Jan 29 16:00:41 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 9BEF81065678; Sun, 29 Jan 2012 16:00:41 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2001:470:1f0b:105e::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id 537CC8FC18; Sun, 29 Jan 2012 16:00:41 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id B69E927CAD; Sun, 29 Jan 2012 16:00:39 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Stefan Bethke In-Reply-To: <20120129153159.GA44362@alchemy.franken.de> Date: Sun, 29 Jan 2012 17:00:38 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <3B5A749B-9553-4152-9441-3F343BA219FB@lassitu.de> References: <20120120221319.ca8b631f.ray@freebsd.org> <30A45A1E-CA13-4AC8-86FB-F8E06301D1F6@lassitu.de> <20120122195130.360261ce.ray@freebsd.org> <0E31FEC4-963D-4AC8-9AB7-EE6D6D7F86EE@lassitu.de> <20120129001251.7e4cfe83.ray@ddteam.net> <81B88904-6894-4AC3-80F3-2866216E494B@lassitu.de> <20120129153159.GA44362@alchemy.franken.de> To: Marius Strobl X-Mailer: Apple Mail (2.1251.1) Cc: FreeBSD Net , Aleksandr Rybalko , Adrian Chadd , FreeBSD-arch Subject: Re: Ethernet Switch Framework 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, 29 Jan 2012 16:00:41 -0000 Am 29.01.2012 um 16:31 schrieb Marius Strobl: > How about adding the MDIO provider via multi-pass probing? That idea > of that model was to attach things like drivers for interrupt = controllers > before any other driver that requires that resource. This seems like a > perfect match here and requires neither a specific hack to the nexus > (the platform generally needs to be multi-pass aware though and the > thing enabled in subr_bus.c) nor a hack to miibus(4). Please recall the devinfo graph that I posted earlier. The PHY arge0 = needs to talk to is attached to the MDIO master on the switch = controller, which in turn is attached to GE1's MDIO master. This would = require early attachment of the switch, in turn requiring early = attachment of arge_mdio, in turn requiring early attachment of = mips/mips/nexus. > We really need > to find a proper way of dealing with the constraints of the embedded- > world rather than to sprinkle hacks all over the place. Why is the above is less of a hack than making the ordering in nexus = configurable through a hint? Stefan --=20 Stefan Bethke Fon +49 151 14070811 diff --git a/sys/mips/mips/nexus.c b/sys/mips/mips/nexus.c index b51357d..c4c207a 100644 --- a/sys/mips/mips/nexus.c +++ b/sys/mips/mips/nexus.c @@ -240,8 +240,11 @@ nexus_hinted_child(device_t bus, const char *dname, = int dunit) int result; int irq; int mem_hints_count; + int order; =20 - child =3D BUS_ADD_CHILD(bus, 0, dname, dunit); + order =3D 1000; /* there should be a define for the default = order */ + resource_int_value(dname, dunit, "order", &order); + child =3D BUS_ADD_CHILD(bus, order, dname, dunit); if (child =3D=3D NULL) return;