coreboot/src/superio/nsc/pc87360/superio.c
<<
>>
Prefs
   1/*
   2 * This file is part of the coreboot project.
   3 *
   4 * Copyright (C) 2000 AG Electronics Ltd.
   5 * Copyright (C) 2003-2004 Linux Networx
   6 *
   7 * This program is free software; you can redistribute it and/or modify
   8 * it under the terms of the GNU General Public License as published by
   9 * the Free Software Foundation; either version 2 of the License, or
  10 * (at your option) any later version.
  11 *
  12 * This program is distributed in the hope that it will be useful,
  13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15 * GNU General Public License for more details.
  16 *
  17 * You should have received a copy of the GNU General Public License
  18 * along with this program; if not, write to the Free Software
  19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  20 */
  21
  22#include <arch/io.h>
  23#include <device/device.h>
  24#include <device/pnp.h>
  25#include <console/console.h>
  26#include <string.h>
  27#include <bitops.h>
  28#include <uart8250.h>
  29#include <pc80/keyboard.h>
  30#include <stdlib.h>
  31#include "chip.h"
  32#include "pc87360.h"
  33
  34static void init(device_t dev)
  35{
  36        struct superio_nsc_pc87360_config *conf = dev->chip_info;
  37
  38        if (!dev->enabled)
  39                return;
  40
  41        switch(dev->path.pnp.device) {
  42        case PC87360_KBCK:
  43                pc_keyboard_init(&conf->keyboard);
  44                break;
  45        }
  46}
  47
  48static struct device_operations ops = {
  49        .read_resources   = pnp_read_resources,
  50        .set_resources    = pnp_set_resources,
  51        .enable_resources = pnp_enable_resources,
  52        .enable           = pnp_enable,
  53        .init             = init,
  54};
  55
  56static struct pnp_info pnp_dev_info[] = {
  57        { &ops, PC87360_FDC,  PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x07fa, 0}, },
  58        { &ops, PC87360_PP,   PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x04f8, 0}, },
  59        { &ops, PC87360_SP2,  PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, {0x07f8, 0}, },
  60        { &ops, PC87360_SP1,  PNP_IO0 | PNP_IRQ0, {0x07f8, 0}, },
  61        { &ops, PC87360_SWC,  PNP_IO0 | PNP_IRQ0, {0xfff0, 0}, },
  62        { &ops, PC87360_KBCM, PNP_IRQ0, },
  63        { &ops, PC87360_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0x07f8, 0}, {0x07f8, 4}, },
  64        { &ops, PC87360_GPIO, PNP_IO0 | PNP_IRQ0, {0xfff8, 0}, },
  65        { &ops, PC87360_ACB,  PNP_IO0 | PNP_IRQ0, {0xfff8, 0}, },
  66        { &ops, PC87360_FSCM, PNP_IO0 | PNP_IRQ0, {0xfff8, 0}, },
  67        { &ops, PC87360_WDT,  PNP_IO0 | PNP_IRQ0, {0xfffc, 0}, },
  68};
  69
  70static void enable_dev(struct device *dev)
  71{
  72        pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
  73}
  74
  75struct chip_operations superio_nsc_pc87360_ops = {
  76        CHIP_NAME("NSC PC87360 Super I/O")
  77        .enable_dev = enable_dev,
  78};
  79
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.