mptables and missing devices

Eric W. Biederman ebiederman at lnxi.com
Mon Sep 29 17:15:00 CEST 2003


Stefan Reinauer <stepan at suse.de> writes:

> * Stefan Reinauer <stepan at suse.de> [030929 22:15]:
> > Hi,
> > 
> > is there a reason why the mptable creation uses dev_find_slot()
> > to find the bridges instead of dev_find_device()? Since it does
> > not even check whether the device it finds is the one it wants
> > this sounds rather dangerous.

In the case of a specific motherboard it is safe, as long as all of 
the upper level bridges are taken into account.  dev_find_device,
is worse because you may have two devices with the same vendor
and device id.

It is on the todo list to generate all of this by walking the device
tree.  What we have now is a place holder that let's LinuxBIOS work
until we have generic code that will work for everyone.

> > Taking the PCI_CLASS field into regard, it should be possible to
> > search for all bridges in the system and generate the necessary
> > mptable entries from the information gathered from the devices
> > (SUBORDINATE_BUS, SECONDARY_BUS)
> 
>         /* define bus and isa numbers */
>         for(bus_num = 0; bus_num < bus_isa; bus_num++) {
>                 smp_write_bus(mc, bus_num, "PCI   ");
>         }
>         smp_write_bus(mc, bus_isa, "ISA   ");
> 
> Is this an internal convention, a hardware rule or just common sense
> that the ISA bus is the last bus in the mptable? An ISA bus has no 
> bus number in the PCI view of things, does it?

Right.  A lot of this was modeled on how existing mptables are setup.
I am not certain there needs to be a 1-1 mapping from bus numbers on
the pci bus to other bus numbers but it can't hurt.  And the ISA can
pretty much go anywhere else.

> I assume that the ISA compatibility interrupts handling is the same on
> all platforms that have ISA, is it?
>         /* ISA backward compatibility interrupts  */
>         smp_write_intsrc(mc, mp_ExtINT, 
>                 MP_IRQ_TRIGGER_DEFAULT|MP_IRQ_POLARITY_DEFAULT,
>                 bus_isa, 0x00, 0x02, 0x00);
>         ...

Almost. Interrupts off of the LPC/ISA bus are the same because the bus
generates them.   PCI interrupts that are routed through 8259 also vary.
I think the irq controller can also vary.   Although it may be special
cased.

> Local interrupts are probably one per CPU:
>         /* Standard local interrupt assignments */
> What's the way to find out the number of CPUs while writing the mptable?
> 
> The HDAMA has no AGP slot.. is this a left over, or is it good for
> something?
>         /* AGP Slot */

It must be left over.  I have it yanked out of my tree.  After I finish
catching up on my email I will start synching the tress and kill it.

> The interrupt src entries for the different PCI slots confuse me a bit..
> Is there a way to find out in the system how many pci slots a bridge
> has, or should the bridge entry in the config file get an entry similar to:
>         register "slots" = 2

We should probably hang a ``slot'' device of the device tree to model this.

All pci bridges have a maximum of 32 devices behind them.  And we need to know
which ones are actually devices.


Eric



More information about the coreboot mailing list