Uwe Hermann wrote:
Index: src/southbridge/via/vt686/Config.lb
--- src/southbridge/via/vt686/Config.lb (revision 0) +++ src/southbridge/via/vt686/Config.lb (revision 0)
Not sure. I think we usually use the full part names, so this should probably be src/southbridge/via/vt82686b/?
In Via's datasheets and the datasheets for the mainboards that I've looked at, vt82c686 and vt686 are used interchangeably. We also call it vt686 in LBv1, and lm_sensors does too. Linux calls it vt82xxxx, which I don't much care for at all, since that also would cover vt8231, etc (which linux's driver very well may, but mine doesn't). And vt686 is so much easier to write ;)
How different are vt82686b and vt82686a? Should they become two different directories? If not, how should the directory be called? vt82686ab, or just vt82686a and we add a comment that it applies to the vt82686b as well?
The only difference I've been able to find is that the vt686b supports ATA100, whereas the vt686a is only ATA66, which AFAIK should be handled by linux, not us. Apart from that, they use the same registers (programmed the same way), same ID numbers, etc. If something crops up as a major difference, a revision code is on one of the registers, and we can use that to determine what we're working with, and what fix to apply. Either that, or it can be set up with a #ifdef, and defined in auto.c, so we don't have to do runtime southbridge detection. I haven't been able to find any official reference at all to a vt82c686 without an a or b revision, unless they're referring to either revision, so I'm assuming it doesn't exist. Please correct me if I'm wrong!
Also, shouldn't all of this go into src/superio/via? AFAIK the southbridge has a built-in Super I/O, but do we still want to separate the Super I/O parts and put them in src/superio/via?
Comments anyone?
With the via vt8231 and vt8235, the Super I/O support is in with the southbridge, I was just following this example. It makes sense to me personally, since it is still the same part, just two different functions.
- outb(index, SIO_BASE);
- /* b) Read / write data from / to port 3F1 */
0x3f1
This only writes, drop the comment about reads.
This was actually copied directly from the via datasheets. But yes, I'll take care of this
+{
- /* (1) Enter the configuration state. ( Set PCI Function 0 Rx55[1] = 1 ) */
- device_t dev;
- /* First, find the southbridge. Trip the POST card if we don't (does die() do this?)*/
See src/console/console.c, it sets the POST value to 0xff.
- dev = pci_locate_device( PCI_ID( PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686 ), 0 );
- if ( dev == PCI_DEV_INVALID ) {
outb( 0xf7, 0x80 );
Rather use post_code(0xf7) here...
Yeah, the post code was unnecessary, it's been removed entirely. I meant to look for die() before sending this, but it slipped my mind. Didn't realize we had a post_code(), that could come in handy.
die( "Southbridge not found\r\n" ); //Somewhat pointless
Not pointless, die() halts the CPU and you probably don't want to continue if you don't find the southbridge (?)
The text is the pointless part, but I meant to remove that comment. Sending text output to say that you can't find the southbridge to bring up text output...kinda pointless ;)
- }
- pci_write_config8( dev, 0x85, 0x1f ); //Enable the SuperI/O, SI/O Config, and disable everything else
- /* 2) Configure the chip */
- vt686_sio_write( VT686_POWER, 0x00 ); //Make sure all devs are powered on
- vt686_sio_write( VT686_COM_CFG, 0x00 ); //Set up COMs for normal (non-IR) operation
- vt686_sio_write( VT686_FS, 0x07 ); //Disable Floppy, Enable COM1, Disable COM2 and Parallel Port
This should be somehow configurable. Some people might want to use COM2 (can be configured via some Config.lb)...
The next comment below is from via's datasheets, it's what bits control what for that register. The main purpose of this patch is to get serial output working on COM1, I can worry about the niceties later. Floppy and parallel are also disabled at this point, for the same reason.
- /* Index E2 (aka VT686_FS) ??? Super-I/O Function Select
- 7-5 Reserved (Reads 0)
- 4 Floppy Controller Enable
0 Disable (default)
1 Enable
- 3 Serial Port 2
1 Enable
0 Disable (default)
- 2 Serial Port 1
0 Disable (default)
1 Enable
- 1-0 Parallel Port Mode / Enable
00 Unidirectional mode
01 ECP
10 EPP
11 Disable (default) */
Thanks for all the feedback! A fixed patch is attached. I'll also test this on a vt686a once I find my extra BIOS chips for it, but I can't imagine any reason it wouldn't work.
-Corey