coreboot-v3/include/device/pnp.h
<<
>>
Prefs
   1/*
   2 * Copyright (C) 2007 Ronald G. Minnich <rminnich@gmail.com>
   3 * Copyright (C) 2007 coresystems GmbH
   4 *
   5 * This program is free software; you can redistribute it and/or modify
   6 * it under the terms of the GNU General Public License as published by
   7 * the Free Software Foundation; either version 2 of the License, or
   8 * (at your option) any later version.
   9 * 
  10 * This program is distributed in the hope that it will be useful,
  11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13 * GNU General Public License for more details.
  14 * 
  15 * You should have received a copy of the GNU General Public License
  16 * along with this program; if not, write to the Free Software
  17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  18 */
  19
  20#ifndef DEVICE_PNP_H
  21#define DEVICE_PNP_H
  22
  23#include <types.h>
  24#include <device/device.h>
  25
  26/* Very low-level PNP functions, mostly intended for stage 0 or 1 */
  27void rawpnp_enter_ext_func_mode(u16 port);
  28void rawpnp_exit_ext_func_mode(u16 port);
  29void rawpnp_write_config(u16 port, u8 reg, u8 value);
  30u8 rawpnp_read_config(u16 port, u8 reg);
  31void rawpnp_set_logical_device(u16 port, u8 ldn);
  32void rawpnp_set_enable(u16 port, int enable);
  33void rawpnp_set_iobase(u16 port, u8 index, u16 iobase);
  34
  35/* Primitive pnp resource manipulation */
  36void    pnp_write_config(struct device * dev, u8 reg, u8 value);
  37u8 pnp_read_config(struct device * dev, u8 reg);
  38void    pnp_set_logical_device(struct device * dev);
  39void    pnp_set_enable(struct device * dev, int enable);
  40int     pnp_read_enable(struct device * dev);
  41void    pnp_set_iobase(struct device * dev, unsigned index, unsigned iobase);
  42void    pnp_set_irq(struct device * dev, unsigned index, unsigned irq);
  43void    pnp_set_drq(struct device * dev, unsigned index, unsigned drq);
  44
  45/* PNP device operations */
  46void pnp_read_resources(struct device * dev);
  47void pnp_set_resources(struct device * dev);
  48void pnp_enable_resources(struct device * dev);
  49void pnp_enable(struct device * dev);
  50
  51extern struct device_operations pnp_ops;
  52
  53/* PNP helper operations */
  54
  55struct io_info {
  56        unsigned mask, set, val;
  57};
  58
  59struct pnp_info {
  60        struct device_operations *ops;
  61        unsigned function;
  62        unsigned flags;
  63#define PNP_IO0  0x01
  64#define PNP_IO1  0x02
  65#define PNP_IO2  0x04
  66#define PNP_IO3  0x08
  67#define PNP_IRQ0 0x10
  68#define PNP_IRQ1 0x20
  69#define PNP_DRQ0 0x40
  70#define PNP_DRQ1 0x80
  71        struct io_info io0, io1, io2, io3;
  72        unsigned irq0, irq1, drq0, drq1;
  73        unsigned enable;
  74};
  75
  76struct resource *pnp_get_resource(struct device * dev, unsigned index);
  77
  78void pnp_enable_devices(struct device *dev, struct device_operations *ops,
  79                        unsigned functions, struct pnp_info *info);
  80
  81#define PNP_IDX_IO0  0x60
  82#define PNP_IDX_IO1  0x62
  83#define PNP_IDX_IO2  0x64
  84#define PNP_IDX_IO3  0x66
  85#define PNP_IDX_IRQ0 0x70
  86#define PNP_IDX_IRQ1 0x72
  87#define PNP_IDX_DRQ0 0x74
  88#define PNP_IDX_DRQ1 0x75
  89
  90/* PNP functions used to enter/exit PNP config mode */
  91void pnp_enter_ite_it8661f(struct device *dev);
  92void pnp_enter_ite_it8671f(struct device *dev);
  93void pnp_enter_ite(struct device *dev);
  94void pnp_enter_ite_it8761e(struct device *dev);
  95void pnp_enter_ite_it8228e(struct device *dev);
  96void pnp_enter_8787(struct device *dev);
  97void pnp_enter_ali(struct device *dev);
  98void pnp_enter_smsc(struct device *dev);
  99void pnp_enter_88(struct device *dev);
 100void pnp_enter_89(struct device *dev);
 101void pnp_enter_8686(struct device *dev);
 102void pnp_exit_aa(struct device *dev);
 103void pnp_exit_ite(struct device *dev);
 104void pnp_exit_ali(struct device *dev);
 105
 106#endif /* DEVICE_PNP_H */
 107
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.