Date: Fri, 06 Oct 2006 09:42:31 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: namaskar_alok@yahoo.co.in Cc: freebsd-new-bus@freebsd.org Subject: Re: Device enumeration process Message-ID: <20061006.094231.-1572283957.imp@bsdimp.com> In-Reply-To: <20061006073434.71730.qmail@web8913.mail.in.yahoo.com> References: <20060930.124334.-432842007.imp@bsdimp.com> <20061006073434.71730.qmail@web8913.mail.in.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20061006073434.71730.qmail@web8913.mail.in.yahoo.com>
Alok Barsode <namaskar_alok@yahoo.co.in> writes:
: Thanks for ur earliers replies. They helped me a lot
: in understanding the newbus architecture.
: I am involved in a freeBSD port to a freescale board.
Cool! Remind me: is the freescale an arm design or a Power PC one?
: When i/o configuration is in progress during startup,
: are the drivers for specific busses alreay assosciated
: with them or the association happens at run time ?
The drivers are associated with the busses at compile time (as
extended via modules that are loaded). The assignment of specific
device nodes to drivers is done at run time.
: for example :
: when nexus is being attached to root_bus,
: the method devclass_find_internal("nexus", 0, TRUE) is
: invoked(in method make_device).Now does a nexus
: devclass already exist ( it is created through the
: macro DRIVER_MODULE(nexus, root, nexus_driver,
: nexus_devclass, 0, 0);) or it is created at runtime ?
:
: if it is created at runtime how the nexus_driver get
: assciated with nexus?
nexus_driver gets associated with nexus here:
/*
* Determine i/o configuration for a machine.
*/
static void
configure_first(dummy)
void *dummy;
{
/* nexus0 is the top of the i386 device tree */
device_add_child(root_bus, "nexus", 0);
}
at least tenatively associated. configure_first is run via the
SYSINIT at SI_SUB_CONFIGURE as the first thing. In fact, all the
autoconf look similar in this respect. The arm one does the same
thing.
If you look at sys/arm/at91/at91.c, you'll see code:
static void
at91_identify(driver_t *drv, device_t parent)
{
BUS_ADD_CHILD(parent, 0, "atmelarm", 0);
}
which is how the atmelbus gets added to nexus. Again, the atmelbus is
about the best example I can easily find in the tree...
Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061006.094231.-1572283957.imp>
