From owner-freebsd-new-bus@FreeBSD.ORG Fri Oct 6 15:45:21 2006 Return-Path: X-Original-To: freebsd-new-bus@freebsd.org Delivered-To: freebsd-new-bus@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0886E16A403 for ; Fri, 6 Oct 2006 15:45:21 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8615F43D45 for ; Fri, 6 Oct 2006 15:45:20 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k96FhLCi049279; Fri, 6 Oct 2006 09:43:22 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 06 Oct 2006 09:42:31 -0600 (MDT) Message-Id: <20061006.094231.-1572283957.imp@bsdimp.com> To: namaskar_alok@yahoo.co.in From: "M. Warner Losh" 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> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Fri, 06 Oct 2006 09:43:22 -0600 (MDT) Cc: freebsd-new-bus@freebsd.org Subject: Re: Device enumeration process X-BeenThere: freebsd-new-bus@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD's new-bus architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2006 15:45:21 -0000 In message: <20061006073434.71730.qmail@web8913.mail.in.yahoo.com> Alok Barsode 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