Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jul 1997 21:25:26 +0200
From:      Stefan Esser <se@FreeBSD.ORG>
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        Amancio Hasty <hasty@rah.star-gate.com>, hackers@FreeBSD.ORG, multimedia@FreeBSD.ORG, Stefan Esser <se@FreeBSD.ORG>
Subject:   Re: Advice sought on PnP configuration
Message-ID:  <19970730212526.55863@mi.uni-koeln.de>
In-Reply-To: <199707300404.GAA03229@labinfo.iet.unipi.it>; from Luigi Rizzo on Wed, Jul 30, 1997 at 06:04:33AM %2B0200
References:  <199707300216.TAA03025@rah.star-gate.com> <199707300404.GAA03229@labinfo.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
On Jul 30, Luigi Rizzo <luigi@labinfo.iet.unipi.it> wrote:
> HOWEVER: this relies on the PnP (or PCI for what matters) BIOS to
> work correctly (which might be false, see at the end of the message).

Well, there are **lots** of non-PnP mother boards out there
(and I happen to own one, and for that reason I care :)

Whatever solution we finally implement, we must be able to
attach PnP boards without any help from the PnP BIOS.

> In order to configure cards correctly, the bios should know which
> IRQs and which I/O address ranges are used by plain isa devices.
> The former can be told to some bioses, the latter I have never seen
> how to do on my systems. This is not a big deal with PCI devices
> since they usually map addresses in the high range of iospace, but
> a serious problem with PnP ISA devices where iospace is tight and
> shared with non PnP devices.
>
> Since we cannot trust the BIOS (because it does not have enough
> info) the only way to do autoconfiguration reliably in FreeBSD is
> the following:
> 
> 1 probe & attach pci devices
> 2 disable all pnp devices, so that they are not recognized by isa probes;
> 3 probe & attach plain isa devices;
> 4 configure PnP devices, using info derived from the isa configuration
>   process to determine which address ranges and irqs are busy;
> 5 activate PnP devices;
> 6 finally, probe and attach PnP devices.

I'm planning to make PCI probe before user_config, and attach 
after, and I think the same should be done for PnP ISA devices.
(I don't explicitly mention EISA or MCA, but both fall into the
same category as PCI, I guess ...)

In other words: All devices that can be positively detected and
whose resource requirements can be determined without actually
attaching them should be probed and their resource preferences
or requirements should be recorded.

Then a configuration defaults file should be loaded from the 
boot partition. As proposed earlier, scanning this file could
replace the generated tables with ISA device parameters, that
are currently compiled into the kernel. Fallback resources can
be included into the kenrel in the same textual form that is 
normally read from the configuration defaults file, if a compact
representation is chosen. (I proposed one, a few weeks ago.)

The (optional) user configuration step allows to disable devices 
or to set ISA probe parameters, but I want to see this extended 
to include wiring of devices to buses (including PCI and SCSI :)

Then the PCI and ISA PnP devices are attached, followed by the
probe and attach of ISA devices. The conflicts checking is to
be extended to know about resources assigned to PCI and ISA PnP
devices. (I have implemented a working prototype for such resource
registration and conflicts checking code, but I think it should 
be done quite differently than I tried it, and don't want to 
commit my code for that reason. There should be a functional 
interface that checks for conflicts, and I'm goind to implement
that for PCI in such a way that it can be added to all other
bus drivers easily.)

> Any comments on the above ? Right now I am doing steps in the order 1,
> 5, 6, 3 (2 and 4 are not necessary if the bios works), but it can
> fail in some cases for the reasons stated above.

What do you think about my proposed sequence ?

Regards, STefan



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