162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * i82365.h 1.15 1999/10/25 20:03:34 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * The contents of this file are subject to the Mozilla Public License 562306a36Sopenharmony_ci * Version 1.1 (the "License"); you may not use this file except in 662306a36Sopenharmony_ci * compliance with the License. You may obtain a copy of the License 762306a36Sopenharmony_ci * at http://www.mozilla.org/MPL/ 862306a36Sopenharmony_ci * 962306a36Sopenharmony_ci * Software distributed under the License is distributed on an "AS IS" 1062306a36Sopenharmony_ci * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 1162306a36Sopenharmony_ci * the License for the specific language governing rights and 1262306a36Sopenharmony_ci * limitations under the License. 1362306a36Sopenharmony_ci * 1462306a36Sopenharmony_ci * The initial developer of the original code is David A. Hinds 1562306a36Sopenharmony_ci * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds 1662306a36Sopenharmony_ci * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. 1762306a36Sopenharmony_ci * 1862306a36Sopenharmony_ci * Alternatively, the contents of this file may be used under the 1962306a36Sopenharmony_ci * terms of the GNU General Public License version 2 (the "GPL"), in which 2062306a36Sopenharmony_ci * case the provisions of the GPL are applicable instead of the 2162306a36Sopenharmony_ci * above. If you wish to allow the use of your version of this file 2262306a36Sopenharmony_ci * only under the terms of the GPL and not to allow others to use 2362306a36Sopenharmony_ci * your version of this file under the MPL, indicate your decision by 2462306a36Sopenharmony_ci * deleting the provisions above and replace them with the notice and 2562306a36Sopenharmony_ci * other provisions required by the GPL. If you do not delete the 2662306a36Sopenharmony_ci * provisions above, a recipient may use your version of this file 2762306a36Sopenharmony_ci * under either the MPL or the GPL. 2862306a36Sopenharmony_ci */ 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci#ifndef _LINUX_I82365_H 3162306a36Sopenharmony_ci#define _LINUX_I82365_H 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci/* register definitions for the Intel 82365SL PCMCIA controller */ 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci/* Offsets for PCIC registers */ 3662306a36Sopenharmony_ci#define I365_IDENT 0x00 /* Identification and revision */ 3762306a36Sopenharmony_ci#define I365_STATUS 0x01 /* Interface status */ 3862306a36Sopenharmony_ci#define I365_POWER 0x02 /* Power and RESETDRV control */ 3962306a36Sopenharmony_ci#define I365_INTCTL 0x03 /* Interrupt and general control */ 4062306a36Sopenharmony_ci#define I365_CSC 0x04 /* Card status change */ 4162306a36Sopenharmony_ci#define I365_CSCINT 0x05 /* Card status change interrupt control */ 4262306a36Sopenharmony_ci#define I365_ADDRWIN 0x06 /* Address window enable */ 4362306a36Sopenharmony_ci#define I365_IOCTL 0x07 /* I/O control */ 4462306a36Sopenharmony_ci#define I365_GENCTL 0x16 /* Card detect and general control */ 4562306a36Sopenharmony_ci#define I365_GBLCTL 0x1E /* Global control register */ 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ci/* Offsets for I/O and memory window registers */ 4862306a36Sopenharmony_ci#define I365_IO(map) (0x08+((map)<<2)) 4962306a36Sopenharmony_ci#define I365_MEM(map) (0x10+((map)<<3)) 5062306a36Sopenharmony_ci#define I365_W_START 0 5162306a36Sopenharmony_ci#define I365_W_STOP 2 5262306a36Sopenharmony_ci#define I365_W_OFF 4 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci/* Flags for I365_STATUS */ 5562306a36Sopenharmony_ci#define I365_CS_BVD1 0x01 5662306a36Sopenharmony_ci#define I365_CS_STSCHG 0x01 5762306a36Sopenharmony_ci#define I365_CS_BVD2 0x02 5862306a36Sopenharmony_ci#define I365_CS_SPKR 0x02 5962306a36Sopenharmony_ci#define I365_CS_DETECT 0x0C 6062306a36Sopenharmony_ci#define I365_CS_WRPROT 0x10 6162306a36Sopenharmony_ci#define I365_CS_READY 0x20 /* Inverted */ 6262306a36Sopenharmony_ci#define I365_CS_POWERON 0x40 6362306a36Sopenharmony_ci#define I365_CS_GPI 0x80 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ci/* Flags for I365_POWER */ 6662306a36Sopenharmony_ci#define I365_PWR_OFF 0x00 /* Turn off the socket */ 6762306a36Sopenharmony_ci#define I365_PWR_OUT 0x80 /* Output enable */ 6862306a36Sopenharmony_ci#define I365_PWR_NORESET 0x40 /* Disable RESETDRV on resume */ 6962306a36Sopenharmony_ci#define I365_PWR_AUTO 0x20 /* Auto pwr switch enable */ 7062306a36Sopenharmony_ci#define I365_VCC_MASK 0x18 /* Mask for turning off Vcc */ 7162306a36Sopenharmony_ci/* There are different layouts for B-step and DF-step chips: the B 7262306a36Sopenharmony_ci step has independent Vpp1/Vpp2 control, and the DF step has only 7362306a36Sopenharmony_ci Vpp1 control, plus 3V control */ 7462306a36Sopenharmony_ci#define I365_VCC_5V 0x10 /* Vcc = 5.0v */ 7562306a36Sopenharmony_ci#define I365_VCC_3V 0x18 /* Vcc = 3.3v */ 7662306a36Sopenharmony_ci#define I365_VPP2_MASK 0x0c /* Mask for turning off Vpp2 */ 7762306a36Sopenharmony_ci#define I365_VPP2_5V 0x04 /* Vpp2 = 5.0v */ 7862306a36Sopenharmony_ci#define I365_VPP2_12V 0x08 /* Vpp2 = 12.0v */ 7962306a36Sopenharmony_ci#define I365_VPP1_MASK 0x03 /* Mask for turning off Vpp1 */ 8062306a36Sopenharmony_ci#define I365_VPP1_5V 0x01 /* Vpp1 = 5.0v */ 8162306a36Sopenharmony_ci#define I365_VPP1_12V 0x02 /* Vpp1 = 12.0v */ 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ci/* Flags for I365_INTCTL */ 8462306a36Sopenharmony_ci#define I365_RING_ENA 0x80 8562306a36Sopenharmony_ci#define I365_PC_RESET 0x40 8662306a36Sopenharmony_ci#define I365_PC_IOCARD 0x20 8762306a36Sopenharmony_ci#define I365_INTR_ENA 0x10 8862306a36Sopenharmony_ci#define I365_IRQ_MASK 0x0F 8962306a36Sopenharmony_ci 9062306a36Sopenharmony_ci/* Flags for I365_CSC and I365_CSCINT*/ 9162306a36Sopenharmony_ci#define I365_CSC_BVD1 0x01 9262306a36Sopenharmony_ci#define I365_CSC_STSCHG 0x01 9362306a36Sopenharmony_ci#define I365_CSC_BVD2 0x02 9462306a36Sopenharmony_ci#define I365_CSC_READY 0x04 9562306a36Sopenharmony_ci#define I365_CSC_DETECT 0x08 9662306a36Sopenharmony_ci#define I365_CSC_ANY 0x0F 9762306a36Sopenharmony_ci#define I365_CSC_GPI 0x10 9862306a36Sopenharmony_ci#define I365_CSC_IRQ_MASK 0xF0 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ci/* Flags for I365_ADDRWIN */ 10162306a36Sopenharmony_ci#define I365_ENA_IO(map) (0x40 << (map)) 10262306a36Sopenharmony_ci#define I365_ENA_MEM(map) (0x01 << (map)) 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci/* Flags for I365_IOCTL */ 10562306a36Sopenharmony_ci#define I365_IOCTL_MASK(map) (0x0F << (map<<2)) 10662306a36Sopenharmony_ci#define I365_IOCTL_WAIT(map) (0x08 << (map<<2)) 10762306a36Sopenharmony_ci#define I365_IOCTL_0WS(map) (0x04 << (map<<2)) 10862306a36Sopenharmony_ci#define I365_IOCTL_IOCS16(map) (0x02 << (map<<2)) 10962306a36Sopenharmony_ci#define I365_IOCTL_16BIT(map) (0x01 << (map<<2)) 11062306a36Sopenharmony_ci 11162306a36Sopenharmony_ci/* Flags for I365_GENCTL */ 11262306a36Sopenharmony_ci#define I365_CTL_16DELAY 0x01 11362306a36Sopenharmony_ci#define I365_CTL_RESET 0x02 11462306a36Sopenharmony_ci#define I365_CTL_GPI_ENA 0x04 11562306a36Sopenharmony_ci#define I365_CTL_GPI_CTL 0x08 11662306a36Sopenharmony_ci#define I365_CTL_RESUME 0x10 11762306a36Sopenharmony_ci#define I365_CTL_SW_IRQ 0x20 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_ci/* Flags for I365_GBLCTL */ 12062306a36Sopenharmony_ci#define I365_GBL_PWRDOWN 0x01 12162306a36Sopenharmony_ci#define I365_GBL_CSC_LEV 0x02 12262306a36Sopenharmony_ci#define I365_GBL_WRBACK 0x04 12362306a36Sopenharmony_ci#define I365_GBL_IRQ_0_LEV 0x08 12462306a36Sopenharmony_ci#define I365_GBL_IRQ_1_LEV 0x10 12562306a36Sopenharmony_ci 12662306a36Sopenharmony_ci/* Flags for memory window registers */ 12762306a36Sopenharmony_ci#define I365_MEM_16BIT 0x8000 /* In memory start high byte */ 12862306a36Sopenharmony_ci#define I365_MEM_0WS 0x4000 12962306a36Sopenharmony_ci#define I365_MEM_WS1 0x8000 /* In memory stop high byte */ 13062306a36Sopenharmony_ci#define I365_MEM_WS0 0x4000 13162306a36Sopenharmony_ci#define I365_MEM_WRPROT 0x8000 /* In offset high byte */ 13262306a36Sopenharmony_ci#define I365_MEM_REG 0x4000 13362306a36Sopenharmony_ci 13462306a36Sopenharmony_ci#define I365_REG(slot, reg) (((slot) << 6) + reg) 13562306a36Sopenharmony_ci 13662306a36Sopenharmony_ci#endif /* _LINUX_I82365_H */ 137