Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 02 Feb 2014 09:43:11 -0700
From:      Ian Lepore <ian@FreeBSD.org>
To:        =?ISO-8859-1?Q?Wei=DF=2C_J=FCrgen?= <weiss@uni-mainz.de>
Cc:        "'freebsd-arm@freebsd.org'" <freebsd-arm@FreeBSD.org>
Subject:   RE: status = "disabled" (with the right patch this time)
Message-ID:  <1391359391.13026.20.camel@revolution.hippie.lan>
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>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Sun, 2014-02-02 at 15:59 +0000, Weiß, Jürgen wrote:
> 
> > -----Original Message-----
> > From: Nathan Whitehorn [mailto:nwhitehorn@freebsd.org]
> > Sent: Sunday, February 02, 2014 4:20 PM
> > To: Weiß, Jürgen; freebsd-arm@freebsd.org
> > Subject: Re: status = "disabled"
> > 
> > On 02/02/14 05:55, Weiß, Jürgen wrote:
> > > Hi,
> > >
> > > it seems your recent changes (261351) discarded a call to fdt_is_enabled
> > > for devices on simplebus. So 'status = "disabled" ' does not work
> > > anymore in arm dts.
> > >
> > > Regards
> > >
> > > Juergen Weiss
> > >
> > > Juergen Weiss      |Universitaet Mainz, Zentrum fuer Datenverarbeitung,
> > > weiss@uni-mainz.de |55099 Mainz, Tel: +49(6131)39-26361, FAX: +49(6131)39-26407
> > >
> > >
> > 
> > That's actually required to make some hardware work ("disabled" may just
> > mean the clock is turned off and needs to be turned back on, which means
> > 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
> 
> 
> Thanks for the quick answer. Right know there seem to be zero device drivers
> doing this. And there are quite a few fdts going from general (all devices on SOC) 
> to specific (devices usable on specific board), which use the status field
> to disable a device (for example i.mx in general and wandboard specifically).
> At least with the i.mx6 the unconnected sdhci devices lead to hangs during
> boot.
> 

Ooops, I attached the wrong patch to my previous reply, here's the right
one.

-- Ian


[-- Attachment #2 --]
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);

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1391359391.13026.20.camel>