I am in the process of a major change to linuxBIOS. The goal
is to make the code simpler and to give device drivers the
information they need to properly initialize devices in linuxBIOS,
without board specific hacks.
My starting point is to create a table of all of the devices
on a motherboard. All of the resources of those devices and
all of their interconnections. Such a table should replace
all of our irq_routing and mp_tables as well as solve a few
other interesting difficulties.
To date I have implemented such a table for the dual-amd board.
I've started at it it is handy to work against. And it is almost
complete. I have some resources on the superio chip yet to document
but I have all of the irq routing in place so far. So I am confident
the basic idea works.
The table has 4 kinds of structures.
1) A device identifier that is composed of 3 strings.
device-identifier type.
Manufacture/Vendor
device
2) A link (that represents some kind of connection between devices).
Is composed of several strings.
Label (Mostly as a comment)
link_addresses (How many different places you can address on this
connection)
3) A resource is composed of the following strings
Label
Start
Size
flag -- Master/Slave
Pointer to the link the resource is on.
A slave resource is like pci bars. An I/O port someone else
uses. A master resource is like the bus master capability
of a pci device. It doesn't matter much until you get into
things like interrupts. Which are best modeled as the devices
being the bus masters (but only in a tightly constrained
sphere) and the interrupt controllers having the slave
resoruces.
4) A device is compossed of the following.
Label
Device id
Container device (A superio chips and multifunction pci devices are
good examples, often times the individual functions don't quite
stand alone.)
Array of resources
This basic structure takes work to map it to different kinds of
devices. And that is the foggies part, remaining. A clear
specification of what the mappings to various devices, and interrupt
controllers is. After having worked with it the general structure
appears solid. And once it all firms up it looks like changes
except for mapping new kinds of devices will be unnecessary in the
future.
Once this stabalizes I want to export this to the linux kernel and
whatever standalone programs we run directly.
On the simplifying linuxBIOS side this should be able to merge in all
of the work we do with southbridge, and superio chips into one form.
And leave hardwaremain.c almost completely architecture netural.
Most/all? of the current device initialization settings should be able
to be put in a parrallel tree of recommended resource settings.
Writing this up has led me to one problem though. How do I want
to handle bus speeds, or more generally bus transport options.
This would include baud rates on serial ports, pio and dma modes for
ide drives, and polarity and edge triggered ness for irq lines.
My initial reaction is to encoded it as part of the address but that
doesn't sound reasonable. This probably calls for a link to have
a range of options it supports, and a for resources to do linkwise.
Well time to sleep on it. At any rate if you think the path
I'm walking down is folly I'd love to hear it...
Eric