coreboot-v3/superio/fintek/f71805f/stage1.c
<<
>>
Prefs
   1/*
   2 * This file is part of the coreboot project.
   3 *
   4 * Copyright 2008 Corey Osgood <corey.osgood@gmail.com>
   5 *
   6 * This program is free software; you can redistribute it and/or modify
   7 * it under the terms of the GNU General Public License as published by
   8 * the Free Software Foundation; either version 2 of the License, or
   9 * (at your option) any later version.
  10 *
  11 * This program is distributed in the hope that it will be useful,
  12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14 * GNU General Public License for more details.
  15 *
  16 * You should have received a copy of the GNU General Public License
  17 * along with this program; if not, write to the Free Software
  18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  19 */
  20
  21#include <config.h>
  22#include <device/pnp.h>
  23#include "f71805f.h"
  24
  25void f71805f_enable_serial(u8 dev)
  26{
  27        u8 serial_ldn;
  28        u16 serial_iobase;
  29
  30        /* Serial port info from Kconfig (FTW!). Would be even more 
  31         * awesome if we could get 'dev' from Kconfig or dts */
  32        /* TODO: Get/set serial port speed divisor from Kconfig as well */
  33#if defined (CONFIG_CONSOLE_SERIAL_COM1) && CONFIG_CONSOLE_SERIAL_COM1
  34        serial_ldn = F71805F_COM1;
  35        serial_iobase = 0x3f8;
  36#elif defined (CONFIG_CONSOLE_SERIAL_COM2) && CONFIG_CONSOLE_SERIAL_COM2
  37        serial_ldn = F71805F_COM2;
  38        serial_iobase = 0x2f8;
  39#else /* No serial console */
  40        return;
  41#endif
  42
  43        rawpnp_enter_ext_func_mode(dev);
  44        rawpnp_set_logical_device(dev, serial_ldn);
  45        rawpnp_set_enable(dev, 0);
  46        rawpnp_set_iobase(dev, PNP_IDX_IO0, serial_iobase);
  47        rawpnp_set_enable(dev, 1);
  48        rawpnp_exit_ext_func_mode(dev);
  49}
  50
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.