The whole coreboot is devided into 4 main part.
1. CPU and Northbridge.
We put these 2 things together because they usually are embedded together.
2. Southbridge 1
3. Southbridge 2
SB1 is connected to Northbridge and SB2 is connected to SB1. Taking dbm690t as an example, SB1 is RS690 and SB2 is SB600.
4. SuperIO.
The SuperIO is connected to SB2. It has the feature which is back compatible to legacy devices, such as PS/2 keyboard and mouse, serial port.
I am going to make a detailed introduction helping people to develop a coreboot based on a given specific board.
Let's start now.
1. SuperIO
I introduce the SuperIO first because it is easiest. And, coreboot need the serial port to work at a very early stage. Coreboot tries to do least work before serial port can work. After the serial port works, we can debug the coreboot by print message to serial.
The superIO is accessed by io port 0x2E and 0x2F. 0x2E is index port, 0x2F is date port. The SuperIO chip always has several logical modules. We set the LDN by index 7 then the
feature is selected.
Select LDN:
outb(0x2E, 7);
outb(0x2F, LDN);
The following action is based on the selected LDN.
outb(0x2E, 0x30);
outb(0x2F, 0x01); /* Enable the logical device */
outb(0x2E, 0x60);
outb(0x2F, MSB);
outb(0x2E, 0x61);
outb(0x2F, LSB); /* set the address used by this device. */
Afterwards, we can access the logical devices by the address which is got by combining the MSB and LSB.
Actually almost all the SuperIO chip is based on the above code. It it not difficult, is it?
After early stage, we need to put the SuperIO into our whole device map. That is done by superio.c. The resources are allocated based on tradional rules. The serial port uses 0x3F8-0x3FF, the keyboard uses 0x60 and 0x64. The OS can also uses the IO port to access the devices and don't have to know the existence of SuperIO chips.
There are several manufactures which provide SuperIO silicon. They are located in directory of superio. Each of them has several types of chips. Actually the chips from one vendor are almost the same. They can use the exact same code. But we have to put them into different folders because we need to define it in mainboard configuation file. When some one modify the code in one folder, the other chips are also need to modified. But no one will do it because that chip has nothing to him. He is reluctant to do it. This need to be resolved.
After the SuperIO works, we need to know how we can make the devices on it also work. The code for PS/2 keyboard and mouse, serial port are almost the same. We dont have to make a new patch for each new SuperIO chip. Relax, they are not difficult at all. Go to src/pc80 and find out what you want.
January 21, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment