[coreboot] v3: superio/via/vt1211 with serial port init but nothing else

Uwe Hermann uwe at hermann-uwe.de
Fri Oct 31 19:34:04 CET 2008


On Fri, Oct 31, 2008 at 07:11:55PM +0100, Peter Stuge wrote:
> Maybe this works..

I doubt it, so NAK in the current state.


> v3: superio/via/vt1211 with serial port init but nothing else
> 
> Signed-off-by: Peter Stuge <peter at stuge.se>
> 
> Index: superio/via/vt1211/vt1211.h
> ===================================================================
> --- superio/via/vt1211/vt1211.h	(revision 0)
> +++ superio/via/vt1211/vt1211.h	(revision 0)
> @@ -0,0 +1,36 @@
> +/*
> + * This file is part of the coreboot project.
> + *
> + * Copyright 2007 Ronald G. Minnich <rminnich at gmail.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
> + */
> +
> +#ifndef SUPERIO_VIA_VT1211_VT122_H
> +#define SUPERIO_VIA_VT1211_VT122_H
> +
> +#define VT1211_FDC              0   /* Floppy */
> +#define VT1211_PP               1   /* Parallel Port */
> +#define VT1211_SP1              2   /* Com1 */
> +#define VT1211_SP2              3   /* Com2 */
> +#define VT1211_KBC              5   /* Keyboard & Mouse */
> +#define VT1211_CIR              6
> +#define VT1211_GAME_MIDI_GPIO1  7
> +#define VT1211_GPIO2            8
> +#define VT1211_GPIO3            9
> +#define VT1211_ACPI            10
> +#define VT1211_HWM             11   /* Hardware Monitor */

The LDNs here are wrong (probably a copy of some Winbond Super I/O),
please check v2's vt1211.h or the datasheet for the correct ones.


> +
> +#endif /* SUPERIO_VIA_VT1211_VT122_H */
> Index: superio/via/vt1211/stage1.c
> ===================================================================
> --- superio/via/vt1211/stage1.c	(revision 0)
> +++ superio/via/vt1211/stage1.c	(revision 0)
> @@ -0,0 +1,33 @@
> +/*
> + * This file is part of the coreboot project.
> + *
> + * Copyright (C) 2008 Peter Stuge <peter at stuge.se>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
> + */
> +
> +#include <io.h>
> +#include <device/pnp.h>
> +#include "vt1211.h"
> +
> +void vt1211_enable_serial(u8 dev, u8 serial, u16 iobase)
> +{
> +	rawpnp_enter_ext_func_mode(dev);
> +	rawpnp_set_logical_device(dev, serial);
> +	rawpnp_set_enable(dev, 0);
> +	rawpnp_set_iobase(dev, 2, (iobase>>2) & 0xff);

Might work, didn't check the datasheet, yet.


> +	rawpnp_set_enable(dev, 1);
> +	rawpnp_exit_ext_func_mode(dev);
> +}



> Index: superio/via/vt1211/superio.c
> ===================================================================
> --- superio/via/vt1211/superio.c	(revision 0)
> +++ superio/via/vt1211/superio.c	(revision 0)

Pretty much all of this file's code won't work/apply for VT1121, as it's
a copy-paste from some Winbond Super I/O. Please base the code on
the vt1211.c from v2, that has a proper GPL header so it should be no
problem.

If you don't want to port it over just now, please use an empty function
with a /* TODO */ in it, but don't carry over all the unusable code here,
that'll never work for VT1221.


> Index: superio/via/vt1211/Makefile
> ===================================================================
> --- superio/via/vt1211/Makefile	(revision 0)
> +++ superio/via/vt1211/Makefile	(revision 0)
> @@ -0,0 +1,29 @@
> +##
> +## This file is part of the coreboot project.
> +##
> +## Copyright (C) 2008 Peter Stuge <peter at stuge.se>
> +##
> +## This program is free software; you can redistribute it and/or modify
> +## it under the terms of the GNU General Public License as published by
> +## the Free Software Foundation; either version 2 of the License, or
> +## (at your option) any later version.
> +##
> +## This program is distributed in the hope that it will be useful,
> +## but WITHOUT ANY WARRANTY; without even the implied warranty of
> +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +## GNU General Public License for more details.
> +##
> +## You should have received a copy of the GNU General Public License
> +## along with this program; if not, write to the Free Software
> +## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
> +##
> +
> +ifeq ($(CONFIG_SUPERIO_VIA_VT1211),y)
> +
> +STAGE0_CHIPSET_SRC += $(src)/superio/via/vt1211/stage1.c
> +STAGE0_CHIPSET_SRC += $(src)/device/pnp_raw.c
> +
> +# Always add to variables, as there could be more than one Super I/O.
> +#STAGE2_CHIPSET_SRC += $(src)/superio/via/vt1211/superio.c
> +
> +endif

This looks ok.


Uwe.
-- 
http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org




More information about the coreboot mailing list