The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/pccard/i82365.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  *      i82365.h - Definitions for Intel 82365 PCIC
    3  *      PCMCIA Card Interface Controller
    4  *
    5  * originally by Barry Jaspan; hacked over by Keith Moore
    6  * hacked to unrecognisability by Andrew McRae (andrew@mega.com.au)
    7  *
    8  * Updated 3/3/95 to include Cirrus Logic stuff.
    9  *-------------------------------------------------------------------------
   10  *
   11  * Copyright (c) 1995 Andrew McRae.  All rights reserved.
   12  *
   13  * Redistribution and use in source and binary forms, with or without
   14  * modification, are permitted provided that the following conditions
   15  * are met:
   16  * 1. Redistributions of source code must retain the above copyright
   17  *    notice, this list of conditions and the following disclaimer.
   18  * 2. Redistributions in binary form must reproduce the above copyright
   19  *    notice, this list of conditions and the following disclaimer in the
   20  *    documentation and/or other materials provided with the distribution.
   21  * 3. The name of the author may not be used to endorse or promote products
   22  *    derived from this software without specific prior written permission.
   23  *
   24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   25  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   26  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   27  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   29  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   33  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   34  */
   35 
   36 #define PCIC_I82365     0               /* Intel chip */
   37 #define PCIC_IBM        1               /* IBM clone */
   38 #define PCIC_VLSI       2               /* VLSI chip */
   39 #define PCIC_PD672X     3               /* Cirrus logic 627x */
   40 #define PCIC_PD6710     4               /* Cirrus logic 6710 */
   41 #define PCIC_CL6729     5               /* Cirrus logic 6729 */
   42 #define PCIC_VG468      6               /* Vadem 468 */
   43 #define PCIC_VG469      7               /* Vadem 469 */
   44 #define PCIC_RF5C396    8               /* Ricoh RF5C396 */
   45 #define PCIC_IBM_KING   9               /* IBM KING PCMCIA Controller */
   46 #define PCIC_PC98       10              /* NEC PC98 PCMCIA Controller */
   47 #define PCIC_TI1130     11              /* TI PCI1130 CardBus */
   48 
   49 /*
   50  *      Address of the controllers. Each controller can manage
   51  *      two PCMCIA slots. Up to 8 slots are supported in total.
   52  *      The PCIC controller is accessed via an index port and a
   53  *      data port. The index port has the 8 bit address of the
   54  *      register accessed via the data port. How I long for
   55  *      real memory mapped I/O!
   56  *      The top two bits of the index address are used to
   57  *      identify the port number, and the lower 6 bits
   58  *      select one of the 64 possible data registers.
   59  */
   60 #define PCIC_INDEX_0    0x3E0                   /* index reg, chips 0 and 1 */
   61 #define PCIC_DATA_0     (PCIC_INDEX_0 + 1)      /* data reg, chips 0 and 1 */
   62 #define PCIC_INDEX_1    (PCIC_INDEX_0 + 2)      /* index reg, chips 2 and 3 */
   63 #define PCIC_DATA_1     (PCIC_INDEX_1 + 1)      /* data reg, chips 2 and 3 */
   64 /*
   65  *      Register index addresses.
   66  */
   67 #define PCIC_ID_REV     0x00    /* Identification and Revision */
   68 #define PCIC_STATUS     0x01    /* Interface Status */
   69 #define PCIC_POWER      0x02    /* Power and RESETDRV control */
   70 #define PCIC_INT_GEN    0x03    /* Interrupt and General Control */
   71 #define PCIC_STAT_CHG   0x04    /* Card Status Change */
   72 #define PCIC_STAT_INT   0x05    /* Card Status Change Interrupt Config */
   73 #define PCIC_ADDRWINE   0x06    /* Address Window Enable */
   74 #define PCIC_IOCTL      0x07    /* I/O Control */
   75 #define PCIC_IO0        0x08    /* I/O Address 0 */
   76 #define PCIC_IO1        0x0c    /* I/O Address 1 */
   77 #define PCIC_MEMBASE    0x10    /* Base of memory window registers */
   78 #define PCIC_CDGC       0x16    /* Card Detect and General Control */
   79 #define PCIC_MISC1      0x16    /* PD672x: Misc control register 1 per slot */
   80 #define PCIC_GLO_CTRL   0x1e    /* Global Control Register */
   81 #define PCIC_MISC2      0x1e    /* PD672x: Misc control register 2 per chip */
   82 
   83 #define PCIC_TIME_SETUP0        0x3a
   84 #define PCIC_TIME_CMD0          0x3b
   85 #define PCIC_TIME_RECOV0        0x3c
   86 #define PCIC_TIME_SETUP1        0x3d
   87 #define PCIC_TIME_CMD1          0x3e
   88 #define PCIC_TIME_RECOV1        0x3f
   89 
   90 #define PCIC_SLOT_SIZE  0x40    /* Size of register set for one slot */
   91 
   92 /* Now register bits, ordered by reg # */
   93 
   94 /* For Identification and Revision (PCIC_ID_REV) */
   95 #define PCIC_INTEL0     0x82    /* Intel 82365SL Rev. 0; Both Memory and I/O */
   96 #define PCIC_INTEL1     0x83    /* Intel 82365SL Rev. 1; Both Memory and I/O */
   97 #define PCIC_IBM1       0x88    /* IBM PCIC clone; Both Memory and I/O */
   98 #define PCIC_IBM2       0x89    /* IBM PCIC clone; Both Memory and I/O */
   99 #define PCIC_IBM3       0x8a    /* IBM KING PCIC clone; Both Memory and I/O */
  100 
  101 /* For Interface Status register (PCIC_STATUS) */
  102 #define PCIC_VPPV       0x80    /* Vpp_valid */
  103 #define PCIC_POW        0x40    /* PC Card power active */
  104 #define PCIC_READY      0x20    /* Ready/~Busy */
  105 #define PCIC_MWP        0x10    /* Memory Write Protect */
  106 #define PCIC_CD         0x0C    /* Both card detect bits */
  107 #define PCIC_BVD        0x03    /* Both Battery Voltage Detect bits */
  108 
  109 /* For the Power and RESETDRV register (PCIC_POWER) */
  110 #define PCIC_OUTENA     0x80    /* Output Enable */
  111 #define PCIC_DISRST     0x40    /* Disable RESETDRV */
  112 #define PCIC_APSENA     0x20    /* Auto Pwer Switch Enable */
  113 #define PCIC_PCPWRE     0x10    /* PC Card Power Enable */
  114 #define PCIC_VCC        0x18    /* Vcc control bits */
  115 #define PCIC_VCC_5V     0x10    /* 5 volts */
  116 #define PCIC_VCC_3V     0x18    /* 3 volts */
  117 #define PCIC_VCC_5V_KING        0x14    /* 5 volts for KING PCIC */
  118 #define PCIC_VPP        0x0C    /* Vpp control bits */
  119 #define PCIC_VPP_5V     0x01    /* 5 volts */
  120 #define PCIC_VPP_12V    0x02    /* 12 volts */
  121 
  122 /* For the Interrupt and General Control register (PCIC_INT_GEN) */
  123 #define PCIC_CARDTYPE   0x20    /* Card Type 0 = memory, 1 = I/O */
  124 #define         PCIC_IOCARD     0x20
  125 #define         PCIC_MEMCARD    0x00
  126 #define PCIC_CARDRESET  0x40    /* Card reset 0 = Reset, 1 = Normal */
  127 #define PCIC_INTR_ENA   0x10    /* Interrupt enable */
  128 
  129 /* For the Card Status Change register (PCIC_STAT_CHG) */
  130 #define PCIC_CDTCH      0x08    /* Card Detect Change */
  131 #define PCIC_RDYCH      0x04    /* Ready Change */
  132 #define PCIC_BATWRN     0x02    /* Battery Warning */
  133 #define PCIC_BATDED     0x01    /* Battery Dead */
  134 
  135 /*
  136  * For the Address Window Enable Register (PCIC_ADDRWINE)
  137  * The lower 6 bits contain enable bits for the memory
  138  * windows (LSB = memory window 0).
  139  */
  140 #define PCIC_MEMCS16    0x20    /* ~MEMCS16 Decode A23-A12 */
  141 #define PCIC_IO0_EN     0x40    /* I/O Window 0 Enable */
  142 #define PCIC_IO1_EN     0x80    /* I/O Window 1 Enable */
  143 
  144 /*
  145  * For the I/O Control Register (PCIC_IOCTL)
  146  * The lower nybble is the flags for I/O window 0
  147  * The upper nybble is the flags for I/O window 1
  148  */
  149 #define PCIC_IO_16BIT   0x01    /* I/O to this segment is 16 bit */
  150 #define PCIC_IO_CS16    0x02    /* I/O cs16 source is the card */
  151 #define PCIC_IO_0WS     0x04    /* zero wait states added on 8 bit cycles */
  152 #define PCIC_IO_WS      0x08    /* Wait states added for 16 bit cycles */
  153 
  154 /*
  155  *      The memory window registers contain the start and end
  156  *      physical host address that the PCIC maps to the card,
  157  *      and an offset calculated from the card memory address.
  158  *      All values are shifted down 12 bits, so allocation is
  159  *      done in 4Kb blocks. Only 12 bits of each value is
  160  *      stored, limiting the range to the ISA address size of
  161  *      24 bits. The upper 4 bits of the most significant byte
  162  *      within the values are used for various flags.
  163  *
  164  *      The layout is:
  165  *
  166  *      base+0 : lower 8 bits of system memory start address
  167  *      base+1 : upper 4 bits of system memory start address + flags
  168  *      base+2 : lower 8 bits of system memory end address
  169  *      base+3 : upper 4 bits of system memory end address + flags
  170  *      base+4 : lower 8 bits of offset to card address
  171  *      base+5 : upper 4 bits of offset to card address + flags
  172  *
  173  *      The following two bytes are reserved for other use.
  174  */
  175 #define PCIC_MEMSIZE    8
  176 /*
  177  *      Flags for system memory start address upper byte
  178  */
  179 #define PCIC_ZEROWS     0x40    /* Zero wait states */
  180 #define PCIC_DATA16     0x80    /* Data width is 16 bits */
  181 
  182 /*
  183  *      Flags for system memory end address upper byte
  184  */
  185 #define PCIC_MW0        0x40    /* Wait state bit 0 */
  186 #define PCIC_MW1        0x80    /* Wait state bit 1 */
  187 
  188 /*
  189  *      Flags for card offset upper byte
  190  */
  191 #define PCIC_REG        0x40    /* Attribute/Common select (why called Reg?) */
  192 #define PCIC_WP         0x80    /* Write-protect this window */
  193 
  194 /* For Card Detect and General Control register (PCIC_CDGC) */
  195 #define PCIC_16_DL_INH  0x01    /* 16-bit memory delay inhibit */
  196 #define PCIC_CNFG_RST_EN 0x02   /* configuration reset enable */
  197 #define PCIC_GPI_EN     0x04    /* GPI Enable */
  198 #define PCIC_GPI_TRANS  0x08    /* GPI Transition Control */
  199 #define PCIC_CDRES_EN   0x10    /* card detect resume enable */
  200 #define PCIC_SW_CD_INT  0x20    /* s/w card detect interrupt */
  201 
  202 /* For Misc. Control Register 1 */
  203 #define PCIC_SPKR_EN    0x10    /* Cirrus PD672x: speaker enable */
  204 
  205 /* For Global Control register (PCIC_GLO_CTRL) */
  206 #define PCIC_PWR_DOWN   0x01    /* power down */
  207 #define PCIC_LVL_MODE   0x02    /* level mode interrupt enable */
  208 #define PCIC_WB_CSCINT  0x04    /* explicit write-back csc intr */
  209 #define PCIC_IRQ0_LEVEL 0x08    /* irq 14 pulse mode enable */
  210 #define PCIC_IRQ1_LEVEL 0x10
  211 
  212 /* For Misc. Control Register 2 */
  213 #define PCIC_LPDM_EN    0x02    /* Cirrus PD672x: low power dynamic mode */
  214 
  215 /*
  216  *      Mask of allowable interrupts.
  217  *      Ints are 3,4,5,7,9,10,11,12,14,15
  218  */
  219 #define PCIC_INT_MASK_ALLOWED   0xDEB8
  220 
  221 #define PCIC_IO_WIN     2
  222 #define PCIC_MEM_WIN    5
  223 
  224 #define PCIC_MAX_SLOTS  8

Cache object: 19b4c2040670cfc2b81288eea09dec06


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.