uboot/include/pcmcia/ss.h
<<
>>
Prefs
   1/*
   2 * ss.h 1.31 2001/08/24 12:16:13
   3 *
   4 * The contents of this file are subject to the Mozilla Public License
   5 * Version 1.1 (the "License"); you may not use this file except in
   6 * compliance with the License. You may obtain a copy of the License
   7 * at http://www.mozilla.org/MPL/
   8 *
   9 * Software distributed under the License is distributed on an "AS IS"
  10 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
  11 * the License for the specific language governing rights and
  12 * limitations under the License.
  13 *
  14 * The initial developer of the original code is David A. Hinds
  15 * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
  16 * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
  17 *
  18 * Alternatively, the contents of this file may be used under the
  19 * terms of the GNU General Public License version 2 (the "GPL"), in
  20 * which case the provisions of the GPL are applicable instead of the
  21 * above.  If you wish to allow the use of your version of this file
  22 * only under the terms of the GPL and not to allow others to use
  23 * your version of this file under the MPL, indicate your decision by
  24 * deleting the provisions above and replace them with the notice and
  25 * other provisions required by the GPL.  If you do not delete the
  26 * provisions above, a recipient may use your version of this file
  27 * under either the MPL or the GPL.
  28 */
  29
  30#ifndef _LINUX_SS_H
  31#define _LINUX_SS_H
  32
  33/* For RegisterCallback */
  34typedef struct ss_callback_t {
  35    void        (*handler)(void *info, u_int events);
  36    void        *info;
  37} ss_callback_t;
  38
  39/* Definitions for card status flags for GetStatus */
  40#define SS_WRPROT       0x0001
  41#define SS_CARDLOCK     0x0002
  42#define SS_EJECTION     0x0004
  43#define SS_INSERTION    0x0008
  44#define SS_BATDEAD      0x0010
  45#define SS_BATWARN      0x0020
  46#define SS_READY        0x0040
  47#define SS_DETECT       0x0080
  48#define SS_POWERON      0x0100
  49#define SS_GPI          0x0200
  50#define SS_STSCHG       0x0400
  51#define SS_CARDBUS      0x0800
  52#define SS_3VCARD       0x1000
  53#define SS_XVCARD       0x2000
  54#define SS_PENDING      0x4000
  55
  56/* for InquireSocket */
  57typedef struct socket_cap_t {
  58    u_int       features;
  59    u_int       irq_mask;
  60    u_int       map_size;
  61    u_char      pci_irq;
  62    u_char      cardbus;
  63    struct pci_bus *cb_bus;
  64    struct bus_operations *bus;
  65} socket_cap_t;
  66
  67/* InquireSocket capabilities */
  68#define SS_CAP_PAGE_REGS        0x0001
  69#define SS_CAP_VIRTUAL_BUS      0x0002
  70#define SS_CAP_MEM_ALIGN        0x0004
  71#define SS_CAP_STATIC_MAP       0x0008
  72#define SS_CAP_PCCARD           0x4000
  73#define SS_CAP_CARDBUS          0x8000
  74
  75/* for GetSocket, SetSocket */
  76typedef struct socket_state_t {
  77    u_int       flags;
  78    u_int       csc_mask;
  79    u_char      Vcc, Vpp;
  80    u_char      io_irq;
  81} socket_state_t;
  82
  83/* Socket configuration flags */
  84#define SS_PWR_AUTO     0x0010
  85#define SS_IOCARD       0x0020
  86#define SS_RESET        0x0040
  87#define SS_DMA_MODE     0x0080
  88#define SS_SPKR_ENA     0x0100
  89#define SS_OUTPUT_ENA   0x0200
  90#define SS_ZVCARD       0x0400
  91
  92/* Flags for I/O port and memory windows */
  93#define MAP_ACTIVE      0x01
  94#define MAP_16BIT       0x02
  95#define MAP_AUTOSZ      0x04
  96#define MAP_0WS         0x08
  97#define MAP_WRPROT      0x10
  98#define MAP_ATTRIB      0x20
  99#define MAP_USE_WAIT    0x40
 100#define MAP_PREFETCH    0x80
 101
 102/* Use this just for bridge windows */
 103#define MAP_IOSPACE     0x20
 104
 105typedef struct pccard_io_map {
 106    u_char      map;
 107    u_char      flags;
 108    u_short     speed;
 109    u_short     start, stop;
 110} pccard_io_map;
 111
 112typedef struct pccard_mem_map {
 113    u_char      map;
 114    u_char      flags;
 115    u_short     speed;
 116    u_long      sys_start, sys_stop;
 117    u_int       card_start;
 118} pccard_mem_map;
 119
 120typedef struct cb_bridge_map {
 121    u_char      map;
 122    u_char      flags;
 123    u_int       start, stop;
 124} cb_bridge_map;
 125
 126enum ss_service {
 127    SS_RegisterCallback, SS_InquireSocket,
 128    SS_GetStatus, SS_GetSocket, SS_SetSocket,
 129    SS_GetIOMap, SS_SetIOMap, SS_GetMemMap, SS_SetMemMap,
 130    SS_GetBridge, SS_SetBridge, SS_ProcSetup
 131};
 132
 133#endif /* _LINUX_SS_H */
 134