Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Sep 2006 12:43:34 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        namaskar_alok@yahoo.co.in
Cc:        freebsd-new-bus@freebsd.org
Subject:   Re: more Device enumeration
Message-ID:  <20060930.124334.-432842007.imp@bsdimp.com>
In-Reply-To: <20060930120043.41538.qmail@web8913.mail.in.yahoo.com>
References:  <20060928.101531.-957832987.imp@bsdimp.com> <20060930120043.41538.qmail@web8913.mail.in.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20060930120043.41538.qmail@web8913.mail.in.yahoo.com>
            Alok Barsode <namaskar_alok@yahoo.co.in> writes:
: A question which arises is, If the kernel calls the
: probe routine (in case of PCI)for all the devices
: attached to it during bus-enumeration, whats the point
: of having the device entries in GENERIC?

Smaller kernels can be created by omitting unwanted/unneeded devices.

: does the
: bus-dependent code call the probe routine of the
: device-driver,for only those devices which are
: mentioned in GENERIC file.

Only for those modules that are loaded, would be a better way to say
it.  The GENERIC file effectively specifies which modules to load by
creating a makefile that preloads them.

: I am writing a device driver for a memory mapped
: ethernet device.Does it HAVE to be attached to a
: bus?

Yes.  It must be attached to a bus.  The device, in hardware, is
attached to a bus by definition.  The software reflects this hardware
definition and requires that you attach it to a bus.  The word bus in
software just means that it has to attach somewhere.

: Its the only device I want to support(right
: now).Is it not possible to hard-code the probe-attach
: routine calls?

Not really, but creating a bus is easy.

: Can i attach it to nexus? OR Can I attach it to the
: PCI bus (though its not a PCI device) through some
: hack? 

It would be better not to do that.

: This is not a i386 port hence the ISA bus is absent. 
: Will i have to implement a pseudo-bus (write the
: bus-dependent code)in order to attach my device?

Ah, in that case, can you describe the hardware a little better?  I'm
always curious about non-i386 ports...

For the Atmel ARM AT91RM9200 port that I've been working on, we placed
all the devices that were on the SoC part in their own bus (called
atmelarm).  This bus manages the resources and attachment points for
all the devices on the atmel chip.  At the moment, I've hard coded the
devices that are present and add them (see src/sys/arm/at91/at91.c for
the details).  I'd like to make it even easier to create a generic-ish
bus like this, but this is the best example in the tree right now.

You could attach this to nexus, and hard wire the resources that the
ethernet driver uses.  This would be a quick and dirty way of dealing
to get things rolling, but isn't very flexible or expandable and will
likely bite you in the long run...

Warner



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