From owner-freebsd-arm@FreeBSD.ORG Sun Feb 2 16:43:17 2014 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44A2E403; Sun, 2 Feb 2014 16:43:17 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 102F31A1F; Sun, 2 Feb 2014 16:43:16 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WA08Z-0006pa-90; Sun, 02 Feb 2014 16:43:15 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s12GhBLv062228; Sun, 2 Feb 2014 09:43:11 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19VluXQ9VMTn5VVDsScB+S6 Subject: RE: status = "disabled" (with the right patch this time) From: Ian Lepore To: =?ISO-8859-1?Q?Wei=DF=2C_J=FCrgen?= In-Reply-To: <06235e983f8142fcb7f6f6c329a84b90@e15be-01.zdv.Uni-Mainz.DE> References: <726dc97ccd1f44b3ba9d7bee3eeff08a@e15be-01.zdv.Uni-Mainz.DE> <52EE622C.9010004@freebsd.org> <06235e983f8142fcb7f6f6c329a84b90@e15be-01.zdv.Uni-Mainz.DE> Content-Type: multipart/mixed; boundary="=-GKdBpTLDRqI0exn7tErc" Date: Sun, 02 Feb 2014 09:43:11 -0700 Message-ID: <1391359391.13026.20.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: "'freebsd-arm@freebsd.org'" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2014 16:43:17 -0000 --=-GKdBpTLDRqI0exn7tErc Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org id s12GhBLv062228 On Sun, 2014-02-02 at 15:59 +0000, Wei=DF, J=FCrgen wrote: >=20 > > -----Original Message----- > > From: Nathan Whitehorn [mailto:nwhitehorn@freebsd.org] > > Sent: Sunday, February 02, 2014 4:20 PM > > To: Wei=DF, J=FCrgen; freebsd-arm@freebsd.org > > Subject: Re: status =3D "disabled" > >=20 > > On 02/02/14 05:55, Wei=DF, J=FCrgen wrote: > > > Hi, > > > > > > it seems your recent changes (261351) discarded a call to fdt_is_en= abled > > > for devices on simplebus. So 'status =3D "disabled" ' does not work > > > anymore in arm dts. > > > > > > Regards > > > > > > Juergen Weiss > > > > > > Juergen Weiss |Universitaet Mainz, Zentrum fuer Datenverarbeit= ung, > > > weiss@uni-mainz.de |55099 Mainz, Tel: +49(6131)39-26361, FAX: +49(6= 131)39-26407 > > > > > > > >=20 > > That's actually required to make some hardware work ("disabled" may j= ust > > mean the clock is turned off and needs to be turned back on, which me= ans > > you absolutely do want that device probed). The device drivers > > themselves, not the bus, should be checking this property and > > interpreting it. If this has actually broken hardware, we could add a > > temporary #ifdef __arm__ check to the simplebus tree-walker while the > > relevant drivers get fixed up. > > -Nathan >=20 >=20 > Thanks for the quick answer. Right know there seem to be zero device dr= ivers > doing this. And there are quite a few fdts going from general (all devi= ces on SOC)=20 > to specific (devices usable on specific board), which use the status fi= eld > to disable a device (for example i.mx in general and wandboard specific= ally). > At least with the i.mx6 the unconnected sdhci devices lead to hangs dur= ing > boot. >=20 Ooops, I attached the wrong patch to my previous reply, here's the right one. -- Ian --=-GKdBpTLDRqI0exn7tErc Content-Disposition: inline; filename="status.diff" Content-Type: text/x-patch; name="status.diff"; charset="us-ascii" Content-Transfer-Encoding: 7bit Index: simplebus.c =================================================================== --- simplebus.c (revision 261397) +++ simplebus.c (working copy) @@ -242,6 +242,7 @@ { struct simplebus_softc *sc; struct simplebus_devinfo *ndi; + char status[64]; uint32_t *reg, *intr, icells; uint64_t phys, size; phandle_t iparent; @@ -251,6 +252,14 @@ sc = device_get_softc(dev); +#ifdef __arm__ + /* XXX: THIS IS TOTALLY BOGUS AND NEEDS TO BE MOVED TO THE DRIVERS */ + status[0] = 0; + OF_getprop(node, "status", status, sizeof(status)); + if (strcmp(status, "disabled") == 0) + return NULL; +#endif + ndi = malloc(sizeof(*ndi), M_DEVBUF, M_WAITOK | M_ZERO); if (ofw_bus_gen_setup_devinfo(&ndi->obdinfo, node) != 0) { free(ndi, M_DEVBUF); --=-GKdBpTLDRqI0exn7tErc--