[LinuxBIOS] [PATCH] Add initial serial output for Via vt82c686

Uwe Hermann uwe at hermann-uwe.de
Wed Mar 14 01:54:12 CET 2007


On Mon, Mar 12, 2007 at 07:08:32PM -0400, Corey Osgood wrote:
> Here's the updated version of this patch, which from what I can see 
> works perfectly fine, every boot. The description, once again:
> This patch is just for initial serial output for the Via vt82c686(a/b) 
> southbridge, no more and no less. SMBus and the rest of the SuperI/O 
> functions are yet to be written. I've confirmed that this works on Tyan 
> S2507 (vt686b), and it should also work fine on vt686a. This is based 
> rather loosely on Uwe's code for the SMSC FDC37M60x.
> Signed-off-by: Corey Osgood <corey_osgood at verizon.net>

OK, I tried this code today on an MSI K7T Turbo (MS-6330), which uses
the VT82C686B southbridge.

I didn't manage to get serial output with this code, yet. I verified
that I can boot Linux with the proprietary BIOS and that I can use
minicom for serial connections to another PC (COM1, 115200 bps, 8N1).

Attached is my quick hack which I used in addition to your patch to be
able to build an image. I abused the tyan/s2735, but it really doesn't
matter which board you use in this case (I think)...

In targets/tyan/s2735/Config.lb I added
  option ROM_SIZE = 256*1024
and set the payload to
  payload /etc/hosts
for a dummy payload (doesn't matter yet).

Maybe I'm missing some important detail in my code? Can you please post
your full patch you use for building an image?

> Index: src/southbridge/via/vt686/vt686_early_serial.c
> ===================================================================
> --- src/southbridge/via/vt686/vt686_early_serial.c	(revision 0)
> +++ src/southbridge/via/vt686/vt686_early_serial.c	(revision 0)

I've been thinking about the name and location of this code. I think
it's better to name the directory vt82c686 (no "a" and no "b") and use it
for both variants (a/b).

Please rename all respective variable names and file names to vt82c686*.

I guess we can keep the code in src/southbridge/via for now (instead of
src/superio/via), I'm still undecided which is better here, but
we can always move the code later...

> +/* Enable the peripheral devices on the VT686 Super I/O chip. */
> +static void vt686_enable_serial( void )
> +{
> +	/* (1) Enter the configuration state. ( Set PCI Function 0 Rx85[1] = 1 ) */
> +	device_t dev;
> +	/* First, find the southbridge. Trip the POST card if we don't (does die() do this?)*/
> +	dev = pci_locate_device( PCI_ID( PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686 ), 0 );
> +	if ( dev == PCI_DEV_INVALID ) {
> +		outb( 0xff, 0x80 );
> +		die( "Southbridge not found\r\n" );
> +	}

First I suspected that this code might not work for my board, but the
PCI IDs are ok:

00:07.0 0601: 1106:0686 (rev 40)

I don't have a working POST card at the moment, unfortunately (my old
one is broken), so I cannot verify much here...

> +	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. FIXME: only power on used devices
> +	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 part should check whether COM1 or COM2 was selected by the user,
then only enable that one. No other devices yet (this is
vt686_early_serial.c so we only need serial).

Cheers, Uwe.
http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msi_k7t_turbo.patch
Type: text/x-diff
Size: 3268 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20070314/8af46951/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20070314/8af46951/attachment.sig>

More information about the coreboot mailing list